Beispiel #1
0
    def __init__(self, motor_index, item_id, name, protocol):
        self._motor_index = motor_index
        self._protocol = protocol

        ParlayStandardItem.__init__(self, item_id, name)

        # manually add command options
        dropdown_options = [("spin", "spin")]
        dropdown_sub_fields = [[
            self.create_field("speed",
                              INPUT_TYPES.NUMBER,
                              label="speed to spin (-9 to 9)",
                              required=True)
        ]]

        dropdown_options.append(("stop", "stop"))
        dropdown_sub_fields.append([])

        self.add_field("COMMAND",
                       INPUT_TYPES.DROPDOWN,
                       dropdown_options=dropdown_options,
                       dropdown_sub_fields=dropdown_sub_fields)