Skip to content

Add single mode#18

Merged
arghyabi merged 6 commits into
masterfrom
add_single_mode
Sep 6, 2025
Merged

Add single mode#18
arghyabi merged 6 commits into
masterfrom
add_single_mode

Conversation

@arghyabi
Copy link
Copy Markdown
Owner

@arghyabi arghyabi commented Sep 6, 2025

No description provided.

arghyabi and others added 5 commits September 6, 2025 20:40
Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
update the gpio lib to work in any platform

Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
@arghyabi arghyabi requested a review from Copilot September 6, 2025 18:58

This comment was marked as outdated.

Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
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 adds single switch mode functionality to the spring-loaded switch testing system. It introduces the ability to switch between different switch types (single vs double microswitch) and adds motor control functionality through a web interface.

  • Refactors main.py to support both single and double switch modes
  • Adds motor control toggle functionality
  • Implements switch type selection with dynamic model switching

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
config.yaml Updates application version from 1.8.1.1016 to 1.9.1.1017
Web/style.css Adds CSS styles for switch type dropdown and motor control buttons
Web/script.js Implements JavaScript functions for switch type updates and motor toggling
Web/postRequest.php Adds server-side handlers for switch type and motor control requests
Web/index.php Updates UI to include switch type selection and motor status controls
Web/backend.php Adds backend functions for switch model and motor status management
Script/utility.py Adds utility functions for switch model and motor control state management
Script/singleSwitch.py New file implementing single switch testing logic
Script/rpigpio.py Adds error handling for missing RPi.GPIO module
Script/main.py Refactors to support both single and double switch modes
Script/lcd20x4.py Adds error handling for missing RPLCD module
Script/doubleSwitch.py New file containing extracted double switch logic from original main.py
Script/common.py Adds constants for switch model types and loop return values

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread Web/backend.php
function getSwitchType()
{
$rtConfig = getRtConfig();
return isset($rtConfig['switchModel']) ? $rtConfig['switchModel'] : $SWT_MODEL_DOUBLE_TYPE_B; // Default to Type-B
Copy link

Copilot AI Sep 6, 2025

Choose a reason for hiding this comment

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

The variable $SWT_MODEL_DOUBLE_TYPE_B is used but not defined in this scope. The constants are defined at the top of the file but PHP variables need the $ prefix or should be defined as constants.

Copilot uses AI. Check for mistakes.
Comment thread Script/utility.py
blankData = {
"cycleCount": 0
"cycleCount": 0,
"switchModel": SWT_MODEL_DOUBLE_TYPE_B,
Copy link

Copilot AI Sep 6, 2025

Choose a reason for hiding this comment

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

The constant SWT_MODEL_DOUBLE_TYPE_B is used but not imported. This will cause a NameError since the constant is defined in common.py but not imported in this file.

Copilot uses AI. Check for mistakes.
Comment thread Script/utility.py


def getSwitchModel():
switchModel = SWT_MODEL_DOUBLE_TYPE_B
Copy link

Copilot AI Sep 6, 2025

Choose a reason for hiding this comment

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

The constant SWT_MODEL_DOUBLE_TYPE_B is used but not imported. This will cause a NameError since the constant is defined in common.py but not imported in this file.

Copilot uses AI. Check for mistakes.
Comment thread Script/utility.py
if rtData:
switchModel = rtData.get("switchModel")
if switchModel == None:
switchModel = SWT_MODEL_DOUBLE_TYPE_B
Copy link

Copilot AI Sep 6, 2025

Choose a reason for hiding this comment

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

The constant SWT_MODEL_DOUBLE_TYPE_B is used but not imported. This will cause a NameError since the constant is defined in common.py but not imported in this file.

Copilot uses AI. Check for mistakes.
@arghyabi arghyabi merged commit bd3992f into master Sep 6, 2025
1 check passed
@arghyabi arghyabi deleted the add_single_mode branch September 6, 2025 19:04
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