pswamp.app_templates.status_reporting

Classes

ReportingApp

Implements the reporting functionality of applications. Uses a timer to

AlarmHandler

Module Contents

class pswamp.app_templates.status_reporting.ReportingApp(parent, status_update_freq=1)

Implements the reporting functionality of applications. Uses a timer to determine when to emit status messages.

TODO: Rename so it does not look like an application template.

Parameters:
  • parent – The application for which the reporting is done.

  • status_update_freq – How often the reporting is done (default is once per second).

parent
io
status_update_freq = 1
status_update_timer = None
t_next_status = None
t_status_target
communicate_status()

Determine when to send a new status message, generate the message, and hand it over to the io object of the parent.

class pswamp.app_templates.status_reporting.AlarmHandler(app, alarms_topic='alarms', alarm_time_threshold=15)
app
alarms_topic = 'alarms'
time_of_last_alarm = None
id_of_last_alarm = None
alarm_time_threshold = 15
update()