Automatic PROD MODE + changes Q conso location
This commit is contained in:
parent
350125b659
commit
cae91b5f05
10
main.py
10
main.py
|
|
@ -312,7 +312,7 @@ def send_command(state: str, pu_number: int, ploop_setpoint: float = Query(...),
|
||||||
## MONITORING
|
## MONITORING
|
||||||
@app.get("/api/pu_status")
|
@app.get("/api/pu_status")
|
||||||
def get_pu_status():
|
def get_pu_status():
|
||||||
global active_PUs
|
global active_PUs, latest_setpoints
|
||||||
states = {
|
states = {
|
||||||
"PU1": can_backend.read_current_state(1),
|
"PU1": can_backend.read_current_state(1),
|
||||||
"PU2": can_backend.read_current_state(2),
|
"PU2": can_backend.read_current_state(2),
|
||||||
|
|
@ -320,6 +320,14 @@ def get_pu_status():
|
||||||
}
|
}
|
||||||
logging.debug(f"[PU STATUS] {states}")
|
logging.debug(f"[PU STATUS] {states}")
|
||||||
|
|
||||||
|
if states["PU1"] == "SYSTEM_MODE_READY":
|
||||||
|
send_command(state="PRODUCTION", pu_number = 1, ploop_setpoint = latest_setpoints["PU_1"]["Ploop_sp"] , qperm_setpoint=latest_setpoints["PU_1"]["Qperm_sp"])
|
||||||
|
if states["PU2"] == "SYSTEM_MODE_READY":
|
||||||
|
send_command(state="PRODUCTION", pu_number = 2, ploop_setpoint = latest_setpoints["PU_2"]["Ploop_sp"] , qperm_setpoint=latest_setpoints["PU_2"]["Qperm_sp"])
|
||||||
|
if states["PU3"] == "SYSTEM_MODE_READY":
|
||||||
|
send_command(state="PRODUCTION", pu_number = 3, ploop_setpoint = latest_setpoints["PU_3"]["Ploop_sp"] , qperm_setpoint=latest_setpoints["PU_3"]["Qperm_sp"])
|
||||||
|
|
||||||
|
|
||||||
active_PUs = [
|
active_PUs = [
|
||||||
index + 1
|
index + 1
|
||||||
for index, (pu, status) in enumerate(states.items())
|
for index, (pu, status) in enumerate(states.items())
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ async function updateAllPlots() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extend QSkid + Qconso for Qperm
|
// Extend QSkid + Qconso for Qperm
|
||||||
if (plot.id === 'Qperm-plot') {
|
if (plot.id === 'Qdrain-plot') {
|
||||||
const qSkid = SkidData["QSkid"];
|
const qSkid = SkidData["QSkid"];
|
||||||
const qConso = DSData["Qconso"];
|
const qConso = DSData["Qconso"];
|
||||||
const baseIndex = puList.length + (plot.refKey ? 1 : 0);
|
const baseIndex = puList.length + (plot.refKey ? 1 : 0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user