def __init__(self, pv_prefix: APvPrefix, group: ca.util.AGroup = None) -> None: super().__init__("sinkPorts") self.pvs = [pv_prefix + ":CsPort", pv_prefix + ":CsAxis"] self.rbvs = [ pv_prefix + ":CsPort_RBV", pv_prefix + ":CsAxis_RBV", pv_prefix + ".OUT", ] meta = ChoiceMeta("CS Axis") builtin.util.set_tags(meta, writeable=True, group=group, sink_port=Port.MOTOR) self.cs_attr = meta.create_attribute_model() meta = StringMeta("Parent PMAC Port name") builtin.util.set_tags(meta, group=group, sink_port=Port.MOTOR) self.pmac_attr = meta.create_attribute_model() meta = NumberMeta("int32", "Parent PMAC Axis number") builtin.util.set_tags(meta, group=group) self.axis_num_attr = meta.create_attribute_model() # Subscriptions self.monitors: List = [] self.port = None self.axis = None self.port_choices: List = []
def __init__( self, name: APartName, description: AMetaDescription, choices: UChoices, value: AValue, writeable: AWriteable = False, config: AConfig = 1, group: AGroup = None, widget: AWidget = None, ) -> None: super().__init__(name) meta = ChoiceMeta(description, choices) 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, # type: APartName description, # type: AMetaDescription choices, # type: UChoices value, # type: AValue writeable=False, # type: AWriteable config=1, # type: AConfig group=None, # type: AGroup widget=None, # type: AWidget ): # type: (...) -> None super(ChoicePart, self).__init__(name) meta = ChoiceMeta(description, choices) 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, prefix, group=None): # type: (ca.util.APartName, APrefix, ca.util.AGroup) -> None super(RawMotorCSPart, self).__init__(name) self.pvs = [prefix + ":CsPort", prefix + ":CsAxis"] self.rbvs = [prefix + ":CsPort_RBV", prefix + ":CsAxis_RBV"] meta = ChoiceMeta("CS Axis") builtin.util.set_tags(meta, writeable=True, group=group, sink_port=Port.MOTOR) self.attr = meta.create_attribute_model() # Subscriptions self.monitors = [] self.port = None self.axis = None self.port_choices = [] # Hooks self.register_hooked(builtin.hooks.DisableHook, self.disconnect) self.register_hooked((builtin.hooks.InitHook, builtin.hooks.ResetHook), self.reconnect)
def __init__(self, name: APartName, description: AMetaDescription) -> None: super().__init__(name) meta = ChoiceMeta(description, ["expanded", "collapsed"]) set_tags(meta, writeable=True, widget=Widget.GROUP) self.attr = meta.create_attribute_model("expanded")