From 8b8b6a077805d72e20c5766192d25c099b8556b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Ates?= Date: Thu, 10 Mar 2016 09:12:02 +0100 Subject: [PATCH] Add transmitter settings to config. --- config.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/config.py b/config.py index f932dec..7f51a12 100644 --- a/config.py +++ b/config.py @@ -24,9 +24,11 @@ import logging DEFAULT_CONFIG = { - # Reader general configuration + # Reader and transmitter general configuration 'temperature': True, # Analyse and record temperature from reading 'heartrate': True, # Analyse and record heartrate from reading + + # Reader general configuration 'reader_sleep_short': 0.1, # Sleep between inventory of detection 'reader_sleep_long': 5, # Sleep before a long inventory @@ -40,15 +42,15 @@ DEFAULT_CONFIG = { 'tag_in_field': '', # The last antenna the tag was detected # Transmitter general configuration - 'metrics_path': 'entrouvert.research.veadista.patients.monitoring', - 'transmitter_sleep': 1, - 'patient_id': 1, - 'carbon_hostname': '127.0.0.1', - 'carbon_port': 2003, + 'carbon_hostname': '127.0.0.1', # carbon hostname + 'carbon_port': 2003, # carbon post + 'metrics_path': 'entrouvert.research.veadista.patients.monitoring', # whisper root path + 'patient_id': None, # patient id + 'transmitter_sleep': 1, # Waiting time between transmissions # Flags to act during veadista sending - 'exit_transmitter': True, - 'transmitter_status': True, + 'exit_transmitter': False, # Exit reading function + 'pause_transmitter': False, # Suspend transmission } @@ -94,3 +96,15 @@ class Config: config.get('reader_sleep_short'), config.get('temperature'), config.get('heartrate')) + + def transmitter_config(self): + config = self.get_config() + return (config.get('exit_transmitter'), + config.get('pause_transmitter'), + config.get('transmitter_sleep'), + config.get('patient_id'), + config.get('carbon_hostname'), + config.get('carbon_port'), + config.get('temperature'), + config.get('heartrate'), + config.get('metrics_path'))