Adds cloud templates, updates transfer station program

- allows custom priorities
- adds manual mode
This commit is contained in:
Patrick McDonagh
2017-07-27 20:23:06 -05:00
parent b8c9890d34
commit 0f501f58d2
6 changed files with 12356 additions and 9248 deletions

View File

@@ -30,6 +30,12 @@
</div>
<div class="col-xs-2">
<h2>Flow Rate</h2>
<p><%= Math.round(channels["transferstation.flow_rate"].value * 100) / 100 %> GPM</p>
<p>
<% if ([1, 3, 5, 7, 9, 11, 15].indexOf(parseInt(channels['transferstation.ftx1_enabled'].value)) != -1) { %>
<%= Math.round(channels["transferstation.ft01_flow"].value * 100) / 100 %> GPM
<% } else { %>
<%= Math.round((channels["transferstation.ft11_flow"].value + channels["transferstation.ft21_flow"].value + channels["transferstation.ft31_flow"].value) * 100) / 100 %> GPM
<% }%>
</p>
</div>
</div>

View File

@@ -1,10 +1,10 @@
<% if ((channels['transferstation.lt01_enabled'].value == 1) || (channels['transferstation.ft01_enabled'].value == 1)) { %>
<% if (([1, 3, 5, 7, 9, 11, 15].indexOf(parseInt(channels['transferstation.ltx1_enabled'].value)) != -1 ) || ([1, 3, 5, 7, 9, 11, 15].indexOf(parseInt(channels['transferstation.ftx1_enabled'].value)) != -1)) { %>
<div class="row row-flex box-me" id="sharedSystems">
<div class="col-xs-12 text-center">
<h1>Shared Devices</h1>
</div>
<% if (channels["transferstation.lt01_enabled"].value == 1) { %>
<% if ([1, 3, 5, 7, 9, 11, 15].indexOf(parseInt(channels["transferstation.ltx1_enabled"].value)) != -1) { %>
<div class="col-xs-4 text-center">
<h2>Pond Level (LT01)</h2>
<div class="gauge-box">
@@ -33,7 +33,7 @@
<% } %>
<% if (channels['transferstation.ft01_enabled'].value == 1) { %>
<% if ([1, 3, 5, 7, 9, 11, 15].indexOf(parseInt(channels['transferstation.ftx1_enabled'].value)) != -1) { %>
<div class="col-xs-4 text-center">
<h2>System Flow (FT01)</h2>
<div class="gauge-box">
@@ -44,7 +44,7 @@
data-nodename="transferstation.ft01_flow"
data-units="GPM"
data-min="0"
data-max="1000"
data-max="4000"
data-decimalplaces="2"
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
data-valuefontsize="18px">
@@ -65,12 +65,12 @@
<% if (channels["transferstation.system1_enabled"].value == 1) { %>
<% if ([2, 3, 6, 7, 10, 11, 14, 15].indexOf(parseInt(channels["transferstation.systems_enabled"].value)) != -1) { %>
<div class="row row-flex box-me" id="system1">
<div class="col-xs-12 text-center">
<h1>System 1</h1>
</div>
<% if (channels['transferstation.lt11_enabled'].value == 1) { %>
<% if ([2, 3, 6, 7, 10, 11, 14, 15].indexOf(parseInt(channels['transferstation.ltx1_enabled'].value)) != -1) { %>
<div class="col-xs-4 text-center">
<h2>Pond Level (LT11)</h2>
<div class="gauge-box">
@@ -107,7 +107,7 @@
data-nodename="transferstation.pt11_pressure"
data-units="PSI"
data-min="0"
data-max="100"
data-max="600"
data-decimalplaces="2"
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
data-valuefontsize="18px">
@@ -122,7 +122,7 @@
</span>
</div>
</div>
<% if (channels['transferstation.pt12_enabled'].value == 1) { %>
<% if ([2, 3, 6, 7, 10, 11, 14, 15].indexOf(parseInt(channels['transferstation.ptx2_enabled'].value)) != -1 ) { %>
<div class="col-xs-4 text-center">
<h2>Booster Pump Discharge Pressure (PT12)</h2>
<div class="gauge-box">
@@ -133,7 +133,7 @@
data-nodename="transferstation.pt12_pressure"
data-units="PSI"
data-min="0"
data-max="100"
data-max="600"
data-decimalplaces="2"
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
data-valuefontsize="18px">
@@ -150,7 +150,7 @@
</div>
<% } %>
<% if (channels['transferstation.ft11_enabled'].value == 1) { %>
<% if ([2, 3, 6, 7, 10, 11, 14, 15].indexOf(parseInt(channels['transferstation.ftx1_enabled'].value)) != -1 ) { %>
<div class="col-xs-4 text-center">
<h2>System Flow (FT11)</h2>
<div class="gauge-box">
@@ -161,7 +161,7 @@
data-nodename="transferstation.ft11_flow"
data-units="GPM"
data-min="0"
data-max="1000"
data-max="4000"
data-decimalplaces="2"
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
data-valuefontsize="18px">
@@ -183,12 +183,12 @@
<% if (channels["transferstation.system2_enabled"].value == 1) { %>
<% if ([4, 5, 6, 7, 12, 13, 14, 15].indexOf(parseInt(channels["transferstation.systems_enabled"].value)) != -1 ) { %>
<div class="row row-flex box-me" id="system2">
<div class="col-xs-12 text-center">
<h1>System 2</h1>
</div>
<% if (channels['transferstation.lt21_enabled'].value == 1) { %>
<% if ([4, 5, 6, 7, 12, 13, 14, 15].indexOf(parseInt(channels['transferstation.ltx1_enabled'].value)) != -1 ) { %>
<div class="col-xs-4 text-center">
<h2>Pond Level (LT21)</h2>
<div class="gauge-box">
@@ -225,7 +225,7 @@
data-nodename="transferstation.pt21_pressure"
data-units="PSI"
data-min="0"
data-max="100"
data-max="600"
data-decimalplaces="2"
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
data-valuefontsize="18px">
@@ -240,7 +240,7 @@
</span>
</div>
</div>
<% if (channels['transferstation.pt22_enabled'].value == 1) { %>
<% if ([4, 5, 6, 7, 12, 13, 14, 15].indexOf(parseInt(channels['transferstation.ptx2_enabled'].value)) != -1 ) { %>
<div class="col-xs-4 text-center">
<h2>Booster Pump Discharge Pressure (PT22)</h2>
<div class="gauge-box">
@@ -251,7 +251,7 @@
data-nodename="transferstation.pt22_pressure"
data-units="PSI"
data-min="0"
data-max="100"
data-max="600"
data-decimalplaces="2"
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
data-valuefontsize="18px">
@@ -268,7 +268,7 @@
</div>
<% } %>
<% if (channels['transferstation.ft21_enabled'].value == 1) { %>
<% if ([4, 5, 6, 7, 12, 13, 14, 15].indexOf(parseInt(channels['transferstation.ftx1_enabled'].value)) != -1 ) { %>
<div class="col-xs-4 text-center">
<h2>System Flow (FT21)</h2>
<div class="gauge-box">
@@ -279,7 +279,7 @@
data-nodename="transferstation.ft21_flow"
data-units="GPM"
data-min="0"
data-max="1000"
data-max="4000"
data-decimalplaces="2"
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
data-valuefontsize="18px">
@@ -298,12 +298,12 @@
</div>
<% } %>
<% if (channels["transferstation.system3_enabled"].value == 1) { %>
<% if ([8, 9, 10, 11, 12, 13, 14, 15].indexOf(parseInt(channels["transferstation.systems_enabled"].value)) != -1 ) { %>
<div class="row row-flex box-me" id="system3">
<div class="col-xs-12 text-center">
<h1>System 3</h1>
</div>
<% if (channels['transferstation.lt31_enabled'].value == 1) { %>
<% if ([8, 9, 10, 11, 12, 13, 14, 15].indexOf(parseInt(channels['transferstation.ltx1_enabled'].value)) != -1 ) { %>
<div class="col-xs-4 text-center">
<h2>Pond Level (LT31)</h2>
<div class="gauge-box">
@@ -340,7 +340,7 @@
data-nodename="transferstation.pt31_pressure"
data-units="PSI"
data-min="0"
data-max="100"
data-max="600"
data-decimalplaces="2"
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
data-valuefontsize="18px">
@@ -355,7 +355,7 @@
</span>
</div>
</div>
<% if (channels['transferstation.pt32_enabled'].value == 1) { %>
<% if ([8, 9, 10, 11, 12, 13, 14, 15].indexOf(parseInt(channels['transferstation.ptx2_enabled'].value)) != -1 ) { %>
<div class="col-xs-4 text-center">
<h2>Booster Pump Discharge Pressure (PT32)</h2>
<div class="gauge-box">
@@ -366,7 +366,7 @@
data-nodename="transferstation.pt32_pressure"
data-units="PSI"
data-min="0"
data-max="100"
data-max="600"
data-decimalplaces="2"
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
data-valuefontsize="18px">
@@ -383,7 +383,7 @@
</div>
<% } %>
<% if (channels['transferstation.ft31_enabled'].value == 1) { %>
<% if ([8, 9, 10, 11, 12, 13, 14, 15].indexOf(parseInt(channels['transferstation.ftx1_enabled'].value)) != -1 ) { %>
<div class="col-xs-4 text-center">
<h2>System Flow (FT31)</h2>
<div class="gauge-box">
@@ -394,7 +394,7 @@
data-nodename="transferstation.ft31_flow"
data-units="GPM"
data-min="0"
data-max="1000"
data-max="4000"
data-decimalplaces="2"
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
data-valuefontsize="18px">

View File

@@ -3,12 +3,13 @@
"driverFileName":"transferstation.py",
"deviceName":"transferstation",
"driverId":"0140",
"releaseVersion":"1",
"releaseVersion":"2",
"files": {
"file1":"transferstation.py",
"file2":"Channel.py",
"file3":"Maps.py",
"file4":"Scheduler.py"
"file4":"Scheduler.py",
"file5":"modbusMap.p"
}
}

2000
POCloud/modbusMap.p Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,6 @@ import threading
from device_base import deviceBase
from Channel import Channel, write_tag, BoolArrayChannels
from Maps import transferstation_map as maps
from Scheduler import ScheduleRun
import json
import time
@@ -60,7 +59,7 @@ channels = [
Channel(plc_ip_address, "ft21_flow", "FTX1_SystemOutput[2].Val", "REAL", 5.0, 3600),
Channel(plc_ip_address, "ft31_flow", "FTX1_SystemOutput[3].Val", "REAL", 5.0, 3600),
Channel(plc_ip_address, "cmd_run", "cmd_run", "BOOL", _, 3600, map_=maps['run']),
# Channel(plc_ip_address, "run_status", "TransferStation.Running", "BOOL", _, 3600, map_=maps['run']),
# Channel(plc_ip_address, "ft21_enabled", "cfg_SystemFTEnabled[2]", "BOOL", _, 3600),
# Channel(plc_ip_address, "ft31_enabled", "cfg_SystemFTEnabled[3]", "BOOL", _, 3600),
]
@@ -75,7 +74,7 @@ class start(threading.Thread, deviceBase):
deviceBase.__init__(self, name=name, number=number, mac=mac, Q=Q, mcu=mcu, companyId=companyId, offset=offset, mqtt=mqtt, Nodes=Nodes)
self.daemon = True
self.version = "1"
self.version = "2"
self.finished = threading.Event()
self.forceSend = False
threading.Thread.start(self)
@@ -98,14 +97,15 @@ class start(threading.Thread, deviceBase):
while True:
if self.forceSend:
print "FORCE SEND: TRUE"
for c in channels:
if c.read(self.forceSend):
self.sendtodb(c.mesh_name, c.value, 0)
for b in bit_channels:
if b.read(self.forceSend):
for v in b.last_value:
self.sendtodb(v, b.last_value[v], 0)
# for c in channels:
# if c.read(self.forceSend):
# self.sendtodb(c.mesh_name, c.value, 0)
#
# for b in bit_channels:
# if b.read(self.forceSend):
# for v in b.last_value:
# self.sendtodb(v, b.last_value[v], 0)
print("transferstation driver still alive...")
if self.forceSend:

File diff suppressed because one or more lines are too long