75 log.debug(f
"Trying to read magnetic field configuration from {partition=}")
79 ipcPart = ipc.IPCPartition(partition)
80 if not ipcPart.isValid():
82 f
"{partition=} invalid - cannot access magnetic field setting "
85 torCurrent = ISInfoDynAny(ipcPart,
"DdcFloatInfo")
86 solCurrent = ISInfoDynAny(ipcPart,
"DdcFloatInfo")
87 torInvalid = ISInfoDynAny(ipcPart,
"DdcIntInfo")
88 solInvalid = ISInfoDynAny(ipcPart,
"DdcIntInfo")
93 log.info(f
"toroidCurrent = {torCurrent.value}")
94 log.info(f
"toroidInvalid = {torInvalid.value}")
95 log.info(f
"solenoidCurrent = {solCurrent.value}")
96 log.info(f
"solenoidInvalid = {solInvalid.value}")
99 solOn = (solCurrent.value > 1000.0)
and (solInvalid.value == 0)
100 torOn = (torCurrent.value > 1000.0)
and (torInvalid.value == 0)
101 except UserWarning
as err:
104 log.fatal(
"Failed to read magnetic field configuration from IS, aborting")
109 log.info(f
"Magnetic field in solenoid is {((solOn and 'ON') or 'OFF')}")
110 log.info(f
"Magnetic field in toroid is {((torOn and 'ON') or 'OFF')}")
113 return (solCurrent, torCurrent)