diff --git a/ait/gui/__init__.py b/ait/gui/__init__.py index 5b9eee93..fcc9c50a 100644 --- a/ait/gui/__init__.py +++ b/ait/gui/__init__.py @@ -389,8 +389,11 @@ def telem_handler(session): for k, v in tlm.getDefaultDict().iteritems(): packet_dict[v.uid] = v - notif_thrshld = cfg.AitConfig.get('notifications.options.threshold') - notif_freq = cfg.AitConfig.get('notifications.options.frequency') + notif_thrshld = cfg.AitConfig().get('notifications.options.threshold') + if cfg.AitConfig().get('notifications.options.frequency'): + notif_freq = cfg.AitConfig().get('notifications.options.frequency') + else: + notif_freq = float('inf') log.info('Starting telemetry limit monitoring') try: @@ -417,8 +420,9 @@ def telem_handler(session): limit_trip_repeats[packet.name][field] += 1 - if limit_trip_repeats[packet.name][field] == notif_thrshld or - limit_trip_repeats[packet.name][field] % notif_freq == 0: + if (limit_trip_repeats[packet.name][field] == notif_thrshld or + (limit_trip_repeats[packet.name][field] - notif_thrshld) + % notif_freq == 0): notify.trigger_notification('limit-error', msg) elif defn.warn(v): @@ -427,8 +431,9 @@ def telem_handler(session): limit_trip_repeats[packet.name][field] += 1 - if limit_trip_repeats[packet.name][field] == notif_thrshld or - limit_trip_repeats[packet.name][field] % notif_freq == 0: + if (limit_trip_repeats[packet.name][field] == notif_thrshld or + (limit_trip_repeats[packet.name][field] - notif_thrshld) + % notif_freq == 0): notify.trigger_notification('limit-warn', msg) else: