2015-05-18 21:04:10 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
# -*- coding: cp1252 -*-
|
|
|
|
|
|
|
|
|
|
import logging # Global logger
|
|
|
|
|
import globals # Global variables
|
2015-05-18 12:03:42 +02:00
|
|
|
|
2015-05-18 14:56:01 +02:00
|
|
|
def run(typ,freq,data):
|
2015-05-18 22:10:23 +02:00
|
|
|
try:
|
2015-05-20 09:38:30 +02:00
|
|
|
#ConfigParser
|
2015-05-20 10:48:17 +02:00
|
|
|
#config Data in config["OPTION"]
|
2015-05-20 09:38:30 +02:00
|
|
|
logging.debug("reading config file")
|
|
|
|
|
try:
|
|
|
|
|
config = dict(globals.config.items("template"))
|
|
|
|
|
for key,val in config.items():
|
|
|
|
|
logging.debug(" - %s = %s", key, val)
|
|
|
|
|
except:
|
|
|
|
|
logging.exception("cannot read config file")
|
2015-05-19 12:58:13 +02:00
|
|
|
|
|
|
|
|
if typ == "FMS":
|
2015-05-20 10:48:17 +02:00
|
|
|
logging.debug("FMS: %s Status: %s Dir: %s TKI: %s", data["fms"], data["status"], data["direction"], data["tki"])
|
2015-05-19 12:58:13 +02:00
|
|
|
elif typ == "ZVEI":
|
|
|
|
|
logging.debug("ZVEI: %s", data["zvei"])
|
|
|
|
|
elif typ == "POC":
|
2015-05-20 10:48:17 +02:00
|
|
|
logging.debug("POC: %s-%s - %s", data["ric"], data["function"], data["msg"])
|
2015-05-19 14:04:50 +02:00
|
|
|
else:
|
2015-05-19 12:58:13 +02:00
|
|
|
logging.warning(typ + " not supportet")
|
|
|
|
|
|
2015-05-18 22:10:23 +02:00
|
|
|
except:
|
2015-05-19 12:58:13 +02:00
|
|
|
logging.exception("unknown error")
|