From 56c433545a0339d074ca03503dbef0129bacde06 Mon Sep 17 00:00:00 2001 From: Patrick McDonagh Date: Mon, 25 Apr 2016 16:09:24 -0500 Subject: [PATCH] Fixed some non-default IP address issues --- dbMySQL/dataLogger_MySQL.py | 2 +- dbSQLite/dataLogger_SQLite.py | 22 +++++++++++----------- setdb_SQLite.sh | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dbMySQL/dataLogger_MySQL.py b/dbMySQL/dataLogger_MySQL.py index 1b6c37a..cdb7f61 100644 --- a/dbMySQL/dataLogger_MySQL.py +++ b/dbMySQL/dataLogger_MySQL.py @@ -133,7 +133,7 @@ welltest_tags = {} # Tags stored at well test submit bit_tags = {} safety_tags = {} custom_tags = {} -status = Status('run_status', 'Pump.Run_Status', 0, 'STRING', 0, 3600, mapFn=maps['statusMap']) +status = Status('run_status', 'Pump.Run_Status', 0, 'STRING', 0, 3600, mapFn=maps['statusMap'], ip_address=configProperties['PLC_IP_ADDRESS']) def setupTags(): diff --git a/dbSQLite/dataLogger_SQLite.py b/dbSQLite/dataLogger_SQLite.py index 258294c..13b66fe 100644 --- a/dbSQLite/dataLogger_SQLite.py +++ b/dbSQLite/dataLogger_SQLite.py @@ -130,7 +130,7 @@ welltest_tags = {} # Tags stored at well test submit bit_tags = {} safety_tags = {} custom_tags = {} -status = Status('run_status', 'Pump.Run_Status', 0, 'STRING', 0, 3600, mapFn=maps['statusMap']) +status = Status('run_status', 'Pump.Run_Status', 0, 'STRING', 0, 3600, mapFn=maps['statusMap'], ip_address=configProperties['PLC_IP_ADDRESS']) def setupTags(): @@ -145,29 +145,29 @@ def setupTags(): print(x) if str(x[1]) == 'stroke': if x[7]: - stroke_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], mapFn=maps[str(x[7])]) + stroke_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], mapFn=maps[str(x[7])], ip_address=configProperties['PLC_IP_ADDRESS']) else: - stroke_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5]) + stroke_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], ip_address=configProperties['PLC_IP_ADDRESS']) elif str(x[1]) == 'history': if x[7]: - history_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], mapFn=maps[str(x[7])]) + history_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], mapFn=maps[str(x[7])], ip_address=configProperties['PLC_IP_ADDRESS']) else: - history_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5]) + history_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], ip_address=configProperties['PLC_IP_ADDRESS']) elif str(x[1]) == 'gaugeoff': if x[7]: - gaugeoff_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], mapFn=maps[str(x[7])]) + gaugeoff_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], mapFn=maps[str(x[7])], ip_address=configProperties['PLC_IP_ADDRESS']) else: - gaugeoff_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5]) + gaugeoff_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], ip_address=configProperties['PLC_IP_ADDRESS']) elif str(x[1]) == 'welltest': if x[7]: - welltest_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], mapFn=maps[str(x[7])]) + welltest_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], mapFn=maps[str(x[7])], ip_address=configProperties['PLC_IP_ADDRESS']) else: - welltest_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5]) + welltest_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], ip_address=configProperties['PLC_IP_ADDRESS']) elif str(x[1]) == 'custom': if x[7]: - custom_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], mapFn=maps[str(x[7])]) + custom_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], mapFn=maps[str(x[7])], ip_address=configProperties['PLC_IP_ADDRESS']) else: - custom_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5]) + custom_tags[x[0]] = Tag(str(x[0]), str(x[2]), x[6], str(x[3]), x[4], x[5], ip_address=configProperties['PLC_IP_ADDRESS']) with con: cur = con.cursor() diff --git a/setdb_SQLite.sh b/setdb_SQLite.sh index d97572b..d0d9219 100644 --- a/setdb_SQLite.sh +++ b/setdb_SQLite.sh @@ -1,4 +1,4 @@ -echo "Setting database type to MySQL" +echo "Setting database type to SQLite" cp dbSQLite/dataLogger_SQLite.py dataLogger.py cp dbSQLite/readConfig_SQLite.py readConfig.py