Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Bug report
description: Report a defect in WeaMachine
labels: ["bug", "maintenance"]
body:
- type: textarea
id: summary
attributes:
label: Summary
description: What went wrong?
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce
description: Minimal steps, including Manual vs Automatic mode
validations:
required: true
- type: input
id: env
attributes:
label: Environment
description: "OS, Qt version, Modbus RTU/TCP, hardware if relevant"
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
validations:
required: true
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Feature request
description: Propose a WeaMachine improvement
labels: ["enhancement"]
body:
- type: textarea
id: problem
attributes:
label: Problem
description: What limitation are you hitting?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed solution
validations:
required: true
- type: dropdown
id: area
attributes:
label: Area
options:
- Step sequencer
- PLC I/O
- Servo / motion
- UI / QML
- Build / CI / docs
- Other
validations:
required: true
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Summary

<!-- What changed and why -->

## Test plan

- [ ] `python scripts/protocol_map.py`
- [ ] `PYTHONPATH=scripts python -m pytest scripts/tests -q` (or from `scripts/`)
- [ ] CMake configure/build on your Qt kit (if C++/QML touched)
- [ ] Manual smoke: Manual mode → Go to Position / Records shot
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
protocol-python:
name: Protocol helpers (Python)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install deps
run: python -m pip install -r scripts/requirements.txt
- name: Validate register map
run: python scripts/protocol_map.py
- name: Run unit tests
working-directory: scripts
run: PYTHONPATH=. python -m pytest tests -q

cmake-lint-structure:
name: CMake project structure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check required files
run: |
test -f CMakeLists.txt
test -f main.cpp
test -f main.qml
test -f LICENSE
test -f README.md
test -d include/InjectionMolding
test -d src
test -d qml
grep -q "project(InjectionMolding" CMakeLists.txt
! grep -q "find_package(Qt5 REQUIRED COMPONENTS Core)" CMakeLists.txt
25 changes: 19 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,19 @@ CMakeLists.txt.user*
*.Debug
*.Release

# Python byte code
*.pyc
# Python
__pycache__/
*.py[cod]
*.egg-info/
.venv/
venv/
.pytest_cache/

# Binaries
# --------
*.dll
*.exe
!scripts/**

# Directories with generated files
.moc/
Expand All @@ -80,7 +86,14 @@ CMakeLists.txt.user*
.rcc/
.uic/
/build*/
branch_structure.json
temp_auto_push.bat
temp_interactive_push.bat
.gitignore
/out/
/cmake-build-*/

# Local / editor
.idea/
*.user
*.user.*

