Swtiches Pro and Pretenate
This commit is contained in:
parent
f34d2f6606
commit
9523c24122
6
main.py
6
main.py
|
|
@ -87,9 +87,9 @@ def format_data(data):
|
||||||
"Qdilute": np.round(data.get("FM1", 0.0), 1),
|
"Qdilute": np.round(data.get("FM1", 0.0), 1),
|
||||||
"Qdrain": np.round(data.get("FM4", 0.0), 1),
|
"Qdrain": np.round(data.get("FM4", 0.0), 1),
|
||||||
"Qrecirc": np.round(data.get("FM3", 0.0), 1),
|
"Qrecirc": np.round(data.get("FM3", 0.0), 1),
|
||||||
"Pro": np.round(data.get("PS1", 0.0), 1),
|
"Pro": np.round(data.get("PS2", 0.0), 1),
|
||||||
"Pdilute": np.round(data.get("PS3", 0.0), 1),
|
"Pdilute": np.round(data.get("PS3", 0.0), 1),
|
||||||
"Prentate": np.round(data.get("PS2", 0.0), 1),
|
"Pretentate": np.round(data.get("PS1", 0.0), 1),
|
||||||
"Conductivity": np.round(data.get("Cond", 0.0), 1),
|
"Conductivity": np.round(data.get("Cond", 0.0), 1),
|
||||||
"MV02": np.round(data.get("MV02", 0.0), 1),
|
"MV02": np.round(data.get("MV02", 0.0), 1),
|
||||||
"MV02_sp": np.round(data.get("MV02_sp", 0.0), 1),
|
"MV02_sp": np.round(data.get("MV02_sp", 0.0), 1),
|
||||||
|
|
@ -334,8 +334,6 @@ async def record_data_loop():
|
||||||
timestamp = datetime.datetime.now().isoformat()
|
timestamp = datetime.datetime.now().isoformat()
|
||||||
for pu, data in latest_data.items():
|
for pu, data in latest_data.items():
|
||||||
if data:
|
if data:
|
||||||
row = {"timestamp": timestamp, "pu": pu, **data}
|
|
||||||
print("record_data",data)
|
|
||||||
row = {
|
row = {
|
||||||
"timestamp": timestamp,
|
"timestamp": timestamp,
|
||||||
"pu": pu,
|
"pu": pu,
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@
|
||||||
Qrecirc: puData.Qrecirc,
|
Qrecirc: puData.Qrecirc,
|
||||||
Pro: puData.Pro,
|
Pro: puData.Pro,
|
||||||
Pdilute: puData.Pdilute,
|
Pdilute: puData.Pdilute,
|
||||||
Prentate: puData.Prentate,
|
Pretentate: puData.Pretentate,
|
||||||
MV02_sp: puData.MV02_sp,
|
MV02_sp: puData.MV02_sp,
|
||||||
MV03_sp: puData.MV03_sp,
|
MV03_sp: puData.MV03_sp,
|
||||||
MV04_sp: puData.MV04_sp,
|
MV04_sp: puData.MV04_sp,
|
||||||
|
|
@ -129,9 +129,9 @@
|
||||||
clearInterval(recordingInterval);
|
clearInterval(recordingInterval);
|
||||||
if (recordedData.length > 0) {
|
if (recordedData.length > 0) {
|
||||||
const csvContent = "data:text/csv;charset=utf-8," +
|
const csvContent = "data:text/csv;charset=utf-8," +
|
||||||
"Timestamp,Qperm,Qdilute,Qdrain,Qrecirc,Pro,Pdilute,Prentate,MV02_sp,MV03_sp,MV04_sp,MV05_sp,MV06_sp,MV07_sp,MV08_sp,QSkid\n" +
|
"Timestamp,Qperm,Qdilute,Qdrain,Qrecirc,Pro,Pdilute,Pretentate,MV02_sp,MV03_sp,MV04_sp,MV05_sp,MV06_sp,MV07_sp,MV08_sp,QSkid\n" +
|
||||||
recordedData.map(row =>
|
recordedData.map(row =>
|
||||||
`${row.timestamp},${row.Qperm},${row.Qdilute},${row.Qdrain},${row.Qrecirc},${row.Pro},${row.Pdilute},${row.Prentate},${row.MV02_sp},${row.MV03_sp},${row.MV04_sp},${row.MV05_sp},${row.MV06_sp},${row.MV07_sp},${row.MV08_sp},${row.QSkid}`
|
`${row.timestamp},${row.Qperm},${row.Qdilute},${row.Qdrain},${row.Qrecirc},${row.Pro},${row.Pdilute},${row.Pretentate},${row.MV02_sp},${row.MV03_sp},${row.MV04_sp},${row.MV05_sp},${row.MV06_sp},${row.MV07_sp},${row.MV08_sp},${row.QSkid}`
|
||||||
).join("\n");
|
).join("\n");
|
||||||
const encodedUri = encodeURI(csvContent);
|
const encodedUri = encodeURI(csvContent);
|
||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
|
|
@ -177,7 +177,7 @@
|
||||||
|
|
||||||
Plotly.extendTraces('pressure-plot-1', {
|
Plotly.extendTraces('pressure-plot-1', {
|
||||||
x: [[timestamp], [timestamp]],
|
x: [[timestamp], [timestamp]],
|
||||||
y: [[puData.Pro], [puData.Prentate]]
|
y: [[puData.Pro], [puData.Pretentate]]
|
||||||
}, [0, 1], maxPoints);
|
}, [0, 1], maxPoints);
|
||||||
|
|
||||||
Plotly.extendTraces('pressure-plot-2', {
|
Plotly.extendTraces('pressure-plot-2', {
|
||||||
|
|
@ -242,9 +242,9 @@
|
||||||
|
|
||||||
Plotly.newPlot('pressure-plot-1', [
|
Plotly.newPlot('pressure-plot-1', [
|
||||||
{ x: time0, y: [0], name: 'Pro', mode: 'lines', line: { color: 'purple' } },
|
{ x: time0, y: [0], name: 'Pro', mode: 'lines', line: { color: 'purple' } },
|
||||||
{ x: time0, y: [0], name: 'Prentate', mode: 'lines', line: { color: 'gray' } }
|
{ x: time0, y: [0], name: 'Pretentate', mode: 'lines', line: { color: 'gray' } }
|
||||||
], {
|
], {
|
||||||
title: 'Pro and Prentate Pressure Over Time',
|
title: 'Pro and Pretentate Pressure Over Time',
|
||||||
xaxis: { title: 'Time', type: 'date' },
|
xaxis: { title: 'Time', type: 'date' },
|
||||||
yaxis: { title: 'Pressure (bar)' }
|
yaxis: { title: 'Pressure (bar)' }
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user