Finalized with documentation

This commit is contained in:
Patrick McDonagh
2018-08-17 14:54:50 -05:00
parent c7f8d30446
commit a5632d14ed
17 changed files with 2972 additions and 199 deletions

Binary file not shown.

View File

@@ -73,4 +73,16 @@ id,name,deviceTypeId,fromMe,io,subTitle,helpExplanation,channelType,dataType,def
,an5decimals,465,FALSE,readwrite,Analog 5 Decimal Places,Decimal places to show for analog 5,user input,integer,2,,,,,,,,
,an6decimals,465,FALSE,readwrite,Analog 6 Decimal Places,Decimal places to show for analog 6,user input,integer,2,,,,,,,,
,an7decimals,465,FALSE,readwrite,Analog 7 Decimal Places,Decimal places to show for analog 7,user input,integer,2,,,,,,,,
,sync,465,FALSE,readwrite,Sync,sync,device,string,,,,,,,,,
,sync,465,FALSE,readwrite,Sync,sync,device,string,,,,,,,,,
,pond0calibration,465,FALSE,readonly,Pond 0 Calibration,Calibration JSON object,device,string,{},,,,,,,,
,pond1calibration,465,FALSE,readonly,Pond 1 Calibration,Calibration JSON object,device,string,{},,,,,,,,
,pond2calibration,465,FALSE,readonly,Pond 2 Calibration,Calibration JSON object,device,string,{},,,,,,,,
,pond3calibration,465,FALSE,readonly,Pond 3 Calibration,Calibration JSON object,device,string,{},,,,,,,,
,pond4calibration,465,FALSE,readonly,Pond 4 Calibration,Calibration JSON object,device,string,{},,,,,,,,
,pond5calibration,465,FALSE,readonly,Pond 5 Calibration,Calibration JSON object,device,string,{},,,,,,,,
,pond6calibration,465,FALSE,readonly,Pond 6 Calibration,Calibration JSON object,device,string,{},,,,,,,,
,pond7calibration,465,FALSE,readonly,Pond 7 Calibration,Calibration JSON object,device,string,{},,,,,,,,
,addcalibrationpoint,465,FALSE,readwrite,Add Command,sends data to PLC,device,string,,,,,,,,,
,deletecalibrationpoint,465,FALSE,readwrite,Delete Command,sends data to PLC,device,string,,,,,,,,,
,writeplctag,465,FALSE,readwrite,Write PLC Tag,sends data to PLC,device,string,,,,,,,,,
,pondvolumetotal,466,FALSE,readonly,Total Pond Volume,in BBL,device,float,,,,,,,,,
1 id name deviceTypeId fromMe io subTitle helpExplanation channelType dataType defaultValue regex regexErrMsg units min max change guaranteedReportPeriod minReportTime
73 an5decimals 465 FALSE readwrite Analog 5 Decimal Places Decimal places to show for analog 5 user input integer 2
74 an6decimals 465 FALSE readwrite Analog 6 Decimal Places Decimal places to show for analog 6 user input integer 2
75 an7decimals 465 FALSE readwrite Analog 7 Decimal Places Decimal places to show for analog 7 user input integer 2
76 sync 465 FALSE readwrite Sync sync device string
77 pond0calibration 465 FALSE readonly Pond 0 Calibration Calibration JSON object device string {}
78 pond1calibration 465 FALSE readonly Pond 1 Calibration Calibration JSON object device string {}
79 pond2calibration 465 FALSE readonly Pond 2 Calibration Calibration JSON object device string {}
80 pond3calibration 465 FALSE readonly Pond 3 Calibration Calibration JSON object device string {}
81 pond4calibration 465 FALSE readonly Pond 4 Calibration Calibration JSON object device string {}
82 pond5calibration 465 FALSE readonly Pond 5 Calibration Calibration JSON object device string {}
83 pond6calibration 465 FALSE readonly Pond 6 Calibration Calibration JSON object device string {}
84 pond7calibration 465 FALSE readonly Pond 7 Calibration Calibration JSON object device string {}
85 addcalibrationpoint 465 FALSE readwrite Add Command sends data to PLC device string
86 deletecalibrationpoint 465 FALSE readwrite Delete Command sends data to PLC device string
87 writeplctag 465 FALSE readwrite Write PLC Tag sends data to PLC device string
88 pondvolumetotal 466 FALSE readonly Total Pond Volume in BBL device float

View File

