Changeset 1161:38b1f077d211
- Timestamp:
- 04/28/24 07:49:42 (7 months ago)
- Branch:
- python3
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/flight.py
r1106 r1161 55 55 @staticmethod 56 56 def isTimeDifferenceTooMuch(scheduledTime, realTimestamp, 57 earlyOnlyWarning = False): 57 earlyOnlyWarning = False, 58 earlyOK = False): 58 59 """Determine if the given real time differs to much from the scheduled 59 60 time. … … 69 70 realMinute = realTime.tm_hour * 60 + realTime.tm_min 70 71 71 diff = abs(Flight.getMinutesDifference(scheduledMinute, realMinute)) 72 73 return (diff>Flight.TIME_WARNING_DIFFERENCE, 74 False if earlyOnlyWarning else diff>Flight.TIME_ERROR_DIFFERENCE) 72 diff = Flight.getMinutesDifference(scheduledMinute, realMinute) 73 74 return (diff<-Flight.TIME_WARNING_DIFFERENCE or 75 (not earlyOK and diff>Flight.TIME_WARNING_DIFFERENCE), 76 diff<-Flight.TIME_ERROR_DIFFERENCE or 77 (not earlyOK and not earlyOnlyWarning 78 and diff>Flight.TIME_ERROR_DIFFERENCE)) 75 79 76 80 def __init__(self, logger, gui): … … 389 393 return self.isTimeDifferenceTooMuch(self.bookedFlight.arrivalTime, 390 394 self.blockTimeEnd, 391 earlyO nlyWarning= True)395 earlyOK = True) 392 396 393 397 def disconnected(self):
Note:
See TracChangeset
for help on using the changeset viewer.