aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-07-08 08:12:58 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-07-08 08:12:58 +0200
commit8df2849a482ef356584bcddf34e8e78fbe040ea1 (patch)
tree433903aacccabcfe05ae2cf06502abb067ff4e96
parent5b0afa8bb0f44fd9cb578d077faf2ee080f8bf18 (diff)
downloadglutte-serial-web-8df2849a482ef356584bcddf34e8e78fbe040ea1.tar.gz
glutte-serial-web-8df2849a482ef356584bcddf34e8e78fbe040ea1.tar.bz2
glutte-serial-web-8df2849a482ef356584bcddf34e8e78fbe040ea1.zip
Add new balise states
-rw-r--r--adsl.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/adsl.py b/adsl.py
index 3b2ff69..414c4b2 100644
--- a/adsl.py
+++ b/adsl.py
@@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
-# Copyright (c) 2016 Matthias P. Braendli, Maximilien Cuony
+# Copyright (c) 2019 Matthias P. Braendli, Maximilien Cuony
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -88,7 +88,10 @@ class Monitor(threading.Thread):
self.status_starttime[new_state] = datetime.datetime.now()
self.current_state = new_state
- if "FSM: FSM_BALISE_LONGUE" in line or "FSM: FSM_BALISE_SPECIALE" in line:
+ if "FSM: FSM_BALISE_LONGUE" in line or \
+ "FSM: FSM_BALISE_SPECIALE" in line or \
+ "FSM: FSM_BALISE_STATS1" in line or \
+ "FSM: FSM_BALISE_SPECIALE_STATS1" in line:
self.last_balise = datetime.datetime.now()
def alarms(self):
@@ -107,7 +110,13 @@ class Monitor(threading.Thread):
'FSM_TEXTE_HB9G': (120, '2 minutes'),
'FSM_TEXTE_LONG': (120, '2 minutes'),
'FSM_BALISE_LONGUE': (120, '2 minutes'),
+ 'FSM_BALISE_STATS1' : (120, '2 minutes'),
+ 'FSM_BALISE_STATS2' : (120, '2 minutes'),
+ 'FSM_BALISE_STATS3' : (120, '2 minutes'),
'FSM_BALISE_SPECIALE': (120, '2 minutes'),
+ 'FSM_BALISE_SPECIALE_STATS1' : (120, '2 minutes'),
+ 'FSM_BALISE_SPECIALE_STATS2' : (120, '2 minutes'),
+ 'FSM_BALISE_SPECIALE_STATS3' : (120, '2 minutes'),
'FSM_BALISE_COURTE': (120, '2 minutes'),
'FSM_BALISE_COURTE_OPEN': (120, '2 minutes'),
}
@@ -129,7 +138,7 @@ class Monitor(threading.Thread):
result.append("No GPS for more than 5 minutes !")
if self.last_balise and (datetime.datetime.now() - self.last_balise).total_seconds() > 10800:
- result.append("No FSM_BALISE_LONGUE nor FSM_BALISE_SPECIALE for more than 3 hours !")
+ result.append("No long balise for more than 3 hours !")
if self.current_state and self.current_state in MAXIMUM_STATES and (datetime.datetime.now() - self.status_starttime[self.current_state]).total_seconds() > MAXIMUM_STATES[self.current_state][0]:
result.append("The FSM has been in the state {} for more than {} !".format(self.current_state, MAXIMUM_STATES[self.current_state][1]))