From 9266d7d8e1fa9e7e7ac669e56c938507e3327949 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 00:40:01 -0400 Subject: [PATCH 01/11] #258 versioned graphics component --- ccmsi.lua | 267 ++++++++++++++++++++---------------------- graphics/core.lua | 2 + imgen.py | 7 +- install_manifest.json | 2 +- 4 files changed, 137 insertions(+), 141 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index a8fff8a..b3bc16d 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -20,7 +20,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local function println(message) print(tostring(message)) end local function print(message) term.write(tostring(message)) end -local CCMSI_VERSION = "v1.2" +local CCMSI_VERSION = "v1.3" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -54,6 +54,68 @@ local function write_install_manifest(manifest, dependencies) imfile.close() end +-- ask the user yes or no +---@nodiscard +---@param question string +---@param default boolean +---@return boolean|nil +local function ask_y_n(question, default) + print(question) + + if default == true then + print(" (Y/n)? ") + else + print(" (y/N)? ") + end + + local response = read(nil, nil) + + if response == "" then + return default + elseif response == "Y" or response == "y" then + return true + elseif response == "N" or response == "n" then + return false + else + return nil + end +end + +-- print out a white + blue text message
+-- automatically adds a space +---@param message string message +---@param package string dependency/package/version +local function pkg_message(message, package) + term.setTextColor(colors.white) + print(message .. " ") + term.setTextColor(colors.blue) + println(package) + term.setTextColor(colors.white) +end + +-- indicate actions to be taken based on package differences for installs/updates +---@param name string package name +---@param _local_v string|nil local version +---@param _remote_v string remote version +local function show_pkg_change(name, _local_v, _remote_v) + if _local_v ~= nil then + if _local_v ~= _remote_v then + print("[" .. name .. "] updating ") + term.setTextColor(colors.blue) + print(_local_v) + term.setTextColor(colors.white) + print(" \xbb ") + term.setTextColor(colors.blue) + println(_local_v) + term.setTextColor(colors.white) + elseif mode == "install" then + pkg_message("[" .. name .. "] reinstalling", _local_v) + end + else + pkg_message("[" .. name .. "] new install of", _remote_v) + end +end + -- -- get and validate command line options -- @@ -230,6 +292,13 @@ elseif mode == "install" or mode == "update" then -- GET LOCAL MANIFEST -- ------------------------ + local ver = { + app = { v_local = nil, v_remote = nil, changed = false }, + boot = { v_local = nil, v_remote = nil, changed = false }, + comms = { v_local = nil, v_remote = nil, changed = false }, + graphics = { v_local = nil, v_remote = nil, changed = false } + } + local imfile = fs.open("install_manifest.json", "r") local local_ok = false local local_manifest = {} @@ -239,10 +308,6 @@ elseif mode == "install" or mode == "update" then imfile.close() end - local local_app_version = nil - local local_comms_version = nil - local local_boot_version = nil - -- try to find local versions if not local_ok then if mode == "update" then @@ -252,9 +317,10 @@ elseif mode == "install" or mode == "update" then return end else - local_app_version = local_manifest.versions[app] - local_comms_version = local_manifest.versions.comms - local_boot_version = local_manifest.versions.bootloader + ver.boot.v_local = local_manifest.versions.bootloader + ver.app.v_local = local_manifest.versions[app] + ver.comms.v_local = local_manifest.versions.comms + ver.graphics.v_local = local_manifest.versions.graphics if local_manifest.versions[app] == nil then term.setTextColor(colors.red) @@ -271,93 +337,43 @@ elseif mode == "install" or mode == "update" then end end - local remote_app_version = manifest.versions[app] - local remote_comms_version = manifest.versions.comms - local remote_boot_version = manifest.versions.bootloader + ver.boot.v_remote = manifest.versions.bootloader + ver.app.v_remote = manifest.versions[app] + ver.comms.v_remote = manifest.versions.comms + ver.graphics.v_remote = manifest.versions.graphics term.setTextColor(colors.green) if mode == "install" then - println("installing " .. app .. " files...") + println("Installing " .. app .. " files...") elseif mode == "update" then - println("updating " .. app .. " files... (keeping old config.lua)") + println("Updating " .. app .. " files... (keeping old config.lua)") end term.setTextColor(colors.white) -- display bootloader version change information - if local_boot_version ~= nil then - if local_boot_version ~= remote_boot_version then - print("[bootldr] updating ") - term.setTextColor(colors.blue) - print(local_boot_version) - term.setTextColor(colors.white) - print(" \xbb ") - term.setTextColor(colors.blue) - println(remote_boot_version) - term.setTextColor(colors.white) - elseif mode == "install" then - print("[bootldr] reinstalling ") - term.setTextColor(colors.blue) - println(local_boot_version) - term.setTextColor(colors.white) - end - else - print("[bootldr] new install of ") - term.setTextColor(colors.blue) - println(remote_boot_version) - term.setTextColor(colors.white) - end + show_pkg_change("bootldr", ver.boot.v_local, ver.boot.v_remote) + ver.boot.changed = ver.boot.v_local ~= ver.boot.v_remote -- display app version change information - if local_app_version ~= nil then - if local_app_version ~= remote_app_version then - print("[" .. app .. "] updating ") - term.setTextColor(colors.blue) - print(local_app_version) - term.setTextColor(colors.white) - print(" \xbb ") - term.setTextColor(colors.blue) - println(remote_app_version) - term.setTextColor(colors.white) - elseif mode == "install" then - print("[" .. app .. "] reinstalling ") - term.setTextColor(colors.blue) - println(local_app_version) - term.setTextColor(colors.white) - end - else - print("[" .. app .. "] new install of ") - term.setTextColor(colors.blue) - println(remote_app_version) + show_pkg_change(app, ver.app.v_local, ver.app.v_remote) + ver.app.changed = ver.app.v_local ~= ver.app.v_remote + + -- display comms version change information + show_pkg_change("comms", ver.comms.v_local, ver.comms.v_remote) + ver.comms.changed = ver.comms.v_local ~= ver.comms.v_remote + if ver.comms.changed then + print("[comms] ") + term.setTextColor(colors.yellow) + println("other devices on the network will require an update") term.setTextColor(colors.white) end - -- display comms version change information - if local_comms_version ~= nil then - if local_comms_version ~= remote_comms_version then - print("[comms] updating ") - term.setTextColor(colors.blue) - print(local_comms_version) - term.setTextColor(colors.white) - print(" \xbb ") - term.setTextColor(colors.blue) - println(remote_comms_version) - term.setTextColor(colors.white) - print("[comms] ") - term.setTextColor(colors.yellow) - println("other devices on the network will require an update") - term.setTextColor(colors.white) - elseif mode == "install" then - print("[comms] reinstalling ") - term.setTextColor(colors.blue) - println(local_comms_version) - term.setTextColor(colors.white) - end - else - print("[comms] new install of ") - term.setTextColor(colors.blue) - println(remote_comms_version) - term.setTextColor(colors.white) - end + -- display graphics version change information + show_pkg_change("graphics", ver.graphics.v_local, ver.graphics.v_remote) + ver.graphics.changed = ver.graphics.v_local ~= ver.graphics.v_remote + + -- ask for confirmation + if not ask_y_n("Continue?", false) then return end -------------------------- -- START INSTALL/UPDATE -- @@ -386,18 +402,13 @@ elseif mode == "install" or mode == "update" then println("WARNING: Insufficient space available for a full download!") term.setTextColor(colors.white) println("Files can be downloaded one by one, so if you are replacing a current install this will not be a problem unless installation fails.") - println("Do you wish to continue? (y/N)") - - local confirm = read() - if confirm ~= "y" and confirm ~= "Y" then - println("installation cancelled") + if mode == "update" then println("If installation still fails, delete this device's log file and try again.") end + if not ask_y_n("Do you wish to continue?", false) then + println("Operation cancelled.") return end end ----@diagnostic disable-next-line: undefined-field - os.sleep(2) - local success = true if not single_file_mode then @@ -408,20 +419,14 @@ elseif mode == "install" or mode == "update" then -- download all dependencies for _, dependency in pairs(dependencies) do - if mode == "update" and ((dependency == "system" and local_boot_version == remote_boot_version) or (local_app_version == remote_app_version)) then - -- skip system package if unchanged, skip app package if not changed - -- skip packages that have no version if app version didn't change - term.setTextColor(colors.white) - print("skipping download of unchanged package ") - term.setTextColor(colors.blue) - println(dependency) + if mode == "update" and ((dependency == "system" and ver.boot.changed) or + (dependency == "graphics" and ver.graphics.changed) or + (ver.changed.app)) then + pkg_message("skipping download of unchanged package", dependency) else - term.setTextColor(colors.white) - print("downloading package ") - term.setTextColor(colors.blue) - println(dependency) - + pkg_message("downloading package", dependency) term.setTextColor(colors.lightGray) + local files = file_list[dependency] for _, file in pairs(files) do println("GET " .. file) @@ -444,20 +449,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 ((dependency == "system" and local_boot_version == remote_boot_version) or (local_app_version == remote_app_version)) then - -- skip system package if unchanged, skip app package if not changed - -- skip packages that have no version if app version didn't change - term.setTextColor(colors.white) - print("skipping install of unchanged package ") - term.setTextColor(colors.blue) - println(dependency) + if mode == "update" and ((dependency == "system" and ver.boot.changed) or + (dependency == "graphics" and ver.graphics.changed) or + (ver.changed.app)) then + pkg_message("skipping install of unchanged package", dependency) else - term.setTextColor(colors.white) - print("installing package ") - term.setTextColor(colors.blue) - println(dependency) - + pkg_message("installing package", dependency) term.setTextColor(colors.lightGray) + local files = file_list[dependency] for _, file in pairs(files) do if mode == "install" or file ~= config_file then @@ -478,36 +477,30 @@ elseif mode == "install" or mode == "update" then write_install_manifest(manifest, dependencies) term.setTextColor(colors.green) if mode == "install" then - println("installation completed successfully") + println("Installation completed successfully.") else - println("update completed successfully") + println("Update completed successfully.") end else if mode == "install" then term.setTextColor(colors.red) - println("installation failed") + println("Installation failed.") else term.setTextColor(colors.orange) - println("update failed, existing files unmodified") + println("Update failed, existing files unmodified.") end end else -- go through all files and replace one by one for _, dependency in pairs(dependencies) do - if mode == "update" and ((dependency == "system" and local_boot_version == remote_boot_version) or (local_app_version == remote_app_version)) then - -- skip system package if unchanged, skip app package if not changed - -- skip packages that have no version if app version didn't change - term.setTextColor(colors.white) - print("skipping install of unchanged package ") - term.setTextColor(colors.blue) - println(dependency) + if mode == "update" and ((dependency == "system" and ver.boot.changed) or + (dependency == "graphics" and ver.graphics.changed) or + (ver.changed.app)) then + pkg_message("skipping install of unchanged package", dependency) else - term.setTextColor(colors.white) - print("installing package ") - term.setTextColor(colors.blue) - println(dependency) - + pkg_message("installing package", dependency) term.setTextColor(colors.lightGray) + local files = file_list[dependency] for _, file in pairs(files) do if mode == "install" or file ~= config_file then @@ -534,16 +527,16 @@ elseif mode == "install" or mode == "update" then write_install_manifest(manifest, dependencies) term.setTextColor(colors.green) if mode == "install" then - println("installation completed successfully") + println("Installation completed successfully.") else - println("update completed successfully") + println("Update completed successfully.") end else term.setTextColor(colors.red) if mode == "install" then - println("installation failed, files may have been skipped") + println("Installation failed, files may have been skipped.") else - println("update failed, files may have been skipped") + println("Update failed, files may have been skipped.") end end end @@ -576,8 +569,8 @@ elseif mode == "remove" or mode == "purge" then println("purging all " .. app .. " files...") end ----@diagnostic disable-next-line: undefined-field - os.sleep(2) + -- ask for confirmation + if not ask_y_n("Continue?", false) then return end local file_list = manifest.files local dependencies = manifest.depends[app] @@ -666,7 +659,7 @@ elseif mode == "remove" or mode == "purge" then end term.setTextColor(colors.green) - println("done!") + println("Done!") end term.setTextColor(colors.white) diff --git a/graphics/core.lua b/graphics/core.lua index 58b6b8c..d99ef3b 100644 --- a/graphics/core.lua +++ b/graphics/core.lua @@ -7,6 +7,8 @@ local flasher = require("graphics.flasher") local core = {} +core.version = "1.0.0" + core.flasher = flasher core.events = events diff --git a/imgen.py b/imgen.py index bd34822..63f28cf 100644 --- a/imgen.py +++ b/imgen.py @@ -23,11 +23,11 @@ def dir_size(path): return total # get the version of an application at the provided path -def get_version(path, is_comms = False): +def get_version(path, is_lib = False): ver = "" - string = "comms.version = \"" + string = ".version = \"" - if not is_comms: + if not is_lib: string = "_VERSION = \"" f = open(path, "r") @@ -49,6 +49,7 @@ def make_manifest(size): "installer" : get_version("./ccmsi.lua"), "bootloader" : get_version("./startup.lua"), "comms" : get_version("./scada-common/comms.lua", True), + "graphics" : get_version("./graphics/core.lua", True), "reactor-plc" : get_version("./reactor-plc/startup.lua"), "rtu" : get_version("./rtu/startup.lua"), "supervisor" : get_version("./supervisor/startup.lua"), diff --git a/install_manifest.json b/install_manifest.json index c75c072..62b1edc 100644 --- a/install_manifest.json +++ b/install_manifest.json @@ -1 +1 @@ -{"versions": {"installer": "v1.2", "bootloader": "0.2", "comms": "2.0.0", "reactor-plc": "v1.4.6", "rtu": "v1.3.6", "supervisor": "v0.17.7", "coordinator": "v0.16.1", "pocket": "alpha-v0.4.5"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common", "graphics"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5781, "system": 1991, "common": 92736, "graphics": 144532, "lockbox": 100797, "reactor-plc": 97335, "rtu": 102240, "supervisor": 315402, "coordinator": 197991, "pocket": 37581}} \ No newline at end of file +{"versions": {"installer": "v1.3", "bootloader": "0.2", "comms": "2.0.0", "graphics": "1.0.0", "reactor-plc": "v1.4.6", "rtu": "v1.3.6", "supervisor": "v0.17.7", "coordinator": "v0.16.1", "pocket": "alpha-v0.4.5"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common", "graphics"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5802, "system": 1991, "common": 92736, "graphics": 144556, "lockbox": 100797, "reactor-plc": 97335, "rtu": 102240, "supervisor": 315402, "coordinator": 197991, "pocket": 37581}} \ No newline at end of file From bc8703049161c2a9b439311e35700714592357c1 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 00:48:06 -0400 Subject: [PATCH 02/11] #258 installer improvements and test change to graphics version --- ccmsi.lua | 31 +++++++++++++++---------------- graphics/core.lua | 2 +- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index b3bc16d..0c62acf 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -20,7 +20,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local function println(message) print(tostring(message)) end local function print(message) term.write(tostring(message)) end -local CCMSI_VERSION = "v1.3" +local CCMSI_VERSION = "v1.4" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -95,24 +95,24 @@ end -- indicate actions to be taken based on package differences for installs/updates ---@param name string package name ----@param _local_v string|nil local version ----@param _remote_v string remote version -local function show_pkg_change(name, _local_v, _remote_v) - if _local_v ~= nil then - if _local_v ~= _remote_v then +---@param v_local string|nil local version +---@param v_remote string remote version +local function show_pkg_change(name, v_local, v_remote) + if v_local ~= nil then + if v_local ~= v_remote then print("[" .. name .. "] updating ") term.setTextColor(colors.blue) - print(_local_v) + print(v_local) term.setTextColor(colors.white) print(" \xbb ") term.setTextColor(colors.blue) - println(_local_v) + println(v_local) term.setTextColor(colors.white) elseif mode == "install" then - pkg_message("[" .. name .. "] reinstalling", _local_v) + pkg_message("[" .. name .. "] reinstalling", v_local) end else - pkg_message("[" .. name .. "] new install of", _remote_v) + pkg_message("[" .. name .. "] new install of", v_remote) end end @@ -123,12 +123,12 @@ end println("-- CC Mekanism SCADA Installer " .. CCMSI_VERSION .. " --") if #opts == 0 or opts[1] == "help" then - println("usage: ccmsi ") + println("usage: ccmsi ") println("") term.setTextColor(colors.lightGray) println(" check - check latest versions avilable") term.setTextColor(colors.yellow) - println(" ccmsi check for target") + println(" ccmsi check for target") term.setTextColor(colors.lightGray) println(" install - fresh install, overwrites config") println(" update - update files EXCEPT for config/logs") @@ -143,12 +143,11 @@ if #opts == 0 or opts[1] == "help" then println(" coordinator - coordinator application") println(" pocket - pocket application") term.setTextColor(colors.white) - println("") + println("") term.setTextColor(colors.yellow) println(" second parameter when used with check") term.setTextColor(colors.lightGray) - println(" note: defaults to main") - println(" target GitHub tag or branch name") + println(" main (default) | latest | devel") return else for _, v in pairs({ "check", "install", "update", "remove", "purge" }) do @@ -361,7 +360,7 @@ elseif mode == "install" or mode == "update" then -- display comms version change information show_pkg_change("comms", ver.comms.v_local, ver.comms.v_remote) ver.comms.changed = ver.comms.v_local ~= ver.comms.v_remote - if ver.comms.changed then + if ver.comms.changed and mode == "update" then print("[comms] ") term.setTextColor(colors.yellow) println("other devices on the network will require an update") diff --git a/graphics/core.lua b/graphics/core.lua index d99ef3b..657bc0d 100644 --- a/graphics/core.lua +++ b/graphics/core.lua @@ -7,7 +7,7 @@ local flasher = require("graphics.flasher") local core = {} -core.version = "1.0.0" +core.version = "1.0.0-test" core.flasher = flasher core.events = events From 49db75f34db4a36cb0f05875351fca45d8dc421a Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 01:04:40 -0400 Subject: [PATCH 03/11] #258 installer bugfix --- ccmsi.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index 0c62acf..dd66062 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -20,7 +20,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local function println(message) print(tostring(message)) end local function print(message) term.write(tostring(message)) end -local CCMSI_VERSION = "v1.4" +local CCMSI_VERSION = "v1.4a" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -38,13 +38,13 @@ local function write_install_manifest(manifest, dependencies) for key, value in pairs(manifest.versions) do local is_dependency = false for _, dependency in pairs(dependencies) do - if key == "bootloader" and dependency == "system" then + if (key == "bootloader" and dependency == "system") or key == dependency then is_dependency = true break end end - if key == app or key == "comms" or is_dependency then versions[key] = value end + if key == app or is_dependency then versions[key] = value end end manifest.versions = versions @@ -420,7 +420,7 @@ elseif mode == "install" or mode == "update" then for _, dependency in pairs(dependencies) do if mode == "update" and ((dependency == "system" and ver.boot.changed) or (dependency == "graphics" and ver.graphics.changed) or - (ver.changed.app)) then + (ver.app.changed)) then pkg_message("skipping download of unchanged package", dependency) else pkg_message("downloading package", dependency) @@ -450,7 +450,7 @@ elseif mode == "install" or mode == "update" then for _, dependency in pairs(dependencies) do if mode == "update" and ((dependency == "system" and ver.boot.changed) or (dependency == "graphics" and ver.graphics.changed) or - (ver.changed.app)) then + (ver.app.changed)) then pkg_message("skipping install of unchanged package", dependency) else pkg_message("installing package", dependency) @@ -494,7 +494,7 @@ elseif mode == "install" or mode == "update" then for _, dependency in pairs(dependencies) do if mode == "update" and ((dependency == "system" and ver.boot.changed) or (dependency == "graphics" and ver.graphics.changed) or - (ver.changed.app)) then + (ver.app.changed)) then pkg_message("skipping install of unchanged package", dependency) else pkg_message("installing package", dependency) From d42327a20d5f7ce57283e76687b19dfb093c9694 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 01:09:46 -0400 Subject: [PATCH 04/11] #258 bugfixes --- ccmsi.lua | 22 +++++++++++----------- graphics/core.lua | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index dd66062..7fefba7 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -20,7 +20,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local function println(message) print(tostring(message)) end local function print(message) term.write(tostring(message)) end -local CCMSI_VERSION = "v1.4a" +local CCMSI_VERSION = "v1.4b" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -44,7 +44,7 @@ local function write_install_manifest(manifest, dependencies) end end - if key == app or is_dependency then versions[key] = value end + if key == app or key == "comms" or is_dependency then versions[key] = value end end manifest.versions = versions @@ -418,9 +418,9 @@ elseif mode == "install" or mode == "update" then -- download all dependencies for _, dependency in pairs(dependencies) do - if mode == "update" and ((dependency == "system" and ver.boot.changed) or - (dependency == "graphics" and ver.graphics.changed) or - (ver.app.changed)) then + if mode == "update" and ((dependency == "system" and not ver.boot.changed) or + (dependency == "graphics" and not ver.graphics.changed) or + (not ver.app.changed)) then pkg_message("skipping download of unchanged package", dependency) else pkg_message("downloading package", dependency) @@ -448,9 +448,9 @@ 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 ((dependency == "system" and ver.boot.changed) or - (dependency == "graphics" and ver.graphics.changed) or - (ver.app.changed)) then + if mode == "update" and ((dependency == "system" and not ver.boot.changed) or + (dependency == "graphics" and not ver.graphics.changed) or + (not ver.app.changed)) then pkg_message("skipping install of unchanged package", dependency) else pkg_message("installing package", dependency) @@ -492,9 +492,9 @@ elseif mode == "install" or mode == "update" then else -- go through all files and replace one by one for _, dependency in pairs(dependencies) do - if mode == "update" and ((dependency == "system" and ver.boot.changed) or - (dependency == "graphics" and ver.graphics.changed) or - (ver.app.changed)) then + if mode == "update" and ((dependency == "system" and not ver.boot.changed) or + (dependency == "graphics" and not ver.graphics.changed) or + (not ver.app.changed)) then pkg_message("skipping install of unchanged package", dependency) else pkg_message("installing package", dependency) diff --git a/graphics/core.lua b/graphics/core.lua index 657bc0d..c343308 100644 --- a/graphics/core.lua +++ b/graphics/core.lua @@ -7,7 +7,7 @@ local flasher = require("graphics.flasher") local core = {} -core.version = "1.0.0-test" +core.version = "1.0.0-test2" core.flasher = flasher core.events = events From aef8281ad66186be6cf4b82430859ac9469beae2 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 01:19:00 -0400 Subject: [PATCH 05/11] #258 more installer fixes --- ccmsi.lua | 25 +++++++++++++++---------- graphics/core.lua | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index 7fefba7..0b42bd9 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -20,7 +20,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local function println(message) print(tostring(message)) end local function print(message) term.write(tostring(message)) end -local CCMSI_VERSION = "v1.4b" +local CCMSI_VERSION = "v1.4c" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -410,6 +410,17 @@ elseif mode == "install" or mode == "update" then local success = true + -- helper function to check if a dependency is unchanged + ---@nodiscard + ---@param dependency string + ---@return boolean + local function unchanged(dependency) + if dependency == "system" then return not ver.boot.changed + elseif dependency == "graphics" then return not ver.graphics.changed + elseif dependency == app then return not ver.app.changed + else return true end + end + if not single_file_mode then if fs.exists(install_dir) then fs.delete(install_dir) @@ -418,9 +429,7 @@ elseif mode == "install" or mode == "update" then -- download all dependencies for _, dependency in pairs(dependencies) do - if mode == "update" and ((dependency == "system" and not ver.boot.changed) or - (dependency == "graphics" and not ver.graphics.changed) or - (not ver.app.changed)) then + if mode == "update" and unchanged(dependency) then pkg_message("skipping download of unchanged package", dependency) else pkg_message("downloading package", dependency) @@ -448,9 +457,7 @@ 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 ((dependency == "system" and not ver.boot.changed) or - (dependency == "graphics" and not ver.graphics.changed) or - (not ver.app.changed)) then + if mode == "update" and unchanged(dependency) then pkg_message("skipping install of unchanged package", dependency) else pkg_message("installing package", dependency) @@ -492,9 +499,7 @@ elseif mode == "install" or mode == "update" then else -- go through all files and replace one by one for _, dependency in pairs(dependencies) do - if mode == "update" and ((dependency == "system" and not ver.boot.changed) or - (dependency == "graphics" and not ver.graphics.changed) or - (not ver.app.changed)) then + if mode == "update" and unchanged(dependency) then pkg_message("skipping install of unchanged package", dependency) else pkg_message("installing package", dependency) diff --git a/graphics/core.lua b/graphics/core.lua index c343308..27ede11 100644 --- a/graphics/core.lua +++ b/graphics/core.lua @@ -7,7 +7,7 @@ local flasher = require("graphics.flasher") local core = {} -core.version = "1.0.0-test2" +core.version = "1.0.0-test3" core.flasher = flasher core.events = events From a2fa6570dcfbca1f53486aab7382fed52911b4c8 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 13:12:34 -0400 Subject: [PATCH 06/11] #258 installer improvement --- ccmsi.lua | 17 ++++++++++++----- graphics/core.lua | 2 +- install_manifest.json | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index 0b42bd9..1f8c886 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -20,7 +20,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local function println(message) print(tostring(message)) end local function print(message) term.write(tostring(message)) end -local CCMSI_VERSION = "v1.4c" +local CCMSI_VERSION = "v1.4d" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -29,6 +29,7 @@ local repo_path = "http://raw.githubusercontent.com/MikaylaFischler/cc-mek-scada local opts = { ... } local mode = nil local app = nil +local target = "main" -- record the local installation manifest ---@param manifest table @@ -173,6 +174,12 @@ else println("unrecognized application") return end + + -- determine target + if mode == "check" then target = opts[2] else target = opts[3] end + if target ~= "main" or target ~= "latest" or target ~= "devel" then + target = "main" + end end -- @@ -184,7 +191,7 @@ if mode == "check" then -- GET REMOTE MANIFEST -- ------------------------- - if opts[2] then manifest_path = manifest_path .. opts[2] .. "/" else manifest_path = manifest_path .. "main/" end + manifest_path = manifest_path .. target .. "/" local install_manifest = manifest_path .. "install_manifest.json" local response, error = http.get(install_manifest) @@ -264,8 +271,8 @@ elseif mode == "install" or mode == "update" then -- GET REMOTE MANIFEST -- ------------------------- - if opts[3] then repo_path = repo_path .. opts[3] .. "/" else repo_path = repo_path .. "main/" end - if opts[3] then manifest_path = manifest_path .. opts[3] .. "/" else manifest_path = manifest_path .. "main/" end + repo_path = repo_path .. target .. "/" + manifest_path = manifest_path .. target .. "/" local install_manifest = manifest_path .. "install_manifest.json" local response, error = http.get(install_manifest) @@ -360,7 +367,7 @@ elseif mode == "install" or mode == "update" then -- display comms version change information show_pkg_change("comms", ver.comms.v_local, ver.comms.v_remote) ver.comms.changed = ver.comms.v_local ~= ver.comms.v_remote - if ver.comms.changed and mode == "update" then + if ver.comms.changed and ver.comms.v_local ~= nil then print("[comms] ") term.setTextColor(colors.yellow) println("other devices on the network will require an update") diff --git a/graphics/core.lua b/graphics/core.lua index 27ede11..d99ef3b 100644 --- a/graphics/core.lua +++ b/graphics/core.lua @@ -7,7 +7,7 @@ local flasher = require("graphics.flasher") local core = {} -core.version = "1.0.0-test3" +core.version = "1.0.0" core.flasher = flasher core.events = events diff --git a/install_manifest.json b/install_manifest.json index 62b1edc..ca507ff 100644 --- a/install_manifest.json +++ b/install_manifest.json @@ -1 +1 @@ -{"versions": {"installer": "v1.3", "bootloader": "0.2", "comms": "2.0.0", "graphics": "1.0.0", "reactor-plc": "v1.4.6", "rtu": "v1.3.6", "supervisor": "v0.17.7", "coordinator": "v0.16.1", "pocket": "alpha-v0.4.5"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common", "graphics"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5802, "system": 1991, "common": 92736, "graphics": 144556, "lockbox": 100797, "reactor-plc": 97335, "rtu": 102240, "supervisor": 315402, "coordinator": 197991, "pocket": 37581}} \ No newline at end of file +{"versions": {"installer": "v1.4d", "bootloader": "0.2", "comms": "2.0.0", "graphics": "1.0.0", "reactor-plc": "v1.4.6", "rtu": "v1.3.6", "supervisor": "v0.17.7", "coordinator": "v0.16.1", "pocket": "alpha-v0.4.5"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common", "graphics"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5803, "system": 1991, "common": 92736, "graphics": 144556, "lockbox": 100797, "reactor-plc": 97335, "rtu": 102240, "supervisor": 315402, "coordinator": 197991, "pocket": 37581}} \ No newline at end of file From 4a3455fa608505971a0591f537a2df6091531c6d Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 13:13:34 -0400 Subject: [PATCH 07/11] #258 luacheck fix --- ccmsi.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccmsi.lua b/ccmsi.lua index 1f8c886..bacba6f 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -29,7 +29,7 @@ local repo_path = "http://raw.githubusercontent.com/MikaylaFischler/cc-mek-scada local opts = { ... } local mode = nil local app = nil -local target = "main" +local target = nil -- record the local installation manifest ---@param manifest table From 75dfa3ae7381dc2224ca8ee56f08c34eb2d5902c Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 13:16:28 -0400 Subject: [PATCH 08/11] #258 luacheck fix --- ccmsi.lua | 5 +++-- install_manifest.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index bacba6f..3a00542 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -20,7 +20,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local function println(message) print(tostring(message)) end local function print(message) term.write(tostring(message)) end -local CCMSI_VERSION = "v1.4d" +local CCMSI_VERSION = "v1.4e" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -29,7 +29,7 @@ local repo_path = "http://raw.githubusercontent.com/MikaylaFischler/cc-mek-scada local opts = { ... } local mode = nil local app = nil -local target = nil +local target -- record the local installation manifest ---@param manifest table @@ -179,6 +179,7 @@ else if mode == "check" then target = opts[2] else target = opts[3] end if target ~= "main" or target ~= "latest" or target ~= "devel" then target = "main" + println("unknown target, defaulting to 'main'") end end diff --git a/install_manifest.json b/install_manifest.json index ca507ff..e3fc79d 100644 --- a/install_manifest.json +++ b/install_manifest.json @@ -1 +1 @@ -{"versions": {"installer": "v1.4d", "bootloader": "0.2", "comms": "2.0.0", "graphics": "1.0.0", "reactor-plc": "v1.4.6", "rtu": "v1.3.6", "supervisor": "v0.17.7", "coordinator": "v0.16.1", "pocket": "alpha-v0.4.5"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common", "graphics"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5803, "system": 1991, "common": 92736, "graphics": 144556, "lockbox": 100797, "reactor-plc": 97335, "rtu": 102240, "supervisor": 315402, "coordinator": 197991, "pocket": 37581}} \ No newline at end of file +{"versions": {"installer": "v1.4e", "bootloader": "0.2", "comms": "2.0.0", "graphics": "1.0.0", "reactor-plc": "v1.4.6", "rtu": "v1.3.6", "supervisor": "v0.17.7", "coordinator": "v0.16.1", "pocket": "alpha-v0.4.5"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common", "graphics"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5803, "system": 1991, "common": 92736, "graphics": 144556, "lockbox": 100797, "reactor-plc": 97335, "rtu": 102240, "supervisor": 315402, "coordinator": 197991, "pocket": 37581}} \ No newline at end of file From b28e4d1e9574d67a03587b57fe34281910c4fd31 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 14:04:49 -0400 Subject: [PATCH 09/11] #258 installer bugfix --- ccmsi.lua | 4 ++-- install_manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ccmsi.lua b/ccmsi.lua index 3a00542..f3f74d1 100644 --- a/ccmsi.lua +++ b/ccmsi.lua @@ -20,7 +20,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. local function println(message) print(tostring(message)) end local function print(message) term.write(tostring(message)) end -local CCMSI_VERSION = "v1.4e" +local CCMSI_VERSION = "v1.4f" local install_dir = "/.install-cache" local manifest_path = "https://mikaylafischler.github.io/cc-mek-scada/manifests/" @@ -177,7 +177,7 @@ else -- determine target if mode == "check" then target = opts[2] else target = opts[3] end - if target ~= "main" or target ~= "latest" or target ~= "devel" then + if (target ~= "main") and (target ~= "latest") and (target ~= "devel") then target = "main" println("unknown target, defaulting to 'main'") end diff --git a/install_manifest.json b/install_manifest.json index e3fc79d..5cec2b8 100644 --- a/install_manifest.json +++ b/install_manifest.json @@ -1 +1 @@ -{"versions": {"installer": "v1.4e", "bootloader": "0.2", "comms": "2.0.0", "graphics": "1.0.0", "reactor-plc": "v1.4.6", "rtu": "v1.3.6", "supervisor": "v0.17.7", "coordinator": "v0.16.1", "pocket": "alpha-v0.4.5"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common", "graphics"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5803, "system": 1991, "common": 92736, "graphics": 144556, "lockbox": 100797, "reactor-plc": 97335, "rtu": 102240, "supervisor": 315402, "coordinator": 197991, "pocket": 37581}} \ No newline at end of file +{"versions": {"installer": "v1.4f", "bootloader": "0.2", "comms": "2.0.0", "graphics": "1.0.0", "reactor-plc": "v1.4.6", "rtu": "v1.3.6", "supervisor": "v0.17.7", "coordinator": "v0.16.1", "pocket": "alpha-v0.4.5"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common", "graphics"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5803, "system": 1991, "common": 92736, "graphics": 144556, "lockbox": 100797, "reactor-plc": 97335, "rtu": 102240, "supervisor": 315402, "coordinator": 197991, "pocket": 37581}} \ No newline at end of file From af38025f501f3aaebfaf574ed77e7b7744d9bfaa Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 14:26:38 -0400 Subject: [PATCH 10/11] #262 don't ever abort RTU unit parsing on error, just skip --- install_manifest.json | 2 +- supervisor/session/rtu.lua | 10 ++++------ supervisor/startup.lua | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/install_manifest.json b/install_manifest.json index 5cec2b8..dc82370 100644 --- a/install_manifest.json +++ b/install_manifest.json @@ -1 +1 @@ -{"versions": {"installer": "v1.4f", "bootloader": "0.2", "comms": "2.0.0", "graphics": "1.0.0", "reactor-plc": "v1.4.6", "rtu": "v1.3.6", "supervisor": "v0.17.7", "coordinator": "v0.16.1", "pocket": "alpha-v0.4.5"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common", "graphics"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5803, "system": 1991, "common": 92736, "graphics": 144556, "lockbox": 100797, "reactor-plc": 97335, "rtu": 102240, "supervisor": 315402, "coordinator": 197991, "pocket": 37581}} \ No newline at end of file +{"versions": {"installer": "v1.4f", "bootloader": "0.2", "comms": "2.0.0", "graphics": "1.0.0", "reactor-plc": "v1.4.6", "rtu": "v1.3.6", "supervisor": "v0.17.8", "coordinator": "v0.16.1", "pocket": "alpha-v0.4.5"}, "files": {"system": ["initenv.lua", "startup.lua"], "common": ["scada-common/crypto.lua", "scada-common/ppm.lua", "scada-common/comms.lua", "scada-common/psil.lua", "scada-common/rsio.lua", "scada-common/constants.lua", "scada-common/mqueue.lua", "scada-common/tcd.lua", "scada-common/crash.lua", "scada-common/log.lua", "scada-common/types.lua", "scada-common/util.lua"], "graphics": ["graphics/element.lua", "graphics/events.lua", "graphics/flasher.lua", "graphics/core.lua", "graphics/elements/listbox.lua", "graphics/elements/textbox.lua", "graphics/elements/displaybox.lua", "graphics/elements/pipenet.lua", "graphics/elements/rectangle.lua", "graphics/elements/div.lua", "graphics/elements/multipane.lua", "graphics/elements/tiling.lua", "graphics/elements/colormap.lua", "graphics/elements/indicators/alight.lua", "graphics/elements/indicators/icon.lua", "graphics/elements/indicators/power.lua", "graphics/elements/indicators/rad.lua", "graphics/elements/indicators/state.lua", "graphics/elements/indicators/light.lua", "graphics/elements/indicators/vbar.lua", "graphics/elements/indicators/led.lua", "graphics/elements/indicators/coremap.lua", "graphics/elements/indicators/data.lua", "graphics/elements/indicators/ledpair.lua", "graphics/elements/indicators/hbar.lua", "graphics/elements/indicators/trilight.lua", "graphics/elements/indicators/ledrgb.lua", "graphics/elements/controls/switch_button.lua", "graphics/elements/controls/spinbox_numeric.lua", "graphics/elements/controls/hazard_button.lua", "graphics/elements/controls/push_button.lua", "graphics/elements/controls/radio_button.lua", "graphics/elements/controls/multi_button.lua", "graphics/elements/controls/tabbar.lua", "graphics/elements/controls/sidebar.lua", "graphics/elements/animations/waiting.lua"], "lockbox": ["lockbox/init.lua", "lockbox/LICENSE", "lockbox/kdf/pbkdf2.lua", "lockbox/util/bit.lua", "lockbox/util/array.lua", "lockbox/util/stream.lua", "lockbox/util/queue.lua", "lockbox/digest/sha2_224.lua", "lockbox/digest/sha1.lua", "lockbox/digest/sha2_256.lua", "lockbox/cipher/aes128.lua", "lockbox/cipher/aes256.lua", "lockbox/cipher/aes192.lua", "lockbox/cipher/mode/ofb.lua", "lockbox/cipher/mode/cbc.lua", "lockbox/cipher/mode/ctr.lua", "lockbox/cipher/mode/cfb.lua", "lockbox/mac/hmac.lua", "lockbox/padding/ansix923.lua", "lockbox/padding/pkcs7.lua", "lockbox/padding/zero.lua", "lockbox/padding/isoiec7816.lua"], "reactor-plc": ["reactor-plc/renderer.lua", "reactor-plc/threads.lua", "reactor-plc/databus.lua", "reactor-plc/plc.lua", "reactor-plc/config.lua", "reactor-plc/startup.lua", "reactor-plc/panel/front_panel.lua", "reactor-plc/panel/style.lua"], "rtu": ["rtu/renderer.lua", "rtu/threads.lua", "rtu/rtu.lua", "rtu/databus.lua", "rtu/modbus.lua", "rtu/config.lua", "rtu/startup.lua", "rtu/panel/front_panel.lua", "rtu/panel/style.lua", "rtu/dev/sps_rtu.lua", "rtu/dev/envd_rtu.lua", "rtu/dev/boilerv_rtu.lua", "rtu/dev/redstone_rtu.lua", "rtu/dev/sna_rtu.lua", "rtu/dev/imatrix_rtu.lua", "rtu/dev/turbinev_rtu.lua"], "supervisor": ["supervisor/renderer.lua", "supervisor/databus.lua", "supervisor/supervisor.lua", "supervisor/unit.lua", "supervisor/config.lua", "supervisor/startup.lua", "supervisor/unitlogic.lua", "supervisor/facility.lua", "supervisor/panel/pgi.lua", "supervisor/panel/front_panel.lua", "supervisor/panel/style.lua", "supervisor/panel/components/rtu_entry.lua", "supervisor/panel/components/pdg_entry.lua", "supervisor/session/coordinator.lua", "supervisor/session/svqtypes.lua", "supervisor/session/pocket.lua", "supervisor/session/svsessions.lua", "supervisor/session/rtu.lua", "supervisor/session/plc.lua", "supervisor/session/rsctl.lua", "supervisor/session/rtu/boilerv.lua", "supervisor/session/rtu/txnctrl.lua", "supervisor/session/rtu/unit_session.lua", "supervisor/session/rtu/turbinev.lua", "supervisor/session/rtu/envd.lua", "supervisor/session/rtu/imatrix.lua", "supervisor/session/rtu/sps.lua", "supervisor/session/rtu/qtypes.lua", "supervisor/session/rtu/sna.lua", "supervisor/session/rtu/redstone.lua"], "coordinator": ["coordinator/coordinator.lua", "coordinator/renderer.lua", "coordinator/iocontrol.lua", "coordinator/sounder.lua", "coordinator/config.lua", "coordinator/startup.lua", "coordinator/process.lua", "coordinator/ui/dialog.lua", "coordinator/ui/style.lua", "coordinator/ui/layout/main_view.lua", "coordinator/ui/layout/unit_view.lua", "coordinator/ui/components/reactor.lua", "coordinator/ui/components/processctl.lua", "coordinator/ui/components/unit_overview.lua", "coordinator/ui/components/boiler.lua", "coordinator/ui/components/unit_detail.lua", "coordinator/ui/components/imatrix.lua", "coordinator/ui/components/turbine.lua", "coordinator/session/pocket.lua", "coordinator/session/apisessions.lua"], "pocket": ["pocket/pocket.lua", "pocket/renderer.lua", "pocket/config.lua", "pocket/coreio.lua", "pocket/startup.lua", "pocket/ui/main.lua", "pocket/ui/style.lua", "pocket/ui/components/conn_waiting.lua", "pocket/ui/pages/turbine_page.lua", "pocket/ui/pages/reactor_page.lua", "pocket/ui/pages/home_page.lua", "pocket/ui/pages/unit_page.lua", "pocket/ui/pages/boiler_page.lua"]}, "depends": {"reactor-plc": ["system", "common", "graphics"], "rtu": ["system", "common", "graphics"], "supervisor": ["system", "common", "graphics"], "coordinator": ["system", "common", "graphics"], "pocket": ["system", "common", "graphics"]}, "sizes": {"manifest": 5803, "system": 1991, "common": 92736, "graphics": 144556, "lockbox": 100797, "reactor-plc": 97335, "rtu": 102240, "supervisor": 315388, "coordinator": 197991, "pocket": 37581}} \ No newline at end of file diff --git a/supervisor/session/rtu.lua b/supervisor/session/rtu.lua index d1fbaec..69ba796 100644 --- a/supervisor/session/rtu.lua +++ b/supervisor/session/rtu.lua @@ -120,7 +120,7 @@ function rtu.new_session(id, s_addr, in_queue, out_queue, timeout, advertisement if u_type == false then -- validation fail - log.debug(log_header .. "advertisement unit validation failure") + log.debug(log_header .. "_handle_advertisement(): advertisement unit validation failure") else if unit_advert.reactor > 0 then local target_unit = self.fac_units[unit_advert.reactor] ---@type reactor_unit @@ -146,7 +146,7 @@ function rtu.new_session(id, s_addr, in_queue, out_queue, timeout, advertisement -- skip virtual units log.debug(util.c(log_header, "skipping virtual RTU unit #", i)) else - log.error(util.c(log_header, "bad advertisement: encountered unsupported reactor-specific RTU type ", type_string)) + log.warning(util.c(log_header, "_handle_advertisement(): encountered unsupported reactor-specific RTU type ", type_string)) end else -- facility RTUs @@ -172,7 +172,7 @@ function rtu.new_session(id, s_addr, in_queue, out_queue, timeout, advertisement -- skip virtual units log.debug(util.c(log_header, "skipping virtual RTU unit #", i)) else - log.error(util.c(log_header, "bad advertisement: encountered unsupported reactor-independent RTU type ", type_string)) + log.warning(util.c(log_header, "_handle_advertisement(): encountered unsupported facility RTU type ", type_string)) end end end @@ -181,9 +181,7 @@ function rtu.new_session(id, s_addr, in_queue, out_queue, timeout, advertisement self.units[i] = unit unit_count = unit_count + 1 elseif u_type ~= RTU_UNIT_TYPE.VIRTUAL then - _reset_config() - log.error(util.c(log_header, "bad advertisement: error occured while creating a unit (type is ", type_string, ")")) - break + log.warning(util.c(log_header, "_handle_advertisement(): problem occured while creating a unit (type is ", type_string, ")")) end end diff --git a/supervisor/startup.lua b/supervisor/startup.lua index f03fe1e..3ec55cc 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -20,7 +20,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v0.17.7" +local SUPERVISOR_VERSION = "v0.17.8" local println = util.println local println_ts = util.println_ts From a02529b9f703dd00d5fe9c085edad58e9c8a36bf Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Jun 2023 15:19:01 -0400 Subject: [PATCH 11/11] #263 fixed bug with supervisor group map length not matching number of reactors --- .gitignore | 2 +- supervisor/facility.lua | 5 +++-- supervisor/startup.lua | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 17ae161..0688a64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ _notes/ -program.sh \ No newline at end of file +/*program.sh \ No newline at end of file diff --git a/supervisor/facility.lua b/supervisor/facility.lua index e3b8059..5864ea5 100644 --- a/supervisor/facility.lua +++ b/supervisor/facility.lua @@ -75,7 +75,7 @@ function facility.new(num_reactors, cooling_conf) burn_target = 0.1, -- burn rate target for aggregate burn mode charge_setpoint = 0, -- FE charge target setpoint gen_rate_setpoint = 0, -- FE/t charge rate target setpoint - group_map = { 0, 0, 0, 0 }, -- units -> group IDs + group_map = {}, -- units -> group IDs prio_defs = { {}, {}, {}, {} }, -- priority definitions (each level is a table of units) at_max_burn = false, ascram = false, @@ -109,6 +109,7 @@ function facility.new(num_reactors, cooling_conf) -- create units for i = 1, num_reactors do table.insert(self.units, unit.new(i, cooling_conf[i].BOILERS, cooling_conf[i].TURBINES)) + table.insert(self.group_map, 0) end -- init redstone RTU I/O controller @@ -790,7 +791,7 @@ function facility.new(num_reactors, cooling_conf) ---@param unit_id integer unit ID ---@param group integer group ID or 0 for independent function public.set_group(unit_id, group) - if group >= 0 and group <= 4 and self.mode == PROCESS.INACTIVE then + if (group >= 0 and group <= 4) and (unit_id > 0 and unit_id <= num_reactors) and self.mode == PROCESS.INACTIVE then -- remove from old group if previously assigned local old_group = self.group_map[unit_id] if old_group ~= 0 then diff --git a/supervisor/startup.lua b/supervisor/startup.lua index 3ec55cc..0949573 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -20,7 +20,7 @@ local supervisor = require("supervisor.supervisor") local svsessions = require("supervisor.session.svsessions") -local SUPERVISOR_VERSION = "v0.17.8" +local SUPERVISOR_VERSION = "v0.17.9" local println = util.println local println_ts = util.println_ts