From eebac1007aef921243f2297e16ea57da2c0ed91e Mon Sep 17 00:00:00 2001 From: Arghya Biswas Date: Mon, 15 Dec 2025 20:31:00 +0530 Subject: [PATCH] fix the sw-model auto reset issue Signed-off-by: Arghya Biswas --- Script/main.py | 2 +- Script/utility.py | 6 ++++-- config.yaml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Script/main.py b/Script/main.py index 5a1ae19..c43f8cb 100644 --- a/Script/main.py +++ b/Script/main.py @@ -30,7 +30,7 @@ def app_loop(switchModel): # Entry point main function def main(ForceDbCreation = False, newSwModel = None): print(f"Starting Spring Loaded Switch application. {getAppVersion()}") - createRtDbFile(ForceDbCreation) + createRtDbFile(ForceDbCreation, SwModel = newSwModel) print("Database creation done!") if newSwModel: print("Updating new Switch Model...") diff --git a/Script/utility.py b/Script/utility.py index e95f96b..20514c1 100644 --- a/Script/utility.py +++ b/Script/utility.py @@ -33,11 +33,13 @@ def getAppVersion(): return "0.0.0.0000" -def createRtDbFile(ForceDbCreation = False): +def createRtDbFile(ForceDbCreation = False, SwModel = None): + if SwModel is None: + SwModel = SWT_MODEL_DOUBLE_TYPE_B if not os.path.exists(RT_DB_FILE) or ForceDbCreation: blankData = { "cycleCount": 0, - "switchModel": SWT_MODEL_DOUBLE_TYPE_B, + "switchModel": SwModel, "motorStatus": 1 } diff --git a/config.yaml b/config.yaml index 4ed8978..686ea99 100644 --- a/config.yaml +++ b/config.yaml @@ -1,2 +1,2 @@ -appVersion: 1.9.2.1018 +appVersion: 1.9.3.1019 maxCount : 7500000