better process start check + logging

This commit is contained in:
Mikayla Fischler 2024-10-14 01:20:52 -04:00
parent c0b7d7e13c
commit 60ff22f57d
2 changed files with 6 additions and 4 deletions

View File

@ -425,9 +425,9 @@ function facility.new(config)
ready = self.mode_set > 0
if (self.mode_set == PROCESS.CHARGE) and (self.charge_setpoint <= 0) or
(self.mode_set == PROCESS.GEN_RATE) and (self.gen_rate_setpoint <= 0) or
(self.mode_set == PROCESS.BURN_RATE) and (self.burn_target < 0.1) then
if ((self.mode_set == PROCESS.CHARGE) and (self.charge_setpoint <= 0)) or
((self.mode_set == PROCESS.GEN_RATE) and (self.gen_rate_setpoint <= 0)) or
((self.mode_set == PROCESS.BURN_RATE) and (self.burn_target < 0.1)) then
ready = false
end
@ -436,6 +436,8 @@ function facility.new(config)
if ready then self.mode = self.mode_set end
end
log.debug(util.c("FAC: process start ", util.trinary(ready, "accepted", "rejected")))
return {
ready,
self.mode_set,

View File

@ -22,7 +22,7 @@ local supervisor = require("supervisor.supervisor")
local svsessions = require("supervisor.session.svsessions")
local SUPERVISOR_VERSION = "v1.5.8"
local SUPERVISOR_VERSION = "v1.5.9"
local println = util.println
local println_ts = util.println_ts