Skip to content

Commit 0411af5

Browse files
committed
Merge feature/dual-connection-support: cleanup project and add development scripts
2 parents 0745f5d + 9343d2d commit 0411af5

73 files changed

Lines changed: 3232 additions & 3680 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AVG_OFF.bat‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# ========================================
2+
# Rust Build with AVG Control
3+
# ========================================
4+
5+
Write-Host "Stopping AVG services..." -ForegroundColor Yellow
6+
7+
# Stop AVG services
8+
@("AVGIDSAgent", "AVG Antivirus Service", "avgwd", "avgsvc") | ForEach-Object {
9+
try {
10+
net stop $_ /y 2>$null
11+
} catch {}
12+
}
13+
14+
Start-Sleep -Seconds 2
15+
16+
Write-Host "Building Rust project..." -ForegroundColor Yellow
17+
18+
# Setup environment
19+
$env:RUSTUP_HOME = "C:\Users\tkogut\.rustup"
20+
$env:CARGO_HOME = "C:\Users\tkogut\.cargo"
21+
$env:PATH = "C:\Users\tkogut\.cargo\bin;D:\msys64\mingw64\bin;D:\msys64\usr\bin;$env:PATH"
22+
23+
# Build
24+
cd C:\Users\tkogut\.cursor\Bridge_ScaleCmd_Rust\src-rust
25+
cargo clean
26+
cargo build --target x86_64-pc-windows-gnu --release
27+
28+
$buildResult = $LASTEXITCODE
29+
30+
# Restart AVG
31+
Write-Host "Restarting AVG services..." -ForegroundColor Yellow
32+
@("avgsvc", "AVG Antivirus Service") | ForEach-Object {
33+
try {
34+
net start $_ /y 2>$null
35+
} catch {}
36+
}
37+
38+
# Result
39+
if ($buildResult -eq 0) {
40+
Write-Host "✓ BUILD SUCCESS!" -ForegroundColor Green
41+
Write-Host "Binary: C:\Users\tkogut\.cursor\Bridge_ScaleCmd_Rust\src-rust\target\x86_64-pc-windows-gnu\release\scaleit-bridge.exe"
42+
} else {
43+
Write-Host "✗ BUILD FAILED" -ForegroundColor Red
44+
}

‎BUILD.bat‎

Lines changed: 0 additions & 136 deletions
This file was deleted.

‎BUILD_WINDOWS.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ cargo build --release
7070
# Output will be at: target/release/scaleit-bridge.exe
7171
```
7272

73+
For automated releases that target the installer bundle, run `powershell.exe -ExecutionPolicy Bypass -File "..\build-rust-mingw.ps1"` from the repository root to configure the MinGW toolchain and produce the `x86_64-pc-windows-gnu` release binary. This script also handles the `PATH` environment, linker overrides and cleanup required for downstream packaging.
74+
75+
> **GNU linker path**: the scripts depend on `ld.exe` living under `D:\msys64\mingw64\x86_64-w64-mingw32\bin`. Make sure that directory is exported into `%PATH%` before the regular `mingw64\bin` so the linker is discoverable when `cargo` invokes `ld`. The scripts (`build-rust-mingw.ps1`, `build-mingw.ps1`, `test-rust-mingw.ps1`) already include that path, so rerunning them will refresh the environment.
76+
7377
### Frontend (React + TypeScript)
7478

7579
```powershell
@@ -130,6 +134,23 @@ Copy-Item ".env.example" "$packageDir/.env.example"
130134

131135
---
132136

137+
## Automated Installer Packaging
138+
139+
Use `scripts/prepare-installer.ps1` to produce the release ZIP without manually copying files. The script:
140+
141+
1. Prepares the MinGW toolchain via `build-rust-mingw.ps1` and builds `src-rust` with the `x86_64-pc-windows-gnu` target.
142+
2. Installs frontend dependencies (if missing) and runs `npm run build` to generate the `dist/` bundle.
143+
3. Calls `Create-InstallerPackage.ps1` to copy binaries, configs, frontend assets, scripts, documentation and `.env.example` into `ScaleIT_Bridge_Windows_v<Version>` and compress it.
144+
145+
```powershell
146+
# builds backend+frontend and packages everything for v1.0.0 in ./release
147+
powershell.exe -ExecutionPolicy Bypass -File "scripts/prepare-installer.ps1" -Version "1.0.0" -OutputPath ".\release"
148+
```
149+
150+
After the script finishes you can extract the generated `ScaleIT_Bridge_Windows_v1.0.0.zip` and proceed with the installation steps below.
151+
152+
---
153+
133154
## Installation on Target Machine
134155

