def __init__(self, name, wait=0.0): # type: (APartName, AWait) -> None super(WaitingPart, self).__init__(name) meta = NumberMeta("float64", "How long to wait") set_tags(meta, writeable=True) self.attr = meta.create_attribute_model(wait) self.register_hooked(RunHook, self.run)
def exposure_attribute(min_exposure: float) -> AttributeModel: meta = NumberMeta( "float64", "The calculated exposure for this run", tags=[Widget.TEXTUPDATE.tag()], display=Display(precision=6, units="s", limitLow=min_exposure), ) return meta.create_attribute_model()
def __init__( self, name, # type: APartName description, # type: AMetaDescription writeable=False, # type: AWriteable config=1, # type: AConfig group=None, # type: AGroup widget=None, # type: AWidget value=0.0, # type: Value ): # type: (...) -> None super(Float64Part, self).__init__(name) meta = NumberMeta("float64", description) set_tags(meta, writeable, config, group, widget) self.attr = meta.create_attribute_model(value) self.writeable_func = self.attr.set_value if writeable else None
def __init__( self, name: APartName, description: AMetaDescription, writeable: AWriteable = False, config: AConfig = 1, group: AGroup = None, widget: AWidget = None, value: AValue = 0.0, limit_low: ULimitLow = 0, limit_high: ULimitHigh = 0, precision: UPrecision = 8, units: AUnits = "", ) -> None: super().__init__(name) display = Display( limitLow=limit_low, limitHigh=limit_high, precision=precision, units=units ) meta = NumberMeta("float64", description, display=display) set_tags(meta, writeable, config, group, widget) self.attr = meta.create_attribute_model(value) self.writeable_func = self.attr.set_value if writeable else None