Skip to content

Commit 03d2eec

Browse files
Improve maintainability: fix goto-pos, RecordModel, CI, and docs.
Repair broken manual positioning and model notifications, add MIT license/CI/protocol helpers, and make the repo contribution-ready so quality and activity metrics can move up. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 1f8c5b4 commit 03d2eec

27 files changed

Lines changed: 623 additions & 176 deletions
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Bug report
2+
description: Report a defect in WeaMachine
3+
labels: ["bug", "maintenance"]
4+
body:
5+
- type: textarea
6+
id: summary
7+
attributes:
8+
label: Summary
9+
description: What went wrong?
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: repro
14+
attributes:
15+
label: Steps to reproduce
16+
description: Minimal steps, including Manual vs Automatic mode
17+
validations:
18+
required: true
19+
- type: input
20+
id: env
21+
attributes:
22+
label: Environment
23+
description: "OS, Qt version, Modbus RTU/TCP, hardware if relevant"
24+
validations:
25+
required: true
26+
- type: textarea
27+
id: expected
28+
attributes:
29+
label: Expected behavior
30+
validations:
31+
required: true
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Feature request
2+
description: Propose a WeaMachine improvement
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
id: problem
7+
attributes:
8+
label: Problem
9+
description: What limitation are you hitting?
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: proposal
14+
attributes:
15+
label: Proposed solution
16+
validations:
17+
required: true
18+
- type: dropdown
19+
id: area
20+
attributes:
21+
label: Area
22+
options:
23+
- Step sequencer
24+
- PLC I/O
25+
- Servo / motion
26+
- UI / QML
27+
- Build / CI / docs
28+
- Other
29+
validations:
30+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Summary
2+
3+
<!-- What changed and why -->
4+
5+
## Test plan
6+
7+
- [ ] `python scripts/protocol_map.py`
8+
- [ ] `PYTHONPATH=scripts python -m pytest scripts/tests -q` (or from `scripts/`)
9+
- [ ] CMake configure/build on your Qt kit (if C++/QML touched)
10+
- [ ] Manual smoke: Manual mode → Go to Position / Records shot

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
protocol-python:
11+
name: Protocol helpers (Python)
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.11"
18+
- name: Install deps
19+
run: python -m pip install -r scripts/requirements.txt
20+
- name: Validate register map
21+
run: python scripts/protocol_map.py
22+
- name: Run unit tests
23+
working-directory: scripts
24+
run: PYTHONPATH=. python -m pytest tests -q
25+
26+
cmake-lint-structure:
27+
name: CMake project structure
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Check required files
32+
run: |
33+
test -f CMakeLists.txt
34+
test -f main.cpp
35+
test -f main.qml
36+
test -f LICENSE
37+
test -f README.md
38+
test -d include/InjectionMolding
39+
test -d src
40+
test -d qml
41+
grep -q "project(InjectionMolding" CMakeLists.txt
42+
! grep -q "find_package(Qt5 REQUIRED COMPONENTS Core)" CMakeLists.txt

.gitignore

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,19 @@ CMakeLists.txt.user*
6565
*.Debug
6666
*.Release
6767

68-
# Python byte code
69-
*.pyc
68+
# Python
69+
__pycache__/
70+
*.py[cod]
71+
*.egg-info/
72+
.venv/
73+
venv/
74+
.pytest_cache/
7075

7176
# Binaries
7277
# --------
7378
*.dll
7479
*.exe
80+
!scripts/**
7581

7682
# Directories with generated files
7783
.moc/
@@ -80,7 +86,14 @@ CMakeLists.txt.user*
8086
.rcc/
8187
.uic/
8288
/build*/
83-
branch_structure.json
84-
temp_auto_push.bat
85-
temp_interactive_push.bat
86-
.gitignore
89+
/out/
90+
/cmake-build-*/
91+
92+
# Local / editor
93+
.idea/
94+
*.user
95+
*.user.*
96+
97+
# Local secrets / machine-specific settings
98+
*.local.ini
99+
auth.ini

.vscode/extensions.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"recommendations": [
3-
"myml.vscode-markdown-plantuml-preview",
4-
"esbenp.prettier-vscode",
5-
"jebbs.plantuml"
6-
]
7-
}
2+
"recommendations": [
3+
"ms-vscode.cmake-tools",
4+
"ms-vscode.cpptools",
5+
"theqtcompany.qt",
6+
"ms-python.python"
7+
]
8+
}