135156
### Step 1: Extract Package

‎CHANGELOG.md‎

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
---
99

10+
## [3.2.0] - 2025-12-11
11+
12+
### Added
13+
- 🛑 **Server Control API**:
14+
- POST `/api/shutdown` endpoint for controlled server shutdown
15+
- Disconnects all devices before stopping
16+
- Frontend "Stop" button now fully functional
17+
- Proper cleanup of resources on shutdown
18+
- POST `/api/start` endpoint for server startup (works when server is running, shows manual instructions when stopped)
19+
- Frontend status detection (Running/Stopped/Error) with automatic refresh
20+
- Real-time server health monitoring
21+
22+
- 🔧 **Device Configuration Management**:
23+
- Enhanced device configuration form with better validation
24+
- Case-insensitive command matching (readGross/readgross both work)
25+
- Automatic device ID normalization (lowercase)
26+
- Duplicate device ID detection before saving
27+
- Improved error messages and logging
28+
29+
- ✅ **Test Suite Improvements**:
30+
- All tests now pass 100%
31+
- Fixed property-based tests for weight readings
32+
- Improved integration test timeouts
33+
- Better floating-point comparison handling
34+
- Enhanced device name validation strategies
35+
36+
- 🌐 **Frontend Enhancements**:
37+
- Better error handling in API calls
38+
- Improved form validation with Zod
39+
- Connection type-specific field validation (TCP vs Serial)
40+
- Real-time form error display
41+
- Automatic form reset after successful save
42+
- **Diagnostics Panel Improvements**:
43+
- Real-time connection status detection (Online/Offline)
44+
- Actual device health monitoring (Responsive/Unresponsive)
45+
- Server status display (Running/Stopped/Unknown)
46+
- Automatic status refresh every 5 seconds
47+
- Removed hardcoded device status simulation
48+
49+
### Changed
50+
- ⬆️ Updated build script (`build-rust-mingw.ps1`):
51+
- Added `--release` flag support for optimized builds
52+
- Better error messages and troubleshooting tips
53+
- Improved build status reporting
54+
- Enhanced test result display
55+
56+
- 🔄 **Command Handling**:
57+
- Commands are now case-insensitive (readGross, readgross, READGROSS all work)
58+
- Improved command lookup in both Rinstrum and Dini Argeo adapters
59+
60+
- 📝 **Documentation**:
61+
- Updated README with latest build instructions
62+
- Added troubleshooting section for common issues
63+
- Enhanced API documentation
64+
65+
### Fixed
66+
- 🐛 Fixed form validation errors when switching between TCP and Serial connection types
67+
- 🐛 Fixed "Add Device" button not working due to validation issues
68+
- 🐛 Fixed serial_port validation triggering for TCP connections
69+
- 🐛 Fixed device ID case sensitivity issues
70+
- 🐛 Fixed CORS configuration for frontend-backend communication
71+
- 🐛 Fixed frontend port conflict (changed from 8080 to 5173)
72+
- 🐛 Fixed test timeouts in integration tests
73+
- 🐛 Fixed property test failures for weight reading constraints
74+
- 🐛 Fixed API error response parsing in frontend
75+
- 🐛 Fixed Diagnostics panel showing hardcoded "Offline" status
76+
- 🐛 Fixed server status not updating after shutdown
77+
- 🐛 Fixed "Stop" button not reflecting actual server state
78+
79+
### Performance
80+
- ⚡ Improved build script execution time
81+
- ⚡ Better error recovery in device connections
82+
- ⚡ Optimized form validation performance
83+
84+
---
85+
1086
## [3.1.0] - 2025-11-23
1187

1288
### Added

0 commit comments

Comments
 (0)