@@ -1,180 +0,0 @@
<div class="row">
<div class="col-xs-10 col-xs-offset-1">
<form>
<div class="form-group">
<label for="number-of-ponds">Number of Ponds</label>
<input class="form-control"
id="number-of-ponds"
type="number"
step="1"
value="<%= channels["plcpond.cfgnumberofponds"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="1"
data-channelId="<%= channels["plcpond.cfgnumberofponds"].channelId %>"
data-techname="<%=channels["plcpond.cfgnumberofponds"].techName %>"
data-name="<%= channels["plcpond.cfgnumberofponds"].name%>"
data-nodechannelcurrentId="<%= channels["plcpond.cfgnumberofponds"].nodechannelcurrentId %>"
id="<%= channels["plcpond.cfgnumberofponds"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<h2>Pond 1 Calibration</h2>
<table id="calibration-data-table-1" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="col-xs-6">
<h2>Pond 2 Calibration</h2>
<table id="calibration-data-table-2" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<h2>Pond 3 Calibration</h2>
<table id="calibration-data-table-3" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="col-xs-6">
<h2>Pond 4 Calibration</h2>
<table id="calibration-data-table-4" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="row pad15">
<div class="col-md-12 entry-top-level" id="new-entry">
<h2>Add a new Calibration Point</h2>
<form>
<div class="form-group">
<label for="pond-select">Pond Number</label>
<select class="form-control" id="pond-select">
<option value=1 >1</option>
<option value=2 >2</option>
<option value=3 >3</option>
<option value=4 >4</option>
</select>
</div>
<div class="form-group">
<label for="height-box">Height</label>
<input class="form-control height_box"
id="height-box"
type="number"
step="any"
value="0">
</div>
<div class="form-group">
<label for="volume-box">Volume</label>
<input class="form-control volume_box"
id="volume-box"
type="number"
step="any"
value="0">
</div>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'pond':0, 'height':0.0, 'volume':0.0}"
data-channelId="<%= channels["plcpond.addcalibrationpoint"].channelId %>"
data-techname="<%=channels["plcpond.addcalibrationpoint"].techName %>"
data-name="<%= channels["plcpond.addcalibrationpoint"].name%>"
data-nodechannelcurrentId="<%= channels["plcpond.addcalibrationpoint"].nodechannelcurrentId %>"
id="<%= channels["plcpond.addcalibrationpoint"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<script type="text/javascript">
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
var configRaw = [""];
configRaw.push("<%= channels["plcpond.pond1calibration"].value %>");
configRaw.push("<%= channels["plcpond.pond2calibration"].value %>");
configRaw.push("<%= channels["plcpond.pond3calibration"].value %>");
configRaw.push("<%= channels["plcpond.pond4calibration"].value %>");
for (var j = 1; j<=4; j++){
var configData = JSON.parse(configRaw[j].replaceAll("'", '"'));
console.log(configData);
var tableRows = [];
for (var i = 0; i < configData.length; i++){
var thisHtml = "<tr><td>" + configData[i].height + "</td><td>" + configData[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'pond\': '+ j +', \'point\': '+ i +'}" data-channelId="<%= channels["plcpond.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["plcpond.deletecalibrationpoint"].techName %>" data-name="<%= channels["plcpond.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["plcpond.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["plcpond.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
tableRows.push(thisHtml);
}
$("#calibration-data-table-"+ j +" > tbody").html(tableRows);
}
$("#height-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["plcpond.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['height'] = $("#height-box").val();
$("#<%= channels["plcpond.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#volume-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["plcpond.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['volume'] = $("#volume-box").val();
$("#<%= channels["plcpond.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#pond-select").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["plcpond.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['pond'] = $("#pond-select").val();
$("#<%= channels["plcpond.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#number-of-ponds").change(function(){
$("#<%= channels["plcpond.cfgnumberofponds"].channelId %>").attr('data-staticsend', $("#number-of-ponds").val());
})
</script>

View File

@@ -0,0 +1,454 @@
<div class='row'>
<div class='col-xs-12'>
<div style="height:300px"
id="chart-overview"
data-chart="chart"
data-nodename1="multisensor.an0val"
data-datalabel1="Analog 0 Value"
data-nodename2="multisensor.an1val"
data-datalabel2="Analog 1 Value"
<% if (channels["multisensor.an0ispond"].value === "true"){ %>
data-nodename3="multisensor.pond0volume"
data-datalabel3="Pond 0 Volume"
<% } %>
<% if (channels["multisensor.an1ispond"].value === "true"){ %>
data-nodename4="multisensor.pond1volume"
data-datalabel4="Pond 1 Volume"
<% } %>
data-daysofhistory="2"
data-chartlabel="Last 48 Hours"
data-ylabel=""
data-xlabel="Date"
data-units="">
</div>
</div>
</div>
<div class="row" style="margin-bottom: 10px">
<div class="col-md-6 align-center">
<h2>Input 0</h2>
<% if (channels["multisensor.an0ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input0_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input0_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<h2>Scaling</h2>
<form class="form-inline">
<div class="form-group">
<label for="min-scaling-0">Min Value</label>
<input class="form-control setpoint"
id="min-scaling-0"
type="number"
step="0.1"
value="<%= channels["multisensor.an0min"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input0_cfg.scalingConfig.euMin', 'value': 4.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an0min"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<form class="form-inline">
<div class="form-group">
<label for="max-scaling-0">Max Value</label>
<input class="form-control setpoint"
id="max-scaling-0"
type="number"
step="0.1"
value="<%= channels["multisensor.an0max"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input0_cfg.scalingConfig.euMax', 'value': 20.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an0max"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="name-0">Name</label>
<input class="form-control setpoint"
id="name-0"
type="text"
value="<%= channels["multisensor.an0name"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an0name"].value %>"
data-channelId="<%= channels["multisensor.an0name"].channelId %>"
data-techname="<%=channels["multisensor.an0name"].techName %>"
data-name="<%= channels["multisensor.an0name"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an0name"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an0name"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="units-0">Units</label>
<input class="form-control setpoint"
id="units-0"
type="text"
value="<%= channels["multisensor.an0units"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an0units"].value %>"
data-channelId="<%= channels["multisensor.an0units"].channelId %>"
data-techname="<%=channels["multisensor.an0units"].techName %>"
data-name="<%= channels["multisensor.an0units"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an0units"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an0units"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
<div class="col-md-6 align-center">
<h2>Input 1</h2>
<% if (channels["multisensor.an1ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input1_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input1_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<h2>Scaling</h2>
<form class="form-inline">
<div class="form-group">
<label for="min-scaling-1">Min Value</label>
<input class="form-control setpoint"
id="min-scaling-1"
type="number"
step="0.1"
value="<%= channels["multisensor.an1min"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input1_cfg.scalingConfig.euMin', 'value': 4.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an1min"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<form class="form-inline">
<div class="form-group">
<label for="max-scaling-1">Max Value</label>
<input class="form-control setpoint"
id="max-scaling-1"
type="number"
step="0.1"
value="<%= channels["multisensor.an1max"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input1_cfg.scalingConfig.euMax', 'value': 20.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an1max"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="name-1">Name</label>
<input class="form-control setpoint"
id="name-1"
type="text"
value="<%= channels["multisensor.an1name"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an1name"].value %>"
data-channelId="<%= channels["multisensor.an1name"].channelId %>"
data-techname="<%=channels["multisensor.an1name"].techName %>"
data-name="<%= channels["multisensor.an1name"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an1name"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an1name"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="units-1">Units</label>
<input class="form-control setpoint"
id="units-1"
type="text"
value="<%= channels["multisensor.an1units"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an1units"].value %>"
data-channelId="<%= channels["multisensor.an1units"].channelId %>"
data-techname="<%=channels["multisensor.an1units"].techName %>"
data-name="<%= channels["multisensor.an1units"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an1units"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an1units"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
</div>
<hr />
<div class="row row-flex">
<% if (channels["multisensor.an0ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 0 Calibration</h2>
<table id="calibration-data-table-0" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an1ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 1 Calibration</h2>
<table id="calibration-data-table-1" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
</div>
<hr />
<% if (channels["multisensor.an0ispond"].value === "true" || channels["multisensor.an1ispond"].value === "true") { %>
<div class="row pad15">
<div class="col-md-12 entry-top-level" id="new-entry">
<h2>Add a new Calibration Point</h2>
<form>
<div class="form-group">
<label for="input-select">Pond Number</label>
<select class="form-control" id="input-select">
<option value=0 >0</option>
<option value=1 >1</option>
</select>
</div>
<div class="form-group">
<label for="height-box">Height</label>
<input class="form-control height_box"
id="height-box"
type="number"
step="any"
value="0">
</div>
<div class="form-group">
<label for="volume-box">Volume</label>
<input class="form-control volume_box"
id="volume-box"
type="number"
step="any"
value="0">
</div>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'input':0, 'height':0.0, 'volume':0.0}"
data-channelId="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
data-techname="<%=channels["multisensor.addcalibrationpoint"].techName %>"
data-name="<%= channels["multisensor.addcalibrationpoint"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.addcalibrationpoint"].nodechannelcurrentId %>"
id="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<% } %>
<script type="text/javascript">
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
var config0raw = "<%= channels["multisensor.pond0calibration"].value %>";
var config1raw = "<%= channels["multisensor.pond1calibration"].value %>";
var config0 = JSON.parse(config0raw.replaceAll("'", '"'));
var config1 = JSON.parse(config1raw.replaceAll("'", '"'));
var table0Rows = [];
var table1Rows = [];
for (var i = 0; i < config0.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + config0[i].height + "</td><td>" + config0[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': 0, \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
table0Rows.push(thisHtml);
}
$("#calibration-data-table-0 > tbody").html(table0Rows);
for (var i = 0; i < config1.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + config1[i].height + "</td><td>" + config1[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': 1, \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
table1Rows.push(thisHtml);
}
$("#calibration-data-table-1 > tbody").html(table1Rows);
$("#height-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['height'] = $("#height-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#volume-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['volume'] = $("#volume-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#input-select").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['input'] = $("#input-select").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#min-scaling-0").change(function(){
$("#<%= channels["multisensor.an0min"].channelId %>").attr('data-staticsend', "{'tag': 'input0_cfg.scalingConfig.euMin', 'value': "+ $("#min-scaling-0").val() +"}");
})
$("#max-scaling-0").change(function(){
$("#<%= channels["multisensor.an0max"].channelId %>").attr('data-staticsend', "{'tag': 'input0_cfg.scalingConfig.euMax', 'value': "+ $("#max-scaling-0").val() +"}");
})
$("#name-0").change(function(){
$("#<%= channels["multisensor.an0name"].channelId %>").attr('data-staticsend', $("#name-0").val());
})
$("#units-0").change(function(){
$("#<%= channels["multisensor.an0units"].channelId %>").attr('data-staticsend', $("#units-0").val());
})
$("#min-scaling-1").change(function(){
$("#<%= channels["multisensor.an1min"].channelId %>").attr('data-staticsend', "{'tag': 'input1_cfg.scalingConfig.euMin', 'value': "+ $("#min-scaling-1").val() +"}");
})
$("#max-scaling-1").change(function(){
$("#<%= channels["multisensor.an1max"].channelId %>").attr('data-staticsend', "{'tag': 'input1_cfg.scalingConfig.euMax', 'value': "+ $("#max-scaling-1").val() +"}");
})
$("#name-1").change(function(){
$("#<%= channels["multisensor.an1name"].channelId %>").attr('data-staticsend', $("#name-1").val());
})
$("#units-1").change(function(){
$("#<%= channels["multisensor.an1units"].channelId %>").attr('data-staticsend', $("#units-1").val());
})
</script>
<style>
.align-center {
text-align: center;
}
</style>

View File

@@ -0,0 +1,454 @@
<div class='row'>
<div class='col-xs-12'>
<div style="height:300px"
id="chart-overview"
data-chart="chart"
data-nodename1="multisensor.an2val"
data-datalabel1="Analog 2 Value"
data-nodename2="multisensor.an3val"
data-datalabel2="Analog 3 Value"
<% if (channels["multisensor.an2ispond"].value === "true"){ %>
data-nodename3="multisensor.pond2volume"
data-datalabel3="Pond 2 Volume"
<% } %>
<% if (channels["multisensor.an3ispond"].value === "true"){ %>
data-nodename4="multisensor.pond3volume"
data-datalabel4="Pond 3 Volume"
<% } %>
data-daysofhistory="2"
data-chartlabel="Last 48 Hours"
data-ylabel=""
data-xlabel="Date"
data-units="">
</div>
</div>
</div>
<div class="row" style="margin-bottom: 10px">
<div class="col-md-6 align-center">
<h2>Input 2</h2>
<% if (channels["multisensor.an2ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input2_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input2_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<h2>Scaling</h2>
<form class="form-inline">
<div class="form-group">
<label for="min-scaling-2">Min Value</label>
<input class="form-control setpoint"
id="min-scaling-2"
type="number"
step="0.1"
value="<%= channels["multisensor.an2min"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input2_cfg.scalingConfig.euMin', 'value': 4.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an2min"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<form class="form-inline">
<div class="form-group">
<label for="max-scaling-2">Max Value</label>
<input class="form-control setpoint"
id="max-scaling-2"
type="number"
step="0.1"
value="<%= channels["multisensor.an2max"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input2_cfg.scalingConfig.euMax', 'value': 20.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an2max"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="name-2">Name</label>
<input class="form-control setpoint"
id="name-2"
type="text"
value="<%= channels["multisensor.an2name"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an2name"].value %>"
data-channelId="<%= channels["multisensor.an2name"].channelId %>"
data-techname="<%=channels["multisensor.an2name"].techName %>"
data-name="<%= channels["multisensor.an2name"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an2name"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an2name"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="units-2">Units</label>
<input class="form-control setpoint"
id="units-2"
type="text"
value="<%= channels["multisensor.an2units"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an2units"].value %>"
data-channelId="<%= channels["multisensor.an2units"].channelId %>"
data-techname="<%=channels["multisensor.an2units"].techName %>"
data-name="<%= channels["multisensor.an2units"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an2units"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an2units"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
<div class="col-md-6 align-center">
<h2>Input 3</h2>
<% if (channels["multisensor.an3ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input3_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input3_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<h2>Scaling</h2>
<form class="form-inline">
<div class="form-group">
<label for="min-scaling-3">Min Value</label>
<input class="form-control setpoint"
id="min-scaling-3"
type="number"
step="0.1"
value="<%= channels["multisensor.an3min"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input3_cfg.scalingConfig.euMin', 'value': 4.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an3min"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<form class="form-inline">
<div class="form-group">
<label for="max-scaling-3">Max Value</label>
<input class="form-control setpoint"
id="max-scaling-3"
type="number"
step="0.1"
value="<%= channels["multisensor.an3max"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input3_cfg.scalingConfig.euMax', 'value': 20.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an3max"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="name-3">Name</label>
<input class="form-control setpoint"
id="name-3"
type="text"
value="<%= channels["multisensor.an3name"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an3name"].value %>"
data-channelId="<%= channels["multisensor.an3name"].channelId %>"
data-techname="<%=channels["multisensor.an3name"].techName %>"
data-name="<%= channels["multisensor.an3name"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an3name"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an3name"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="units-3">Units</label>
<input class="form-control setpoint"
id="units-3"
type="text"
value="<%= channels["multisensor.an3units"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an3units"].value %>"
data-channelId="<%= channels["multisensor.an3units"].channelId %>"
data-techname="<%=channels["multisensor.an3units"].techName %>"
data-name="<%= channels["multisensor.an3units"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an3units"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an3units"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
</div>
<hr />
<div class="row row-flex">
<% if (channels["multisensor.an2ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 2 Calibration</h2>
<table id="calibration-data-table-2" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an3ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 3 Calibration</h2>
<table id="calibration-data-table-3" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
</div>
<hr />
<% if (channels["multisensor.an2ispond"].value === "true" || channels["multisensor.an3ispond"].value === "true") { %>
<div class="row pad15">
<div class="col-md-12 entry-top-level" id="new-entry">
<h2>Add a new Calibration Point</h2>
<form>
<div class="form-group">
<label for="input-select">Pond Number</label>
<select class="form-control" id="input-select">
<option value=2 >2</option>
<option value=3 >3</option>
</select>
</div>
<div class="form-group">
<label for="height-box">Height</label>
<input class="form-control height_box"
id="height-box"
type="number"
step="any"
value="0">
</div>
<div class="form-group">
<label for="volume-box">Volume</label>
<input class="form-control volume_box"
id="volume-box"
type="number"
step="any"
value="0">
</div>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'input':0, 'height':0.0, 'volume':0.0}"
data-channelId="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
data-techname="<%=channels["multisensor.addcalibrationpoint"].techName %>"
data-name="<%= channels["multisensor.addcalibrationpoint"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.addcalibrationpoint"].nodechannelcurrentId %>"
id="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<% } %>
<script type="text/javascript">
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
var config2raw = "<%= channels["multisensor.pond2calibration"].value %>";
var config3raw = "<%= channels["multisensor.pond3calibration"].value %>";
var config2 = JSON.parse(config2raw.replaceAll("'", '"'));
var config3 = JSON.parse(config3raw.replaceAll("'", '"'));
var table2Rows = [];
var table3Rows = [];
for (var i = 0; i < config2.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + config2[i].height + "</td><td>" + config2[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': 2, \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
table2Rows.push(thisHtml);
}
$("#calibration-data-table-2 > tbody").html(table2Rows);
for (var i = 0; i < config3.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + config3[i].height + "</td><td>" + config3[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': 3, \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
table3Rows.push(thisHtml);
}
$("#calibration-data-table-3 > tbody").html(table3Rows);
$("#height-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['height'] = $("#height-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#volume-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['volume'] = $("#volume-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#input-select").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['input'] = $("#input-select").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#min-scaling-2").change(function(){
$("#<%= channels["multisensor.an2min"].channelId %>").attr('data-staticsend', "{'tag': 'input2_cfg.scalingConfig.euMin', 'value': "+ $("#min-scaling-2").val() +"}");
})
$("#max-scaling-2").change(function(){
$("#<%= channels["multisensor.an2max"].channelId %>").attr('data-staticsend', "{'tag': 'input2_cfg.scalingConfig.euMax', 'value': "+ $("#max-scaling-2").val() +"}");
})
$("#name-2").change(function(){
$("#<%= channels["multisensor.an2name"].channelId %>").attr('data-staticsend', $("#name-2").val());
})
$("#units-2").change(function(){
$("#<%= channels["multisensor.an2units"].channelId %>").attr('data-staticsend', $("#units-2").val());
})
$("#min-scaling-3").change(function(){
$("#<%= channels["multisensor.an3min"].channelId %>").attr('data-staticsend', "{'tag': 'input3_cfg.scalingConfig.euMin', 'value': "+ $("#min-scaling-3").val() +"}");
})
$("#max-scaling-3").change(function(){
$("#<%= channels["multisensor.an3max"].channelId %>").attr('data-staticsend', "{'tag': 'input3_cfg.scalingConfig.euMax', 'value': "+ $("#max-scaling-3").val() +"}");
})
$("#name-3").change(function(){
$("#<%= channels["multisensor.an3name"].channelId %>").attr('data-staticsend', $("#name-3").val());
})
$("#units-3").change(function(){
$("#<%= channels["multisensor.an3units"].channelId %>").attr('data-staticsend', $("#units-3").val());
})
</script>
<style>
.align-center {
text-align: center;
}
</style>

View File

@@ -0,0 +1,454 @@
<div class='row'>
<div class='col-xs-12'>
<div style="height:300px"
id="chart-overview"
data-chart="chart"
data-nodename1="multisensor.an4val"
data-datalabel1="Analog 4 Value"
data-nodename2="multisensor.an5val"
data-datalabel2="Analog 5 Value"
<% if (channels["multisensor.an4ispond"].value === "true"){ %>
data-nodename3="multisensor.pond4volume"
data-datalabel3="Pond 4 Volume"
<% } %>
<% if (channels["multisensor.an5ispond"].value === "true"){ %>
data-nodename4="multisensor.pond5volume"
data-datalabel4="Pond 5 Volume"
<% } %>
data-daysofhistory="2"
data-chartlabel="Last 48 Hours"
data-ylabel=""
data-xlabel="Date"
data-units="">
</div>
</div>
</div>
<div class="row" style="margin-bottom: 10px">
<div class="col-md-6 align-center">
<h2>Input 4</h2>
<% if (channels["multisensor.an4ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input4_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input4_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<h2>Scaling</h2>
<form class="form-inline">
<div class="form-group">
<label for="min-scaling-4">Min Value</label>
<input class="form-control setpoint"
id="min-scaling-4"
type="number"
step="0.1"
value="<%= channels["multisensor.an4min"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input4_cfg.scalingConfig.euMin', 'value': 4.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an4min"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<form class="form-inline">
<div class="form-group">
<label for="max-scaling-4">Max Value</label>
<input class="form-control setpoint"
id="max-scaling-4"
type="number"
step="0.1"
value="<%= channels["multisensor.an4max"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input4_cfg.scalingConfig.euMax', 'value': 20.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an4max"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="name-4">Name</label>
<input class="form-control setpoint"
id="name-4"
type="text"
value="<%= channels["multisensor.an4name"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an4name"].value %>"
data-channelId="<%= channels["multisensor.an4name"].channelId %>"
data-techname="<%=channels["multisensor.an4name"].techName %>"
data-name="<%= channels["multisensor.an4name"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an4name"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an4name"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="units-4">Units</label>
<input class="form-control setpoint"
id="units-4"
type="text"
value="<%= channels["multisensor.an4units"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an4units"].value %>"
data-channelId="<%= channels["multisensor.an4units"].channelId %>"
data-techname="<%=channels["multisensor.an4units"].techName %>"
data-name="<%= channels["multisensor.an4units"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an4units"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an4units"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
<div class="col-md-6 align-center">
<h2>Input 5</h2>
<% if (channels["multisensor.an5ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input5_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input5_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<h2>Scaling</h2>
<form class="form-inline">
<div class="form-group">
<label for="min-scaling-5">Min Value</label>
<input class="form-control setpoint"
id="min-scaling-5"
type="number"
step="0.1"
value="<%= channels["multisensor.an5min"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input5_cfg.scalingConfig.euMin', 'value': 4.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an5min"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<form class="form-inline">
<div class="form-group">
<label for="max-scaling-5">Max Value</label>
<input class="form-control setpoint"
id="max-scaling-5"
type="number"
step="0.1"
value="<%= channels["multisensor.an5max"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input5_cfg.scalingConfig.euMax', 'value': 20.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an5max"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="name-5">Name</label>
<input class="form-control setpoint"
id="name-5"
type="text"
value="<%= channels["multisensor.an5name"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an5name"].value %>"
data-channelId="<%= channels["multisensor.an5name"].channelId %>"
data-techname="<%=channels["multisensor.an5name"].techName %>"
data-name="<%= channels["multisensor.an5name"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an5name"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an5name"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="units-5">Units</label>
<input class="form-control setpoint"
id="units-5"
type="text"
value="<%= channels["multisensor.an5units"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an5units"].value %>"
data-channelId="<%= channels["multisensor.an5units"].channelId %>"
data-techname="<%=channels["multisensor.an5units"].techName %>"
data-name="<%= channels["multisensor.an5units"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an5units"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an5units"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
</div>
<hr />
<div class="row row-flex">
<% if (channels["multisensor.an4ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 4 Calibration</h2>
<table id="calibration-data-table-4" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an5ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 5 Calibration</h2>
<table id="calibration-data-table-5" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
</div>
<hr />
<% if (channels["multisensor.an4ispond"].value === "true" || channels["multisensor.an5ispond"].value === "true") { %>
<div class="row pad15">
<div class="col-md-12 entry-top-level" id="new-entry">
<h2>Add a new Calibration Point</h2>
<form>
<div class="form-group">
<label for="input-select">Pond Number</label>
<select class="form-control" id="input-select">
<option value=4 >4</option>
<option value=5 >5</option>
</select>
</div>
<div class="form-group">
<label for="height-box">Height</label>
<input class="form-control height_box"
id="height-box"
type="number"
step="any"
value="0">
</div>
<div class="form-group">
<label for="volume-box">Volume</label>
<input class="form-control volume_box"
id="volume-box"
type="number"
step="any"
value="0">
</div>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'input':0, 'height':0.0, 'volume':0.0}"
data-channelId="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
data-techname="<%=channels["multisensor.addcalibrationpoint"].techName %>"
data-name="<%= channels["multisensor.addcalibrationpoint"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.addcalibrationpoint"].nodechannelcurrentId %>"
id="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<% } %>
<script type="text/javascript">
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
var config4raw = "<%= channels["multisensor.pond4calibration"].value %>";
var config5raw = "<%= channels["multisensor.pond5calibration"].value %>";
var config4 = JSON.parse(config4raw.replaceAll("'", '"'));
var config5 = JSON.parse(config5raw.replaceAll("'", '"'));
var table4Rows = [];
var table5Rows = [];
for (var i = 0; i < config4.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + config4[i].height + "</td><td>" + config4[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': 4, \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
table4Rows.push(thisHtml);
}
$("#calibration-data-table-4 > tbody").html(table4Rows);
for (var i = 0; i < config5.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + config5[i].height + "</td><td>" + config5[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': 5, \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
table5Rows.push(thisHtml);
}
$("#calibration-data-table-5 > tbody").html(table5Rows);
$("#height-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['height'] = $("#height-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#volume-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['volume'] = $("#volume-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#input-select").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['input'] = $("#input-select").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#min-scaling-4").change(function(){
$("#<%= channels["multisensor.an4min"].channelId %>").attr('data-staticsend', "{'tag': 'input4_cfg.scalingConfig.euMin', 'value': "+ $("#min-scaling-4").val() +"}");
})
$("#max-scaling-4").change(function(){
$("#<%= channels["multisensor.an4max"].channelId %>").attr('data-staticsend', "{'tag': 'input4_cfg.scalingConfig.euMax', 'value': "+ $("#max-scaling-4").val() +"}");
})
$("#name-4").change(function(){
$("#<%= channels["multisensor.an4name"].channelId %>").attr('data-staticsend', $("#name-4").val());
})
$("#units-4").change(function(){
$("#<%= channels["multisensor.an4units"].channelId %>").attr('data-staticsend', $("#units-4").val());
})
$("#min-scaling-5").change(function(){
$("#<%= channels["multisensor.an5min"].channelId %>").attr('data-staticsend', "{'tag': 'input5_cfg.scalingConfig.euMin', 'value': "+ $("#min-scaling-5").val() +"}");
})
$("#max-scaling-5").change(function(){
$("#<%= channels["multisensor.an5max"].channelId %>").attr('data-staticsend', "{'tag': 'input5_cfg.scalingConfig.euMax', 'value': "+ $("#max-scaling-5").val() +"}");
})
$("#name-5").change(function(){
$("#<%= channels["multisensor.an5name"].channelId %>").attr('data-staticsend', $("#name-5").val());
})
$("#units-5").change(function(){
$("#<%= channels["multisensor.an5units"].channelId %>").attr('data-staticsend', $("#units-5").val());
})
</script>
<style>
.align-center {
text-align: center;
}
</style>

View File

@@ -0,0 +1,454 @@
<div class='row'>
<div class='col-xs-12'>
<div style="height:300px"
id="chart-overview"
data-chart="chart"
data-nodename1="multisensor.an6val"
data-datalabel1="Analog 6 Value"
data-nodename2="multisensor.an7val"
data-datalabel2="Analog 7 Value"
<% if (channels["multisensor.an6ispond"].value === "true"){ %>
data-nodename3="multisensor.pond6volume"
data-datalabel3="Pond 6 Volume"
<% } %>
<% if (channels["multisensor.an7ispond"].value === "true"){ %>
data-nodename4="multisensor.pond7volume"
data-datalabel4="Pond 7 Volume"
<% } %>
data-daysofhistory="2"
data-chartlabel="Last 48 Hours"
data-ylabel=""
data-xlabel="Date"
data-units="">
</div>
</div>
</div>
<div class="row" style="margin-bottom: 10px">
<div class="col-md-6 align-center">
<h2>Input 6</h2>
<% if (channels["multisensor.an6ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input6_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input6_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<h2>Scaling</h2>
<form class="form-inline">
<div class="form-group">
<label for="min-scaling-6">Min Value</label>
<input class="form-control setpoint"
id="min-scaling-6"
type="number"
step="0.1"
value="<%= channels["multisensor.an6min"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input6_cfg.scalingConfig.euMin', 'value': 4.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an6min"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<form class="form-inline">
<div class="form-group">
<label for="max-scaling-6">Max Value</label>
<input class="form-control setpoint"
id="max-scaling-6"
type="number"
step="0.1"
value="<%= channels["multisensor.an6max"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input6_cfg.scalingConfig.euMax', 'value': 20.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an6max"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="name-6">Name</label>
<input class="form-control setpoint"
id="name-6"
type="text"
value="<%= channels["multisensor.an6name"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an6name"].value %>"
data-channelId="<%= channels["multisensor.an6name"].channelId %>"
data-techname="<%=channels["multisensor.an6name"].techName %>"
data-name="<%= channels["multisensor.an6name"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an6name"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an6name"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="units-6">Units</label>
<input class="form-control setpoint"
id="units-6"
type="text"
value="<%= channels["multisensor.an6units"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an6units"].value %>"
data-channelId="<%= channels["multisensor.an6units"].channelId %>"
data-techname="<%=channels["multisensor.an6units"].techName %>"
data-name="<%= channels["multisensor.an6units"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an6units"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an6units"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
<div class="col-md-6 align-center">
<h2>Input 7</h2>
<% if (channels["multisensor.an7ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input7_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input7_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<h2>Scaling</h2>
<form class="form-inline">
<div class="form-group">
<label for="min-scaling-7">Min Value</label>
<input class="form-control setpoint"
id="min-scaling-7"
type="number"
step="0.1"
value="<%= channels["multisensor.an7min"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input7_cfg.scalingConfig.euMin', 'value': 4.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an7min"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<form class="form-inline">
<div class="form-group">
<label for="max-scaling-7">Max Value</label>
<input class="form-control setpoint"
id="max-scaling-7"
type="number"
step="0.1"
value="<%= channels["multisensor.an7max"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input7_cfg.scalingConfig.euMax', 'value': 20.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an7max"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="name-7">Name</label>
<input class="form-control setpoint"
id="name-7"
type="text"
value="<%= channels["multisensor.an7name"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an7name"].value %>"
data-channelId="<%= channels["multisensor.an7name"].channelId %>"
data-techname="<%=channels["multisensor.an7name"].techName %>"
data-name="<%= channels["multisensor.an7name"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an7name"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an7name"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="units-7">Units</label>
<input class="form-control setpoint"
id="units-7"
type="text"
value="<%= channels["multisensor.an7units"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an7units"].value %>"
data-channelId="<%= channels["multisensor.an7units"].channelId %>"
data-techname="<%=channels["multisensor.an7units"].techName %>"
data-name="<%= channels["multisensor.an7units"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an7units"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an7units"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
</div>
<hr />
<div class="row row-flex">
<% if (channels["multisensor.an6ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 6 Calibration</h2>
<table id="calibration-data-table-6" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an7ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 7 Calibration</h2>
<table id="calibration-data-table-7" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
</div>
<hr />
<% if (channels["multisensor.an6ispond"].value === "true" || channels["multisensor.an7ispond"].value === "true") { %>
<div class="row pad15">
<div class="col-md-12 entry-top-level" id="new-entry">
<h2>Add a new Calibration Point</h2>
<form>
<div class="form-group">
<label for="input-select">Pond Number</label>
<select class="form-control" id="input-select">
<option value=6 >6</option>
<option value=7 >7</option>
</select>
</div>
<div class="form-group">
<label for="height-box">Height</label>
<input class="form-control height_box"
id="height-box"
type="number"
step="any"
value="0">
</div>
<div class="form-group">
<label for="volume-box">Volume</label>
<input class="form-control volume_box"
id="volume-box"
type="number"
step="any"
value="0">
</div>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'input':0, 'height':0.0, 'volume':0.0}"
data-channelId="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
data-techname="<%=channels["multisensor.addcalibrationpoint"].techName %>"
data-name="<%= channels["multisensor.addcalibrationpoint"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.addcalibrationpoint"].nodechannelcurrentId %>"
id="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<% } %>
<script type="text/javascript">
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
var config6raw = "<%= channels["multisensor.pond6calibration"].value %>";
var config7raw = "<%= channels["multisensor.pond7calibration"].value %>";
var config6 = JSON.parse(config6raw.replaceAll("'", '"'));
var config7 = JSON.parse(config7raw.replaceAll("'", '"'));
var table6Rows = [];
var table7Rows = [];
for (var i = 0; i < config6.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + config6[i].height + "</td><td>" + config6[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': 6, \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
table6Rows.push(thisHtml);
}
$("#calibration-data-table-6 > tbody").html(table6Rows);
for (var i = 0; i < config7.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + config7[i].height + "</td><td>" + config7[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': 7, \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
table7Rows.push(thisHtml);
}
$("#calibration-data-table-7 > tbody").html(table7Rows);
$("#height-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['height'] = $("#height-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#volume-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['volume'] = $("#volume-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#input-select").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['input'] = $("#input-select").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#min-scaling-6").change(function(){
$("#<%= channels["multisensor.an6min"].channelId %>").attr('data-staticsend', "{'tag': 'input6_cfg.scalingConfig.euMin', 'value': "+ $("#min-scaling-6").val() +"}");
})
$("#max-scaling-6").change(function(){
$("#<%= channels["multisensor.an6max"].channelId %>").attr('data-staticsend', "{'tag': 'input6_cfg.scalingConfig.euMax', 'value': "+ $("#max-scaling-6").val() +"}");
})
$("#name-6").change(function(){
$("#<%= channels["multisensor.an6name"].channelId %>").attr('data-staticsend', $("#name-6").val());
})
$("#units-6").change(function(){
$("#<%= channels["multisensor.an6units"].channelId %>").attr('data-staticsend', $("#units-6").val());
})
$("#min-scaling-7").change(function(){
$("#<%= channels["multisensor.an7min"].channelId %>").attr('data-staticsend', "{'tag': 'input7_cfg.scalingConfig.euMin', 'value': "+ $("#min-scaling-7").val() +"}");
})
$("#max-scaling-7").change(function(){
$("#<%= channels["multisensor.an7max"].channelId %>").attr('data-staticsend', "{'tag': 'input7_cfg.scalingConfig.euMax', 'value': "+ $("#max-scaling-7").val() +"}");
})
$("#name-7").change(function(){
$("#<%= channels["multisensor.an7name"].channelId %>").attr('data-staticsend', $("#name-7").val());
})
$("#units-7").change(function(){
$("#<%= channels["multisensor.an7units"].channelId %>").attr('data-staticsend', $("#units-7").val());
})
</script>
<style>
.align-center {
text-align: center;
}
</style>

View File

@@ -0,0 +1,454 @@
<div class='row'>
<div class='col-xs-12'>
<div style="height:300px"
id="chart-overview"
data-chart="chart"
data-nodename1="multisensor.an?0?val"
data-datalabel1="Analog ?0? Value"
data-nodename2="multisensor.an?1?val"
data-datalabel2="Analog ?1? Value"
<% if (channels["multisensor.an?0?ispond"].value === "true"){ %>
data-nodename3="multisensor.pond?0?volume"
data-datalabel3="Pond ?0? Volume"
<% } %>
<% if (channels["multisensor.an?1?ispond"].value === "true"){ %>
data-nodename4="multisensor.pond?1?volume"
data-datalabel4="Pond ?1? Volume"
<% } %>
data-daysofhistory="2"
data-chartlabel="Last 48 Hours"
data-ylabel=""
data-xlabel="Date"
data-units="">
</div>
</div>
</div>
<div class="row" style="margin-bottom: 10px">
<div class="col-md-6 align-center">
<h2>Input ?0?</h2>
<% if (channels["multisensor.an?0?ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input?0?_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input?0?_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<h2>Scaling</h2>
<form class="form-inline">
<div class="form-group">
<label for="min-scaling-?0?">Min Value</label>
<input class="form-control setpoint"
id="min-scaling-?0?"
type="number"
step="0.1"
value="<%= channels["multisensor.an?0?min"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input?0?_cfg.scalingConfig.euMin', 'value': 4.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an?0?min"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<form class="form-inline">
<div class="form-group">
<label for="max-scaling-?0?">Max Value</label>
<input class="form-control setpoint"
id="max-scaling-?0?"
type="number"
step="0.1"
value="<%= channels["multisensor.an?0?max"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input?0?_cfg.scalingConfig.euMax', 'value': 20.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an?0?max"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="name-?0?">Name</label>
<input class="form-control setpoint"
id="name-?0?"
type="text"
value="<%= channels["multisensor.an?0?name"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an?0?name"].value %>"
data-channelId="<%= channels["multisensor.an?0?name"].channelId %>"
data-techname="<%=channels["multisensor.an?0?name"].techName %>"
data-name="<%= channels["multisensor.an?0?name"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an?0?name"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an?0?name"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="units-?0?">Units</label>
<input class="form-control setpoint"
id="units-?0?"
type="text"
value="<%= channels["multisensor.an?0?units"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an?0?units"].value %>"
data-channelId="<%= channels["multisensor.an?0?units"].channelId %>"
data-techname="<%=channels["multisensor.an?0?units"].techName %>"
data-name="<%= channels["multisensor.an?0?units"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an?0?units"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an?0?units"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
<div class="col-md-6 align-center">
<h2>Input ?1?</h2>
<% if (channels["multisensor.an?1?ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input?1?_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input?1?_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<h2>Scaling</h2>
<form class="form-inline">
<div class="form-group">
<label for="min-scaling-?1?">Min Value</label>
<input class="form-control setpoint"
id="min-scaling-?1?"
type="number"
step="0.1"
value="<%= channels["multisensor.an?1?min"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input?1?_cfg.scalingConfig.euMin', 'value': 4.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an?1?min"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<form class="form-inline">
<div class="form-group">
<label for="max-scaling-?1?">Max Value</label>
<input class="form-control setpoint"
id="max-scaling-?1?"
type="number"
step="0.1"
value="<%= channels["multisensor.an?1?max"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input?1?_cfg.scalingConfig.euMax', 'value': 20.0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an?1?max"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="name-?1?">Name</label>
<input class="form-control setpoint"
id="name-?1?"
type="text"
value="<%= channels["multisensor.an?1?name"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an?1?name"].value %>"
data-channelId="<%= channels["multisensor.an?1?name"].channelId %>"
data-techname="<%=channels["multisensor.an?1?name"].techName %>"
data-name="<%= channels["multisensor.an?1?name"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an?1?name"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an?1?name"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
<hr style="margin-top: 10px; margin-bottom:10px;" />
<form class="form-inline">
<div class="form-group">
<label for="units-?1?">Units</label>
<input class="form-control setpoint"
id="units-?1?"
type="text"
value="<%= channels["multisensor.an?1?units"].value %>" />
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="<%= channels["multisensor.an?1?units"].value %>"
data-channelId="<%= channels["multisensor.an?1?units"].channelId %>"
data-techname="<%=channels["multisensor.an?1?units"].techName %>"
data-name="<%= channels["multisensor.an?1?units"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.an?1?units"].nodechannelcurrentId %>"
id="<%= channels["multisensor.an?1?units"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</div>
</form>
</div>
</div>
<hr />
<div class="row row-flex">
<% if (channels["multisensor.an?0?ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond ?0? Calibration</h2>
<table id="calibration-data-table-?0?" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an?1?ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond ?1? Calibration</h2>
<table id="calibration-data-table-?1?" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
</div>
<hr />
<% if (channels["multisensor.an?0?ispond"].value === "true" || channels["multisensor.an?1?ispond"].value === "true") { %>
<div class="row pad15">
<div class="col-md-12 entry-top-level" id="new-entry">
<h2>Add a new Calibration Point</h2>
<form>
<div class="form-group">
<label for="input-select">Pond Number</label>
<select class="form-control" id="input-select">
<option value=?0? >?0?</option>
<option value=?1? >?1?</option>
</select>
</div>
<div class="form-group">
<label for="height-box">Height</label>
<input class="form-control height_box"
id="height-box"
type="number"
step="any"
value="0">
</div>
<div class="form-group">
<label for="volume-box">Volume</label>
<input class="form-control volume_box"
id="volume-box"
type="number"
step="any"
value="0">
</div>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'input':0, 'height':0.0, 'volume':0.0}"
data-channelId="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
data-techname="<%=channels["multisensor.addcalibrationpoint"].techName %>"
data-name="<%= channels["multisensor.addcalibrationpoint"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.addcalibrationpoint"].nodechannelcurrentId %>"
id="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<% } %>
<script type="text/javascript">
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
var config?0?raw = "<%= channels["multisensor.pond?0?calibration"].value %>";
var config?1?raw = "<%= channels["multisensor.pond?1?calibration"].value %>";
var config?0? = JSON.parse(config?0?raw.replaceAll("'", '"'));
var config?1? = JSON.parse(config?1?raw.replaceAll("'", '"'));
var table?0?Rows = [];
var table?1?Rows = [];
for (var i = 0; i < config?0?.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + config?0?[i].height + "</td><td>" + config?0?[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': ?0?, \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
table?0?Rows.push(thisHtml);
}
$("#calibration-data-table-?0? > tbody").html(table?0?Rows);
for (var i = 0; i < config?1?.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + config?1?[i].height + "</td><td>" + config?1?[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': ?1?, \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
table?1?Rows.push(thisHtml);
}
$("#calibration-data-table-?1? > tbody").html(table?1?Rows);
$("#height-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['height'] = $("#height-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#volume-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['volume'] = $("#volume-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#input-select").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['input'] = $("#input-select").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#min-scaling-?0?").change(function(){
$("#<%= channels["multisensor.an?0?min"].channelId %>").attr('data-staticsend', "{'tag': 'input?0?_cfg.scalingConfig.euMin', 'value': "+ $("#min-scaling-?0?").val() +"}");
})
$("#max-scaling-?0?").change(function(){
$("#<%= channels["multisensor.an?0?max"].channelId %>").attr('data-staticsend', "{'tag': 'input?0?_cfg.scalingConfig.euMax', 'value': "+ $("#max-scaling-?0?").val() +"}");
})
$("#name-?0?").change(function(){
$("#<%= channels["multisensor.an?0?name"].channelId %>").attr('data-staticsend', $("#name-?0?").val());
})
$("#units-?0?").change(function(){
$("#<%= channels["multisensor.an?0?units"].channelId %>").attr('data-staticsend', $("#units-?0?").val());
})
$("#min-scaling-?1?").change(function(){
$("#<%= channels["multisensor.an?1?min"].channelId %>").attr('data-staticsend', "{'tag': 'input?1?_cfg.scalingConfig.euMin', 'value': "+ $("#min-scaling-?1?").val() +"}");
})
$("#max-scaling-?1?").change(function(){
$("#<%= channels["multisensor.an?1?max"].channelId %>").attr('data-staticsend', "{'tag': 'input?1?_cfg.scalingConfig.euMax', 'value': "+ $("#max-scaling-?1?").val() +"}");
})
$("#name-?1?").change(function(){
$("#<%= channels["multisensor.an?1?name"].channelId %>").attr('data-staticsend', $("#name-?1?").val());
})
$("#units-?1?").change(function(){
$("#<%= channels["multisensor.an?1?units"].channelId %>").attr('data-staticsend', $("#units-?1?").val());
})
</script>
<style>
.align-center {
text-align: center;
}
</style>

View File

@@ -28,4 +28,11 @@
<div class="col-xs-4">
<h4><%= node.vanityname %></h4>
</div>
<% if (channels['multisensor.an0ispond'].value === 'true' || channels['multisensor.an1ispond'].value === 'true' || channels['multisensor.an2ispond'].value === 'true' || channels['multisensor.an3ispond'].value === 'true' || channels['multisensor.an4ispond'].value === 'true' || channels['multisensor.an5ispond'].value === 'true' || channels['multisensor.an6ispond'].value === 'true' || channels['multisensor.an7ispond'].value === 'true') { %>
<div class="col-xs-4" style="text-align:center;">
<h2>Pond Volume Total</h2>
<h4><%= Math.round(channels['multisensor.pondvolumetotal'].value) %> BBL</h4>
</div>
<% } %>
</div>

View File

@@ -0,0 +1,488 @@
<div class="row">
<div class="col-md-3">
<h2>Input 0</h2>
<% if (channels["multisensor.an0ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input0_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input0_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
</div>
<div class="col-md-3">
<h2>Input 1</h2>
<% if (channels["multisensor.an1ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input1_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input1_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
</div>
<div class="col-md-3">
<h2>Input 2</h2>
<% if (channels["multisensor.an2ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input2_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input2_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
</div>
<div class="col-md-3">
<h2>Input 3</h2>
<% if (channels["multisensor.an3ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input3_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Vlume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input3_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
</div>
</div>
<div class="row">
<div class="col-md-3">
<h2>Input 4</h2>
<% if (channels["multisensor.an4ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input0_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Vlume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input4_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
</div>
<div class="col-md-3">
<h2>Input 5</h2>
<% if (channels["multisensor.an5ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input5_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Vlume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input5_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
</div>
<div class="col-md-3">
<h2>Input 6</h2>
<% if (channels["multisensor.an6ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input6_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input6_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
</div>
<div class="col-md-3">
<h2>Input 7</h2>
<% if (channels["multisensor.an7ispond"].value === "true"){ %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input7_cfg.isPondLevel', 'value': 0}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-danger animated setstatic">Disable Pond Volume</a>
<% } else { %>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'tag': 'input7_cfg.isPondLevel', 'value': 1}"
data-channelId="<%= channels["multisensor.writeplctag"].channelId %>"
data-techname="<%=channels["multisensor.writeplctag"].techName %>"
data-name="<%= channels["multisensor.writeplctag"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.writeplctag"].nodechannelcurrentId %>"
id="<%= channels["multisensor.writeplctag"].channelId %>"
class="btn btn-large btn-success animated setstatic">Enable Pond Volume</a>
<% } %>
</div>
</div>
<hr />
<div class="row row-flex">
<% if (channels["multisensor.an0ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 0 Calibration</h2>
<table id="calibration-data-table-0" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an1ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 1 Calibration</h2>
<table id="calibration-data-table-1" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an2ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 2 Calibration</h2>
<table id="calibration-data-table-2" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an3ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 3 Calibration</h2>
<table id="calibration-data-table-3" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an4ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 4 Calibration</h2>
<table id="calibration-data-table-4" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an5ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 5 Calibration</h2>
<table id="calibration-data-table-5" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an6ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 6 Calibration</h2>
<table id="calibration-data-table-6" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
<% if (channels["multisensor.an7ispond"].value === "true") { %>
<div class="col-xs-6">
<h2>Pond 7 Calibration</h2>
<table id="calibration-data-table-7" class="table">
<thead>
<tr>
<th>Level (Ft.)</th>
<th>Volume</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% } %>
</div>
<hr />
<div class="row pad15">
<div class="col-md-12 entry-top-level" id="new-entry">
<h2>Add a new Calibration Point</h2>
<form>
<div class="form-group">
<label for="input-select">Pond Number</label>
<select class="form-control" id="input-select">
<option value=0 >0</option>
<option value=1 >1</option>
<option value=2 >2</option>
<option value=3 >3</option>
<option value=4 >4</option>
<option value=5 >5</option>
<option value=6 >6</option>
<option value=7 >7</option>
</select>
</div>
<div class="form-group">
<label for="height-box">Height</label>
<input class="form-control height_box"
id="height-box"
type="number"
step="any"
value="0">
</div>
<div class="form-group">
<label for="volume-box">Volume</label>
<input class="form-control volume_box"
id="volume-box"
type="number"
step="any"
value="0">
</div>
<a href="#"
data-confirm-message="Are you sure you want to do this?"
data-refreshpause="1"
data-command=""
data-staticsend="{'input':0, 'height':0.0, 'volume':0.0}"
data-channelId="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
data-techname="<%=channels["multisensor.addcalibrationpoint"].techName %>"
data-name="<%= channels["multisensor.addcalibrationpoint"].name%>"
data-nodechannelcurrentId="<%= channels["multisensor.addcalibrationpoint"].nodechannelcurrentId %>"
id="<%= channels["multisensor.addcalibrationpoint"].channelId %>"
class="btn btn-large btn-theme animated setstatic material-icons">send</a>
</form>
</div>
</div>
<script type="text/javascript">
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
var configRaw = [];
configRaw.push("<%= channels["multisensor.pond0calibration"].value %>");
configRaw.push("<%= channels["multisensor.pond1calibration"].value %>");
configRaw.push("<%= channels["multisensor.pond2calibration"].value %>");
configRaw.push("<%= channels["multisensor.pond3calibration"].value %>");
configRaw.push("<%= channels["multisensor.pond4calibration"].value %>");
configRaw.push("<%= channels["multisensor.pond5calibration"].value %>");
configRaw.push("<%= channels["multisensor.pond6calibration"].value %>");
configRaw.push("<%= channels["multisensor.pond7calibration"].value %>");
for (var j = 0; j<=7; j++){
var configData = JSON.parse(configRaw[j].replaceAll("'", '"'));
console.log(configData);
var tableRows = [];
for (var i = 0; i < configData.length; i++){
var ptIndex = i + 1;
var thisHtml = "<tr><td>" + configData[i].height + "</td><td>" + configData[i].volume + '</td><td><a href="#" data-confirm-message="Are you sure you want to do this?" data-refreshpause="1" data-command="" data-staticsend="{\'input\': '+ j +', \'point\': '+ ptIndex +'}" data-channelId="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" data-techname="<%=channels["multisensor.deletecalibrationpoint"].techName %>" data-name="<%= channels["multisensor.deletecalibrationpoint"].name%>" data-nodechannelcurrentId="<%= channels["multisensor.deletecalibrationpoint"].nodechannelcurrentId %>" id="<%= channels["multisensor.deletecalibrationpoint"].channelId %>" class="btn btn-large btn-theme animated setstatic">Delete</a></tr>';
tableRows.push(thisHtml);
}
$("#calibration-data-table-"+ j +" > tbody").html(tableRows);
}
$("#height-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['height'] = $("#height-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#volume-box").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['volume'] = $("#volume-box").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
$("#input-select").change(function(){
var currentNewPoint = JSON.parse($("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend').replaceAll("'", '"'));
currentNewPoint['input'] = $("#input-select").val();
$("#<%= channels["multisensor.addcalibrationpoint"].channelId %>").attr('data-staticsend', JSON.stringify(currentNewPoint).replaceAll('"', "'"));
})
</script>

View File

@@ -18,7 +18,7 @@
data-ylabel=""
data-xlabel="Date"
data-units=""
data-channelnames="plcpond.pond1height,plcpond.pond2height,plcpond.pond3height,plcpond.pond4height,plcpond.pond1volume,plcpond.pond2volume,plcpond.pond3volume,plcpond.pond4volume,plcpond.pondvolumetotal">
data-channelnames="multisensor.an0val,multisensor.an1val,multisensor.an2val,multisensor.an3val,multisensor.an4val,multisensor.an5val,multisensor.an6val,multisensor.an7val,multisensor.pond0volume,multisensor.pond1volume,multisensor.pond2volume,multisensor.pond3volume,multisensor.pond4volume,multisensor.pond5volume,multisensor.pond6volume,multisensor.pond7volume,multisensor.pondvolumetotal">
</div>
<style>
.dynamic-chart-form {

View File

@@ -42,6 +42,35 @@ def read_tag(addr, tag, plc_type="CLX"):
return False
def read_tag_group(addr, tag_list, plc_type="CLX"):
"""Read a tag group from the PLC."""
direct = plc_type.lower() == "micro800"
read_values = []
clx = ClxDriver()
try:
if clx.open(addr, direct_connection=direct):
for i in range(0, len(tag_list)):
try:
val = clx.read_tag(tag_list[i])
read_values.append(val)
except DataError as err:
read_values.append(None)
time.sleep(TAG_DATAERROR_SLEEPTIME)
log.error("Data Error during read_tag_group({}, {}): {}".format(addr, tag_list[i], err))
else:
log.error("Error opening {}".format(addr))
except CommError:
# err = c.get_status()
clx.close()
log.error("Could not connect during read_tag_group({})".format(addr))
except AttributeError as err:
clx.close()
log.error("AttributeError during read_tag_group({}: \n{}".format(addr, err))
clx.close()
return read_values
def read_array(addr, tag, start, end, plc_type="CLX"):
"""Read an array from the PLC."""
direct = plc_type == "Micro800"
@@ -70,11 +99,15 @@ def write_tag(addr, tag, val, plc_type="CLX"):
"""Write a tag value to the PLC."""
direct = plc_type == "Micro800"
clx = ClxDriver()
write_status = None
try:
if clx.open(addr, direct_connection=direct):
try:
initial_val = clx.read_tag(tag)
write_status = clx.write_tag(tag, val, initial_val[1])
if initial_val:
write_status = clx.write_tag(tag, val, initial_val[1])
else:
log.error("Unable to get initial value in write_tag({}, {}, {}, {})".format(addr, tag, val, plc_type))
return write_status
except DataError as err:
clx_err = clx.get_status()
@@ -85,6 +118,7 @@ def write_tag(addr, tag, val, plc_type="CLX"):
clx_err = clx.get_status()
log.error("--\nCommError during write_tag({}, {}, {}, plc_type={})\n{}\n--".format(addr, tag, val, plc_type, err))
clx.close()
return False

View File

@@ -6,7 +6,7 @@ import time
from random import randint
from device_base import deviceBase
from channel import PLCChannel, read_tag, write_tag
from channel import PLCChannel, read_tag, write_tag, read_tag_group
from utilities import get_public_ip_address
from file_logger import filelogger as log
@@ -70,6 +70,24 @@ CHANNELS = [
PLCChannel(PLC_IP_ADDRESS, 'pond5volume', 'input5.pondVolume', 'REAL', 1000.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'pond6volume', 'input6.pondVolume', 'REAL', 1000.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'pond7volume', 'input7.pondVolume', 'REAL', 1000.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an0min', 'input0_cfg.scalingConfig.euMin', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an1min', 'input1_cfg.scalingConfig.euMin', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an2min', 'input2_cfg.scalingConfig.euMin', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an3min', 'input3_cfg.scalingConfig.euMin', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an4min', 'input4_cfg.scalingConfig.euMin', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an5min', 'input5_cfg.scalingConfig.euMin', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an6min', 'input6_cfg.scalingConfig.euMin', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an7min', 'input7_cfg.scalingConfig.euMin', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an0max', 'input0_cfg.scalingConfig.euMax', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an1max', 'input1_cfg.scalingConfig.euMax', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an2max', 'input2_cfg.scalingConfig.euMax', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an3max', 'input3_cfg.scalingConfig.euMax', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an4max', 'input4_cfg.scalingConfig.euMax', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an5max', 'input5_cfg.scalingConfig.euMax', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an6max', 'input6_cfg.scalingConfig.euMax', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'an7max', 'input7_cfg.scalingConfig.euMax', 'REAL', 1.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
PLCChannel(PLC_IP_ADDRESS, 'pondvolumetotal', 'pondVolumeTotal', 'REAL', 100.0, 600, map_=False, write_enabled=False, plc_type="Micro800"),
]
@@ -104,10 +122,12 @@ class start(threading.Thread, deviceBase):
def run(self):
"""Actually run the driver."""
self.nodes["multisensor_0199"] = self
for i in range(0, WAIT_FOR_CONNECTION_SECONDS):
print("multisensor driver will start in {} seconds".format(WAIT_FOR_CONNECTION_SECONDS - i))
time.sleep(1)
log.info("BOOM! Starting multisensor driver...")
self._check_watchdog()
self._check_ip_address()
@@ -129,8 +149,11 @@ class start(threading.Thread, deviceBase):
self.sendtodbDev(1, chan.mesh_name, chan.value, 0, 'multisensor')
time.sleep(2)
for i in range(0, 8):
self.read_pond_calibration(i)
# print("multisensor driver still alive...")
log.info("multisensor driver still alive...")
if self.force_send:
if send_loops > 2:
log.warning("Turning off force_send")
@@ -151,13 +174,19 @@ class start(threading.Thread, deviceBase):
last_read_height = -1.0
cal_values = []
cal_index = 1
height_tags = []
volume_tags = []
for i in range(0, 11):
height_tags.append("input{}.calibrationLevel[{}]".format(input_number, i))
volume_tags.append("input{}.calibrationVolume[{}]".format(input_number, i))
height_values = read_tag_group(PLC_IP_ADDRESS, height_tags, plc_type="Micro800")
volume_values = read_tag_group(PLC_IP_ADDRESS, volume_tags, plc_type="Micro800")
while last_read_height != 0 and cal_index <= 10:
cal_tag_height = "input{}.calibrationLevel[{}]".format(input_number, cal_index)
cal_tag_volume = "input{}.calibrationVolume[{}]".format(input_number, cal_index)
read_height = read_tag(PLC_IP_ADDRESS, cal_tag_height, plc_type="Micro800")
time.sleep(2)
read_volume = read_tag(PLC_IP_ADDRESS, cal_tag_volume, plc_type="Micro800")
time.sleep(2)
read_height = height_values[cal_index]
read_volume = volume_values[cal_index]
if read_height and read_volume:
if read_height[0] > 0.0:
cal_values.append({"height": read_height[0], "volume": read_volume[0]})
@@ -170,6 +199,68 @@ class start(threading.Thread, deviceBase):
self.sendtodbDev(1, calibration_channel, calibration_string, 0, 'multisensor')
CALIBRATION_TABLES[input_number] = cal_values
def multisensor_addcalibrationpoint(self, name, value):
"""Add a calibration point."""
# value = {"input": int, "height": float, "volume": float}
try:
# parse json values, throw an error if one is missing
value = value.replace("'", '"')
parsed = json.loads(value)
input_number = int(parsed['input'])
height = float(parsed['height'])
volume = float(parsed['volume'])
# write values to the tags
level_inp_tag = "input{}_cmd.inpCalLevel".format(input_number)
volume_inp_tag = "input{}_cmd.inpCalVolume".format(input_number)
cmd_tag = "input{}_cmd.cmdInsertCalPoint".format(input_number)
insert_success_tag = "input{}.insertSuccess".format(input_number)
write_height = write_tag(PLC_IP_ADDRESS, level_inp_tag, height, plc_type="Micro800")
time.sleep(2)
write_volume = write_tag(PLC_IP_ADDRESS, volume_inp_tag, volume, plc_type="Micro800")
time.sleep(2)
if write_height and write_volume:
write_cmd = write_tag(PLC_IP_ADDRESS, cmd_tag, 1, plc_type="Micro800")
time.sleep(2)
if write_cmd:
self.read_pond_calibration(input_number)
return True
return "Didn't write insert command correctly."
return "Didn't write height or volume correctly."
except KeyError as e:
return "Couldn't parse input value: {} -- {}".format(value, e)
def multisensor_deletecalibrationpoint(self, name, value):
"""Delete a calibration point from a calibration table"""
# {"input": int, "point": int}
value = value.replace("'", '"')
parsed = json.loads(value)
try:
input_number = int(parsed['input'])
point_number = int(parsed['point'])
delete_index_tag = "input{}_cmd.inpDeleteIndex".format(input_number)
delete_cmd_tag = "input{}_cmd.cmdDeleteCalPoint".format(input_number)
write_point = write_tag(PLC_IP_ADDRESS, delete_index_tag, point_number, plc_type="Micro800")
time.sleep(2)
if write_point:
write_cmd = write_tag(PLC_IP_ADDRESS, delete_cmd_tag, 1, plc_type="Micro800")
time.sleep(2)
if write_cmd:
self.read_pond_calibration(input_number)
return True
log.error("Didn't write delete command correctly.")
return "Didn't write delete command correctly."
log.error("Didn't write pond or point correctly.")
return "Didn't write pond or point correctly."
except KeyError as e:
return "Couldn't parse input value: {} -- {}".format(value, e)
except Exception as e:
log.error("Caught error in _deletecalibrationpoint({}, {}): {}".format(name, value, e))
return e
def _check_watchdog(self):
"""Check the watchdog and send to Meshify if changed or stale."""
test_watchdog = self.multisensor_watchdog()
@@ -209,11 +300,22 @@ class start(threading.Thread, deviceBase):
def multisensor_writeplctag(self, name, value):
"""Write a value to the PLC."""
new_val = json.loads(str(value).replace("'", '"'))
tag_n = str(new_val['tag']) # "cmd_Start"
val_n = new_val['val']
write_res = write_tag(str(PLC_IP_ADDRESS), tag_n, val_n)
print("Result of multisensor_writeplctag(self, {}, {}) = {}".format(name, value, write_res))
if write_res is None:
write_res = "Error writing to PLC..."
return write_res
# {"tag": string, "val": }
try:
new_val = json.loads(str(value).replace("'", '"'))
tag_n = str(new_val['tag']) # "cmd_Start"
val_n = new_val['value']
write_res = write_tag(str(PLC_IP_ADDRESS), tag_n, val_n, plc_type="Micro800")
print("Result of multisensor_writeplctag(self, {}, {}, plc_type=\"Micro800\") = {}".format(name, value, write_res))
if write_res is None:
write_res = "Error writing to PLC..."
return write_res
except ValueError as e:
log.error("Error writing to PLC: {}\n{}".format(value, e))
return e
except KeyError as e:
log.error("KeyError for key {} in JSON object: {}".format(e, value))
return e
except Exception as e:
log.error("Caught error in _writeplctag({}, {}): {}".format(name, value, e))
return e

View File

@@ -0,0 +1,30 @@
from channel import write_tag, read_tag
import json
from file_logger import filelogger as log
PLC_IP_ADDRESS = "10.20.4.18"
value = "{'tag': 'input1_cfg.ispond', 'value': 1}"
# {"tag": string, "val": }
try:
new_val = json.loads(str(value).replace("'", '"'))
tag_n = str(new_val['tag']) # "cmd_Start"
val_n = new_val['value']
print("IP_ADDRESS: {}, VALUES: {} -- {}".format(PLC_IP_ADDRESS, tag_n, val_n))
write_res = write_tag(str(PLC_IP_ADDRESS), tag_n, val_n, plc_type="Micro800")
print("Result of multisensor_writeplctag(self, name, {}, plc_type=\"Micro800\") = {}".format(value, write_res))
if write_res is None:
write_res = "Error writing to PLC..."
print(write_res)
# return write_res
except ValueError as e:
log.error("Error writing to PLC: {}\n{}".format(value, e))
# return e
except KeyError as e:
log.error("KeyError for key {} in JSON object: {}".format(e, value))
# return e
# except Exception as e:
# log.error("Caught error in _writeplctag({}): {}".format(value, e))
# return e

View File

@@ -2,5 +2,15 @@
Connect up to 8 analog signals to be monitored by POCloud!
## Configuration
All configuration can be done via the POCloud interface.
### Scaling Parameters
Scaling defaults to EU values of 4.0 to 20.0
### Pond Configuration
To configure the input to be a pond, click the Pond Enable button. Strapping table measurements can be input below the scaling parameters.