[docs]classFFSHelper(HALHelper):"""Command and keeps track of the Flat-Field Screens status."""TIMEOUT:float=config["timeouts"]["ffs"]name="ffs"
[docs]defget_values(self):"""Returns the FFS status flags."""values=self.actor.models["mcp"]["ffsStatus"].valueiflen(values)==0orall([valueisNoneforvalueinvalues]):return[FFSStatus.UNKNWON]*8return[FFSStatus(value)forvalueinvalues]
[docs]defall_closed(self):"""Returns `True` if all the petals are closed."""returnall([x==FFSStatus.CLOSEDforxinself.get_values()])
[docs]defall_open(self):"""Returns `True` if all the petals are open."""returnall([x==FFSStatus.OPENforxinself.get_values()])
[docs]asyncdefopen(self,command:HALCommandType):"""Open all the petals."""ifself.all_open():returnreturnawaitself._send_command(command,"mcp","ffs.open")
[docs]asyncdefclose(self,command:HALCommandType):"""Close all the petals."""ifself.all_closed():returnreturnawaitself._send_command(command,"mcp","ffs.close")
[docs]classFFSStatus(enum.Enum):"""FFS status flags."""UNKNWON="00"CLOSED="01"OPEN="10"INVALID="11"