Adds HTML Templates
This commit is contained in:
1
HTML/Alerts.html
Normal file
1
HTML/Alerts.html
Normal file
@@ -0,0 +1 @@
|
||||
<module>Alerts</module>
|
||||
50
HTML/Configuration.html
Normal file
50
HTML/Configuration.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<div class="row row-flex">
|
||||
<div class="col-md-6 box-me entry-top-level" id="low_flow_gpm">
|
||||
<div style="margin-left:15px;">
|
||||
<h2>Low Flow Setpoint</h2>
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-bottom:15px;">
|
||||
<label
|
||||
class="sr-only"
|
||||
for="<%= channels["flowmonitor.low_flow_gpm"].channelId %>">Low Flow Limit (GPM)</label>
|
||||
<div class="input-group">
|
||||
<input
|
||||
class="form-control channel_value"
|
||||
type="number"
|
||||
step="any"
|
||||
value="<%=channels['flowmonitor.low_flow_gpm'].value %>">
|
||||
<div class="input-group-addon">GPM</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<a
|
||||
href="#"
|
||||
data-confirm-message="Are you sure you want to do this?"
|
||||
data-refreshpause="1"
|
||||
data-command=""
|
||||
data-staticsend=1.0
|
||||
data-channelId="<%= channels["flowmonitor.low_flow_gpm"].channelId %>"
|
||||
data-techname="<%=channels["flowmonitor.low_flow_gpm"].techName %>"
|
||||
data-name="<%= channels["flowmonitor.low_flow_gpm"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["flowmonitor.low_flow_gpm"].nodechannelcurrentId %>"
|
||||
id="<%= channels["flowmonitor.low_flow_gpm"].channelId %>"
|
||||
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$('.channel_value').each(function(topLevel){
|
||||
$(this).change(function(){
|
||||
var id = "#" + $(this).closest(".entry-top-level").attr('id');
|
||||
if (id !== "#undefined"){
|
||||
var val = $(id).find('.channel_value').val();
|
||||
var tag = $(id).find('.setstatic').attr('data-staticsend', val);
|
||||
console.log($(id).find('.setstatic').attr('data-staticsend'));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
15
HTML/NodeDetailHeader.html
Normal file
15
HTML/NodeDetailHeader.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class='col-xs-1'>
|
||||
<div class="<%= nodecolors.statuscolor %> nodecolor"></div>
|
||||
</div>
|
||||
<div class='col-xs-6'>
|
||||
<h3><%= node.vanityname %></h3>
|
||||
<h4>
|
||||
<span data-updatevalue="run_status">
|
||||
<% if(channels["flowmonitor.run_status"].value === 1) {%>
|
||||
Running
|
||||
<% } else { %>
|
||||
Stopped
|
||||
<% } %>
|
||||
</span>
|
||||
</h4>
|
||||
</div>
|
||||
157
HTML/Overview.html
Normal file
157
HTML/Overview.html
Normal file
@@ -0,0 +1,157 @@
|
||||
<div class="row row-flex box-me">
|
||||
<div class='col-xs-6 text-center box-me'>
|
||||
<h2>GPM Flow</h2>
|
||||
<div class="gauge-box">
|
||||
<div data-labelheight="10"
|
||||
style="height: 170px; background: transparent; margin: 0 auto;"
|
||||
id="gauge-gpm_flow"
|
||||
data-chart="solidgauge"
|
||||
data-nodename="flowmonitor.gpm_flow"
|
||||
data-units="GPM"
|
||||
data-min="0"
|
||||
data-max="500"
|
||||
data-decimalplaces="2"
|
||||
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
|
||||
data-valuefontsize="18px">
|
||||
</div>
|
||||
<div class- "timestamp-box">
|
||||
<a href="#" data-channelId="<%= channels['flowmonitor.gpm_flow'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
<span data-timeupdate="gpm_flow">
|
||||
<%= channels["flowmonitor.gpm_flow"].timestamp %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-xs-6 text-center box-me'>
|
||||
<h2>BPD Flow</h2>
|
||||
<div class="gauge-box">
|
||||
<div data-labelheight="10"
|
||||
style="height: 170px; background: transparent; margin: 0 auto;"
|
||||
id="gauge-bpd_flow"
|
||||
data-chart="solidgauge"
|
||||
data-nodename="flowmonitor.bpd_flow"
|
||||
data-units="BPD"
|
||||
data-min="0"
|
||||
data-max="5000"
|
||||
data-decimalplaces="2"
|
||||
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
|
||||
data-valuefontsize="18px">
|
||||
</div>
|
||||
<div class- "timestamp-box">
|
||||
<a href="#" data-channelId="<%= channels['flowmonitor.bpd_flow'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
<span data-timeupdate="bpd_flow">
|
||||
<%= channels["flowmonitor.bpd_flow"].timestamp %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-xs-3 text-center box-me'>
|
||||
<h2>Gallons Today</h2>
|
||||
<div class="gauge-box">
|
||||
<div data-labelheight="10"
|
||||
style="height: 170px; background: transparent; margin: 0 auto;"
|
||||
id="gauge-gal_total"
|
||||
data-chart="solidgauge"
|
||||
data-nodename="flowmonitor.gal_total"
|
||||
data-units="Gal."
|
||||
data-min="0"
|
||||
data-max="5000"
|
||||
data-decimalplaces="2"
|
||||
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
|
||||
data-valuefontsize="18px">
|
||||
</div>
|
||||
<div class- "timestamp-box">
|
||||
<a href="#" data-channelId="<%= channels['flowmonitor.gal_total'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
<span data-timeupdate="gal_total">
|
||||
<%= channels["flowmonitor.gal_total"].timestamp %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-xs-3 text-center box-me'>
|
||||
<h2>Gallons Yesterday</h2>
|
||||
<div class="gauge-box">
|
||||
<div data-labelheight="10"
|
||||
style="height: 170px; background: transparent; margin: 0 auto;"
|
||||
id="gauge-gal_total_yesterday"
|
||||
data-chart="solidgauge"
|
||||
data-nodename="flowmonitor.gal_total_yesterday"
|
||||
data-units="Gal."
|
||||
data-min="0"
|
||||
data-max="5000"
|
||||
data-decimalplaces="2"
|
||||
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
|
||||
data-valuefontsize="18px">
|
||||
</div>
|
||||
<div class- "timestamp-box">
|
||||
<a href="#" data-channelId="<%= channels['flowmonitor.gal_total_yesterday'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
<span data-timeupdate="gal_total_yesterday">
|
||||
<%= channels["flowmonitor.gal_total_yesterday"].timestamp %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-xs-3 text-center box-me'>
|
||||
<h2>Barrels Today</h2>
|
||||
<div class="gauge-box">
|
||||
<div data-labelheight="10"
|
||||
style="height: 170px; background: transparent; margin: 0 auto;"
|
||||
id="gauge-bbl_total"
|
||||
data-chart="solidgauge"
|
||||
data-nodename="flowmonitor.bbl_total"
|
||||
data-units="BBL"
|
||||
data-min="0"
|
||||
data-max="5000"
|
||||
data-decimalplaces="2"
|
||||
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
|
||||
data-valuefontsize="18px">
|
||||
</div>
|
||||
<div class- "timestamp-box">
|
||||
<a href="#" data-channelId="<%= channels['flowmonitor.bbl_total'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
<span data-timeupdate="bbl_total">
|
||||
<%= channels["flowmonitor.bbl_total"].timestamp %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-xs-3 text-center box-me'>
|
||||
<h2>Barrels Yesterday</h2>
|
||||
<div class="gauge-box">
|
||||
<div data-labelheight="10"
|
||||
style="height: 170px; background: transparent; margin: 0 auto;"
|
||||
id="gauge-bbl_total_yesterday"
|
||||
data-chart="solidgauge"
|
||||
data-nodename="flowmonitor.bbl_total_yesterday"
|
||||
data-units="BBL"
|
||||
data-min="0"
|
||||
data-max="5000"
|
||||
data-decimalplaces="2"
|
||||
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
|
||||
data-valuefontsize="18px">
|
||||
</div>
|
||||
<div class- "timestamp-box">
|
||||
<a href="#" data-channelId="<%= channels['flowmonitor.bbl_total_yesterday'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
<span data-timeupdate="bbl_total_yesterday">
|
||||
<%= channels["flowmonitor.bbl_total_yesterday"].timestamp %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
49
HTML/Trends.html
Normal file
49
HTML/Trends.html
Normal file
@@ -0,0 +1,49 @@
|
||||
<div class='col-xs-12' style="padding-top: 1em; margin-bottom: 1em;">
|
||||
<div class="input-daterange input-group" id="datepicker">
|
||||
<input data-chartid="dynamicChart"
|
||||
id="fromDate"
|
||||
data-daysofhistory="7"
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="start">
|
||||
<span class="input-group-addon">to</span>
|
||||
<input class="form-control"
|
||||
data-chartid="dynamicChart"
|
||||
id="toDate"
|
||||
type="text"
|
||||
name="end">
|
||||
<span class='input-group-btn'>
|
||||
<a href="#!"
|
||||
data-chartid="dynamicChart"
|
||||
data-otherchartids="statusTimeline"
|
||||
class="btn chart-update btn-theme">Run</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class='clearfix col-xs-12'
|
||||
style='height: 450px'
|
||||
id="dynamicChart"
|
||||
data-chart="dynamicchart"
|
||||
data-daysofhistory="7"
|
||||
data-chartlabel="Data"
|
||||
data-ylabel=""
|
||||
data-xlabel="Date"
|
||||
data-units=""
|
||||
data-channelnames="flowmonitor.gal_total,flowmonitor.gal_total_yesterday,flowmonitor.bbl_total,flowmonitor.bbl_total_yesterday,flowmonitor.gpm_flow,flowmonitor.bpd_flow"></div>
|
||||
|
||||
<style>
|
||||
.dynamic-chart-form {
|
||||
background-color: whiteSmoke;
|
||||
padding: 1em 0.5em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
#systemStatusTimelineContainer h2 {
|
||||
text-transform: uppercase;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
font-weight: 400;
|
||||
letter-spacing: 1px;
|
||||
z-index: 100;
|
||||
}
|
||||
</style>
|
||||
@@ -74,10 +74,8 @@ class start(threading.Thread, deviceBase):
|
||||
"""Register the driver."""
|
||||
self.channels["status"]["last_value"] = ""
|
||||
|
||||
|
||||
def run(self):
|
||||
"""Run the driver."""
|
||||
|
||||
# Configuration Parameters
|
||||
total_time_store_delta = 60 # seconds
|
||||
flow_time_store_delta = 60 # seconds
|
||||
@@ -98,6 +96,8 @@ class start(threading.Thread, deviceBase):
|
||||
|
||||
runstatus_ch = Channel('run_status', 0.5, 600)
|
||||
|
||||
date_reset = False
|
||||
|
||||
last_measured_timestamp = time.time()
|
||||
conn = sqlite3.connect('/root/python_firmware/drivers/flow-monitor.db')
|
||||
c = conn.cursor()
|
||||
@@ -165,6 +165,19 @@ class start(threading.Thread, deviceBase):
|
||||
self.sendtodb(runstatus_ch.meshify_name, din1_val, 0)
|
||||
runstatus_ch.update(din1_val, now)
|
||||
|
||||
if time.localtime(now)[3] == 0 and not date_reset:
|
||||
self.sendtodb('gal_total_yesterday', gal_totalizer_value, 0)
|
||||
self.sendtodb('bbl_total_yesterday', bbl_totalizer_value, 0)
|
||||
gal_totalizer_value = 0.0
|
||||
bbl_totalizer_value = 0.0
|
||||
c.execute('UPDATE flow_data SET gal_totalizer_value=?, bbl_totalizer_value=?, last_measured_timestamp=?',
|
||||
(gal_totalizer_value, bbl_totalizer_value, last_measured_timestamp))
|
||||
conn.commit()
|
||||
date_reset = True
|
||||
|
||||
if time.localtime(now)[3] != 0 and date_reset:
|
||||
date_reset = False
|
||||
|
||||
except Exception as e:
|
||||
print("problem in the driver: {}".format(e))
|
||||
time.sleep(5)
|
||||
|
||||
@@ -52,8 +52,8 @@ def is_today(tstamp):
|
||||
def loop():
|
||||
"""Run the driver."""
|
||||
# Configuration Parameters
|
||||
total_time_store_delta = 600 # seconds
|
||||
flow_time_store_delta = 600 # seconds
|
||||
# total_time_store_delta = 600 # seconds
|
||||
# flow_time_store_delta = 600 # seconds
|
||||
|
||||
raw_min = 3.89
|
||||
raw_max = 19.54
|
||||
@@ -63,13 +63,13 @@ def loop():
|
||||
|
||||
gal_per_bbl = 42.0
|
||||
|
||||
galtotal_ch = Channel('gal_total', 100.0, total_time_store_delta)
|
||||
bbltotal_ch = Channel('bbl_total', galtotal_ch.senddelta_value/gal_per_bbl, total_time_store_delta)
|
||||
|
||||
gpmflow_ch = Channel('gpm_flow', 10.0, flow_time_store_delta)
|
||||
bpdflow_ch = Channel('bpd_flow', gpmflow_ch.senddelta_value/gal_per_bbl, total_time_store_delta)
|
||||
|
||||
runstatus_ch = Channel('run_status', 0.5, 600)
|
||||
# galtotal_ch = Channel('gal_total', 100.0, total_time_store_delta)
|
||||
# bbltotal_ch = Channel('bbl_total', galtotal_ch.senddelta_value/gal_per_bbl, total_time_store_delta)
|
||||
#
|
||||
# gpmflow_ch = Channel('gpm_flow', 10.0, flow_time_store_delta)
|
||||
# bpdflow_ch = Channel('bpd_flow', gpmflow_ch.senddelta_value/gal_per_bbl, total_time_store_delta)
|
||||
#
|
||||
# runstatus_ch = Channel('run_status', 0.5, 600)
|
||||
|
||||
last_measured_timestamp = time.time()
|
||||
conn = sqlite3.connect('flow-monitor.db')
|
||||
|
||||
Reference in New Issue
Block a user