nthallen / monarch

Monarch Data Acquisition System
0 stars 1 forks source link

swscomp feature: SWM_ constants to suppress generation of TMA switch code #186

Open nthallen opened 1 year ago

nthallen commented 1 year ago

In the MOUDI instrument, in addition to the standard SWStat, I have a MoudiMode variable which I intend to use as a state variable. This immediately caused problems because I defined an SWS_ variable with value 0, which triggered a duplicate case in the generate .tma code (see #185). Resolving that was fine, but a better solution would be to flag the fact that the generated .tma code does nothing and should not be generated.

I had proposed using SWM constants instead of SWS, but the implementation of that in swscomp would be difficult. Perhaps a better approach would be to use SW_Variable_2 instead of SW_Variable, where the only difference is whether TMA code is generated.

A better keyword might be SW_Variable_no_TMA.