PL PCDU enum #229
@ -85,6 +85,39 @@ class NormalSubmodesMask(enum.IntEnum):
|
||||
HPA_ON = 5
|
||||
|
||||
|
||||
class SubmodeForOnMode(enum.IntEnum):
|
||||
SSR_ON = 1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||
DRO_ON = 1 << NormalSubmodesMask.DRO_ON | (
|
||||
1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||
)
|
||||
X8_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
)
|
||||
TX_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
)
|
||||
MPA_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
| (1 << NormalSubmodesMask.MPA_ON)
|
||||
)
|
||||
HPA_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
| (1 << NormalSubmodesMask.MPA_ON)
|
||||
| (1 << NormalSubmodesMask.HPA_ON)
|
||||
)
|
||||
|
||||
|
||||
class ParamIds(enum.IntEnum):
|
||||
NEG_V_LOWER_BOUND = 0
|
||||
NEG_V_UPPER_BOUND = 1
|
||||
@ -381,39 +414,6 @@ def request_wait_time() -> Optional[float]:
|
||||
return wait_time
|
||||
|
||||
|
||||
class SubmodeForOnMode(enum.IntEnum):
|
||||
SSR_ON = 1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||
DRO_ON = 1 << NormalSubmodesMask.DRO_ON | (
|
||||
1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON
|
||||
)
|
||||
X8_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
)
|
||||
TX_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
)
|
||||
MPA_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
| (1 << NormalSubmodesMask.MPA_ON)
|
||||
)
|
||||
HPA_ON = (
|
||||
1 << NormalSubmodesMask.DRO_ON
|
||||
| (1 << NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON)
|
||||
| (1 << NormalSubmodesMask.X8_ON)
|
||||
| (1 << NormalSubmodesMask.TX_ON)
|
||||
| (1 << NormalSubmodesMask.MPA_ON)
|
||||
| (1 << NormalSubmodesMask.HPA_ON)
|
||||
)
|
||||
|
||||
|
||||
def submode_mask_to_submode(on_tgt: NormalSubmodesMask) -> int:
|
||||
if on_tgt == NormalSubmodesMask.SOLID_STATE_RELAYS_ADC_ON:
|
||||
return SubmodeForOnMode.SSR_ON
|
||||
|
Loading…
Reference in New Issue
Block a user