Esempio n. 1
0
 def stop(self):
     if not self._waiting_alarm_sid is None:
         try:
             scheduler.remove(self._waiting_alarm_sid)
         except:  # SID may already have expired and been removed...
             msglog.exception()
         self._waiting_alarm_sid = None
     self._started = 0
     ServiceNode.stop(self)
     return
Esempio n. 2
0
 def stop(self):
     if not self._waiting_alarm_sid is None:
         try:
             scheduler.remove(self._waiting_alarm_sid)
         except: # SID may already have expired and been removed...
             msglog.exception()
         self._waiting_alarm_sid = None
     self._started = 0
     ServiceNode.stop(self)
     return
Esempio n. 3
0
 def export_waiting_alarm(self):
     if (self._started == 1) \
        and (not self.log.collector is None):
         if not self._waiting_alarm_sid is None:
             try:
                 scheduler.remove(self._waiting_alarm_sid)
             except: # SID may already have expired and been removed...
                 msglog.exception()
             self._waiting_alarm_sid = None
         while len(self._alarm) > 0:
             init_len = len(self._alarm)
             alarm = self._alarm.pop(0)
             self.export(alarm) # should leave alarm off of list...
             if init_len <= len(self._alarm):
                 break # failed to keep alarm off the list
     elif (len(self._alarm) > 0):
         self._waiting_alarm_sid = scheduler.after(10.0, self.export_waiting_alarm, ())
     return
Esempio n. 4
0
 def export_waiting_alarm(self):
     if (self._started == 1) \
        and (not self.log.collector is None):
         if not self._waiting_alarm_sid is None:
             try:
                 scheduler.remove(self._waiting_alarm_sid)
             except:  # SID may already have expired and been removed...
                 msglog.exception()
             self._waiting_alarm_sid = None
         while len(self._alarm) > 0:
             init_len = len(self._alarm)
             alarm = self._alarm.pop(0)
             self.export(alarm)  # should leave alarm off of list...
             if init_len <= len(self._alarm):
                 break  # failed to keep alarm off the list
     elif (len(self._alarm) > 0):
         self._waiting_alarm_sid = scheduler.after(
             10.0, self.export_waiting_alarm, ())
     return
Esempio n. 5
0
 def clear(self):
    self.program_code = 0 # '0' is 'Manual' AND 'Cool-Down' Program
    self.version_data = None
    self.last_odometer = 0
    self.last_utilization = 0
    self.last_utilization_time = 0 # to determine if new_utilization is too high for current time
    self.session_start_time = 0
    self.session_end_time = 0
    self.radio_loss = 0    # 1: indicates that the FEU xcvr state was NOT "transceiver_responding" during the current CSAFE state
    self.feu_data_loss = 0 # 1: indicates that the FEU GetStatus call returned "None" at least once during the current CSAFE state
    self.self_powered_radio_loss = 0
    if hasattr(self, 'radio_loss_sid') and (not self.radio_loss_sid is None):
       scheduler.remove(self.radio_loss_sid)
    if hasattr(self, 'self_powered_radio_loss_sid') and (not self.self_powered_radio_loss_sid is None):
       scheduler.remove(self.self_powered_radio_loss_sid)
    self.self_powered_radio_loss_sid = None
    self.radio_loss_sid = None
    self.speed = CalcData()
    self.gear = CalcData()
    self.grade = CalcData()
    self.power = CalcData()
    return