From 7fb88becb8ab532d0f0c4387da64a60774b54858 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Thu, 7 Nov 2024 15:01:19 +0000 Subject: [PATCH 01/11] #567 detect and report ramping in max burn and burn rate modes --- supervisor/facility.lua | 4 ++-- supervisor/facility_update.lua | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/supervisor/facility.lua b/supervisor/facility.lua index 4b2b38c..b87d6f4 100644 --- a/supervisor/facility.lua +++ b/supervisor/facility.lua @@ -91,8 +91,8 @@ function facility.new(config) charge_conversion = 1.0, time_start = 0.0, initial_ramp = true, - waiting_on_ramp = false, - waiting_on_stable = false, + waiting_on_ramp = false, -- waiting on auto ramping + waiting_on_stable = false, -- waiting on gen rate stabilization accumulator = 0.0, saturated = false, last_update = 0, diff --git a/supervisor/facility_update.lua b/supervisor/facility_update.lua index 6375077..658de99 100644 --- a/supervisor/facility_update.lua +++ b/supervisor/facility_update.lua @@ -341,9 +341,17 @@ function update.auto_control(ExtChargeIdling) if state_changed then self.time_start = now self.saturated = true + self.waiting_on_ramp = true - self.status_text = { "MONITORED MODE", "running reactors at limit" } + self.status_text = { "MONITORED MODE", "ramping reactors to limit" } log.info("FAC: MAX_BURN process mode started") + elseif self.waiting_on_ramp then + if all_units_ramped() then + self.waiting_on_ramp = false + + self.status_text = { "MONITORED MODE", "running reactors at limit" } + log.info("FAC: MAX_BURN process mode initial ramp completed") + end end allocate_burn_rate(self.max_burn_combined, true) @@ -351,8 +359,17 @@ function update.auto_control(ExtChargeIdling) -- a total aggregate burn rate if state_changed then self.time_start = now - self.status_text = { "BURN RATE MODE", "running" } + self.waiting_on_ramp = true + + self.status_text = { "BURN RATE MODE", "ramping to target" } log.info("FAC: BURN_RATE process mode started") + elseif self.waiting_on_ramp then + if all_units_ramped() then + self.waiting_on_ramp = false + + self.status_text = { "BURN RATE MODE", "running" } + log.info("FAC: BURN_RATE process mode initial ramp completed") + end end local unallocated = allocate_burn_rate(self.burn_target, true) From c1c3723b672f8112d08fb267e33c735dea2e74ee Mon Sep 17 00:00:00 2001 From: Mikayla Date: Thu, 7 Nov 2024 16:45:53 +0000 Subject: [PATCH 02/11] #567 bump supervisor version --- supervisor/startup.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/startup.lua b/supervisor/startup.lua index 537b263..a8ebb91 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -22,7 +22,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.5.10" +local SUPERVISOR_VERSION = "v1.5.11" local println = util.println local println_ts = util.println_ts From 801fd99448e2c26b05b5ddd118a563e7b291c144 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Thu, 7 Nov 2024 16:46:38 +0000 Subject: [PATCH 03/11] #571 still check for critical unit alarms and facility radiation when induction matrix is disconnected --- supervisor/facility_update.lua | 56 +++++++++++++++++----------------- supervisor/startup.lua | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/supervisor/facility_update.lua b/supervisor/facility_update.lua index 658de99..f60fe06 100644 --- a/supervisor/facility_update.lua +++ b/supervisor/facility_update.lua @@ -545,38 +545,38 @@ function update.auto_safety() log.info(util.c("FAC: charge state of induction matrix entered acceptable range <= ", ALARM_LIMS.CHARGE_RE_ENABLE * 100, "%")) end - -- check for critical unit alarms - astatus.crit_alarm = false - for i = 1, #self.units do - local u = self.units[i] - - if u.has_alarm_min_prio(PRIO.CRITICAL) then - astatus.crit_alarm = true - break - end - end - - -- check for facility radiation - if #self.envd > 0 then - local max_rad = 0 - - for i = 1, #self.envd do - local envd = self.envd[i] - local e_db = envd.get_db() - if e_db.radiation_raw > max_rad then max_rad = e_db.radiation_raw end - end - - astatus.radiation = max_rad >= ALARM_LIMS.FAC_HIGH_RAD - else - -- don't clear, if it is true then we lost it with high radiation, so just keep alarming - -- operator can restart the system or hit the stop/reset button - end - -- system not ready, will need to restart GEN_RATE mode -- clears when we enter the fault waiting state astatus.gen_fault = self.mode == PROCESS.GEN_RATE and not self.units_ready else - astatus.matrix_dc = true + astatus.matrix_fault = true + end + + -- check for critical unit alarms + astatus.crit_alarm = false + for i = 1, #self.units do + local u = self.units[i] + + if u.has_alarm_min_prio(PRIO.CRITICAL) then + astatus.crit_alarm = true + break + end + end + + -- check for facility radiation + if #self.envd > 0 then + local max_rad = 0 + + for i = 1, #self.envd do + local envd = self.envd[i] + local e_db = envd.get_db() + if e_db.radiation_raw > max_rad then max_rad = e_db.radiation_raw end + end + + astatus.radiation = max_rad >= ALARM_LIMS.FAC_HIGH_RAD + else + -- don't clear, if it is true then we lost it with high radiation, so just keep alarming + -- operator can restart the system or hit the stop/reset button end if (self.mode ~= PROCESS.INACTIVE) and (self.mode ~= PROCESS.SYSTEM_ALARM_IDLE) then diff --git a/supervisor/startup.lua b/supervisor/startup.lua index a8ebb91..2011059 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -22,7 +22,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.5.11" +local SUPERVISOR_VERSION = "v1.5.12" local println = util.println local println_ts = util.println_ts From 661bef063c4c427aae0d4e64a197595d153c623f Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Thu, 7 Nov 2024 21:44:34 -0500 Subject: [PATCH 04/11] safemin update for @as --- build/safemin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/safemin.py b/build/safemin.py index 1567b5f..1e89307 100644 --- a/build/safemin.py +++ b/build/safemin.py @@ -28,7 +28,10 @@ def minify(path: str): contents = f.read() f.close() - if re.search(r'--+\[(?!\[@as)+', contents) != None: + # remove --[[@as type]] hints before anything, since it would detect as multiline comments + contents = re.sub(r' --+\[.+]]', '', contents) + + if re.search(r'--+\[+', contents) != None: # absolutely not dealing with lua multiline comments # - there are more important things to do # - this minification is intended to be 100% safe, so working with multiline comments is asking for trouble From e27d5eeb85a3cea7612332897678d4fb2b9f339e Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Thu, 7 Nov 2024 21:45:15 -0500 Subject: [PATCH 05/11] #571 fix matrix dc --- supervisor/facility_update.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/facility_update.lua b/supervisor/facility_update.lua index f60fe06..6a34d60 100644 --- a/supervisor/facility_update.lua +++ b/supervisor/facility_update.lua @@ -549,7 +549,7 @@ function update.auto_safety() -- clears when we enter the fault waiting state astatus.gen_fault = self.mode == PROCESS.GEN_RATE and not self.units_ready else - astatus.matrix_fault = true + astatus.matrix_dc = true end -- check for critical unit alarms From 55f6e4756e3021cda21fab152ff2185535f7914f Mon Sep 17 00:00:00 2001 From: Mikayla Date: Fri, 8 Nov 2024 02:52:17 +0000 Subject: [PATCH 06/11] #566 interrupt auto control on unformed/faulted induction matrix --- coordinator/iocontrol.lua | 6 +++--- coordinator/startup.lua | 2 +- coordinator/ui/components/process_ctl.lua | 4 ++-- pocket/iocontrol.lua | 4 ++-- pocket/startup.lua | 2 +- pocket/ui/apps/process.lua | 4 ++-- pocket/ui/docs.lua | 2 +- supervisor/facility.lua | 6 +++--- supervisor/facility_update.lua | 24 ++++++++++++++--------- supervisor/startup.lua | 2 +- 10 files changed, 31 insertions(+), 25 deletions(-) diff --git a/coordinator/iocontrol.lua b/coordinator/iocontrol.lua index 8d57bed..be76052 100644 --- a/coordinator/iocontrol.lua +++ b/coordinator/iocontrol.lua @@ -94,7 +94,7 @@ function iocontrol.init(conf, comms, temp_scale, energy_scale) auto_scram = false, ---@type ascram_status ascram_status = { - matrix_dc = false, + matrix_fault = false, matrix_fill = false, crit_alarm = false, radiation = false, @@ -540,7 +540,7 @@ function iocontrol.update_facility_status(status) fac.auto_saturated = ctl_status[5] fac.auto_scram = ctl_status[6] - fac.ascram_status.matrix_dc = ctl_status[7] + fac.ascram_status.matrix_fault = ctl_status[7] fac.ascram_status.matrix_fill = ctl_status[8] fac.ascram_status.crit_alarm = ctl_status[9] fac.ascram_status.radiation = ctl_status[10] @@ -555,7 +555,7 @@ function iocontrol.update_facility_status(status) fac.ps.publish("auto_ramping", fac.auto_ramping) fac.ps.publish("auto_saturated", fac.auto_saturated) fac.ps.publish("auto_scram", fac.auto_scram) - fac.ps.publish("as_matrix_dc", fac.ascram_status.matrix_dc) + fac.ps.publish("as_matrix_fault", fac.ascram_status.matrix_fault) fac.ps.publish("as_matrix_fill", fac.ascram_status.matrix_fill) fac.ps.publish("as_crit_alarm", fac.ascram_status.crit_alarm) fac.ps.publish("as_radiation", fac.ascram_status.radiation) diff --git a/coordinator/startup.lua b/coordinator/startup.lua index 772b8b6..7b08aba 100644 --- a/coordinator/startup.lua +++ b/coordinator/startup.lua @@ -19,7 +19,7 @@ local renderer = require("coordinator.renderer") local sounder = require("coordinator.sounder") local threads = require("coordinator.threads") -local COORDINATOR_VERSION = "v1.5.13" +local COORDINATOR_VERSION = "v1.5.14" local CHUNK_LOAD_DELAY_S = 30.0 diff --git a/coordinator/ui/components/process_ctl.lua b/coordinator/ui/components/process_ctl.lua index a70bcd6..f649ac5 100644 --- a/coordinator/ui/components/process_ctl.lua +++ b/coordinator/ui/components/process_ctl.lua @@ -94,14 +94,14 @@ local function new_view(root, x, y) main.line_break() local auto_scram = IndicatorLight{parent=main,label="Automatic SCRAM",colors=ind_red,flash=true,period=period.BLINK_250_MS} - local matrix_dc = IndicatorLight{parent=main,label="Matrix Disconnected",colors=ind_yel,flash=true,period=period.BLINK_500_MS} + local matrix_flt = IndicatorLight{parent=main,label="Induction Matrix Fault",colors=ind_yel,flash=true,period=period.BLINK_500_MS} local matrix_fill = IndicatorLight{parent=main,label="Matrix Charge High",colors=ind_red,flash=true,period=period.BLINK_500_MS} local unit_crit = IndicatorLight{parent=main,label="Unit Critical Alarm",colors=ind_red,flash=true,period=period.BLINK_250_MS} local fac_rad_h = IndicatorLight{parent=main,label="Facility Radiation High",colors=ind_red,flash=true,period=period.BLINK_250_MS} local gen_fault = IndicatorLight{parent=main,label="Gen. Control Fault",colors=ind_yel,flash=true,period=period.BLINK_500_MS} auto_scram.register(facility.ps, "auto_scram", auto_scram.update) - matrix_dc.register(facility.ps, "as_matrix_dc", matrix_dc.update) + matrix_flt.register(facility.ps, "as_matrix_fault", matrix_flt.update) matrix_fill.register(facility.ps, "as_matrix_fill", matrix_fill.update) unit_crit.register(facility.ps, "as_crit_alarm", unit_crit.update) fac_rad_h.register(facility.ps, "as_radiation", fac_rad_h.update) diff --git a/pocket/iocontrol.lua b/pocket/iocontrol.lua index e72a573..41f6aef 100644 --- a/pocket/iocontrol.lua +++ b/pocket/iocontrol.lua @@ -148,7 +148,7 @@ function iocontrol.init_fac(conf) auto_scram = false, ---@type ascram_status ascram_status = { - matrix_dc = false, + matrix_fault = false, matrix_fill = false, crit_alarm = false, radiation = false, @@ -908,7 +908,7 @@ function iocontrol.record_process_data(data) fac.ps.publish("auto_saturated", fac.auto_saturated) fac.ps.publish("auto_scram", fac.auto_scram) - fac.ps.publish("as_matrix_dc", fac.ascram_status.matrix_dc) + fac.ps.publish("as_matrix_fault", fac.ascram_status.matrix_fault) fac.ps.publish("as_matrix_fill", fac.ascram_status.matrix_fill) fac.ps.publish("as_crit_alarm", fac.ascram_status.crit_alarm) fac.ps.publish("as_radiation", fac.ascram_status.radiation) diff --git a/pocket/startup.lua b/pocket/startup.lua index 0f6fe40..36330e3 100644 --- a/pocket/startup.lua +++ b/pocket/startup.lua @@ -20,7 +20,7 @@ local pocket = require("pocket.pocket") local renderer = require("pocket.renderer") local threads = require("pocket.threads") -local POCKET_VERSION = "v0.12.7-alpha" +local POCKET_VERSION = "v0.12.8-alpha" local println = util.println local println_ts = util.println_ts diff --git a/pocket/ui/apps/process.lua b/pocket/ui/apps/process.lua index deb7b1f..593e74c 100644 --- a/pocket/ui/apps/process.lua +++ b/pocket/ui/apps/process.lua @@ -269,7 +269,7 @@ local function new_view(root) local auto_scram = IconIndicator{parent=a_div,y=3,label="Automatic SCRAM",states=red_ind_s} TextBox{parent=a_div,y=5,text="Induction Matrix",fg_bg=label_fg_bg} - local matrix_dc = IconIndicator{parent=a_div,label="Disconnected",states=yel_ind_s} + local matrix_flt = IconIndicator{parent=a_div,label="Matrix Fault",states=yel_ind_s} local matrix_fill = IconIndicator{parent=a_div,label="Charge High",states=red_ind_s} TextBox{parent=a_div,y=9,text="Assigned Units",fg_bg=label_fg_bg} @@ -282,7 +282,7 @@ local function new_view(root) local gen_fault = IconIndicator{parent=a_div,label="Control Fault",states=yel_ind_s} auto_scram.register(f_ps, "auto_scram", auto_scram.update) - matrix_dc.register(f_ps, "as_matrix_dc", matrix_dc.update) + matrix_flt.register(f_ps, "as_matrix_fault", matrix_flt.update) matrix_fill.register(f_ps, "as_matrix_fill", matrix_fill.update) unit_crit.register(f_ps, "as_crit_alarm", unit_crit.update) fac_rad_h.register(f_ps, "as_radiation", fac_rad_h.update) diff --git a/pocket/ui/docs.lua b/pocket/ui/docs.lua index 0d4e889..f87b249 100644 --- a/pocket/ui/docs.lua +++ b/pocket/ui/docs.lua @@ -148,7 +148,7 @@ doc("auto_ramping", "Process Ramping", "Automatic process control is performing doc("auto_saturated", "Min/Max Burn Rate", "Auto control has either commanded 0 mB/t or the maximum total burn rate available (from assigned units).") sect("Automatic SCRAM") doc("auto_scram", "Automatic SCRAM", "Automatic control system SCRAM'ed the assigned reactors due to a safety hazard, shown by the below indicators.") -doc("as_matrix_dc", "Matrix Disconnected", "Automatic SCRAM occurred due to loss of induction matrix connection.") +doc("as_matrix_fault", "Matrix Fault", "Automatic SCRAM occurred due to the loss of the induction matrix connection, or the matrix being unformed or faulted.") doc("as_matrix_fill", "Matrix Charge High", "Automatic SCRAM occurred due to induction matrix charge exceeding acceptable limit.") doc("as_crit_alarm", "Unit Critical Alarm", "Automatic SCRAM occurred due to critical level unit alarm(s).") doc("as_radiation", "Facility Radiation High", "Automatic SCRAM occurred due to high facility radiation levels.") diff --git a/supervisor/facility.lua b/supervisor/facility.lua index b87d6f4..604771a 100644 --- a/supervisor/facility.lua +++ b/supervisor/facility.lua @@ -17,7 +17,7 @@ local WASTE = types.WASTE_PRODUCT ---@enum AUTO_SCRAM local AUTO_SCRAM = { NONE = 0, - MATRIX_DC = 1, + MATRIX_FAULT = 1, MATRIX_FILL = 2, CRIT_ALARM = 3, RADIATION = 4, @@ -81,7 +81,7 @@ function facility.new(config) ascram_reason = AUTO_SCRAM.NONE, ---@class ascram_status ascram_status = { - matrix_dc = false, + matrix_fault = false, matrix_fill = false, crit_alarm = false, radiation = false, @@ -599,7 +599,7 @@ function facility.new(config) self.waiting_on_ramp or self.waiting_on_stable, self.at_max_burn or self.saturated, self.ascram, - astat.matrix_dc, + astat.matrix_fault, astat.matrix_fill, astat.crit_alarm, astat.radiation, diff --git a/supervisor/facility_update.lua b/supervisor/facility_update.lua index f60fe06..b2142be 100644 --- a/supervisor/facility_update.lua +++ b/supervisor/facility_update.lua @@ -528,13 +528,19 @@ function update.auto_safety() local astatus = self.ascram_status + -- matrix related checks if self.induction[1] ~= nil then local db = self.induction[1].get_db() - -- clear matrix disconnected - if astatus.matrix_dc then - astatus.matrix_dc = false - log.info("FAC: induction matrix reconnected, clearing ASCRAM condition") + -- check for unformed or faulted state + local i_ok = db.formed and not self.induction[1].is_faulted() + + -- clear matrix fault if ok again + if astatus.matrix_fault and i_ok then + astatus.matrix_fault = false + log.info("FAC: induction matrix OK, clearing ASCRAM condition") + else + astatus.matrix_fault = i_ok end -- check matrix fill too high @@ -580,7 +586,7 @@ function update.auto_safety() end if (self.mode ~= PROCESS.INACTIVE) and (self.mode ~= PROCESS.SYSTEM_ALARM_IDLE) then - local scram = astatus.matrix_dc or astatus.matrix_fill or astatus.crit_alarm or astatus.gen_fault + local scram = astatus.matrix_fault or astatus.matrix_fill or astatus.crit_alarm or astatus.gen_fault if scram and not self.ascram then -- SCRAM all units @@ -604,14 +610,14 @@ function update.auto_safety() self.status_text = { "AUTOMATIC SCRAM", "facility radiation high" } log.info("FAC: automatic SCRAM due to high facility radiation") - elseif astatus.matrix_dc then + elseif astatus.matrix_fault then next_mode = PROCESS.MATRIX_FAULT_IDLE - self.ascram_reason = AUTO_SCRAM.MATRIX_DC - self.status_text = { "AUTOMATIC SCRAM", "induction matrix disconnected" } + self.ascram_reason = AUTO_SCRAM.MATRIX_FAULT + self.status_text = { "AUTOMATIC SCRAM", "induction matrix fault" } if self.mode ~= PROCESS.MATRIX_FAULT_IDLE then self.return_mode = self.mode end - log.info("FAC: automatic SCRAM due to induction matrix disconnection") + log.info("FAC: automatic SCRAM due to induction matrix disconnected, unformed, or faulted") elseif astatus.matrix_fill then next_mode = PROCESS.MATRIX_FAULT_IDLE self.ascram_reason = AUTO_SCRAM.MATRIX_FILL diff --git a/supervisor/startup.lua b/supervisor/startup.lua index 2011059..5a74e20 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -22,7 +22,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.5.12" +local SUPERVISOR_VERSION = "v1.5.13" local println = util.println local println_ts = util.println_ts From 627dd99dd7c534495c55abdeff3dd7bf55d26c56 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Thu, 7 Nov 2024 22:13:03 -0500 Subject: [PATCH 07/11] #566 fixes for matrix fault logic --- supervisor/facility_update.lua | 4 ++-- supervisor/startup.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/supervisor/facility_update.lua b/supervisor/facility_update.lua index 40e5b23..5e6fa07 100644 --- a/supervisor/facility_update.lua +++ b/supervisor/facility_update.lua @@ -540,7 +540,7 @@ function update.auto_safety() astatus.matrix_fault = false log.info("FAC: induction matrix OK, clearing ASCRAM condition") else - astatus.matrix_fault = i_ok + astatus.matrix_fault = not i_ok end -- check matrix fill too high @@ -555,7 +555,7 @@ function update.auto_safety() -- clears when we enter the fault waiting state astatus.gen_fault = self.mode == PROCESS.GEN_RATE and not self.units_ready else - astatus.matrix_dc = true + astatus.matrix_fault = true end -- check for critical unit alarms diff --git a/supervisor/startup.lua b/supervisor/startup.lua index 5a74e20..1fd33c7 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -22,7 +22,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.5.13" +local SUPERVISOR_VERSION = "v1.5.14" local println = util.println local println_ts = util.println_ts From 459ddbaef8302dfb78d195c94533c9977bba9d40 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Sat, 9 Nov 2024 04:01:17 +0000 Subject: [PATCH 08/11] #573 don't require and install to update the installer, cleanup --- ccmsi.lua | 150 ++++++++++++++++++++++++++---------------------------- 1 file changed, 73 insertions(+), 77 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index e1ec80c..30acde6 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -15,7 +15,7 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]]-- -local CCMSI_VERSION = "v1.19" +local CCMSI_VERSION = "v1.19a" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -149,16 +149,16 @@ local function get_remote_manifest() end -- record the local installation manifest -local function write_install_manifest(manifest, dependencies) +local function write_install_manifest(manifest, deps) local versions = {} for key, value in pairs(manifest.versions) do - local is_dependency = false - for _, dependency in pairs(dependencies) do - if (key == "bootloader" and dependency == "system") or key == dependency then - is_dependency = true;break + local is_dep = false + for _, dep in pairs(deps) do + if (key == "bootloader" and dep == "system") or key == dep then + is_dep = true;break end end - if key == app or key == "comms" or is_dependency then versions[key] = value end + if key == app or key == "comms" or is_dep then versions[key] = value end end manifest.versions = versions @@ -383,8 +383,10 @@ if mode == "check" then yellow();println("\nA different version of the installer is available, it is recommended to update (use 'ccmsi update installer').");white() end elseif mode == "install" or mode == "update" then + local ok, r_manifest, l_manifest + local update_installer = app == "installer" - local ok, manifest = get_remote_manifest() + ok, r_manifest = get_remote_manifest() if not ok then return end local ver = { @@ -397,27 +399,27 @@ elseif mode == "install" or mode == "update" then } -- try to find local versions - local local_ok, lmnf = read_local_manifest() - if not local_ok then - if mode == "update" then + ok, l_manifest = read_local_manifest() + if not update_installer then + if mode == "update" and not ok then red();println("Failed to load local installation information, cannot update.");white() return end - elseif not update_installer then - ver.boot.v_local = lmnf.versions.bootloader - ver.app.v_local = lmnf.versions[app] - ver.comms.v_local = lmnf.versions.comms - ver.common.v_local = lmnf.versions.common - ver.graphics.v_local = lmnf.versions.graphics - ver.lockbox.v_local = lmnf.versions.lockbox - if lmnf.versions[app] == nil then + ver.boot.v_local = l_manifest.versions.bootloader + ver.app.v_local = l_manifest.versions[app] + ver.comms.v_local = l_manifest.versions.comms + ver.common.v_local = l_manifest.versions.common + ver.graphics.v_local = l_manifest.versions.graphics + ver.lockbox.v_local = l_manifest.versions.lockbox + + if l_manifest.versions[app] == nil then red();println("Another application is already installed, please uninstall it before installing a new application.");white() return end end - if manifest.versions.installer ~= CCMSI_VERSION then + if r_manifest.versions.installer ~= CCMSI_VERSION then if not update_installer then yellow();println("A different version of the installer is available, it is recommended to update to it.");white() end if update_installer or ask_y_n("Would you like to update now", true) then lgray();println("GET ccmsi.lua") @@ -440,12 +442,12 @@ elseif mode == "install" or mode == "update" then return end - ver.boot.v_remote = manifest.versions.bootloader - ver.app.v_remote = manifest.versions[app] - ver.comms.v_remote = manifest.versions.comms - ver.common.v_remote = manifest.versions.common - ver.graphics.v_remote = manifest.versions.graphics - ver.lockbox.v_remote = manifest.versions.lockbox + ver.boot.v_remote = r_manifest.versions.bootloader + ver.app.v_remote = r_manifest.versions[app] + ver.comms.v_remote = r_manifest.versions.comms + ver.common.v_remote = r_manifest.versions.common + ver.graphics.v_remote = r_manifest.versions.graphics + ver.lockbox.v_remote = r_manifest.versions.lockbox green() if mode == "install" then print("Installing ") else print("Updating ") end @@ -461,36 +463,33 @@ elseif mode == "install" or mode == "update" then ver.graphics.changed = show_pkg_change("graphics", ver.graphics) ver.lockbox.changed = show_pkg_change("lockbox", ver.lockbox) - -------------------------- - -- START INSTALL/UPDATE -- - -------------------------- + -- start install/update - local space_required = manifest.sizes.manifest - local space_available = fs.getFreeSpace("/") + local space_req = r_manifest.sizes.manifest + local space_avail = fs.getFreeSpace("/") - local single_file_mode = false - local file_list = manifest.files - local size_list = manifest.sizes - local dependencies = manifest.depends[app] + local file_list = r_manifest.files + local size_list = r_manifest.sizes + local deps = r_manifest.depends[app] - table.insert(dependencies, app) + table.insert(deps, app) -- helper function to check if a dependency is unchanged - local function unchanged(dependency) - if dependency == "system" then return not ver.boot.changed - elseif dependency == "graphics" then return not ver.graphics.changed - elseif dependency == "lockbox" then return not ver.lockbox.changed - elseif dependency == "common" then return not (ver.common.changed or ver.comms.changed) - elseif dependency == app then return not ver.app.changed + local function unchanged(dep) + if dep == "system" then return not ver.boot.changed + elseif dep == "graphics" then return not ver.graphics.changed + elseif dep == "lockbox" then return not ver.lockbox.changed + elseif dep == "common" then return not (ver.common.changed or ver.comms.changed) + elseif dep == app then return not ver.app.changed else return true end end local any_change = false - for _, dependency in pairs(dependencies) do - local size = size_list[dependency] - space_required = space_required + size - any_change = any_change or not unchanged(dependency) + for _, dep in pairs(deps) do + local size = size_list[dep] + space_req = space_req + size + any_change = any_change or not unchanged(dep) end if mode == "update" and not any_change then @@ -501,10 +500,7 @@ elseif mode == "install" or mode == "update" then -- ask for confirmation if not ask_y_n("Continue", false) then return end - -- check space constraints - if space_available < space_required then - single_file_mode = true - end + local single_file_mode = space_avail < space_req local success = true @@ -548,7 +544,7 @@ elseif mode == "install" or mode == "update" then success = false return end - clean(manifest) + clean(r_manifest) sf_install(3) elseif attempt == 3 then yellow() @@ -574,30 +570,30 @@ elseif mode == "install" or mode == "update" then local abort_attempt = false success = true - for _, dependency in pairs(dependencies) do - if mode == "update" and unchanged(dependency) then - pkg_message("skipping install of unchanged package", dependency) + for _, dep in pairs(deps) do + if mode == "update" and unchanged(dep) then + pkg_message("skipping install of unchanged package", dep) else - pkg_message("installing package", dependency) + pkg_message("installing package", dep) lgray() -- beginning on the second try, delete the directory before starting if attempt >= 2 then - if dependency == "system" then - elseif dependency == "common" then + if dep == "system" then + elseif dep == "common" then if fs.exists("/scada-common") then fs.delete("/scada-common") println("deleted /scada-common") end else - if fs.exists("/"..dependency) then - fs.delete("/"..dependency) - println("deleted /"..dependency) + if fs.exists("/"..dep) then + fs.delete("/"..dep) + println("deleted /"..dep) end end end - local files = file_list[dependency] + local files = file_list[dep] for _, file in pairs(files) do println("GET "..file) mitigate_case(file) @@ -620,14 +616,14 @@ elseif mode == "install" or mode == "update" then if fs.exists(install_dir) then fs.delete(install_dir);fs.makeDir(install_dir) end -- download all dependencies - for _, dependency in pairs(dependencies) do - if mode == "update" and unchanged(dependency) then - pkg_message("skipping download of unchanged package", dependency) + for _, dep in pairs(deps) do + if mode == "update" and unchanged(dep) then + pkg_message("skipping download of unchanged package", dep) else - pkg_message("downloading package", dependency) + pkg_message("downloading package", dep) lgray() - local files = file_list[dependency] + local files = file_list[dep] for _, file in pairs(files) do println("GET "..file) local dl_stat = http_get_file(file, install_dir.."/") @@ -650,14 +646,14 @@ elseif mode == "install" or mode == "update" then -- copy in downloaded files (installation) if success then - for _, dependency in pairs(dependencies) do - if mode == "update" and unchanged(dependency) then - pkg_message("skipping install of unchanged package", dependency) + for _, dep in pairs(deps) do + if mode == "update" and unchanged(dep) then + pkg_message("skipping install of unchanged package", dep) else - pkg_message("installing package", dependency) + pkg_message("installing package", dep) lgray() - local files = file_list[dependency] + local files = file_list[dep] for _, file in pairs(files) do local temp_file = install_dir.."/"..file if fs.exists(file) then fs.delete(file) end @@ -671,13 +667,13 @@ elseif mode == "install" or mode == "update" then end if success then - write_install_manifest(manifest, dependencies) + write_install_manifest(r_manifest, deps) green() if mode == "install" then println("Installation completed successfully.") else println("Update completed successfully.") end white();println("Ready to clean up unused files, press any key to continue...") - any_key();clean(manifest) + any_key();clean(r_manifest) white();println("Done.") else red() @@ -712,14 +708,14 @@ elseif mode == "uninstall" then clean(manifest) local file_list = manifest.files - local dependencies = manifest.depends[app] + local deps = manifest.depends[app] - table.insert(dependencies, app) + table.insert(deps, app) -- delete all installed files lgray() - for _, dependency in pairs(dependencies) do - local files = file_list[dependency] + for _, dep in pairs(deps) do + local files = file_list[dep] for _, file in pairs(files) do if fs.exists(file) then fs.delete(file);println("deleted "..file) end end From 764638c212cc0e6fa6aa7d1893d6913cafc9f202 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Sat, 9 Nov 2024 06:01:37 +0000 Subject: [PATCH 09/11] #535 updates to configurator launcher --- configure.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/configure.lua b/configure.lua index ce6ed40..36aba55 100644 --- a/configure.lua +++ b/configure.lua @@ -1,11 +1,12 @@ print("CONFIGURE> SCANNING FOR CONFIGURATOR...") -if fs.exists("reactor-plc/configure.lua") then require("reactor-plc.configure").configure() -elseif fs.exists("rtu/configure.lua") then require("rtu.configure").configure() -elseif fs.exists("supervisor/configure.lua") then require("supervisor.configure").configure() -elseif fs.exists("coordinator/configure.lua") then require("coordinator.configure").configure() -elseif fs.exists("pocket/configure.lua") then require("pocket.configure").configure() -else - print("CONFIGURE> NO CONFIGURATOR FOUND") - print("CONFIGURE> EXIT") +for _, app in ipairs({ "reactor-plc", "rtu", "supervisor", "coordinator", "pocket" }) do + if fs.exists(app .. "/configure.lua") then + local _, _, launch = require(app .. ".configure").configure() + if launch then shell.execute("/startup") end + return + end end + +print("CONFIGURE> NO CONFIGURATOR FOUND") +print("CONFIGURE> EXIT") From 8439e02586c888f59f7ee576e92a49cfc0d9be35 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sat, 9 Nov 2024 11:56:56 -0500 Subject: [PATCH 10/11] #535 added startup button to configurators --- coordinator/configure.lua | 15 ++++++++++++--- coordinator/startup.lua | 2 +- pocket/configure.lua | 13 +++++++++++-- pocket/startup.lua | 2 +- reactor-plc/configure.lua | 17 +++++++++++++---- reactor-plc/startup.lua | 2 +- rtu/configure.lua | 15 ++++++++++++--- rtu/startup.lua | 2 +- startup.lua | 2 +- supervisor/configure.lua | 15 ++++++++++++--- supervisor/startup.lua | 2 +- 11 files changed, 66 insertions(+), 21 deletions(-) diff --git a/coordinator/configure.lua b/coordinator/configure.lua index 3c9bfe7..453cc44 100644 --- a/coordinator/configure.lua +++ b/coordinator/configure.lua @@ -58,6 +58,7 @@ style.btn_dis_fg_bg = cpair(colors.lightGray,colors.white) local tool_ctl = { sv_cool_conf = nil, ---@type [ integer, integer ][] list of boiler & turbine counts + launch_startup = false, start_fail = 0, fail_message = "", has_config = false, @@ -236,9 +237,17 @@ local function config_view(display) main_pane.set_value(8) end + local function startup() + tool_ctl.launch_startup = true + exit() + end + PushButton{parent=main_page,x=2,y=17,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg} - tool_ctl.color_cfg = PushButton{parent=main_page,x=23,y=17,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=cpair(colors.lightGray,colors.white)} - PushButton{parent=main_page,x=39,y=17,min_width=12,text="Change Log",callback=function()main_pane.set_value(10)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} + local start_btn = PushButton{parent=main_page,x=42,y=17,min_width=9,text="Startup",callback=startup,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} + tool_ctl.color_cfg = PushButton{parent=main_page,x=36,y=y_start,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=cpair(colors.lightGray,colors.white)} + PushButton{parent=main_page,x=39,y=y_start+2,min_width=12,text="Change Log",callback=function()main_pane.set_value(10)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} + + if tool_ctl.start_fail ~= 0 then start_btn.disable() end if not tool_ctl.has_config then tool_ctl.view_cfg.disable() @@ -372,7 +381,7 @@ function configurator.configure(start_code, message) println("configurator error: " .. error) end - return status, error + return status, error, tool_ctl.launch_startup end return configurator diff --git a/coordinator/startup.lua b/coordinator/startup.lua index 7b08aba..b6ee0ed 100644 --- a/coordinator/startup.lua +++ b/coordinator/startup.lua @@ -19,7 +19,7 @@ local renderer = require("coordinator.renderer") local sounder = require("coordinator.sounder") local threads = require("coordinator.threads") -local COORDINATOR_VERSION = "v1.5.14" +local COORDINATOR_VERSION = "v1.5.15" local CHUNK_LOAD_DELAY_S = 30.0 diff --git a/pocket/configure.lua b/pocket/configure.lua index 69a99c7..175be03 100644 --- a/pocket/configure.lua +++ b/pocket/configure.lua @@ -50,6 +50,7 @@ style.btn_dis_fg_bg = cpair(colors.lightGray, colors.white) ---@class _pkt_cfg_tool_ctl local tool_ctl = { + launch_startup = false, ask_config = false, has_config = false, viewing_config = false, @@ -162,8 +163,16 @@ local function config_view(display) if not tool_ctl.has_config then tool_ctl.view_cfg.disable() end + local function startup() + tool_ctl.launch_startup = true + exit() + end + PushButton{parent=main_page,x=2,y=18,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg} - PushButton{parent=main_page,x=14,y=18,min_width=12,text="Change Log",callback=function()main_pane.set_value(6)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} + local start_btn = PushButton{parent=main_page,x=17,y=18,min_width=9,text="Startup",callback=startup,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} + PushButton{parent=main_page,x=2,y=y_start+4,min_width=12,text="Change Log",callback=function()main_pane.set_value(6)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} + + if tool_ctl.ask_config then start_btn.disable() end --#endregion @@ -254,7 +263,7 @@ function configurator.configure(ask_config) println("configurator error: " .. error) end - return status, error + return status, error, tool_ctl.launch_startup end return configurator diff --git a/pocket/startup.lua b/pocket/startup.lua index 36330e3..29a84e3 100644 --- a/pocket/startup.lua +++ b/pocket/startup.lua @@ -20,7 +20,7 @@ local pocket = require("pocket.pocket") local renderer = require("pocket.renderer") local threads = require("pocket.threads") -local POCKET_VERSION = "v0.12.8-alpha" +local POCKET_VERSION = "v0.12.9-alpha" local println = util.println local println_ts = util.println_ts diff --git a/reactor-plc/configure.lua b/reactor-plc/configure.lua index 828c2e6..db0d507 100644 --- a/reactor-plc/configure.lua +++ b/reactor-plc/configure.lua @@ -53,6 +53,7 @@ style.btn_dis_fg_bg = cpair(colors.lightGray, colors.white) ---@class _plc_cfg_tool_ctl local tool_ctl = { + launch_startup = false, ask_config = false, has_config = false, viewing_config = false, @@ -184,10 +185,18 @@ local function config_view(display) main_pane.set_value(5) end + local function startup() + tool_ctl.launch_startup = true + exit() + end + PushButton{parent=main_page,x=2,y=17,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg} - PushButton{parent=main_page,x=10,y=17,min_width=12,text="Self-Check",callback=function()main_pane.set_value(8)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} - tool_ctl.color_cfg = PushButton{parent=main_page,x=23,y=17,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} - PushButton{parent=main_page,x=39,y=17,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} + local start_btn = PushButton{parent=main_page,x=42,y=17,min_width=9,text="Startup",callback=startup,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} + PushButton{parent=main_page,x=39,y=y_start,min_width=12,text="Self-Check",callback=function()main_pane.set_value(8)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} + tool_ctl.color_cfg = PushButton{parent=main_page,x=36,y=y_start+2,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} + PushButton{parent=main_page,x=39,y=y_start+4,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} + + if tool_ctl.ask_config then start_btn.disable() end if not tool_ctl.has_config then tool_ctl.view_cfg.disable() @@ -293,7 +302,7 @@ function configurator.configure(ask_config) println("configurator error: " .. error) end - return status, error + return status, error, tool_ctl.launch_startup end return configurator diff --git a/reactor-plc/startup.lua b/reactor-plc/startup.lua index 67dc290..6a6643a 100644 --- a/reactor-plc/startup.lua +++ b/reactor-plc/startup.lua @@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc") local renderer = require("reactor-plc.renderer") local threads = require("reactor-plc.threads") -local R_PLC_VERSION = "v1.8.12" +local R_PLC_VERSION = "v1.8.13" local println = util.println local println_ts = util.println_ts diff --git a/rtu/configure.lua b/rtu/configure.lua index d4453d1..e623731 100644 --- a/rtu/configure.lua +++ b/rtu/configure.lua @@ -55,6 +55,7 @@ style.btn_dis_fg_bg = cpair(colors.lightGray, colors.white) ---@class _rtu_cfg_tool_ctl local tool_ctl = { + launch_startup = false, ask_config = false, has_config = false, viewing_config = false, @@ -218,9 +219,17 @@ local function config_view(display) main_pane.set_value(5) end + local function startup() + tool_ctl.launch_startup = true + exit() + end + PushButton{parent=main_page,x=2,y=17,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg} - tool_ctl.color_cfg = PushButton{parent=main_page,x=23,y=17,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} - PushButton{parent=main_page,x=39,y=17,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} + local start_btn = PushButton{parent=main_page,x=42,y=17,min_width=9,text="Startup",callback=startup,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} + tool_ctl.color_cfg = PushButton{parent=main_page,x=36,y=y_start,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} + PushButton{parent=main_page,x=39,y=y_start+2,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} + + if tool_ctl.ask_config then start_btn.disable() end if not tool_ctl.has_config then tool_ctl.view_gw_cfg.disable() @@ -346,7 +355,7 @@ function configurator.configure(ask_config) println("configurator error: " .. error) end - return status, error + return status, error, tool_ctl.launch_startup end return configurator diff --git a/rtu/startup.lua b/rtu/startup.lua index f5ec27f..3f5c3c1 100644 --- a/rtu/startup.lua +++ b/rtu/startup.lua @@ -31,7 +31,7 @@ local sna_rtu = require("rtu.dev.sna_rtu") local sps_rtu = require("rtu.dev.sps_rtu") local turbinev_rtu = require("rtu.dev.turbinev_rtu") -local RTU_VERSION = "v1.10.14" +local RTU_VERSION = "v1.10.15" local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE local RTU_HW_STATE = databus.RTU_HW_STATE diff --git a/startup.lua b/startup.lua index 662d989..97122b6 100644 --- a/startup.lua +++ b/startup.lua @@ -1,4 +1,4 @@ -local BOOTLOADER_VERSION = "1.1" +local BOOTLOADER_VERSION = "1.2" print("SCADA BOOTLOADER V" .. BOOTLOADER_VERSION) print("BOOT> SCANNING FOR APPLICATIONS...") diff --git a/supervisor/configure.lua b/supervisor/configure.lua index aaab65e..0b1b558 100644 --- a/supervisor/configure.lua +++ b/supervisor/configure.lua @@ -51,6 +51,7 @@ style.btn_dis_fg_bg = cpair(colors.lightGray, colors.white) ---@class _svr_cfg_tool_ctl local tool_ctl = { + launch_startup = false, ask_config = false, has_config = false, viewing_config = false, @@ -201,9 +202,17 @@ local function config_view(display) main_pane.set_value(5) end + local function startup() + tool_ctl.launch_startup = true + exit() + end + PushButton{parent=main_page,x=2,y=17,min_width=6,text="Exit",callback=exit,fg_bg=cpair(colors.black,colors.red),active_fg_bg=btn_act_fg_bg} - tool_ctl.color_cfg = PushButton{parent=main_page,x=23,y=17,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} - PushButton{parent=main_page,x=39,y=17,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} + local start_btn = PushButton{parent=main_page,x=42,y=17,min_width=9,text="Startup",callback=startup,fg_bg=cpair(colors.black,colors.green),active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} + tool_ctl.color_cfg = PushButton{parent=main_page,x=36,y=y_start,min_width=15,text="Color Options",callback=jump_color,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg,dis_fg_bg=btn_dis_fg_bg} + PushButton{parent=main_page,x=39,y=y_start+2,min_width=12,text="Change Log",callback=function()main_pane.set_value(7)end,fg_bg=nav_fg_bg,active_fg_bg=btn_act_fg_bg} + + if tool_ctl.ask_config then start_btn.disable() end if not tool_ctl.has_config then tool_ctl.view_cfg.disable() @@ -308,7 +317,7 @@ function configurator.configure(ask_config) println("configurator error: " .. error) end - return status, error + return status, error, tool_ctl.launch_startup end return configurator diff --git a/supervisor/startup.lua b/supervisor/startup.lua index 1fd33c7..4d31d6a 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -22,7 +22,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v1.5.14" +local SUPERVISOR_VERSION = "v1.5.15" local println = util.println local println_ts = util.println_ts From d36f7adab11cb7f20832b0f3a06e19e39c6cda4f Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sat, 9 Nov 2024 12:10:50 -0500 Subject: [PATCH 11/11] #573 fix to install --- ccmsi.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index 30acde6..5a70580 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -15,7 +15,7 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]]-- -local CCMSI_VERSION = "v1.19a" +local CCMSI_VERSION = "v1.19b" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -400,22 +400,22 @@ elseif mode == "install" or mode == "update" then -- try to find local versions ok, l_manifest = read_local_manifest() - if not update_installer then - if mode == "update" and not ok then + if mode == "update" and not update_installer then + if not ok then red();println("Failed to load local installation information, cannot update.");white() return - end + else + ver.boot.v_local = l_manifest.versions.bootloader + ver.app.v_local = l_manifest.versions[app] + ver.comms.v_local = l_manifest.versions.comms + ver.common.v_local = l_manifest.versions.common + ver.graphics.v_local = l_manifest.versions.graphics + ver.lockbox.v_local = l_manifest.versions.lockbox - ver.boot.v_local = l_manifest.versions.bootloader - ver.app.v_local = l_manifest.versions[app] - ver.comms.v_local = l_manifest.versions.comms - ver.common.v_local = l_manifest.versions.common - ver.graphics.v_local = l_manifest.versions.graphics - ver.lockbox.v_local = l_manifest.versions.lockbox - - if l_manifest.versions[app] == nil then - red();println("Another application is already installed, please uninstall it before installing a new application.");white() - return + if l_manifest.versions[app] == nil then + red();println("Another application is already installed, please uninstall it before installing a new application.");white() + return + end end end