Fixes maps and adds schedule page

This commit is contained in:
Patrick McDonagh
2017-06-09 09:46:01 -05:00
parent 8d2351bddb
commit 647c462426
3 changed files with 70 additions and 3 deletions

View File

@@ -0,0 +1,66 @@
<div class="row">
<div class="col-md-12">
<h1>Production Scheduler: <%=channels["advvfdipp.sch_enabled"].value %></h1>
<h2>Upcoming Schedule</h2>
<div class="table table-responsive">
<form>
<table>
<thead>
<tr>
<th>ID</th>
<th>Control Mode</th>
<th>Completion Parameter</th>
<th></th>
<th>Target Value</th>
<th>Actual Value</th>
</tr>
</thead>
<tbody id="upcoming_schedule">
<tr>
<td><input id="ps_id_1" type="number"></td>
<td><input id="ps_controlmode_1" type="number"></td>
<td><input id="ps_complparam_1" type="number"></td>
<td><input id="ps_complcomp_1" type="number"></td>
<td><input id="ps_target_1" type="number"></td>
<td><input id="ps_actual_1" type="number"></td>
<td><input id="ps_totalbbl_1" type="number"></td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Previously Scheduled Runs</h2>
<div class="table table-responsive">
<table>
<thead>
<tr>
<th>ID</th>
<th>Control Mode</th>
<th>Completion Parameter</th>
<th></th>
<th>Target Value</th>
<th>Actual Value</th>
<th>Total BBL</th>
</tr>
</thead>
<tbody id="past_schedule"></tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript">
//Get values of run_schedule_x
var run_schedule = [];
for
</script>

View File

@@ -45,5 +45,6 @@ adv_vfd_ipp_map = {
4: "Tubing Pressure",
5: "Time",
},
'completion_comparison': {0: ">", 1: "<"}
'completion_comparison': {0: ">", 1: "<"},
'enable_disable': {0: "Disabled", 1: "Enabled"}
}

View File

@@ -68,7 +68,7 @@ channels = [
Channel(plc_ip_address, "temperatureshutdownlimit", "AIn_IntakeTemperature.Val_HiLim", "REAL", 0.5, 14400),
Channel(plc_ip_address, "temperaturestartuplimit", "AIn_IntakeTemperature.Val_LoLim", "REAL", 0.5, 14400),
Channel(plc_ip_address, "sensorheight", "cfg_DHSensorDistToIntake", "REAL", 0.5, 14400),
Channel(plc_ip_address, "sch_enabled", "sch_enabled", "BOOL", _, 3600)
Channel(plc_ip_address, "sch_enabled", "sch_enabled", "STRING", _, 3600, map_=maps['enable_disable'])
]
scheduler_history = [
@@ -134,7 +134,7 @@ class start(threading.Thread, deviceBase):
for sch_s in scheduler_schedule:
if sch_s.read(self.forceSend):
self.sendtodbJSON("run_schedule", json.dumps(sch_s.jsonify()), 0)
self.sendtodbJSON("run_schedule_{}".format(sch_s.index_), json.dumps(sch_s.jsonify()), 0)
print("advvfdipp driver still alive...")
if self.forceSend: