Allow control via POCloud
This commit is contained in:
12613
RigPump.ACD
12613
RigPump.ACD
File diff suppressed because one or more lines are too long
270
rigpump/html-templates/Control.html
Normal file
270
rigpump/html-templates/Control.html
Normal file
@@ -0,0 +1,270 @@
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
<div class="row row-flex">
|
||||
<div class="col-xs-12 text-center">
|
||||
<h1>Control</h1>
|
||||
</div>
|
||||
<div class='col-xs-6 text-center box-me'>
|
||||
<!-- Use data-confirm-message to set the exact message that pops up in the alert window. -->
|
||||
|
||||
<a href="#"
|
||||
data-confirm-message="Are you sure you want to remotely start the pump?"
|
||||
data-refreshpause="1"
|
||||
data-command=""
|
||||
data-staticsend="{'tag': 'cmd_Start', 'val': 1}"
|
||||
data-channelId="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
data-techname="<%=channels["rigpump.writeplctag"].techName %>"
|
||||
data-name="<%= channels["rigpump.writeplctag"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["rigpump.writeplctag"].nodechannelcurrentId %>"
|
||||
id="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
class="btn btn-large btn-theme animated confirmstatic pad15">
|
||||
Start</a>
|
||||
</div>
|
||||
<div class='col-xs-6 text-center box-me'>
|
||||
<a href="#"
|
||||
data-confirm-message="Are you sure you want to remotely stop the pump?"
|
||||
data-refreshpause="1"
|
||||
data-command=""
|
||||
data-staticsend="{'tag': 'cmd_Stop', 'val': 1}"
|
||||
data-channelId="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
data-techname="<%=channels["rigpump.writeplctag"].techName %>"
|
||||
data-name="<%= channels["rigpump.writeplctag"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["rigpump.writeplctag"].nodechannelcurrentId %>"
|
||||
id="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
class="btn btn-large btn-theme animated confirmstatic pad15">
|
||||
Stop</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row row-flex">
|
||||
<div class='col-xs-6 text-center box-me'>
|
||||
<h2>Auto/Manual Mode</h2>
|
||||
<a href="#"
|
||||
data-confirm-message="Are you sure you want to switch to Auto Mode?"
|
||||
data-refreshpause="1"
|
||||
data-command=""
|
||||
data-staticsend="{'tag': 'mode_AutoManual', 'val': 1}"
|
||||
data-channelId="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
data-techname="<%=channels["rigpump.writeplctag"].techName %>"
|
||||
data-name="<%= channels["rigpump.writeplctag"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["rigpump.writeplctag"].nodechannelcurrentId %>"
|
||||
id="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
class="btn btn-large btn-theme animated confirmstatic pad15">
|
||||
Auto Mode</a>
|
||||
<br />
|
||||
|
||||
<a href="#"
|
||||
data-confirm-message="Are you sure you want to switch to Manual Mode?"
|
||||
data-refreshpause="1"
|
||||
data-command=""
|
||||
data-staticsend="{'tag': 'mode_AutoManual', 'val': 0}"
|
||||
data-channelId="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
data-techname="<%=channels["rigpump.writeplctag"].techName %>"
|
||||
data-name="<%= channels["rigpump.writeplctag"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["rigpump.writeplctag"].nodechannelcurrentId %>"
|
||||
id="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
class="btn btn-large btn-theme animated confirmstatic pad15">
|
||||
Manual Mode</a>
|
||||
</div>
|
||||
|
||||
<div class='col-xs-6 text-center box-me'>
|
||||
<h2>Control Mode</h2>
|
||||
<a href="#"
|
||||
data-confirm-message="Are you sure you want to switch to Pressure Control Mode?"
|
||||
data-refreshpause="1"
|
||||
data-command=""
|
||||
data-staticsend="{'tag': 'controlMode', 'val': 0}"
|
||||
data-channelId="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
data-techname="<%=channels["rigpump.writeplctag"].techName %>"
|
||||
data-name="<%= channels["rigpump.writeplctag"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["rigpump.writeplctag"].nodechannelcurrentId %>"
|
||||
id="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
class="btn btn-large btn-theme animated confirmstatic pad15">
|
||||
Pressure Control</a>
|
||||
<br />
|
||||
|
||||
<a href="#"
|
||||
data-confirm-message="Are you sure you want to switch to Flow Control Mode?"
|
||||
data-refreshpause="1"
|
||||
data-command=""
|
||||
data-staticsend="{'tag': 'controlMode', 'val': 1}"
|
||||
data-channelId="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
data-techname="<%=channels["rigpump.writeplctag"].techName %>"
|
||||
data-name="<%= channels["rigpump.writeplctag"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["rigpump.writeplctag"].nodechannelcurrentId %>"
|
||||
id="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
class="btn btn-large btn-theme animated confirmstatic pad15">
|
||||
Flow Control</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row row-flex">
|
||||
<div class="col-md-12 text-center box-me">
|
||||
<h2>Control Setpoint</h2>
|
||||
<div data-valueupdate="auto_manual" data-refreshonupdate=true>
|
||||
<% if (channels["rigpump.auto_manual"].value === "Manual") { %>
|
||||
<div class="m vfdFrequency">
|
||||
<h3>VFD Frequency</h3>
|
||||
<hr />
|
||||
<br />
|
||||
|
||||
<div class="entry-top-level" id="flowTarget">
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<input class="form-control val_box"
|
||||
type="number"
|
||||
step="any"
|
||||
value="<%=channels['rigpump.vfd_frequency_setpoint'].value %>">
|
||||
</div>
|
||||
<a href="#"
|
||||
data-confirm-message="Are you sure you want to do this?"
|
||||
data-refreshpause="1"
|
||||
data-command=""
|
||||
data-staticsend="{'tag': 'cfg_PID_ManualSP', 'val': <%=channels['rigpump.vfd_frequency_setpoint'].value %>}"
|
||||
data-channelId="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
data-techname="<%=channels["rigpump.writeplctag"].techName %>"
|
||||
data-name="<%= channels["rigpump.writeplctag"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["rigpump.writeplctag"].nodechannelcurrentId %>"
|
||||
id="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<div data-valueupdate="auto_control_mode" data-refreshonupdate=true>
|
||||
<% if (channels["rigpump.auto_control_mode"].value === "Flow"){ %>
|
||||
|
||||
<div class="m flowRate">
|
||||
<h3>Flow Rate</h3>
|
||||
<hr />
|
||||
<br />
|
||||
|
||||
<div class="entry-top-level" id="flowRate">
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<input class="form-control val_box"
|
||||
type="number"
|
||||
step="any"
|
||||
value="<%=channels['rigpump.flow_rate_setpoint'].value %>">
|
||||
</div>
|
||||
<a href="#"
|
||||
data-confirm-message="Are you sure you want to do this?"
|
||||
data-refreshpause="1"
|
||||
data-command=""
|
||||
data-staticsend="{'tag': 'cfg_PID_FlowSP', 'val': <%=channels['rigpump.flow_rate_setpoint'].value %>}"
|
||||
data-channelId="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
data-techname="<%=channels["rigpump.writeplctag"].techName %>"
|
||||
data-name="<%= channels["rigpump.writeplctag"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["rigpump.writeplctag"].nodechannelcurrentId %>"
|
||||
id="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<% } else { %>
|
||||
|
||||
<div class="m dischargePressure">
|
||||
<h3>Discharge Pressure</h3>
|
||||
<hr />
|
||||
<br />
|
||||
|
||||
<div class="entry-top-level" id="dischargePressure">
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<input class="form-control val_box"
|
||||
type="number"
|
||||
step="any"
|
||||
value="<%=channels['rigpump.discharge_pressure_setpoint'].value %>">
|
||||
</div>
|
||||
<a href="#"
|
||||
data-confirm-message="Are you sure you want to do this?"
|
||||
data-refreshpause="1"
|
||||
data-command=""
|
||||
data-staticsend="{'tag': 'cfg_PID_DischargePressureSP', 'val': <%=channels['rigpump.discharge_pressure_setpoint'].value %>}"
|
||||
data-channelId="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
data-techname="<%=channels["rigpump.writeplctag"].techName %>"
|
||||
data-name="<%= channels["rigpump.writeplctag"].name%>"
|
||||
data-nodechannelcurrentId="<%= channels["rigpump.writeplctag"].nodechannelcurrentId %>"
|
||||
id="<%= channels["rigpump.writeplctag"].channelId %>"
|
||||
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$('.val_box').each(function(topLevel){
|
||||
$(this).change(function(){
|
||||
var id = "#" + $(this).closest(".entry-top-level").attr('id');
|
||||
if (id !== "#undefined"){
|
||||
// console.log("before parse", $(id).find('.setstatic').attr('data-staticsend').replace(/'/g, '"'));
|
||||
var jsobj = JSON.parse($(id).find('.setstatic').attr('data-staticsend').replace(/'/g, '"'));
|
||||
// console.log("after parse", jsobj)
|
||||
// var tagStart = $(id).find('.setstatic').attr('data-staticsend').indexOf("tag") + 3;
|
||||
// var tagStop = $(id).find('.setstatic').attr('data-staticsend').indexOf("] ]");
|
||||
// var tag = $(id).find('.setstatic').attr('data-staticsend').substring(tagStart, tagStop).split(',')[0].replace(/'/g,"");
|
||||
var val = $(id).find('.val_box').val();
|
||||
var newData = "{'tag': '" + jsobj.tag +"', 'val': " + val.toString() + "}"
|
||||
var tag = $(id).find('.setstatic').attr('data-staticsend', newData);
|
||||
console.log($(id).find('.setstatic').attr('data-staticsend'));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.uppercase {
|
||||
text-transform: uppercase;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
font-weight: 400;
|
||||
letter-spacing: 1px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.box-me {
|
||||
position: relative;
|
||||
padding: 0.5em;
|
||||
padding-bottom: 1.5em;
|
||||
border: 1px solid #eee;
|
||||
/*margin: 1em 0;*/
|
||||
}
|
||||
.row-flex {
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.row-flex > [class*='col-'] {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.m {
|
||||
text-align: center;
|
||||
}
|
||||
.val_box {
|
||||
width:75% !important;
|
||||
}
|
||||
|
||||
.setstatic {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -4,3 +4,7 @@
|
||||
<div class='col-xs-6'>
|
||||
<h3><%= node.vanityname %></h3>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3">
|
||||
<h3><%= channels["rigpump.device_status"].value%></h3>
|
||||
</div>
|
||||
|
||||
@@ -28,4 +28,7 @@
|
||||
<div class="col-xs-4">
|
||||
<h4><%= node.vanityname %></h4>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<h4><%= Math.round(channels["rigpump.flow_rate"].value * 100) / 100 %> BPM</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,35 +1,159 @@
|
||||
|
||||
<div class="row row-flex box-me">
|
||||
<div class="row row-flex">
|
||||
<div class="col-xs-12 text-center">
|
||||
<h1>HEADER 1</h1>
|
||||
<h1>Current Values</h1>
|
||||
</div>
|
||||
<div class="col-xs-4 text-center">
|
||||
<h2>CHANNEL 1</h2>
|
||||
<div class="col-xs-3 text-center box-me">
|
||||
<h2>Flow Rate</h2>
|
||||
<div class="gauge-box">
|
||||
<div data-labelheight="10"
|
||||
style="height: 170px; background: transparent; margin: 0 auto;"
|
||||
id="gauge-channel_1"
|
||||
id="gauge-flow_rate"
|
||||
data-chart="solidgauge"
|
||||
data-nodename="rigpump.channel_1"
|
||||
data-units="UNITS"
|
||||
data-nodename="rigpump.flow_rate"
|
||||
data-units="BPM"
|
||||
data-min="0"
|
||||
data-max="100"
|
||||
data-decimalplaces="2"
|
||||
data-max="5000"
|
||||
data-decimalplaces="1"
|
||||
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
|
||||
data-valuefontsize="18px">
|
||||
</div>
|
||||
<div class- "timestamp-box">
|
||||
<a href="#" data-channelId="<%= channels['rigpump.channel_1'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<a href="#" data-channelId="<%= channels['rigpump.flow_rate'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
<span data-timeupdate="lt11_level">
|
||||
<%= channels["rigpump.channel_1"].timestamp %>
|
||||
<span data-timeupdate="flow_rate">
|
||||
<%= channels["rigpump.flow_rate"].timestamp %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3 text-center box-me">
|
||||
<h2>Discharge Pressure</h2>
|
||||
<div class="gauge-box">
|
||||
<div data-labelheight="10"
|
||||
style="height: 170px; background: transparent; margin: 0 auto;"
|
||||
id="gauge-discharge_pressure"
|
||||
data-chart="solidgauge"
|
||||
data-nodename="rigpump.discharge_pressure"
|
||||
data-units="PSI"
|
||||
data-min="0"
|
||||
data-max="5000"
|
||||
data-decimalplaces="1"
|
||||
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
|
||||
data-valuefontsize="18px">
|
||||
</div>
|
||||
<div class- "timestamp-box">
|
||||
<a href="#" data-channelId="<%= channels['rigpump.discharge_pressure'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
<span data-timeupdate="discharge_pressure">
|
||||
<%= channels["rigpump.discharge_pressure"].timestamp %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3 text-center box-me">
|
||||
<h2>VFD Frequency</h2>
|
||||
<div class="gauge-box">
|
||||
<div data-labelheight="10"
|
||||
style="height: 170px; background: transparent; margin: 0 auto;"
|
||||
id="gauge-vfd_frequency"
|
||||
data-chart="solidgauge"
|
||||
data-nodename="rigpump.vfd_frequency"
|
||||
data-units="Hz"
|
||||
data-min="0"
|
||||
data-max="75"
|
||||
data-decimalplaces="1"
|
||||
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
|
||||
data-valuefontsize="18px">
|
||||
</div>
|
||||
<div class- "timestamp-box">
|
||||
<a href="#" data-channelId="<%= channels['rigpump.vfd_frequency'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
<span data-timeupdate="vfd_frequency">
|
||||
<%= channels["rigpump.vfd_frequency"].timestamp %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3 text-center box-me">
|
||||
<h2>VFD Current</h2>
|
||||
<div class="gauge-box">
|
||||
<div data-labelheight="10"
|
||||
style="height: 170px; background: transparent; margin: 0 auto;"
|
||||
id="gauge-vfd_current"
|
||||
data-chart="solidgauge"
|
||||
data-nodename="rigpump.vfd_current"
|
||||
data-units="Amps"
|
||||
data-min="0"
|
||||
data-max="200"
|
||||
data-decimalplaces="1"
|
||||
data-colors="0.1:#DF5353,0.5:#DDDF0D,0.9:#55BF3B"
|
||||
data-valuefontsize="18px">
|
||||
</div>
|
||||
<div class- "timestamp-box">
|
||||
<a href="#" data-channelId="<%= channels['rigpump.vfd_current'].channelId %>" class="data-table" title="Download Channel History">
|
||||
<i class="fa fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
<span data-timeupdate="vfd_current">
|
||||
<%= channels["rigpump.vfd_current"].timestamp %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row row-flex">
|
||||
<div class="col-md-6 box-me" style="text-align:center;">
|
||||
<h2>Mode</h2>
|
||||
<h3 data-valueupdate="auto_manual"><%= channels["rigpump.auto_manual"].value %></h3>
|
||||
</div>
|
||||
<div class="col-md-6 box-me" style="text-align:center;">
|
||||
<h2>Control Parameter</h2>
|
||||
<div data-valueupdate="auto_manual" data-refreshonupdate=true>
|
||||
<% if (channels["rigpump.auto_manual"].value === "Auto") { %>
|
||||
|
||||
<h3 data-valueupdate="auto_control_mode"><%= channels["rigpump.auto_control_mode"].value %></h3>
|
||||
<div data-valueupdate="auto_control_mode" data-refreshonupdate=true>
|
||||
<% if (channels["rigpump.auto_control_mode"].value === "Pressure"){ %>
|
||||
<h3 data-valueupdate="discharge_pressure_setpoint" data-refreshonupdate=true><%= channels["rigpump.discharge_pressure_setpoint"].value %> PSI</h3>
|
||||
<% } else { %>
|
||||
<h3 data-valueupdate="flow_rate_setpoint" data-refreshonupdate=true><%= channels["rigpump.flow_rate_setpoint"].value %> BPM</h3>
|
||||
<% } %>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<h3>VFD Frequency</h3>
|
||||
<h3 data-valueupdate="vfd_frequency_setpoint" data-refreshonupdate=true><%= channels["rigpump.vfd_frequency_setpoint"].value %> Hz</h3>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row row-flex">
|
||||
<div class='col-xs-12'>
|
||||
<div style="height:300px"
|
||||
id="chart-overview"
|
||||
data-chart="chart"
|
||||
data-nodename1="rigpump.flow_rate"
|
||||
data-datalabel1="Flow Rate"
|
||||
data-nodename2="rigpump.discharge_pressure"
|
||||
data-datalabel2="Discharge Pressure"
|
||||
data-nodename3="rigpump.vfd_frequency"
|
||||
data-datalabel3="VFD Frequency"
|
||||
data-nodename4="rigpump.vfd_current"
|
||||
data-datalabel4="VFD Current"
|
||||
data-daysofhistory="2"
|
||||
data-chartlabel="Last 48 Hours"
|
||||
data-ylabel=""
|
||||
data-xlabel="Date"
|
||||
data-units=""></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user