Skip to content

fix the sw-model auto reset issue#20

Merged
arghyabi merged 1 commit into
masterfrom
model_change_fix
Dec 15, 2025
Merged

fix the sw-model auto reset issue#20
arghyabi merged 1 commit into
masterfrom
model_change_fix

Conversation

@arghyabi
Copy link
Copy Markdown
Owner

No description provided.

Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
@arghyabi arghyabi requested a review from Copilot December 15, 2025 15:06
@arghyabi arghyabi merged commit 2022608 into master Dec 15, 2025
1 check passed
@arghyabi arghyabi deleted the model_change_fix branch December 15, 2025 15:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where the switch model would automatically reset when creating or recreating the runtime database file. The fix allows the createRtDbFile function to accept an optional SwModel parameter that can be passed from the main function, preserving the intended switch model instead of always defaulting to SWT_MODEL_DOUBLE_TYPE_B.

Key Changes:

  • Added SwModel parameter to createRtDbFile() function to accept custom switch models
  • Updated main() function to pass newSwModel to createRtDbFile() when specified
  • Bumped application version from 1.9.2.1018 to 1.9.3.1019

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
config.yaml Version bump to 1.9.3.1019 reflecting the bug fix
Script/utility.py Modified createRtDbFile() to accept optional SwModel parameter with default value
Script/main.py Updated call to createRtDbFile() to pass newSwModel parameter
Comments suppressed due to low confidence (12)

Script/utility.py:49

  • Testing for None should use the 'is' operator.
        if configData == None or configData == "":

Script/utility.py:61

  • Testing for None should use the 'is' operator.
        if cycleCount == None:

Script/utility.py:73

  • Testing for None should use the 'is' operator.
        if totalCount == None:

Script/utility.py:78

  • Testing for None should use the 'is' operator.
            if totalCount == None:

Script/utility.py:96

  • Testing for None should use the 'is' operator.
        if updateNeeded == None:

Script/utility.py:115

  • Testing for None should use the 'is' operator.
        if switchModel == None:

Script/utility.py:133

  • Testing for None should use the 'is' operator.
        if motorStatus == None:

Script/main.py:1

  • Import pollutes the enclosing namespace, as the imported module common does not define 'all'.
from common       import *

Script/main.py:2

  • Import pollutes the enclosing namespace, as the imported module utility does not define 'all'.
from utility      import *

Script/main.py:3

  • Import pollutes the enclosing namespace, as the imported module doubleSwitch does not define 'all'.
from doubleSwitch import *

Script/main.py:4

  • Import pollutes the enclosing namespace, as the imported module singleSwitch does not define 'all'.
from singleSwitch import *

Script/utility.py:5

  • Import pollutes the enclosing namespace, as the imported module common does not define 'all'.
from common import *

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants