Repeated initialize method on elmo_whistle
Which one to keep? Note that we are registering the instance in the first one (and so we are not registering at all).
def initialize(self):
config = self.config.config_dict
if get_comm_type(config) == SERIAL:
opt = {"baudrate": 19200, "eol": ";"}
else: # Not SERIAL
raise RuntimeError("Serial line is not configured!")
self._cnx = get_comm(config, **opt)
session.get_current().map.register(self, children_list=[self._cnx])
def initialize(self):
log_info(self, "Entering")
self._elmostate = AxisState()
for state, human in (
("INHIBITSWITCH", "Inhibit switch active"),
("CLOSEDLOOPOPEN", "Closed loop open"),
("DRIVEFAULT", "Problem with the Elmo controller"),
("SPEEDCONTROL", "Speed control mode is acive"),
):
self._elmostate.create_state(state, human)
# Internal variables
self.off_limit_sleep_time = 1 # seconds
self.stopped = False