# Local secrets / machine-specific settings
*.local.ini
auth.ini
13 changes: 7 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"recommendations": [
"myml.vscode-markdown-plantuml-preview",
"esbenp.prettier-vscode",
"jebbs.plantuml"
]
}
"recommendations": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"theqtcompany.qt",
"ms-python.python"
]
}
54 changes: 13 additions & 41 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,21 @@
"version": "0.2.0",
"configurations": [
{
"name": "Debug SST",
"type": "node",
"name": "Launch WeaMachine (cppdbg)",
"type": "cppdbg",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["dev", "--increase-timeout"],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
// sourceMapRenames helps with the loading spinner when debugging and viewing local variables
"sourceMapRenames": false,
"env": {
"AWS_PROFILE": "flo-ct-flo360"
}
},
{
"name": "Debug Tests - Unit",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["bind", "yarn", "\"jest\"", "\"--watch\"", "\"--config\"", "\"./jest.unit.config.cjs\"", "\"${input:scopeTestsFileName}\""],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"env": {
"AWS_PROFILE": "flo-ct-flo360"
},
},
{
"name": "Debug Tests - E2E",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
"runtimeArgs": ["bind", "yarn", "\"vitest\"", "\"--config\"", "\"./vitest.e2e.config.ts\"", "\"${input:scopeTestsFileName}\""],
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"env": {
"AWS_PROFILE": "flo-ct-flo360"
"program": "${workspaceFolder}/build/InjectionMolding",
"args": [],
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"windows": {
"program": "${workspaceFolder}/build/InjectionMolding.exe",
"MIMode": "gdb",
"miDebuggerPath": "gdb.exe"
},
},
],
"inputs": [
{
"id": "scopeTestsFileName",
"type": "promptString",
"description": "Partial file name to scope test debugging to. ex. arena. Leave blank to run all tests.",
"preLaunchTask": "CMake: build"
}
]
}
29 changes: 10 additions & 19 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
{
"search.exclude": {
"**/.sst": true
"files.exclude": {
"**/build*/**": true
},
"task.allowAutomaticTasks": true,
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.tsdk": "node_modules/typescript/lib",
"debug.openDebug": "neverOpen",
"problems.autoReveal": true,
"terminal.integrated.hideOnStartup": "always",
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"terminal.integrated.inheritEnv": false,
"jestrunner.configPath": "jest.unit.config.cjs",
"compile-hero.disable-compile-files-on-did-save-code": true,
"tasks": {
"label": "lint on open",
"type": "shell",
"command": "npm run lint",
"runOn": "folderOpen"
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureOnOpen": true,
"editor.formatOnSave": false,
"[cpp]": {
"editor.defaultFormatter": "ms-vscode.cpptools"
},
"[qml]": {
"editor.tabSize": 4
}
}
51 changes: 27 additions & 24 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
{
"version": "2.0.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run My Project",
"console": "",
"internalConsoleOptions": "openOnSessionStart"
}
],
"tasks": [
{
"label": "eslint-check",
"label": "CMake: configure",
"type": "shell",
"command": "(command -v node >/dev/null 2>&1 && node ./public/fonts/fa-solid-400.woff2) || (where node >nul 2>&1 && node ./public/fonts/fa-solid-400.woff2) || echo ''",
"problemMatcher": [],
"isBackground": true,
"hide": true,
"presentation": {
"reveal": "never",
"panel": "dedicated",
"focus": false,
"clear": false,
"echo": false,
"close": true
"command": "cmake -S . -B build",
"options": {
"cwd": "${workspaceFolder}"
},
"runOptions": {
"runOn": "folderOpen"
}
"problemMatcher": []
},
{
"label": "CMake: build",
"type": "shell",
"command": "cmake --build build",
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$gcc"]
},
{
"label": "Python: protocol tests",
"type": "shell",
"command": "python -m pytest scripts/tests -q",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
}
]
}
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ set(PROJECT_SOURCES
${PROJECT_RESOURCES}
)

find_package(Qt5 REQUIRED COMPONENTS Core)
find_package(Qt5 REQUIRED COMPONENTS Core)

add_executable(InjectionMolding
${PROJECT_SOURCES}
)
Expand Down Expand Up @@ -63,8 +60,6 @@ target_link_libraries(InjectionMolding
${WeaCore}
${WeaQuick}
)
target_link_libraries(InjectionMolding PRIVATE Qt5::Core)
target_link_libraries(InjectionMolding PRIVATE Qt5::Core)

# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
Expand Down
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributing to WeaMachine

Thanks for helping improve this industrial automation HMI.

## Ways to contribute

- Fix bugs listed in GitHub Issues (preferred over `TODO.txt`)
- Improve docs, build scripts, or CI
- Add tests for models (`StepModel`, `PlcIOModel`, `RecordModel`)
- Review pull requests and leave concrete feedback

## Development setup

1. Install Qt 5.15+ or Qt 6 with modules: Core, Quick, Qml, QuickControls2, SerialBus, SerialPort
2. Install CMake 3.16+ and a C++17 toolchain (MSVC, MinGW, or Clang)
3. Configure and build:

```bash
cmake -S . -B build -DCMAKE_PREFIX_PATH=<path-to-Qt>
cmake --build build
```

4. Optional protocol helpers (Python 3.9+):

```bash
python -m pip install -r scripts/requirements.txt
python -m pytest scripts/tests
```

## Pull request checklist

- [ ] Change is focused (one concern per PR when possible)
- [ ] Build still configures with CMake
- [ ] QML/C++ naming stays consistent with existing modules
- [ ] No hardcoded secrets or machine credentials in source
- [ ] Update README / issues when behavior changes

## Code style

- Match surrounding C++ / QML style in the file you edit
- Prefer WeaCore logging over raw `qDebug()` for new code
- Avoid drive-by refactors unrelated to the PR

## Reporting issues

Use the Bug / Feature issue templates. Include Qt version, OS, Modbus mode (RTU/TCP), and steps to reproduce.
Loading
Loading