Completes #1.

- Adds Pressure Transmitter on Analog 1
- Updates device driver for reading Analog 1
- Updates device driver to store scaling parameters in persist.json
- Increments version to 11
- Adds migration script to convert from using SQLite scaling storage
- Updates HTML Templates
- Updates README
This commit is contained in:
Patrick McDonagh
2018-04-05 16:41:54 -05:00
parent f48c165aff
commit 91096b2291
8 changed files with 448 additions and 130 deletions

View File

@@ -106,6 +106,45 @@
</form>
</div>
</div>
<div class="col-md-6 text-center box-me" id="pressure-transmitter-toggle">
<% if (channels['flowmonitor.psi_pressure_enabled'].value == "True"){ %>
<h2>Pressure Transmitter Enabled</h2>
<% } else { %>
<h2>Pressure Transmitter Disabled</h2>
<% } %>
<div data-valueupdate="psi_pressure_enabled" data-refreshonupdate=true>
<form>
<% if (channels['flowmonitor.psi_pressure_enabled'].value == "True"){ %>
<a
href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="False"
data-channelId="<%= channels["flowmonitor.psi_pressure_enabled"].channelId %>"
data-techname="<%=channels["flowmonitor.psi_pressure_enabled"].techName %>"
data-name="<%= channels["flowmonitor.psi_pressure_enabled"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.psi_pressure_enabled"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.psi_pressure_enabled"].channelId %>"
class="btn btn-large btn-theme animated setstatic">Disable Pressure Transmitter</a>
<% } else { %>
<a
href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="True"
data-channelId="<%= channels["flowmonitor.psi_pressure_enabled"].channelId %>"
data-techname="<%=channels["flowmonitor.psi_pressure_enabled"].techName %>"
data-name="<%= channels["flowmonitor.psi_pressure_enabled"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.psi_pressure_enabled"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.psi_pressure_enabled"].channelId %>"
class="btn btn-large btn-theme animated setstatic">Enable Pressure Transmitter</a>
<% } %>
</form>
</div>
</div>
</div>

View File

@@ -82,6 +82,35 @@
</span>
</div>
</div>
<% if (channels["flowmonitor.psi_pressure_enabled"].value == "True") { %>
<div class='col-xs-6 col-offset-xs-3 text-center box-me'>
<h2>Pressure Transmitter</h2>
<div class="gauge-box">
<div data-labelheight="10"
style="height: 170px; background: transparent; margin: 0 auto;"
id="gauge-psi_pressure"
data-chart="solidgauge"
data-nodename="flowmonitor.psi_pressure"
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.psi_pressure'].channelId %>" class="data-table" title="Download Channel History">
<i class="fa fa-download"></i>
</a>
</div>
<span data-timeupdate="psi_pressure">
<%= channels["flowmonitor.psi_pressure"].timestamp %>
</span>
</div>
</div>
<% } %>
</div>
<div class="row box-me">
@@ -133,6 +162,10 @@
data-chart="chart"
data-nodename1="flowmonitor.bpd_flow"
data-datalabel1="Flow Rate (BPD)"
<% if (channels["flowmonitor.psi_pressure_enabled"].value === "True") { %>
data-nodename2="flowmonitor.psi_pressure"
data-datalabel2="Pressure (PSI)"
<% } %>
data-daysofhistory="2"
data-chartlabel="Last 48 Hours"
data-ylabel=""

View File

