Loading
Commits on Source 50
-
Silviu Toderita authored
-
Silviu Toderita authored
Release 9.2.0 See merge request software-public/zaber-motion-lib!1717
-
Martin Zak authored
-
Martin Zak authored
ZML-1128: Splitting devices module # ZML-1144: Break up `internal/devices/` into focused packages ## What Split the monolithic `internal/devices/` module into a set of focused feature packages, each owning its own manager and callbacks. This makes boundaries explicit, shrinks the average file size, and lets each area evolve on its own. ## Package moves Extracted out of `internal/devices/` into their own packages: - **`internal/triggers/`** — trigger setup, conditions, actions, labels - **`internal/oscilloscope/`** — channel setup, capture, read-back - **`internal/deviceio/`** — analog/digital I/O, schedules - **`internal/motion/`** — movement, lockstep, parking, axis-number queries - **`internal/stream/`** — streams + PVT (setup, commands, sequences, buffers) - **`internal/savestate/`** — get/set device state, including stream buffer and trigger round-trip ## Supporting structural changes - **Split `internal/ioc/` into `ioc` + `common`.** Interfaces/shared target helpers (`DeviceTarget`, `AxisTarget`, `CommandArg`, etc.) moved into `common` so feature packages can depend on them without pulling the whole IoC container. - **Merged `internal/commandbuilding/` into `internal/commands/`.** The two packages had overlapping responsibilities and a duplicate pair of `SingleCommandDevice/Axis`; unifying them removes a layer and a duplicate. - **Stream/lockstep state colocated with the feature.** Per-device stream and lockstep registries now live on the owning package via `GetOrCreateAssociatedStruct` on `ioc.DeviceInfo`, instead of being managed centrally in `devices/`. ## API surface adjustments - `ioc.DeviceManager` trimmed to the subset other packages actually need; feature-specific methods moved onto their respective manager interfaces (`StreamManager`, `Motion`, `Triggers`, `DeviceIO`, `StorageManager`). - Pure static helpers that didn't need a manager (e.g. `triggers.ActionLabel`) dropped from the IoC interface and exposed as package-level functions. ## Non-goals / out of scope - No behavior changes. Protocol, callback names, and wire formats are unchanged. - No changes to language bindings — this is a Go-core reorganization only. See merge request software-public/zaber-motion-lib!1715
-
Martin Zak authored
-
Martin Zak authored
ZML-1143: add LabVIEW example folder with NuGet setup script Related to ZML-1143 See merge request software-public/zaber-motion-lib!1719
-
Silviu Toderita authored
-
Silviu Toderita authored
Removes save_to_flash option from calibrate() function It should've never been there, so I think it's fair to remove. Calibration should always be saved to flash. See merge request software-public/zaber-motion-lib!1720
-
Software Team laptop authored
-
Soleil Lapierre authored
Add enableAlerts call to LabVIEW example. See merge request software-public/zaber-motion-lib!1721
-
Martin Zak authored
-
Martin Zak authored
Merge branch 'ZML-1150-reference-to-connection-object-is-maintained-by-events-closure-in-python' into 'master' ZML-1150: avoid capturing self in Connection events closure (Python) ## Summary Fixes [ZML-1150](https://youtrack.izaber.com/issue/ZML-1150). In Python, dropping the last user reference to a `Connection` did not free the underlying interface — the connection (and its TCP socket / serial port) stayed open until process exit. ### Root cause `Connection.__setup_events()` defined an inner `filter_connection_event(...)` closure that read `self._interface_id`, capturing `self`. The closure is then attached to subscriptions on the module-level `events` Subject (in `zaber_motion/events.py`), which lives for the lifetime of the process. That keeps `self` alive forever, so `Connection.__del__` (which calls `interface/free`) never runs. ### Fix Bind `interface_id = self._interface_id` to a local **before** defining the closure. The closure now captures only `int` identifiers (`interface_id`, and `session_id` which was already a parameter), not `self`. Same fix applied to both ASCII and Binary `Connection` templates. ## Validation Ran a reproduction that opens a TCP listener, calls `Connection.open_tcp(...)` and immediately drops the reference, then watches whether the server-side socket sees a disconnect: - **Before fix:** server timed out at 5s — connection leaked. - **After fix:** server's `recv()` returned 0 immediately when the local went out of scope (CPython refcount collected it before any explicit `gc.collect()`).
🤖 Generated with [Claude Code](https://claude.com/claude-code) See merge request software-public/zaber-motion-lib!1722 -
Martin Zak authored
-
Martin Zak authored
ZML-1141: add test for square bracket units in PVT CSV Hey Sol, looks like this ticket has no actuall work needed. Can you please verify that that's what I wanted? ## Summary Square bracket units (e.g. `X [mm]`) are already accepted in PVT CSV headers — the existing header regexps use the character class `[\(\[]...[\)\]]` so both round and square brackets match. No code change was needed; this MR just adds an explicit test to lock in that behavior. ## Test plan - [x] New test `parses valid 2d csv data with mixed square and round brackets for units` passes against the unmodified core - [x] All existing PVT CSV tests still pass Closes ZML-1141 See merge request software-public/zaber-motion-lib!1723
-
Silviu Toderita authored
-
Silviu Toderita authored
Fix opening of two-digit COM ports on Windows for Ge1x gripper Tested on Windows to confirm single-digit COM ports still work, and double-digit COM ports now work. Tested on Mac to ensure connection still works. See merge request software-public/zaber-motion-lib!1724
-
Silviu authored
-
Silviu Toderita authored
Release 9.2.1 See merge request software-public/zaber-motion-lib!1725
-
Silviu authored
-
Silviu Toderita authored
Increase timeout for test that flakes on slowest raspberry pi CI machine. See merge request software-public/zaber-motion-lib!1726
-
Martin Zak authored
Each language's docEscape (and DTO description generator) now converts [text](url) markdown into the doc-comment convention appropriate for that language: C# <see href>, MATLAB <a href="matlab: web(...)">, Java/C++ <a href> for Javadoc/Doxygen, Python plain text "text (url)". TypeScript and Swift keep markdown unchanged since TSDoc and DocC render it natively. Co-Authored-By:Claude Opus 4.7 (1M context) <noreply@anthropic.com>
-
Martin Zak authored
Co-Authored-By:Claude Opus 4.7 (1M context) <noreply@anthropic.com>
-
Martin Zak authored
ZML-1119: Clean up web links in API documentation ## Summary - Markdown-style `[text](url)` links in API descriptions now render in each language's doc-comment convention: C# `<see href>`, MATLAB `<a href="matlab: web(...)">`, Java/C++ `<a href>` (Javadoc/Doxygen), Python plain text `text (url)`. TypeScript and Swift keep markdown unchanged since TSDoc and DocC render it natively. Go DTOs are internal-only and were left as-is. - Fixes a separate gap where DTO/enum generators never applied any `docEscape` — so even C#/MATLAB enums (where template-based classes worked) showed raw markdown. - Also closes a Python-side gap where `python.docEscape` was not applied to the body of method docstrings (only params/returns). - New shared helper `markdownLinks` (with `transform` plus per-language format props) lives in `templates/src/common.ts` (renamed from `common_types.ts`). ## Commits 1. `transform markdown links per language` — template/generator source changes (15 files) 2. `regenerate code` — `npx gulp gen_code` output (49 files: C++, C#, Java, Python, MATLAB) ## Test plan - [x] `npm run lint` passes - [x] `tsc --noEmit` passes for templates - [x] Verified canonical `MessageType` enum transforms correctly across C#, Java, C++, Python, MATLAB - [x] Confirmed no raw `](http` markdown remains in generated Java, C++, Python, C#, MATLAB sources - [ ] Review generated docs render as expected in target IDEs (VS Code over C# reflection, IntelliJ JavaDoc tooltip, Doxygen output, MATLAB help)
🤖 Generated with [Claude Code](https://claude.com/claude-code) See merge request software-public/zaber-motion-lib!1728 -
Martin Zak authored
-
Martin Zak authored
Update @zaber/eslint-config to 0.0.100 and add no-multi-spaces rule ## Summary Bumps `@zaber/eslint-config` from `0.0.94` → `0.0.100`, which enables the new `import-x/order` rule, and enables `no-multi-spaces` locally to catch stray double spaces such as `import { foo }` or `, ` followed by extra whitespace. Motivation: a recent review on !1728 flagged `import { Definitions, DtoClass, DtoEnum, DtoVariant, WithNamespace }` (double space before `WithNamespace`). The `no-multi-spaces` rule catches this and similar cases automatically. The auto-fix surfaced 7 similar double-space typos throughout the templates. ## Commits 1. `Update @zaber/eslint-config to 0.0.100 and add no-multi-spaces rule` — config-only changes (`package.json`, `package-lock.json`, both `eslint.config.js` files). 2. `Apply eslint auto-fix from new rules` — auto-fix output: import re-ordering (`import-x/order`) and double-space removal (`no-multi-spaces`) across 90 files. ## Test plan - [x] `npm run lint` passes (only pre-existing local untracked file `generated/src/uint64_audit.ts` shows an unrelated warning) - [x] `tsc --noEmit` passes for both root and `templates/` - [ ] CI passes - [ ] Verify a representative `npx gulp gen_code` run still produces unchanged output🤖 Generated with [Claude Code](https://claude.com/claude-code) See merge request software-public/zaber-motion-lib!1729 -
Martin Zak authored
-
Martin Zak authored
ZML-1151: lowercase PVT CSV action commands before parsing ## Summary Spreadsheets often auto-capitalize cell text, so a user typing `call 2` in the Actions column ends up with `Call 2` in the saved CSV. ZML's PVT CSV loader rejects that with `Unrecognized PVT action` because the action regexes are case-sensitive. ## Fix `internal/stream/stream_pvt_csv.go` now applies `strings.ToLower` to each action command before passing it to `parsePvtActionCommand`, mirroring how the `Relative` column is already normalized a few lines above. Added test fixture `valid_1d_with_uppercase_actions.csv` (mixed casing: `CALL 2`, `IO SET DO 1 1`, `Io Set Ao 2 3.3`) and a load test that deep-equals it against the existing lowercase fixture, proving case-insensitive parsing yields identical sequence items. Closes ZML-1151 See merge request software-public/zaber-motion-lib!1732
-
Colby Sparks authored
-
Colby Sparks authored
Fix MATLAB release pipeline for Linux `build_linux_64` hadn't been added to deps for MATLAB release jobs See merge request software-public/zaber-motion-lib!1733
-
Colby Sparks authored
-
Colby Sparks authored
Remove 32-bit JS Build Release pipeline was broken because of node update. There is no 32-bit NAPI for windows: https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V23.md#2024-10-16-version-2300-current-rafaelgss I think there is still support for linux, so not sure if we actually want to remove that too See merge request software-public/zaber-motion-lib!1735
-
Silviu Toderita authored
-
Silviu Toderita authored
ZML-1160: add hasCommand and hasSetting ## Summary Adds public API methods for users to introspect what a connected device supports without attempting a command/setting first: - `Device.hasCommand(command, allowPartial?)` and `Axis.hasCommand(command, allowPartial?)` - `DeviceSettings.hasSetting(setting)` and `AxisSettings.hasSetting(setting)` `hasCommand` uses the same command-tree matching that `prepareCommand` does — `?`, paramnames, enum values, and numeric values are all accepted in parameter slots. `allowPartial=true` accepts incomplete commands that are a valid prefix of a supported one. `set <setting> <value>` is special-cased to validate the setting name against the device's settings table (mirroring `prepareCommand`'s set handling). Behaviour on unidentified devices throws `NotSupportedException` (matches `canConvertSetting`). ## Test plan - [x] Go core builds (`gulp build_go`) - [x] Generated code regenerates cleanly across all 8 language bindings (`gulp gen_code`) - [x] Full JS e2e suite passes (`gulp test_js`) — 1909 tests - [x] New e2e coverage: identified/unidentified device, partial vs. full match, paramname/enum value/numeric parameters, set-command validation, empty-string edge cases
🤖 Generated with [Claude Code](https://claude.com/claude-code) See merge request software-public/zaber-motion-lib!1730 -
Skyler Olson authored
-
Skyler Olson authored
ZML-1004: Moveable API An API for controlling movables (axes and locksteps) Related to zml-1004 See merge request software-public/zaber-motion-lib!1702
-
Colby Sparks authored
-
Colby Sparks authored
Release v9.3.0 See merge request software-public/zaber-motion-lib!1737
-
Skyler Olson authored
-
Skyler Olson authored
ZML-1004: Moveables Instantiation Forgot to add this so that the documentation would show instantiation examples. Related to zml-1004 See merge request software-public/zaber-motion-lib!1738
-
Skyler Olson authored
-
Skyler Olson authored
ZML-1140: Auto Tag Automatically tags releases after they go out. Related to zml-1140 See merge request software-public/zaber-motion-lib!1736
-
Silviu Toderita authored
-
Silviu Toderita authored
Enforce 140-char line length limit in Go ## Summary - Enable revive's `line-length-limit` rule (140 chars) in `.golangci.yml`, and add `internal/generated/` to the existing exclusions list (alongside `internal/dto/`). - Wrap 313 pre-existing long lines across 88 files in `internal/` to satisfy the new rule. Wrapping conventions used: function signatures broken parameter-per-line, long `fmt.Sprintf`/error-message calls broken argument-per-line, long format strings split via adjacent-string concatenation. - No `//nolint` directives added; no semantic changes — pure line wrapping. ## Seeing violations in VS Code The VS Code Go extension (`golang.go`) can show over-limit lines as wavy yellow underlines on save, but only if it's pointed at `golangci-lint`. It defaults to `staticcheck`, which has no line-length rule. Add to your VS Code user settings (`Cmd+,` → click the `{}` icon top-right to open `settings.json`): ```json "go.lintTool": "golangci-lint", "go.lintOnSave": "package" ``` Then reload the window: `Cmd+Shift+P` → **Developer: Reload Window**. **If lint silently doesn't run**, the extension can't find the `golangci-lint` binary on `PATH`. Check `View → Output → Go` for an error. Fix it either by ensuring `$GOPATH/bin` (or wherever `npx gulp dependencies` installed `golangci-lint`) is on your shell `PATH`, or by adding an explicit pointer to your user settings: ```json "go.alternateTools": { "golangci-lint": "/absolute/path/to/golangci-lint" } ``` You can find your binary path with `ls $GOPATH/bin/golangci-lint`. Once configured, save any `.go` file with a line over 140 chars and you'll see the underline immediately, plus the message in the Problems panel. See merge request software-public/zaber-motion-lib!1740 -
Silviu Toderita authored
-
Silviu Toderita authored
ZL-1116: Split overlong synchronized setting reads into smaller batches ## Summary `getSyncSettings` (and by extension `getMany`/`getSynchronized`/`getManyTyped` when sync mode is available) builds a single multi-setting `get` command per chunk of `MaxSyncSettings`. That chunking caps the _count_ of settings per command but does nothing about the resulting _character length_. If long setting names or many axis-scope switches push the assembled command past the device's `MaxPackets * packetSize` budget, the transport layer raises `ErrCommandTooLong` and the entire multi-get fails. This MR extracts a `runSyncBatch` helper that recursively halves the batch and retries when `ErrCommandTooLong` comes back. A single-scope batch that still fails propagates the error unchanged. ## Changes - `internal/devices/settings_multiget.go`: factored the per-batch send/parse out of `getSyncSettings` into `runSyncBatch`, which catches `Errors_COMMAND_TOO_LONG` and recurses on each half. - `js/test-e2e/ascii/device_settings.test.ts`: added an e2e test that identifies an unidentified device with a single-packet command budget and `get.settings.max=20`, then issues a `getMany` with eight long setting names. Asserts the library halves the batch and sends two smaller sync commands instead of failing. See merge request software-public/zaber-motion-lib!1739
-
Martin Zak authored
-
Martin Zak authored
ZL-1116: Wrap runSyncBatch signature to satisfy Go line-length limit See merge request software-public/zaber-motion-lib!1741
-
Silviu Toderita authored
-
Silviu Toderita authored
ZML-1165: Verify GE1 gripper communication when opening connection Opening a GE1 gripper connection previously succeeded as soon as the serial/TCP port opened, even if the device on the other end was unresponsive or not a gripper at all. This adds a probe read of the device-ID register (`0x0302`) right after the port is opened, so a bad port or silent device fails fast with a clear `ConnectionFailedException` ("Failed to communicate with GE1 Gripper") instead of surfacing later on the first real command. ### Changes - `internal/thirdparty/ge1x_gripper`: after opening and setting the unit ID, read the device-ID register; on failure, close the connection and return `ErrConnectionFailed`. - `js/test-e2e/product/ge1x_gripper.test.ts`: cover the probe (issued on open, addressed to the configured device address, and failing the open on no-response / Modbus error). Existing opens now answer the probe via a shared `openGripper()` helper. Also stopped the `saveToFlash` retry test from holding a second live connection, which raced the single-socket mock server once opens started doing I/O. #zml-1165 Fixed See merge request software-public/zaber-motion-lib!1742 -
Silviu Toderita authored