Commits on Source 50

  • Silviu Toderita's avatar
    Release 9.2.0 · 43620f9c
    Silviu Toderita authored
    43620f9c
  • Silviu Toderita's avatar
    Merge branch 'release-9.2.0' into 'master' · 052eac11
    Silviu Toderita authored
    Release 9.2.0
    
    
    See merge request software-public/zaber-motion-lib!1717
    052eac11
  • Martin Zak's avatar
    ZML-1128: Splitting devices module · f90ac5f3
    Martin Zak authored
    f90ac5f3
  • Martin Zak's avatar
    Merge branch 'ZML-1144-breakup-devices-modules' into 'master' · 292a3e5b
    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
    292a3e5b
  • Martin Zak's avatar
  • Martin Zak's avatar
    Merge branch 'ZML-1143-add-labview-to-getting-started-content' into 'master' · 34263553
    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
    34263553
  • Silviu Toderita's avatar
    03841eba
  • Silviu Toderita's avatar
    Merge branch 'zml-1156-gripper-calibrate-fix' into 'master' · 70ae5e24
    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
    70ae5e24
  • Software Team laptop's avatar
    1269081c
  • Soleil Lapierre's avatar
    Merge branch 'lv-example-add-alerts' into 'master' · c24f9ea5
    Soleil Lapierre authored
    Add enableAlerts call to LabVIEW example.
    
    
    See merge request software-public/zaber-motion-lib!1721
    c24f9ea5
  • Martin Zak's avatar
  • Martin Zak's avatar
    Merge branch... · d96dae97
    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
    d96dae97
  • Martin Zak's avatar
    83302103
  • Martin Zak's avatar
    Merge branch 'ZML-1141-make-pvt-csv-accept-brackets-for-units' into 'master' · 6ca8c7b7
    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
    6ca8c7b7
  • Silviu Toderita's avatar
  • Silviu Toderita's avatar
    Merge branch 'fix-gripper-serial' into 'master' · f451a0da
    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
    f451a0da
  • Silviu's avatar
    Release 9.2.1 · 4c13e535
    Silviu authored
    4c13e535
  • Silviu Toderita's avatar
    Merge branch 'release-v9.2.1' into 'master' · 703110ca
    Silviu Toderita authored
    Release 9.2.1
    
    
    See merge request software-public/zaber-motion-lib!1725
    703110ca
  • Silviu's avatar
  • Silviu Toderita's avatar
    Merge branch 'fix-gripper-flaky-test' into 'master' · 1de127c0
    Silviu Toderita authored
    Increase timeout for test that flakes on slowest raspberry pi CI machine.
    
    
    See merge request software-public/zaber-motion-lib!1726
    1de127c0
  • Martin Zak's avatar
    ZML-1119: transform markdown links per language · dc4847c0
    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: default avatarClaude Opus 4.7 (1M context) <noreply@anthropic.com>
    dc4847c0
  • Martin Zak's avatar
    ZML-1119: regenerate code · a41915a9
    Martin Zak authored
    
    
    Co-Authored-By: default avatarClaude Opus 4.7 (1M context) <noreply@anthropic.com>
    a41915a9
  • Martin Zak's avatar
    Merge branch 'ZML-1119-clean-up-buzzing-badger' into 'master' · ec2ff386
    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
    ec2ff386
  • Martin Zak's avatar
  • Martin Zak's avatar
    Merge branch 'update-eslint-config-0.0.100' into 'master' · 4bc0c79e
    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
    4bc0c79e
  • Martin Zak's avatar
    71dbdc8b
  • Martin Zak's avatar
    Merge branch 'ZML-1151-pvt-csv-action-parsing-should-lowercase-first' into 'master' · 6bf15bcd
    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
    6bf15bcd
  • Colby Sparks's avatar
    Fix MATLAB release pipeline for Linux · 2c70843e
    Colby Sparks authored
    2c70843e
  • Colby Sparks's avatar
    Merge branch 'fix-matlab-release-linux' into 'master' · 9cfc344b
    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
    9cfc344b
  • Colby Sparks's avatar
    Remove 32-bit JS Build · 69d64c52
    Colby Sparks authored
    69d64c52
  • Colby Sparks's avatar
    Merge branch 'fix-js-build' into 'master' · 38911926
    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
    38911926
  • Silviu Toderita's avatar
    ZML-1160: add hasCommand and hasSetting · 0f924ced
    Silviu Toderita authored
    0f924ced
  • Silviu Toderita's avatar
    Merge branch 'zml-1160-hascommand-hassetting' into 'master' · 934a51f9
    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
    934a51f9
  • Skyler Olson's avatar
    ZML-1004: Moveable API · d3e648c2
    Skyler Olson authored
    d3e648c2
  • Skyler Olson's avatar
    Merge branch 'zml-1004-moveable-api' into 'master' · ebd626ff
    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
    ebd626ff
  • Colby Sparks's avatar
    Release v9.3.0 · 18295211
    Colby Sparks authored
    18295211
  • Colby Sparks's avatar
    Merge branch 'release-v9.3.0' into 'master' · 43631bc9
    Colby Sparks authored
    Release v9.3.0
    
    
    See merge request software-public/zaber-motion-lib!1737
    43631bc9
  • Skyler Olson's avatar
    ZML-1004: Moveables Instantiation · e6df4e32
    Skyler Olson authored
    e6df4e32
  • Skyler Olson's avatar
    Merge branch 'zml-1004-moveable-instantiation' into 'master' · 0d73505f
    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
    0d73505f
  • Skyler Olson's avatar
    ZML-1140: Auto Tag · 3db031a4
    Skyler Olson authored
    3db031a4
  • Skyler Olson's avatar
    Merge branch 'zml-1140-auto-tag' into 'master' · ff4e1476
    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
    ff4e1476
  • Silviu Toderita's avatar
    Enforce 140-char line length limit in Go · 5127fc30
    Silviu Toderita authored
    5127fc30
  • Silviu Toderita's avatar
    Merge branch 'go-line-length-limit' into 'master' · 03526dd8
    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
    03526dd8
  • Silviu Toderita's avatar
  • Silviu Toderita's avatar
    Merge branch 'zl-1116-refactor-device-settings-gets' into 'master' · e543e924
    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
    e543e924
  • Martin Zak's avatar
  • Martin Zak's avatar
    Merge branch 'zl-1116-fix-go-line-length' into 'master' · 8efe5b97
    Martin Zak authored
    ZL-1116: Wrap runSyncBatch signature to satisfy Go line-length limit
    
    
    See merge request software-public/zaber-motion-lib!1741
    8efe5b97
  • Silviu Toderita's avatar
  • Silviu Toderita's avatar
    Merge branch 'zml-1165-gripper-open-connection-check' into 'master' · 594688b2
    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
    594688b2
  • Silviu Toderita's avatar
    updates changelog and bumps version · 84ac77d1
    Silviu Toderita authored
    84ac77d1
Loading
Loading