Skip to content

Commit

Permalink
Refs #14. Code structure changed to support OpenTera in WatchServer
Browse files Browse the repository at this point in the history
  • Loading branch information
SBriere committed Jan 24, 2024
1 parent d7850d2 commit def8946
Show file tree
Hide file tree
Showing 13 changed files with 469 additions and 383 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.idea
/.gitignore
venv
logs
Test
data
/__pycache__/*.pyc
*.pyc
/config/PiHub.json
8 changes: 1 addition & 7 deletions Globals.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
##################################################
# PiHub global variables
##################################################
# Author: Simon Brière, Eng. MASc.
##################################################

from libs.config.ConfigManager import ConfigManager

config_man = ConfigManager()

version_string = '1.1.0'
version_string = '1.2.0'
13 changes: 6 additions & 7 deletions config/PiHub.json → config/PiHub_Defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"hostname": "0.0.0.0",
"port": 8118,
"data_path": "data/watch",
"sftp_transfer": true,
"opentera_transfer": false,
"transfer_type": "opentera",
"server_base_folder": "Watch",
"send_logs_only": false,
"minimal_dataset_duration": 10
Expand All @@ -30,13 +29,13 @@
"sensor_ID": "Sensor_0"
},
"SFTP": {
"hostname": "telesante.cdrv.ca",
"port": 40091,
"username": "sftp_dev",
"password": "LS9PwJx7$829so"
"hostname": "127.0.0.1",
"port": 22,
"username": "sftp",
"password": "sftp"
},
"OpenTera": {
"hostname": "localhost",
"hostname": "127.0.0.1",
"port": 40075
}
}
5 changes: 3 additions & 2 deletions libs/config/ConfigManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ def load_config(self, filename) -> bool:
self.opentera_config = config_json["OpenTera"]

if self.validate_config("WatchServer", config_json['WatchServer'], ['hostname', 'port', 'data_path',
'sftp_transfer', 'opentera_transfer',
'server_base_folder', 'send_logs_only']):
'transfer_type', 'server_base_folder',
'send_logs_only', 'minimal_dataset_duration'
]):
self.watch_server_config = config_json["WatchServer"]

if self.validate_config("BedServer", config_json['BedServer'], ['hostname', 'port', 'data_path',
Expand Down
Loading

0 comments on commit def8946

Please sign in to comment.