mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-01-10 18:40:08 +01:00
rename pluginHander.py->alarmHandler.py
Method rename: throwAlarm() ->processAlarm()
This commit is contained in:
parent
82a837c19e
commit
26c9e23db8
|
|
@ -1,14 +1,14 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: cp1252 -*-
|
||||
|
||||
import logging
|
||||
|
||||
from includes import globals # Global variables
|
||||
from includes import pluginloader
|
||||
|
||||
def throwAlarm(typ,freq,data):
|
||||
logging.debug("[ ALARM ]")
|
||||
for name, plugin in globals.pluginList.items():
|
||||
logging.debug("call Plugin: %s", name)
|
||||
plugin.run(typ,freq,data)
|
||||
#!/usr/bin/python
|
||||
# -*- coding: cp1252 -*-
|
||||
|
||||
import logging
|
||||
|
||||
from includes import globals # Global variables
|
||||
from includes import pluginloader
|
||||
|
||||
def processAlarm(typ,freq,data):
|
||||
logging.debug("[ ALARM ]")
|
||||
for name, plugin in globals.pluginList.items():
|
||||
logging.debug("call Plugin: %s", name)
|
||||
plugin.run(typ,freq,data)
|
||||
logging.debug("[END ALARM]")
|
||||
|
|
@ -33,8 +33,8 @@ def decode(freq, decoded):
|
|||
else:
|
||||
logging.info("FMS:%s Status:%s Richtung:%s TKI:%s", fms_id[0:8], fms_status, fms_direction, fms_tsi)
|
||||
data = {"fms":fms_id[0:8], "status":fms_status, "direction":fms_direction, "tsi":fms_tsi}
|
||||
from includes import pluginHandler
|
||||
pluginHandler.throwAlarm("FMS",freq,data)
|
||||
from includes import alarmHandler
|
||||
alarmHandler.processAlarm("FMS",freq,data)
|
||||
|
||||
globals.fms_id_old = fms_id #save last id
|
||||
globals.fms_time_old = timestamp #save last time
|
||||
|
|
@ -57,8 +57,8 @@ def decode(freq, decoded):
|
|||
else:
|
||||
logging.info("5-Ton: %s", zvei_id)
|
||||
data = {"zvei":zvei_id}
|
||||
from includes import pluginHandler
|
||||
pluginHandler.throwAlarm("ZVEI",freq,data)
|
||||
from includes import alarmHandler
|
||||
alarmHandler.processAlarm("ZVEI",freq,data)
|
||||
|
||||
globals.zvei_id_old = zvei_id #save last id
|
||||
globals.zvei_time_old = timestamp #save last time
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ def decode(freq, decoded):
|
|||
else:
|
||||
logging.info("POCSAG%s: %s %s %s ", bitrate, poc_id, poc_sub, poc_text)
|
||||
data = {"ric":poc_id, "function":poc_sub, "msg":poc_text, "bitrate":bitrate}
|
||||
from includes import pluginHandler
|
||||
pluginHandler.throwAlarm("POC",freq,data)
|
||||
from includes import alarmHandler
|
||||
alarmHandler.processAlarm("POC",freq,data)
|
||||
|
||||
globals.poc_id_old = poc_id #save last id
|
||||
globals.poc_time_old = timestamp #save last time
|
||||
|
|
|
|||
Loading…
Reference in a new issue