by adom
Let an AI (Claude, ChatGPT, Codex or any agent) run Altium Designer for you: create symbols and footprints, place parts (also from Altium 365), wire and annotate schematics, Update PCB, set the stack-up and rules, route, pour copper, add mounting holes and stitching vias, run ERC and DRC, and make Gerbers, BOMs and STEP. Free in Hydrogen; bring your own AI and Altium licence.
← Commit history
altium-bridge 0.2.92: caller decimals read without the Windows locale (#31, fix by Carlos Ferri Pereira in PR #4)
7 files changed
+38−8
CHANGELOG.md+5@@ -1,5 +1,10 @@ # Changelog +## 0.2.92++- **Decimal numbers work on Windows set to a comma decimal separator** (#31, found and fixed by Carlos Ferri Pereira in PR #4). The agent read every number a caller passed (`-0.9100` in a footprint spec, a body offset, a board size) with Altium's `StrToFloat`, which uses the Windows region's decimal separator. On Portuguese, Spanish, German, French and other comma locales every such verb raised `EConvertError` and stopped the script: `build_footprint`, `footprint_from_land_pattern`, `import_part`, `create_footprint`, `edit_footprint`, `test_board`, `board_shape`, `import_step` and `add_symbol_art`. The agent now reads the digits itself, whatever the region says, and nothing has to change on the user's machine. Everything the agent writes back was already locale-proof (whole micrometres and mils).+- Tested on Altium Designer Develop 26.9 with the test laptop set to a comma decimal separator: 0.2.91 raised `'-1.5000' is not a valid floating point value` in `footprint_from_land_pattern`; 0.2.92 passes it, and the full verb battery on Altium Designer 26.11 under the same comma locale.+ ## 0.2.91 - **A halted agent no longer takes the bridge down** (#30). When the agent stopped in Altium's script debugger right after it started, every agent verb, `agent_start` and `agent_recover` included, healed it by recovering and starting again, and each start met the same halt and began the next recover. Nothing ended the loop: the bridge restarted the agent about every 30 s, raised Altium's Error box each time, and the request thread's stack eventually ran out, which ends the whole process with no log (197 restarts on one machine). Now a start or recover never heals from inside itself:
bridge-rs/src/main.rs+1−1@@ -79,7 +79,7 @@ use tiny_http::{Header, Method, Response, Server}; /// Attached to every failed reply (see the /command handler). const REPORT_ISSUES: &str = "If this looks like an altium-bridge BUG (not a refusal you expected), report it: check for a duplicate with `adom-wiki issue list adom/altium-bridge`, then `adom-wiki issue create adom/altium-bridge --title \"<verb>: <one-line symptom>\" --category bug-report --body \"<what you ran, what you expected, what happened, the VERBATIM response JSON (and errorShot if present), bridgeVersion, the Altium version from altium_status, the OS>\"`. A relay, routing, toast or lifecycle problem belongs on adom/adom-bridge instead. Reports from real machines are how this bridge gets correct: three different Altium builds behaved three different ways in one weekend."; -pub const BRIDGE_VERSION: &str = "0.2.91";+pub const BRIDGE_VERSION: &str = "0.2.92"; fn json_response(status: u16, body: &serde_json::Value) -> Response<std::io::Cursor<Vec<u8>>> { let data = serde_json::to_vec(body).unwrap_or_else(|_| b"{}".to_vec());
package.json+1−1@@ -1,6 +1,6 @@ { "slug": "altium-bridge",- "version": "0.2.91",+ "version": "0.2.92", "type": "app", "description": "Let an AI (Claude, ChatGPT, Codex or any agent) run Altium Designer for you: create symbols and footprints, place parts (also from Altium 365), wire and annotate schematics, Update PCB, set the stack-up and rules, route, pour copper, add mounting holes and stitching vias, run ERC and DRC, and make Gerbers, BOMs and STEP. Free in Hydrogen; bring your own AI and Altium licence.", "tags": [
page.json+1−1@@ -4,7 +4,7 @@ "type": "app", "title": "Altium Bridge: AI for Altium Designer", "brief": "Let an AI (Claude, ChatGPT, Codex or any agent) run Altium Designer for you: create symbols and footprints, place parts (also from Altium 365), wire and annotate schematics, Update PCB, set the stack-up and rules, route, pour copper, add mounting holes and stitching vias, run ERC and DRC, and make Gerbers, BOMs and STEP. Free in Hydrogen; bring your own AI and Altium licence.",- "version": "0.2.91",+ "version": "0.2.92", "hero": { "type": "image", "path": "screenshots/hero.png"
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-0.2.91+0.2.92
src/agent/AdomAgent.pas.tmpl+28−3@@ -67,14 +67,39 @@ Begin If (Digits = 0) Or (Dots > 1) Then Result := False; End; +{ Caller numbers are ASCII with a dot ("-0.9100"), whatever the Windows region says. StrToFloat reads them with+ the region's decimal separator, so on a comma locale (Portuguese, Spanish, German, French...) every caller float+ raised EConvertError and parked the script (adom/altium-bridge#31, found and fixed by Carlos Ferri Pereira in PR #4).+ The digits are read here instead: one integer mantissa, divided once, so 0.91 is as exact as a Double allows. } Function AdomFloat(S : String) : Double; Var- T : String;+ T, C : String;+ I, D : Integer;+ Neg, InFrac : Boolean;+ Scale : Double; Begin Result := 0; T := Trim(S);- If AdomIsNumber(T, True) Then Result := StrToFloat(T)- Else If gInputError = '' Then gInputError := T;+ If Not AdomIsNumber(T, True) Then+ Begin+ If gInputError = '' Then gInputError := T;+ Exit;+ End;+ Neg := False; InFrac := False; Scale := 1.0;+ For I := 1 To Length(T) Do+ Begin+ C := Copy(T, I, 1);+ D := Pos(C, '0123456789') - 1;+ If C = '-' Then Neg := True+ Else If C = '.' Then InFrac := True+ Else If D >= 0 Then+ Begin+ Result := Result * 10.0 + D;+ If InFrac Then Scale := Scale * 10.0;+ End;+ End;+ Result := Result / Scale;+ If Neg Then Result := -Result; End; Function AdomInt(S : String) : Integer;
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "altium", "displayName": "Altium Designer",- "version": "0.2.91",+ "version": "0.2.92", "description": "Drive Altium Designer from Adom: a resident DelphiScript agent (eval + the 1,100-command process launcher), the X2 -R command line, UIA over the VCL shell, dialogs by PID, screenshots of every Altium window, and Altium 365.", "homepage": "https://wiki.adom.inc/adom/altium-bridge", "docs": "https://wiki.adom.inc/adom/altium-bridge",