@@ -1,4 +1,8 @@
<div class="row row-flex">
<div class="col-xs-12" style="text-align: center;">
<h1>Flowmeter</h1>
</div>
<div class="col-md-6 box-me entry-top-level" id="setrawmin">
<div style="margin-left:15px;">
<h2>Raw Min</h2>
@@ -172,6 +176,149 @@
</div>
<div class="row row-flex">
<div class="col-xs-12" style="text-align: center;">
<h1>Pressure Transmitter</h1>
</div>
<div class="col-md-6 box-me entry-top-level" id="setpressurerawmin">
<div style="margin-left:15px;">
<h2>Raw Min</h2>
<form class="form-inline">
<div class="form-group" style="margin-bottom:15px;">
<label
class="sr-only"
for="<%= channels["flowmonitor.setpressurerawmin"].channelId %>">Raw Min Value</label>
<div class="input-group">
<input
class="form-control channel_value"
type="number"
step="any"
value="<%=channels['flowmonitor.setpressurerawmin'].value %>">
<div class="input-group-addon">V</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.setpressurerawmin"].channelId %>"
data-techname="<%=channels["flowmonitor.setpressurerawmin"].techName %>"
data-name="<%= channels["flowmonitor.setpressurerawmin"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.setpressurerawmin"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.setpressurerawmin"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<div class="col-md-6 box-me entry-top-level" id="setpressurerawmax">
<div style="margin-left:15px;">
<h2>Raw Max</h2>
<form class="form-inline">
<div class="form-group" style="margin-bottom:15px;">
<label
class="sr-only"
for="<%= channels["flowmonitor.setpressurerawmax"].channelId %>">Raw Max Value</label>
<div class="input-group">
<input
class="form-control channel_value"
type="number"
step="any"
value="<%=channels['flowmonitor.setpressurerawmax'].value %>">
<div class="input-group-addon">V</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.setpressurerawmax"].channelId %>"
data-techname="<%=channels["flowmonitor.setpressurerawmax"].techName %>"
data-name="<%= channels["flowmonitor.setpressurerawmax"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.setpressurerawmax"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.setpressurerawmax"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<div class="col-md-6 box-me entry-top-level" id="setpressurepsimin">
<div style="margin-left:15px;">
<h2>PSI Min</h2>
<form class="form-inline">
<div class="form-group" style="margin-bottom:15px;">
<label
class="sr-only"
for="<%= channels["flowmonitor.setpressurepsimin"].channelId %>">PSI Min Value</label>
<div class="input-group">
<input
class="form-control channel_value"
type="number"
step="any"
value="<%=channels['flowmonitor.setpressurepsimin'].value %>">
<div class="input-group-addon">PSI</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.setpressurepsimin"].channelId %>"
data-techname="<%=channels["flowmonitor.setpressurepsimin"].techName %>"
data-name="<%= channels["flowmonitor.setpressurepsimin"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.setpressurepsimin"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.setpressurepsimin"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<div class="col-md-6 box-me entry-top-level" id="setpressurepsimax">
<div style="margin-left:15px;">
<h2>PSI Max</h2>
<form class="form-inline">
<div class="form-group" style="margin-bottom:15px;">
<label
class="sr-only"
for="<%= channels["flowmonitor.setpressurepsimax"].channelId %>">PSI Max Value</label>
<div class="input-group">
<input
class="form-control channel_value"
type="number"
step="any"
value="<%=channels['flowmonitor.setpressurepsimax'].value %>">
<div class="input-group-addon">PSI</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.setpressurepsimax"].channelId %>"
data-techname="<%=channels["flowmonitor.setpressurepsimax"].techName %>"
data-name="<%= channels["flowmonitor.setpressurepsimax"].name%>"
data-nodechannelcurrentId="<%= channels["flowmonitor.setpressurepsimax"].nodechannelcurrentId %>"
id="<%= channels["flowmonitor.setpressurepsimax"].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(){

View File

@@ -30,7 +30,7 @@
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.gal_total_thismonth,flowmonitor.gal_total_lastmonth,flowmonitor.bbl_total_thismonth,flowmonitor.bbl_total_lastmonth,flowmonitor.bpd_flow"></div>
data-channelnames="flowmonitor.gal_total,flowmonitor.gal_total_yesterday,flowmonitor.bbl_total,flowmonitor.bbl_total_yesterday,flowmonitor.gpm_flow,flowmonitor.gal_total_thismonth,flowmonitor.gal_total_lastmonth,flowmonitor.bbl_total_thismonth,flowmonitor.bbl_total_lastmonth,flowmonitor.bpd_flow<% if (channels['flowmonitor.psi_pressure_enabled'].value == 'True') { %>,flowmonitor.psi_pressure<% } %>"></div>
<style>
.dynamic-chart-form {