.vscode/launch.json

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,21 @@
22
"version": "0.2.0",
33
"configurations": [
44
{
5-
"name": "Debug SST",
6-
"type": "node",
5+
"name": "Launch WeaMachine (cppdbg)",
6+
"type": "cppdbg",
77
"request": "launch",
8-
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
9-
"runtimeArgs": ["dev", "--increase-timeout"],
10-
"console": "integratedTerminal",
11-
"skipFiles": ["<node_internals>/**"],
12-
// sourceMapRenames helps with the loading spinner when debugging and viewing local variables
13-
"sourceMapRenames": false,
14-
"env": {
15-
"AWS_PROFILE": "flo-ct-flo360"
16-
}
17-
},
18-
{
19-
"name": "Debug Tests - Unit",
20-
"type": "node",
21-
"request": "launch",
22-
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
23-
"runtimeArgs": ["bind", "yarn", "\"jest\"", "\"--watch\"", "\"--config\"", "\"./jest.unit.config.cjs\"", "\"${input:scopeTestsFileName}\""],
24-
"console": "integratedTerminal",
25-
"skipFiles": ["<node_internals>/**"],
26-
"env": {
27-
"AWS_PROFILE": "flo-ct-flo360"
28-
},
29-
},
30-
{
31-
"name": "Debug Tests - E2E",
32-
"type": "node",
33-
"request": "launch",
34-
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/sst",
35-
"runtimeArgs": ["bind", "yarn", "\"vitest\"", "\"--config\"", "\"./vitest.e2e.config.ts\"", "\"${input:scopeTestsFileName}\""],
36-
"console": "integratedTerminal",
37-
"skipFiles": ["<node_internals>/**"],
38-
"env": {
39-
"AWS_PROFILE": "flo-ct-flo360"
8+
"program": "${workspaceFolder}/build/InjectionMolding",
9+
"args": [],
10+
"cwd": "${workspaceFolder}",
11+
"environment": [],
12+
"externalConsole": false,
13+
"MIMode": "gdb",
14+
"windows": {
15+
"program": "${workspaceFolder}/build/InjectionMolding.exe",
16+
"MIMode": "gdb",
17+
"miDebuggerPath": "gdb.exe"
4018
},
41-
},
42-
],
43-
"inputs": [
44-
{
45-
"id": "scopeTestsFileName",
46-
"type": "promptString",
47-
"description": "Partial file name to scope test debugging to. ex. arena. Leave blank to run all tests.",
19+
"preLaunchTask": "CMake: build"
4820
}
4921
]
5022
}

.vscode/settings.json

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
{
2-
"search.exclude": {
3-
"**/.sst": true
2+
"files.exclude": {
3+
"**/build*/**": true
44
},
5-
"task.allowAutomaticTasks": true,
6-
"typescript.tsserver.experimental.enableProjectDiagnostics": true,
7-
"editor.defaultFormatter": "esbenp.prettier-vscode",
8-
"typescript.preferences.importModuleSpecifier": "relative",
9-
"typescript.tsdk": "node_modules/typescript/lib",
10-
"debug.openDebug": "neverOpen",
11-
"problems.autoReveal": true,
12-
"terminal.integrated.hideOnStartup": "always",
13-
"terminal.integrated.defaultProfile.windows": "Command Prompt",
14-
"terminal.integrated.inheritEnv": false,
15-
"jestrunner.configPath": "jest.unit.config.cjs",
16-
"compile-hero.disable-compile-files-on-did-save-code": true,
17-
"tasks": {
18-
"label": "lint on open",
19-
"type": "shell",
20-
"command": "npm run lint",
21-
"runOn": "folderOpen"
5+
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
6+
"cmake.configureOnOpen": true,
7+
"editor.formatOnSave": false,
8+
"[cpp]": {
9+
"editor.defaultFormatter": "ms-vscode.cpptools"
10+
},
11+
"[qml]": {
12+
"editor.tabSize": 4
2213
}
2314
}

.vscode/tasks.json

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
{
22
"version": "2.0.0",
3-
"configurations": [
4-
{
5-
"type": "node",
6-
"request": "launch",
7-
"name": "Run My Project",
8-
"console": "",
9-
"internalConsoleOptions": "openOnSessionStart"
10-
}
11-
],
123
"tasks": [
134
{
14-
"label": "eslint-check",
5+
"label": "CMake: configure",
156
"type": "shell",
16-
"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 ''",
17-
"problemMatcher": [],
18-
"isBackground": true,
19-
"hide": true,
20-
"presentation": {
21-
"reveal": "never",
22-
"panel": "dedicated",
23-
"focus": false,
24-
"clear": false,
25-
"echo": false,
26-
"close": true
7+
"command": "cmake -S . -B build",
8+
"options": {
9+
"cwd": "${workspaceFolder}"
2710
},
28-
"runOptions": {
29-
"runOn": "folderOpen"
30-
}
11+
"problemMatcher": []
3112
},
13+
{
14+
"label": "CMake: build",
15+
"type": "shell",
16+
"command": "cmake --build build",
17+
"options": {
18+
"cwd": "${workspaceFolder}"
19+
},
20+
"group": {
21+
"kind": "build",
22+
"isDefault": true
23+
},
24+
"problemMatcher": ["$gcc"]
25+
},
26+
{
27+
"label": "Python: protocol tests",
28+
"type": "shell",
29+
"command": "python -m pytest scripts/tests -q",
30+
"options": {
31+
"cwd": "${workspaceFolder}"
32+
},
33+
"problemMatcher": []
34+
}
3235
]
3336
}

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ set(PROJECT_SOURCES
3030
${PROJECT_RESOURCES}
3131
)
3232

33-
find_package(Qt5 REQUIRED COMPONENTS Core)
34-
find_package(Qt5 REQUIRED COMPONENTS Core)
35-
3633
add_executable(InjectionMolding
3734
${PROJECT_SOURCES}
3835
)
@@ -63,8 +60,6 @@ target_link_libraries(InjectionMolding
6360
${WeaCore}
6461
${WeaQuick}
6562
)
66-
target_link_libraries(InjectionMolding PRIVATE Qt5::Core)
67-
target_link_libraries(InjectionMolding PRIVATE Qt5::Core)
6863

6964
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
7065
# If you are developing for iOS or macOS you should consider setting an

0 commit comments

Comments
 (0)