Compare commits

..
Author SHA1 Message Date
kraemr df26ae32bc fixed discov 2025-10-29 14:08:38 +01:00
kraemr ee5b28b8f4 fixed 2025-10-29 14:07:02 +01:00
kraemr c7c0effea5 removed caching 2025-10-29 13:26:24 +01:00
kraemr e45f2c5eaf Events dont get cached in the backend anymore 2025-10-29 13:08:44 +01:00
Robin Krämer 13117a5d94 Merge pull request #845 from qitechgmbh/844-add-winder-mock-machine
added Winder mock
2025-10-28 17:58:25 +01:00
kraemr 6b74c7ec7a removed default mock-machine 2025-10-28 17:53:04 +01:00
kraemr e8b561f722 added Winder mock 2025-10-28 17:53:04 +01:00
Robin Krämer 75ee5af180 Merge pull request #852 from qitechgmbh/851-improve-caching
851 improve caching
2025-10-28 17:46:21 +01:00
kraemr 29f924f6cc removed socketioManager 2025-10-27 16:42:03 +01:00
kraemr 6e058c8e95 Keep namespaces alive 2025-10-27 15:11:30 +01:00
Robin Krämer 6822da80cf Merge pull request #838 from qitechgmbh/dependabot/npm_and_yarn/electron/multi-a50d7f32cf
Bump playwright and @playwright/test in /electron
2025-10-27 11:24:43 +01:00
dependabot[bot] 37e3302f61 Bump playwright and @playwright/test in /electron
Bumps [playwright](https://github.com/microsoft/playwright) to 1.56.1 and updates ancestor dependency [@playwright/test](https://github.com/microsoft/playwright). These dependencies need to be updated together.


Updates `playwright` from 1.54.2 to 1.56.1
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.54.2...v1.56.1)

Updates `@playwright/test` from 1.54.2 to 1.56.1
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.54.2...v1.56.1)

---
updated-dependencies:
- dependency-name: playwright
  dependency-version: 1.56.1
  dependency-type: indirect
- dependency-name: "@playwright/test"
  dependency-version: 1.56.1
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 11:21:25 +01:00
Robin Krämer 9b369d71ee Merge pull request #839 from qitechgmbh/dependabot/npm_and_yarn/electron/vite-6.4.1
Bump vite from 6.3.6 to 6.4.1 in /electron
2025-10-27 11:21:10 +01:00
dependabot[bot] cf58f0db6f Bump vite from 6.3.6 to 6.4.1 in /electron
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.3.6 to 6.4.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@6.4.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.4.1
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 11:17:46 +01:00
Robin Krämer 299f23c796 Merge pull request #847 from qitechgmbh/846-refactor-initialization-to-be-based-around-futures
started refactoring initialization to use futures instead
2025-10-27 11:14:18 +01:00
kraemr b58e4333a0 removed traces 2025-10-27 11:08:21 +01:00
kraemr f76cb9c381 Fixed Loop async code 2025-10-27 11:01:04 +01:00
kraemr e93e10d14d fixed all warnings and restored original ethercat discovery behaviour 2025-10-23 20:13:48 +02:00
kraemr 025464ebff all init functions look sane now
fixed compilation errors

fixed compile errors

refactored serial device detection successfully

added serial_detection functions

fixed  Killed error, and improved serial_detection

fixed all remaining issues

fix

fix
2025-10-23 20:13:33 +02:00
kraemr ae8f77f070 started refactoring initialization to use futures instead 2025-10-22 17:56:52 +02:00
Robin Krämer 97811a12d1 Merge pull request #842 from qitechgmbh/changelog-2.11.0
updated Changelog
2025-10-21 13:11:26 +02:00
kraemr 1f7e01820a updated Changelog 2025-10-21 13:10:37 +02:00
Robin Krämer 2f73771bbd Merge pull request #827 from qitechgmbh/825-add-button-to-change-the-spool-motor-direction-of-the-winder
825 add button to change the spool motor direction of the winder
2025-10-21 13:01:25 +02:00
Christian 503ac18e7b Ensure spool RPM is always displayed as a positive value 2025-10-21 12:37:34 +02:00
Christian 6a99b21c15 Fix spool speed rendering to display absolute values 2025-10-21 12:37:34 +02:00
Christian 170667f2b4 Add spool direction control to Winder2
- Introduced a new setting for spool direction (Forward/Reverse) in Winder2PresetsPage and Winder2Settings.
- Updated the state management to include forward direction in useWinder.
- Enhanced the API to handle SetSpoolForward mutation.
- Adjusted the spool speed controller to apply direction based on the forward setting.
2025-10-21 12:37:34 +02:00
Robin Krämer 314b7f2484 Merge pull request #840 from qitechgmbh/828-add-xl-winder-button-to-the-winder-config
828 add xl winder button to the winder config
2025-10-21 12:28:22 +02:00
Christian 9353b12707 Fix traverse limit reset logic in handleXlModeChange function 2025-10-21 11:51:02 +02:00
Christian 063810f906 Add gotoTraverseHome call when switching from XL to normal mode 2025-10-21 11:51:02 +02:00
Christian ac7ce126e6 Refactor handleXlModeChange to reset traverse limits when switching from XL mode 2025-10-21 11:51:02 +02:00
Christian a920830dcf Update WINDER2_TRAVERSE_MAX_XL to 385 mm for improved configuration 2025-10-21 11:51:02 +02:00
Christian 15d74fcee0 Add configuration for Winder2 settings and implement XL mode functionality 2025-10-21 11:51:02 +02:00
Robin Krämer c598e3fc9f Merge pull request #826 from qitechgmbh/818-smooth-fluctuating-temperature-extruder
818 smooth fluctuating temperature extruder
2025-10-20 18:16:08 +02:00
snacj 0dba0f2774 Removed package-lock from root folder 2025-10-20 18:12:06 +02:00
snacj e2cdb6a94c Removed package-lock from root folder 2025-10-20 18:12:06 +02:00
snacj 5dd2011e78 removed file 2025-10-20 18:12:06 +02:00
snacj 7bc142dc83 Fixed error in Extruder mock and removed zone from UpdateStateOptimistically 2025-10-20 18:12:06 +02:00
snacj 1931f00806 Changed rounding and step size to 0.001 for temperature PID 2025-10-20 18:12:06 +02:00
snacj 253336b02c Refactored frontend code of new PID settings 2025-10-20 18:12:06 +02:00
snacj b0c3a97f7f Fixed 3 New Pid Controllers for Extruder front, middle, back, heating. 2025-10-20 18:12:06 +02:00
snacj 22887d4f7a Added 3 New Pid Controllers for Extruder front, middle, back, heating. 2025-10-20 18:12:06 +02:00
Robin Krämer 00dbc90c85 Merge pull request #834 from qitechgmbh/lag-spike-fix
removed async sleep from control loop
2025-10-20 18:07:21 +02:00
kraemr 9ade1d8993 removed async sleep from control loop 2025-10-20 18:04:52 +02:00
Robin Krämer b2fb803033 Merge pull request #829 from qitechgmbh/808-lock-kernel-in-nix-to-last-working-rt-kernel
Newest kernel with realtime preemption
2025-10-20 13:42:38 +02:00
nixos-install.sh 988ed5b959 Newest kernel with realtime preemption 2025-10-17 17:36:14 +02:00
Oshgnacknak 2e62f99724 Merge pull request #806 from qitechgmbh/fix-caps
Fix caps in cargo run Linux
2025-10-17 15:01:53 +02:00
Oshgnacknak 530327b1e8 Fix caps in cargo run Linux 2025-10-17 14:55:44 +02:00
Robin Krämer 2f75b31fa9 Merge pull request #816 from qitechgmbh/812-improve-interface-discovery-to-only-use-ethernet-devices
fixed the atrocious interface_discovery
2025-10-17 12:42:31 +02:00
kraemr ce8f0a8c4b fixed the atrocious interface_discovery 2025-10-17 12:40:18 +02:00
Robin Krämer 321aae5b86 Merge pull request #820 from qitechgmbh/changelog-210
updated Changelog
2025-10-16 15:16:05 +02:00
kraemr 7712ea2d1f updated Changelog 2025-10-16 15:15:36 +02:00
Robin Krämer 175f64f784 Merge pull request #804 from qitechgmbh/803-add-winder-gearbox-conversion
803 add winder gearbox conversion
2025-10-16 12:39:14 +02:00
ChristianandCopilot 9357960463 Update electron/src/machines/winder/winder2/useWinder.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-16 12:22:54 +02:00
Christian 4d043906bc Remove unnecessary whitespace in puller speed calculation 2025-10-16 12:22:54 +02:00
Christian b99b7f796b Reset target speed to 0 when setting gear ratio and adjust puller speed calculation based on gear ratio 2025-10-16 12:22:54 +02:00
Christian a7b0414613 Add gear ratio calculation and display in Winder2 control and presets 2025-10-16 12:22:54 +02:00
Christian 13c608b11a Add gear ratio functionality to puller speed controller
- Introduced gear ratio enum with options for 1:5 and 1:10.
- Updated puller speed controller to include gear ratio state.
- Implemented gear ratio selection in Winder2Settings component.
- Added corresponding mutation and state management in useWinder2 hook.
2025-10-16 12:22:54 +02:00
Oshgnacknak d14fb91736 Simpliy panic handling and fix backtrace (#809)
* Hide memory locking behind feature flag

* Simplify panic handling
2025-10-15 21:09:05 +02:00
Oshgnacknak 6beaa444af Simplify panic handling 2025-10-15 17:08:37 +02:00
Oshgnacknak 3b552558d4 Hide memory locking behind feature flag 2025-10-15 17:08:37 +02:00
Robin Krämer 9cc63bf8fb Merge pull request #805 from qitechgmbh/743-electron-doesnt-use-gpu-for-hw-acceleration
Remove bad hardware acceleration flag
2025-10-15 10:31:04 +02:00
Oshgnacknak 70ce7625b2 Remove bad hardware acceleration flag 2025-10-13 15:00:21 +02:00
Robin Krämer 9936764125 Merge pull request #717 from qitechgmbh/700-add-a-show-from-option-for-graphs
700 add a show from option for graphs
2025-10-13 12:17:26 +02:00
Christian a0f09e1671 Improve formatting and adjust future time validation messages in TimeInput component 2025-10-13 12:14:09 +02:00
Christian 1100b880f9 Add validation to prevent future time selection in TimeInput component 2025-10-13 12:14:09 +02:00
Christian 6224f33ba5 fix eslint 2025-10-13 12:14:09 +02:00
Christian b0a9b5a6d2 Fix styling 2025-10-13 12:14:09 +02:00
ChristianandCopilot ac7247c87a Update electron/src/components/time/TimeInput.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-13 12:14:09 +02:00
Christian 2ea459f3be Refactor button styles and improve formatting in GraphControls and TimeInput components 2025-10-13 12:14:09 +02:00
Christian 25250f640f Add showFromTimestamp functionality to graph components and implement TimeInput for time selection 2025-10-13 12:14:09 +02:00
Robin Krämer 57a0cc8af4 Merge pull request #776 from qitechgmbh/775-add-explanation-of-padding-to-the-winder-manual
Add padding parameter explanation to manual for filament winding
2025-10-13 12:13:53 +02:00
Christian 5ebb978eae Add padding example image to the winder docs 2025-10-13 12:09:20 +02:00
Christian d647ee6ebe fix format 2025-10-13 12:09:20 +02:00
Christian fea203ae7a Add padding parameter explanation to manual for filament winding 2025-10-13 12:09:20 +02:00
Robin Krämer b5eb413d37 Merge pull request #791 from qitechgmbh/788-fix-remote-setting-reset-and-update-label-in-update-tab
Fix remote setting reset and update label to "Repository Owner" in Update tab
2025-10-13 12:08:43 +02:00
Christian aa1e5c4f39 Fix typos in GitHub repository owner label and description 2025-10-13 12:05:31 +02:00
Christian ee91934bf7 Refactor Github source management: integrate condition store and update UI labels 2025-10-13 12:05:31 +02:00
Milan von dem Bussche 1fa04eae9a Update README.md
Added YouTube Explainer Video about QiTech Control
2025-10-10 18:41:46 +02:00
Robin Krämer 98e1269f6f Merge pull request #800 from qitechgmbh/changelog-2.9.1
updated Changelog
2025-10-10 15:07:51 +02:00
kraemr 8f640fcb21 updated Changelog 2025-10-10 15:06:30 +02:00
Robin Krämer 6c120b7fe9 Merge pull request #796 from qitechgmbh/795-winding-when-puller-reverse-doesnt-work-in-adaptive
adaptive spool speed now takes negative speeds into account,
2025-10-08 18:12:23 +02:00
kraemr 033b93b9da puller speed now is always positive in frontend 2025-10-08 17:49:55 +02:00
kraemr 6092358e87 adaptive spool speed now takes negative speeds into account,
aswell as Auto Stop Spool
2025-10-08 17:40:50 +02:00
Robin Krämer 71de39e871 Merge pull request #793 from qitechgmbh/790-refactor-aquapath-newrs-to-match-others
790 refactor aquapath newrs to match others
2025-10-08 16:29:49 +02:00
joe 54ffa193c3 fixed fmt 2025-10-08 16:23:40 +02:00
joe 03164f1ceb refactor(aquapath1): cleanup and fix device initialization and configuration 2025-10-08 15:45:58 +02:00
Robin Krämer f67a46ab4c Merge pull request #787 from qitechgmbh/786-add-memory-locking
added CAP_IPC_LOCK and added memory locking
2025-10-07 13:54:02 +02:00
kraemr 610790a778 added CAP_IPC_LOCK and memory locking 2025-10-07 13:04:49 +02:00
Robin Krämer 6eaf451ad4 Merge pull request #692 from JanHBade/master
Update README.md
2025-10-07 12:57:27 +02:00
JanHBade 022e0adae3 Update README.md
Minor typo in EtherCAT
2025-10-07 12:57:16 +02:00
Robin Krämer 6e6d4b31e7 Merge pull request #746 from qitechgmbh/640-improve-scroll-bar-styling-for-manuals-to-resemble-macos-style
Update scrollbar styling to be similar to macos
2025-10-07 12:45:12 +02:00
Christian 0dafad3fb5 fix code stye 2025-10-07 12:40:01 +02:00
Christian 534de55239 Refactor scrollbar styles to apply only to html and body elements 2025-10-07 12:40:01 +02:00
Christian d9f92bcdf2 Refactor scrollbar styles for Markdown and Terminal components to be similar to MacOS styling 2025-10-07 12:40:01 +02:00
Robin Krämer 1570299e38 Merge pull request #782 from qitechgmbh/781-refactor-winderv2-emit-functions-to-emitrs
refactored winder2's emit methods to emit.rs
2025-10-06 17:01:38 +02:00
kraemr c95f6f3bd9 refactored winder2's emit methods to emit.rs 2025-10-06 16:36:59 +02:00
Robin Krämer 9fcde2a234 Merge pull request #780 from qitechgmbh/772-remove-dependencies-that-are-not-necessary
decreased compile time by removing jemalloc, and using only f64 uom
2025-10-06 16:05:08 +02:00
kraemr a2ffc41e05 decreased compile time by removing jemalloc, and using only f64 uom 2025-10-06 16:02:29 +02:00
Robin Krämer ff13baf257 Merge pull request #779 from qitechgmbh/changelog-2.9.0
updated Changelog
2025-10-06 14:25:39 +02:00
kraemr 8f5df07c19 updated Changelog 2025-10-06 14:24:43 +02:00
Robin Krämer 299b38515a Merge pull request #778 from qitechgmbh/777-increase-max-step-size
Increased Winder Step Size
2025-10-06 14:12:24 +02:00
kraemr 2b073aeb76 Increased Winder Step Size 2025-10-06 13:56:20 +02:00
Robin Krämer 7a6f92f8a4 Merge pull request #771 from qitechgmbh/770-update-machine-implementation-status-in-the-readme
Update machine documentation to reflect current implementation status
2025-10-02 17:07:13 +02:00
Christian 2e283ea95f Update machine documentation to reflect current implementation status 2025-10-02 17:03:55 +02:00
Robin Krämer 829bb5ea1c Merge pull request #625 from qitechgmbh/improved-disconnect-handling
Introduce machine connection
2025-10-02 14:26:07 +02:00
Oshgnacknak 0be18aaed0 Derive machines from macro again
This time we also add get_machine_identification_unique.

Also fix import warnings
2025-10-02 13:58:54 +02:00
Oshgnacknak ffe0f09061 Clean up machine event creation 2025-10-01 16:50:04 +02:00
nixos-install.sh 730d61a18d Don't clear ethercat slots, we want to keep the namespaces 2025-10-01 15:57:03 +02:00
Oshgnacknak fc07525976 Don't remove, only disconnect serial machines
This allows use to keep the namespaces
2025-10-01 15:57:03 +02:00
Oshgnacknak c48953aa6b Introduce machine connection
This is to hold on to the namespace of
a machine even if the devices of that
machine has disconnected and to allow
reattaching to the namespace once the
devices reconnects.

Additionally to the new struct,
a wast refactor took place cleaning up
connections to machines, cross connections
between machines the way we downcast
machines downcasts.
2025-10-01 15:57:03 +02:00
Melvin Spieß 0c948b436d Merge pull request #764 from qitechgmbh/dependabot/cargo/axum-0.8.6
Bump axum from 0.8.4 to 0.8.6
2025-10-01 12:05:48 +02:00
Robin Krämer 1b3f92dd1c Merge pull request #725 from qitechgmbh/425-fix-terminal-component-issues-v2
425 fix terminal component issues v2
2025-10-01 11:58:55 +02:00
dependabot[bot] c29c549a1c Bump axum from 0.8.4 to 0.8.6
Bumps [axum](https://github.com/tokio-rs/axum) from 0.8.4 to 0.8.6.
- [Release notes](https://github.com/tokio-rs/axum/releases)
- [Changelog](https://github.com/tokio-rs/axum/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/axum/compare/axum-v0.8.4...axum-v0.8.6)

---
updated-dependencies:
- dependency-name: axum
  dependency-version: 0.8.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 09:57:52 +00:00
kraemr 17622cacde set log level to "info" for rust 2025-10-01 11:56:29 +02:00
kraemr 0b423454ec fixed line duplication in Terminal Component on Update Page 2025-10-01 11:56:29 +02:00
kraemr 81ec98f670 dont clear log, causes react errors 2025-10-01 11:56:29 +02:00
93094049+kraemr@users.noreply.github.com 1aed425544 eslint bypass for control character 2025-10-01 11:56:29 +02:00
93094049+kraemr@users.noreply.github.com da080ace68 try using clear functions before interactions 2025-10-01 11:56:29 +02:00
93094049+kraemr@users.noreply.github.com ded8dd2d2d added react-virtualized 2025-10-01 11:56:29 +02:00
93094049+kraemr@users.noreply.github.com edd83ba559 added virtualized list 2025-10-01 11:56:29 +02:00
Melvin Spieß 7d1d8559a5 Merge pull request #672 from qitechgmbh/671-refactor-machine-creation
reduced code duplication in new.rs of machines
2025-10-01 11:56:17 +02:00
kraemr f0bb9bfed1 fixed lifetimes of get_ethercat_device and refactored buffer 2025-10-01 11:52:13 +02:00
93094049+kraemr@users.noreply.github.com c6ea057736 renamed helper function 2025-10-01 11:52:13 +02:00
93094049+kraemr@users.noreply.github.com 90a00198a7 reduced code duplication in new.rs of machines 2025-10-01 11:52:12 +02:00
Melvin Spieß f8241547fe Merge pull request #762 from qitechgmbh/dependabot/cargo/erased-serde-0.4.8
Bump erased-serde from 0.4.6 to 0.4.8
2025-10-01 11:50:54 +02:00
Melvin Spieß 1cb5d51c13 Merge pull request #760 from qitechgmbh/dependabot/npm_and_yarn/electron/tanstack/react-router-1.130.17
Bump @tanstack/react-router from 1.130.12 to 1.130.17 in /electron
2025-10-01 11:38:53 +02:00
Melvin Spieß c42cdf8db1 Merge pull request #759 from qitechgmbh/dependabot/npm_and_yarn/electron/radix-ui/react-navigation-menu-1.2.14
Bump @radix-ui/react-navigation-menu from 1.2.13 to 1.2.14 in /electron
2025-10-01 11:38:22 +02:00
Melvin Spieß 69014ef8c6 Merge pull request #758 from qitechgmbh/dependabot/npm_and_yarn/electron/types/react-19.1.16
Bump @types/react from 19.1.9 to 19.1.16 in /electron
2025-10-01 11:35:53 +02:00
Melvin Spieß 5faab29a2b Merge pull request #763 from qitechgmbh/dependabot/cargo/libc-0.2.176
Bump libc from 0.2.175 to 0.2.176
2025-10-01 11:35:31 +02:00
dependabot[bot] 9a8b16ca69 Bump @radix-ui/react-navigation-menu from 1.2.13 to 1.2.14 in /electron
Bumps [@radix-ui/react-navigation-menu](https://github.com/radix-ui/primitives) from 1.2.13 to 1.2.14.
- [Changelog](https://github.com/radix-ui/primitives/blob/main/release-process.md)
- [Commits](https://github.com/radix-ui/primitives/commits)

---
updated-dependencies:
- dependency-name: "@radix-ui/react-navigation-menu"
  dependency-version: 1.2.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 09:32:49 +00:00
Melvin Spieß 53f3c66214 Merge pull request #765 from qitechgmbh/dependabot/cargo/regex-1.11.3
Bump regex from 1.11.2 to 1.11.3
2025-10-01 11:30:59 +02:00
dependabot[bot] 432bf0d6ba Bump libc from 0.2.175 to 0.2.176
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.175 to 0.2.176.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.176/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.175...0.2.176)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.176
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 09:30:49 +00:00
dependabot[bot] f3990f35f1 Bump erased-serde from 0.4.6 to 0.4.8
Bumps [erased-serde](https://github.com/dtolnay/erased-serde) from 0.4.6 to 0.4.8.
- [Release notes](https://github.com/dtolnay/erased-serde/releases)
- [Commits](https://github.com/dtolnay/erased-serde/compare/0.4.6...0.4.8)

---
updated-dependencies:
- dependency-name: erased-serde
  dependency-version: 0.4.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 09:30:40 +00:00
dependabot[bot] 6f17412363 Bump regex from 1.11.2 to 1.11.3
Bumps [regex](https://github.com/rust-lang/regex) from 1.11.2 to 1.11.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.11.2...1.11.3)

---
updated-dependencies:
- dependency-name: regex
  dependency-version: 1.11.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 09:28:49 +00:00
dependabot[bot] 68907b9750 Bump @types/react from 19.1.9 to 19.1.16 in /electron
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 19.1.9 to 19.1.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-version: 19.1.16
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 09:26:34 +00:00
dependabot[bot] e7007e1980 Bump @tanstack/react-router from 1.130.12 to 1.130.17 in /electron
Bumps [@tanstack/react-router](https://github.com/TanStack/router/tree/HEAD/packages/react-router) from 1.130.12 to 1.130.17.
- [Release notes](https://github.com/TanStack/router/releases)
- [Commits](https://github.com/TanStack/router/commits/v1.130.17/packages/react-router)

---
updated-dependencies:
- dependency-name: "@tanstack/react-router"
  dependency-version: 1.130.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 09:26:27 +00:00
Melvin Spieß 3bcd96d73c Merge pull request #766 from qitechgmbh/dependabot/cargo/anyhow-1.0.100
Bump anyhow from 1.0.99 to 1.0.100
2025-10-01 11:09:51 +02:00
dependabot[bot] 8a77c62a5e Bump anyhow from 1.0.99 to 1.0.100
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.99 to 1.0.100.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.99...1.0.100)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.100
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-01 02:24:32 +00:00
kraemr 93add82ab5 updated Changelog 2025-09-30 15:29:27 +02:00
Robin Krämer 690b1f7ab3 Merge pull request #757 from qitechgmbh/revert-ethercat-setup
fixed ethercat setup timeouts and retry
2025-09-29 17:19:33 +02:00
kraemr 3c07b94e3a fixed ethercat setup timeouts and retry 2025-09-29 17:18:49 +02:00
Robin Krämer 3b63b55859 Merge pull request #756 from qitechgmbh/fix-winder-regression
fixed winder regression due to refactor
2025-09-29 17:10:33 +02:00
kraemr f87982c465 fixed winder regression due to refactor 2025-09-29 17:01:04 +02:00
Robin Krämer b03cedb55c Merge pull request #447 from qitechgmbh/fix/438
Implementation AquaPath
2025-09-29 15:42:32 +02:00
kraemr f5934efa6c restored mock-machine functionality 2025-09-29 15:39:25 +02:00
kraemr 186619cd48 fixed compilation error 2025-09-29 15:33:25 +02:00
Darmenov Alisher 583d4c1a4d resolved comment 2025-09-29 15:33:25 +02:00
Anatomik5 63bee54948 AquapathV1 2025-09-29 15:33:25 +02:00
Robin Krämer 1523d64ed7 Merge pull request #749 from qitechgmbh/738-add-mock-machines
738 add mock machines
2025-09-29 11:32:39 +02:00
kraemr 48fdde61dc further improved readability by moving feature flags to mod.rs 2025-09-29 11:30:54 +02:00
kraemr 7bc700ac5f when selecting mock-machine feature extruder now appears as well 2025-09-29 11:30:54 +02:00
93094049+kraemr@users.noreply.github.com bdd6147f92 rewrote extruder and winder, also added mock-machine for extruder 2025-09-29 11:30:54 +02:00
93094049+kraemr@users.noreply.github.com f7f65bdaaa refactored all emit functions out of mod.rs for clarity for extruder 2025-09-29 11:30:54 +02:00
Robin Krämer 232b0782ca Merge pull request #754 from qitechgmbh/748-add-feature-flag-or-env-var-for-setting-loop-timeout
748 add feature flag or env var for setting loop timeout
2025-09-29 11:30:19 +02:00
kraemr c3c36a26b6 also added development-build flag to irq affinity code 2025-09-25 17:11:18 +02:00
kraemr 7f22bdfbf2 added feature development-build to set timeout 2025-09-25 17:06:42 +02:00
Robin Krämer ff4c579f7b Merge pull request #673 from qitechgmbh/632-add-documentation-for-creating-a-new-machine
added documentation for adding a machine
2025-09-25 15:33:41 +02:00
93094049+kraemr@users.noreply.github.com 9683882775 added documentation for adding a machine 2025-09-25 15:32:33 +02:00
Robin Krämer 893e01532d Merge pull request #753 from qitechgmbh/633-update-documentation-for-adding-new-devices
updated devices documentation by adding an example and explaining the architecture
2025-09-25 14:53:17 +02:00
kraemr 713f78fa4e updated devices documentation by adding an example
and explaining how devices fit into the architecture
2025-09-25 14:50:32 +02:00
Robin Krämer f444347fb9 Merge pull request #752 from qitechgmbh/751-document-performancestability-tweaks-made
added performance and stabillity documentation
2025-09-25 11:37:04 +02:00
kraemr ea03c0f755 added performance and stabillity documentation 2025-09-25 11:31:53 +02:00
Robin Krämer e283a0f164 Merge pull request #745 from qitechgmbh/744-windermode-switch-from-modewind-to-modepull-or-modehold-disables-the-wind-button
fixed emit state after state change
2025-09-23 15:41:28 +02:00
snacj 6820206d78 fixed emit state after state change 2025-09-23 15:38:47 +02:00
Robin Krämer 5069ee425c Merge pull request #742 from qitechgmbh/681-remove-unused-or-redundant-crates
removed unused crates
2025-09-23 13:37:48 +02:00
kraemr f93f342508 added ignores for cargo machete 2025-09-23 13:17:29 +02:00
kraemr c6d3563101 removed unused crates 2025-09-23 12:56:24 +02:00
Robin Krämer f2f893c917 Merge pull request #741 from qitechgmbh/739-add-roundness-value-to-laser-graph-and-control-page
Added Roundness Value to 2 Axis Laser
2025-09-22 14:27:30 +02:00
Robin KrämerandCopilot bbbca4085d Update server/src/machines/laser/mod.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-22 14:24:42 +02:00
Robin KrämerandCopilot 4fdf461520 Update server/src/machines/laser/mod.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-22 14:23:37 +02:00
snacj dcfc6728ba Made Roundness unitless 2025-09-22 14:10:25 +02:00
snacj 2673a92f50 Added Roundness Value to 2 Axis Laser 2025-09-22 13:39:59 +02:00
Robin Krämer 4d72185ba9 Merge pull request #675 from qitechgmbh/512-add-troubleshooting-documentation
512 add troubleshooting documentation
2025-09-18 19:44:43 +02:00
93094049+kraemr@users.noreply.github.com ade4f5cd2b updated troubleshooting.md 2025-09-18 19:41:15 +02:00
93094049+kraemr@users.noreply.github.com cf1ebf2b3d added troubleshooting.md 2025-09-18 19:41:15 +02:00
Robin Krämer 6b5cb7d87e Merge pull request #737 from qitechgmbh/fix_state_handling
Fix state handling
2025-09-17 18:26:01 +02:00
93094049+kraemr@users.noreply.github.com 4894bbc231 fixed all state issues 2025-09-17 18:20:31 +02:00
Robin Krämer 721c5a99ee Merge pull request #736 from qitechgmbh/less_amps_spool_test
Less amps spool test
2025-09-17 17:28:23 +02:00
93094049+kraemr@users.noreply.github.com 36fccc80cb set puller amps to 2.7A 2025-09-17 17:21:15 +02:00
93094049+kraemr@users.noreply.github.com e14fe86306 testing with less current 2025-09-17 17:21:15 +02:00
Robin Krämer 95c9f99961 Merge pull request #735 from qitechgmbh/fix_compiler_flags
Fix compiler flags
2025-09-17 12:53:50 +02:00
93094049+kraemr@users.noreply.github.com 546189b9c8 removed log::error 2025-09-17 12:47:46 +02:00
93094049+kraemr@users.noreply.github.com dfbc2a65c0 hopefully all compiler flags now work as expected 2025-09-17 12:47:46 +02:00
Robin Krämer 2038d79e18 Merge pull request #734 from qitechgmbh/changelog-v2.7.0
updated Changelog for 2.7.0
2025-09-17 11:47:54 +02:00
93094049+kraemr@users.noreply.github.com 188caf397b updated Changelog for 2.7.0 2025-09-17 11:44:22 +02:00
Robin Krämer 13138b1d7d Merge pull request #726 from qitechgmbh/video-streaming
Add video streaming api
2025-09-16 18:25:34 +02:00
Icedsoda 5466efd8c3 add video streaming api 2025-09-16 18:23:36 +02:00
Robin Krämer 61f0dc92d1 Merge pull request #733 from qitechgmbh/685-use-nixos-cache-server-for-private-packages
685 use nixos cache server for private packages
2025-09-16 17:49:32 +02:00
93094049+kraemr@users.noreply.github.com 073c174203 removed unnecessary comment 2025-09-16 17:44:03 +02:00
93094049+kraemr@users.noreply.github.com 1d0f7231e5 added substituter
fixed nix config

actually fixed config now

test

removed git hash as version

nix sucks

removed gitcommitHash from overlays

added fake version

fixed compile script

test

fixed script

updated ip

test

test 2

uppdated script and fixed config

to check for caching

test

fixed config

test

test

extra-subs changed to trusted-public-keys

test

test

removed substituter

removed print statements
2025-09-16 17:44:03 +02:00
93094049+kraemr@users.noreply.github.com 9401c81581 added scripts to compile our nix packages 2025-09-16 17:44:03 +02:00
Robin Krämer 936e54f3e2 Merge pull request #731 from qitechgmbh/666-implement-laserv2
666 implement laserv2
2025-09-16 16:54:29 +02:00
snacj 0c02fc1ce0 Added Comment do explain 45deg rotation 2025-09-16 16:52:12 +02:00
snacj c723f1df00 Fixed Graphs to work with 2axis and 1 axis 2025-09-16 16:52:12 +02:00
snacj c65a3f7fb1 Renamed Values and changed to one Graph 2025-09-16 16:52:12 +02:00
snacj a0c59f9bb6 Added Const for graph color. 2025-09-16 16:52:12 +02:00
snacj 069dcd65bb Removed tracing::info! 2025-09-16 16:52:12 +02:00
snacj 5331d39c1d Changed Visual of Diameter to use x and y values 2025-09-16 16:52:12 +02:00
snacj 2c928e6158 Implemented 2-Axis Laser 2025-09-16 16:52:12 +02:00
snacj 3ae17479cb Adjusted Frontend to work with 2-Axis Laser. 2025-09-16 16:52:12 +02:00
93094049+kraemr@users.noreply.github.com b3589755f5 fixed winder events 2025-09-16 16:41:38 +02:00
Robin Krämer e7f97ff4d4 Merge pull request #729 from qitechgmbh/728-set_irq_handler_affinity-doesnt-work-on-macos
fixed target_os flags for set_irq_affinity
2025-09-16 15:37:40 +02:00
93094049+kraemr@users.noreply.github.com 7b4a3b52b3 fixed target_os flags for set_irq_affinity 2025-09-16 15:30:16 +02:00
Robin Krämer 310fd99730 Merge pull request #711 from qitechgmbh/694-over-time-nixos-generations-takes-up-all-diskspace-even-when-deleted
added collect-garbage on each delete
2025-09-15 19:38:31 +02:00
93094049+kraemr@users.noreply.github.com 26473f5596 collect-garbage does not exist, replaced with nix store gc 2025-09-15 19:36:46 +02:00
93094049+kraemr@users.noreply.github.com ead8a02b6a added collect-garbage on each delete 2025-09-15 19:36:46 +02:00
Robin Krämer b2ca9cf792 Merge pull request #712 from qitechgmbh/708-refactor-nix-config-so-that-no-dynamic-installinfonix-is-created
Read git information during build instead of addign new commit via installInfo.nix
2025-09-15 18:29:19 +02:00
nixos-install.sh 301c254446 Pass git info into gitInfo.nix via env vars 2025-09-15 17:57:43 +02:00
Robin Krämer 769091d271 Merge pull request #720 from qitechgmbh/714-pressing-the-same-button-twice-triggers-isloading
714 pressing the same button twice triggers isloading
2025-09-15 16:55:05 +02:00
93094049+kraemr@users.noreply.github.com 1bc7907ba0 all machines now use old emit_state again, but extruder uses custom maybe_emit_state_hash
fixed compile error after merge conflict
2025-09-15 16:49:47 +02:00
93094049+kraemr@users.noreply.github.com 8260c606dc removed maybe_emit_state from every machine except extruder 2025-09-15 16:48:09 +02:00
Christian c0b7e563c5 Merge pull request #713 from qitechgmbh/596-extend-total-power-output-tile-2
596 extend total power output tile
2025-09-15 16:10:45 +02:00
Melvin Spieß 9062e15712 Merge pull request #727 from qitechgmbh/722-remove-estimated-diameter-value
722 remove estimated diameter value
2025-09-15 15:34:57 +02:00
snacj 134da6fad3 fixed formatting 2025-09-15 15:25:31 +02:00
snacj 4cec6ef711 Changed Radius to Factor 2025-09-15 15:13:09 +02:00
snacj 36d64c85fb Removed Estimated Diameter Value 2025-09-15 15:06:30 +02:00
Robin Krämer 8e00019023 Merge pull request #721 from qitechgmbh/as-any-mut
Add `Machin::as_any_mut`
2025-09-15 13:44:51 +02:00
Icedsoda 575d4d2d26 Add Machin::as_any_mut 2025-09-15 13:26:47 +02:00
Robin Krämer 19e9ebc20f Merge pull request #719 from qitechgmbh/718-ethercat-timeout-on-setup
set wait_loop_delay to zero
2025-09-15 09:34:00 +02:00
93094049+kraemr@users.noreply.github.com dd4476b786 set wait_loop_delay to zero 2025-09-15 09:32:20 +02:00
Christian fc283a64a7 Merge branch 'master' into 596-extend-total-power-output-tile-2 2025-09-13 17:05:56 +02:00
Robin Krämer b6dc1d35c6 Merge pull request #710 from qitechgmbh/707-make-adaptive-mode-for-winder-default
changed MinMax to Adaptive by default
2025-09-11 15:27:20 +02:00
93094049+kraemr@users.noreply.github.com 4f542510d6 changed MinMax to Adaptive by default 2025-09-11 15:23:08 +02:00
Oshgnacknak 0ca334decc Disable hardening in nix develop shell (#705)
Hardening causes jmalloc to fail at compilation
2025-09-11 12:57:34 +02:00
Robin Krämer 239a926301 Merge pull request #706 from qitechgmbh/703-fix-permissions-for-set_irq_affinity
703 fix permissions for set irq affinity
2025-09-11 11:01:27 +02:00
93094049+kraemr@users.noreply.github.com 9f4c7fbedd fixed permissions 2025-09-11 10:59:21 +02:00
93094049+kraemr@users.noreply.github.com 6a9de48bb7 added extra logging 2025-09-11 10:59:21 +02:00
93094049+kraemr@users.noreply.github.com d9fc22399a added DAC_OVERRIDE CAP 2025-09-11 10:59:21 +02:00
Robin Krämer f41b0dc0c2 Merge pull request #697 from qitechgmbh/dependabot/npm_and_yarn/electron/vite-6.3.6
Bump vite from 6.3.5 to 6.3.6 in /electron
2025-09-10 15:58:37 +02:00
dependabot[bot] 14233c0aa1 Bump vite from 6.3.5 to 6.3.6 in /electron
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.3.5 to 6.3.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.3.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.3.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.3.6
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-10 13:48:41 +00:00
Robin Krämer 58e56c4226 Merge pull request #702 from qitechgmbh/701-fix-optimistic-state-handling
701 fix optimistic state handling
2025-09-10 15:01:24 +02:00
93094049+kraemr@users.noreply.github.com 8ee184475e only return state not optimisticstate 2025-09-10 14:56:05 +02:00
93094049+kraemr@users.noreply.github.com be9c5b1be5 fixed optimistic state handling 2025-09-10 14:55:08 +02:00
Robin Krämer 8411f8f2b9 Merge pull request #698 from qitechgmbh/696-pin-ethernet-interrupt-handler-to-the-same-core-as-ethercrab-task
696 pin ethernet interrupt handler to the same core as ethercrab task
2025-09-10 14:19:59 +02:00
93094049+kraemr@users.noreply.github.com 5441a7a126 changed lint, renamed irq_handling funcs, refactor 2025-09-10 14:08:32 +02:00
93094049+kraemr@users.noreply.github.com b2425de273 fixed non unix compilation 2025-09-10 13:55:59 +02:00
93094049+kraemr@users.noreply.github.com 82d5e73129 removed unused import 2025-09-10 13:45:58 +02:00
93094049+kraemr@users.noreply.github.com 31189ebdef refactored irq_handling into own file 2025-09-10 13:45:58 +02:00
93094049+kraemr@users.noreply.github.com ee1720fa95 added code to set irq handler affinity 2025-09-10 13:45:58 +02:00
Robin Krämer 72dc0634f3 Merge pull request #693 from qitechgmbh/clippy-fix
Use Cargo Clippy
2025-09-10 13:43:51 +02:00
Icedsoda 13f5125daa cargo clippy --fix 2025-09-10 12:14:19 +02:00
Icedsoda 2b6904b145 configure clippy 2025-09-10 12:14:19 +02:00
Robin Krämer f776a4ba19 Merge pull request #695 from qitechgmbh/688-pressure-and-rpm-are-switched
reverse prop doesnt make sense on Extruder2ControlPage Regulation
2025-09-09 16:54:29 +02:00
93094049+kraemr@users.noreply.github.com a7c8cb218f reverse prop doesnt make sense on Extruder2ControlPage Regulation 2025-09-09 16:49:31 +02:00
Robin Krämer 3cb2d20df9 Merge pull request #690 from qitechgmbh/sync-act
Make `act` method non-async
2025-09-09 14:21:22 +02:00
Icedsoda ee4b5b15d7 Make act method non-async 2025-09-09 14:18:21 +02:00
93094049+kraemr@users.noreply.github.com 299e6314b8 Revert "using virtualized list"
This reverts commit 01170e1a1b.
2025-09-09 13:15:46 +02:00
93094049+kraemr@users.noreply.github.com 01170e1a1b using virtualized list 2025-09-09 13:13:52 +02:00
Robin Krämer 6fe2e498aa Merge pull request #686 from qitechgmbh/668-frontend-buttons-are-flickering
Fixed Buttons Flickering
2025-09-09 11:21:18 +02:00
93094049+kraemr@users.noreply.github.com fc7262f8f0 Fixed Buttons Flickering 2025-09-09 11:16:56 +02:00
Robin Krämer 880d2ddcb0 Merge pull request #684 from qitechgmbh/683-ethercat-loop-broken
683 ethercat loop broken
2025-09-08 14:06:02 +02:00
93094049+kraemr@users.noreply.github.com e9ea378ef0 set loop timer to 500us 2025-09-08 13:44:33 +02:00
93094049+kraemr@users.noreply.github.com 145ad7ed2c added 1ms delay 2025-09-08 13:25:46 +02:00
93094049+kraemr@users.noreply.github.com d5ce65c868 added 1ms delay 2025-09-08 13:23:39 +02:00
93094049+kraemr@users.noreply.github.com 1bc76dfe09 wait_loop_delay set to 0 2025-09-08 12:52:45 +02:00
Robin Krämer 17e82cf5ea Merge pull request #680 from qitechgmbh/402-many-journald-logs-slow-down-the-frontend
402 many journald logs slow down the frontend
2025-09-08 12:04:59 +02:00
93094049+kraemr@users.noreply.github.com 926650802b reduces Logs, by A LOT 2025-09-08 12:01:01 +02:00
Robin Krämer fba7c0375d Merge pull request #677 from qitechgmbh/676-reduce-heap-allocationsdeallocations-in-machineact
676 reduce heap allocationsdeallocations in machineact
2025-09-08 11:51:46 +02:00
93094049+kraemr@users.noreply.github.com 27be5b8ec4 fixed extruder 2025-09-08 11:49:42 +02:00
93094049+kraemr@users.noreply.github.com d036246b2a refactored all machines 2025-09-08 11:49:42 +02:00
93094049+kraemr@users.noreply.github.com 59a9b15632 started refactoring MachineAct 2025-09-08 11:49:42 +02:00
Robin Krämer c09e061390 Merge pull request #679 from qitechgmbh/678-remove-loopthrottle
678 remove loopthrottle
2025-09-08 11:49:22 +02:00
93094049+kraemr@users.noreply.github.com 02f6dffaff fixed compile error and replaced loopthrottle with sleep 2025-09-08 10:00:37 +02:00
93094049+kraemr@users.noreply.github.com 509d4c8734 removed unused import 2025-09-08 09:57:03 +02:00
93094049+kraemr@users.noreply.github.com 084fdef754 wait_loop_delay of 1ms 2025-09-08 09:56:38 +02:00
93094049+kraemr@users.noreply.github.com a2f21da355 remove LoopThrottle 2025-09-08 09:55:47 +02:00
Robin Krämer b722502f5b Merge pull request #674 from qitechgmbh/dependabot/npm_and_yarn/electron/electron-37.3.1
Bump electron from 37.2.6 to 37.3.1 in /electron
2025-09-04 19:04:55 +02:00
dependabot[bot] ab45407763 Bump electron from 37.2.6 to 37.3.1 in /electron
Bumps [electron](https://github.com/electron/electron) from 37.2.6 to 37.3.1.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](https://github.com/electron/electron/compare/v37.2.6...v37.3.1)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 37.3.1
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 18:57:30 +02:00
Robin Krämer dd4fbbdafd Merge pull request #647 from qitechgmbh/dependabot/npm_and_yarn/electron/radix-ui/react-collapsible-1.1.12
Bump @radix-ui/react-collapsible from 1.1.11 to 1.1.12 in /electron
2025-09-04 12:25:18 +02:00
dependabot[bot] c8c609d88b Bump @radix-ui/react-collapsible from 1.1.11 to 1.1.12 in /electron
Bumps [@radix-ui/react-collapsible](https://github.com/radix-ui/primitives) from 1.1.11 to 1.1.12.
- [Changelog](https://github.com/radix-ui/primitives/blob/main/release-process.md)
- [Commits](https://github.com/radix-ui/primitives/commits)

---
updated-dependencies:
- dependency-name: "@radix-ui/react-collapsible"
  dependency-version: 1.1.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 12:22:05 +02:00
Robin Krämer 92a4905b44 Merge pull request #649 from qitechgmbh/dependabot/npm_and_yarn/electron/zustand-5.0.8
Bump zustand from 5.0.7 to 5.0.8 in /electron
2025-09-04 12:21:47 +02:00
dependabot[bot] 1c2aea7cb1 Bump zustand from 5.0.7 to 5.0.8 in /electron
Bumps [zustand](https://github.com/pmndrs/zustand) from 5.0.7 to 5.0.8.
- [Release notes](https://github.com/pmndrs/zustand/releases)
- [Commits](https://github.com/pmndrs/zustand/compare/v5.0.7...v5.0.8)

---
updated-dependencies:
- dependency-name: zustand
  dependency-version: 5.0.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 12:18:57 +02:00
Robin Krämer 44127bec42 Merge pull request #669 from qitechgmbh/603-add-electrical-diagrams-to-the-machines-manuals
Implement electrical diagrams into the manuals
2025-09-04 12:12:00 +02:00
Christian f48b97dd24 Add electrical diagram images to the public folder and implement them in the md files for extruder and winder. 2025-09-03 21:28:23 +02:00
Icedsoda 74c107c032 Merge pull request #667 from qitechgmbh/fix-stuck-loading
fixed infinite loading error
2025-09-03 19:23:59 +02:00
93094049+kraemr@users.noreply.github.com c4263dbe84 fixed infinite loading error 2025-09-03 19:00:50 +02:00
Icedsoda a6b7ec914d Add rustdoc 2025-09-03 17:25:18 +02:00
Icedsoda 56c095a10c Merge pull request #446 from qitechgmbh/fix/61
Add `EL4002`
2025-09-03 16:44:09 +02:00
Icedsoda f486aaa31b .mailmap 2025-09-03 16:42:57 +02:00
Darmenov Alisher c4f2f96c2e f 2025-09-03 16:31:34 +02:00
Anatomik5 99988c0445 el4002 and el40xx pdo implementation 2025-09-03 16:28:42 +02:00
Robin Krämer 9c5191a6ae Merge pull request #662 from qitechgmbh/changelog-2.6.0
Update CHANGELOG.md
2025-09-03 15:56:22 +02:00
93094049+kraemr@users.noreply.github.com 2f66715738 added missing Cargo.lock changes 2025-09-03 15:46:31 +02:00
Robin Krämer bcfd579a4b Update CHANGELOG.md 2025-09-03 11:54:44 +02:00
Icedsoda bef13832d6 Merge pull request #659 from qitechgmbh/575-automatically-send-stateevent-when-changed
575 automatically send stateevent when changed
2025-09-03 11:30:40 +02:00
93094049+kraemr@users.noreply.github.com 130ebf1681 changed mock and winder to 30 fps and added missing maybe_emit 2025-09-03 11:29:22 +02:00
93094049+kraemr@users.noreply.github.com 587c8c8fdb removed ethercrab (again) 2025-09-03 11:29:22 +02:00
93094049+kraemr@users.noreply.github.com 1ad9896be4 fixed linter errors 2025-09-03 11:29:22 +02:00
93094049+kraemr@users.noreply.github.com a6cdcf893d removed unused imports 2025-09-03 11:29:22 +02:00
93094049+kraemr@users.noreply.github.com 37ca881ed7 fixed stateschema
fixed stateschema for real this time
2025-09-03 11:29:17 +02:00
93094049+kraemr@users.noreply.github.com c38d7c0056 added maybe emit to mock 2025-09-03 11:27:09 +02:00
93094049+kraemr@users.noreply.github.com 99b9a8710c added maybe_emit to winder2 2025-09-03 11:27:09 +02:00
93094049+kraemr@users.noreply.github.com a859426b06 added maybe_emit to laser 2025-09-03 11:27:09 +02:00
93094049+kraemr@users.noreply.github.com 479908bf59 made changes for extruder and added derive 2025-09-03 11:27:09 +02:00
93094049+kraemr@users.noreply.github.com 3bc6522095 fixed hasher compare func 2025-09-03 11:27:09 +02:00
93094049+kraemr@users.noreply.github.com 6fcce62b04 added hasher_serializer and compare func 2025-09-03 11:27:09 +02:00
93094049+kraemr@users.noreply.github.com 060a7b6dbc refactoring States 2025-09-03 11:27:09 +02:00
93094049+kraemr@users.noreply.github.com 73521ad80a state gets sent when changed 2025-09-03 11:27:09 +02:00
Icedsoda 5c3897db9b Merge pull request #658 from qitechgmbh/65-handbook-for-extruder-v2
added extruder manual
2025-09-03 11:23:27 +02:00
Icedsoda e659ebbfd5 added extruder handbook 2025-09-03 10:14:41 +02:00
Icedsoda 3e98d08a0f Merge pull request #661 from qitechgmbh/lfs
track images in git lfs
2025-09-03 10:09:47 +02:00
Icedsoda 12069c0cd2 track images in git lfs 2025-09-03 10:09:17 +02:00
Robin Krämer a62d492a0a Merge pull request #645 from qitechgmbh/dependabot/cargo/tracing-subscriber-0.3.20
Bump tracing-subscriber from 0.3.19 to 0.3.20
2025-09-02 15:33:58 +02:00
dependabot[bot] 2b65d2ddd5 Bump tracing-subscriber from 0.3.19 to 0.3.20
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.19 to 0.3.20.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.19...tracing-subscriber-0.3.20)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-version: 0.3.20
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 15:28:44 +02:00
Robin Krämer 9bb16d5cc5 Merge pull request #651 from qitechgmbh/dependabot/npm_and_yarn/electron/radix-ui/react-select-2.2.6
Bump @radix-ui/react-select from 2.2.5 to 2.2.6 in /electron
2025-09-02 15:27:52 +02:00
dependabot[bot] 9b8076b357 Bump @radix-ui/react-select from 2.2.5 to 2.2.6 in /electron
Bumps [@radix-ui/react-select](https://github.com/radix-ui/primitives) from 2.2.5 to 2.2.6.
- [Changelog](https://github.com/radix-ui/primitives/blob/main/release-process.md)
- [Commits](https://github.com/radix-ui/primitives/commits)

---
updated-dependencies:
- dependency-name: "@radix-ui/react-select"
  dependency-version: 2.2.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 15:25:02 +02:00
Robin Krämer c86d34d881 Merge pull request #653 from qitechgmbh/dependabot/cargo/serde_json-1.0.143
Bump serde_json from 1.0.140 to 1.0.143
2025-09-02 15:22:52 +02:00
Robin Krämer 6dd031df24 Merge branch 'master' into dependabot/cargo/serde_json-1.0.143 2025-09-02 14:57:56 +02:00
Robin Krämer 40b33bf28d Merge pull request #652 from qitechgmbh/dependabot/cargo/serialport-4.7.3
Bump serialport from 4.7.2 to 4.7.3
2025-09-02 14:56:26 +02:00
dependabot[bot] 9a93c7bbd9 Bump serialport from 4.7.2 to 4.7.3
Bumps [serialport](https://github.com/serialport/serialport-rs) from 4.7.2 to 4.7.3.
- [Changelog](https://github.com/serialport/serialport-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/serialport/serialport-rs/compare/v4.7.2...v4.7.3)

---
updated-dependencies:
- dependency-name: serialport
  dependency-version: 4.7.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 14:53:38 +02:00
dependabot[bot] 24ef2b1c6c Bump serde_json from 1.0.140 to 1.0.143
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.140 to 1.0.143.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.140...v1.0.143)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-version: 1.0.143
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 14:52:53 +02:00
Robin Krämer 37359b4058 Merge pull request #654 from qitechgmbh/dependabot/cargo/regex-1.11.2
Bump regex from 1.11.1 to 1.11.2
2025-09-02 14:51:54 +02:00
dependabot[bot] ce19f515d7 Bump regex from 1.11.1 to 1.11.2
Bumps [regex](https://github.com/rust-lang/regex) from 1.11.1 to 1.11.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.11.1...1.11.2)

---
updated-dependencies:
- dependency-name: regex
  dependency-version: 1.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 14:49:40 +02:00
Robin Krämer 1359e0a33d Merge pull request #655 from qitechgmbh/dependabot/cargo/anyhow-1.0.99
Bump anyhow from 1.0.98 to 1.0.99
2025-09-02 14:49:29 +02:00
dependabot[bot] 3b234df7e7 Bump anyhow from 1.0.98 to 1.0.99
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.98 to 1.0.99.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.98...1.0.99)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.99
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-02 12:48:03 +00:00
Icedsoda b820a433df Merge pull request #641 from qitechgmbh/604-manuals-have-two-scroll-bars
604 manuals have two scroll bars
2025-09-01 14:09:38 +02:00
Icedsoda 9bf061bf6d Merge pull request #657 from qitechgmbh/634-store-graphs-timeframe-globally
added global timeframe store
2025-09-01 14:05:25 +02:00
93094049+kraemr@users.noreply.github.com 84f1fa123f fixed linter error 2025-09-01 14:00:14 +02:00
93094049+kraemr@users.noreply.github.com 91660fd1ec fixed compile errors 2025-09-01 13:58:07 +02:00
93094049+kraemr@users.noreply.github.com 28c4a801a6 added global timeframe store 2025-09-01 13:53:41 +02:00
Robin Krämer 22af6e61af Merge pull request #639 from qitechgmbh/extruder-regulation-mode-order-reversion
Add reverse prop to `SelectionGroupBoolean`
2025-09-01 11:48:37 +02:00
Icedsoda 794a309d71 feat(control): Add reverse prop to SelectionGroupBoolean
This change introduces a `reverse` property to the `SelectionGroupBoolean` component to allow for more flexible UI representation.

- When `reverse` is set to true, the `optionTrue` and `optionFalse` props are swapped.
- This allows the visual "on" state to correspond to a `false` value and vice-versa.
- The prop is implemented on the Inverter Regulation control on the Extruder2 page.
2025-09-01 11:14:38 +02:00
Christian 273d695d0d fix eslint error 2025-08-28 21:12:10 +02:00
Christian 76d5ae613a fix code formatting 2025-08-28 21:12:10 +02:00
Christian 14cca9e8cd fix different padding leading to an line jump when changing from passive to active 2025-08-28 21:12:10 +02:00
Christian 8f5ac3706f Improve active heading detection and scrolling behavior 2025-08-28 21:12:10 +02:00
Oshgnacknak d928f02f2b Merge pull request #642 from qitechgmbh/356-substitute-unmaintained-serial-crate
Improve serial conneciton handling
2025-08-28 17:42:44 +02:00
Oshgnacknak 77c099fa8a Formatting 2025-08-28 17:39:48 +02:00
Oshgnacknak bf9e5e2a3c Allow serial connection errors to bubble up and actually log them 2025-08-28 17:39:48 +02:00
Oshgnacknak b1ccbf3585 Fix permission issues for USB serial devices 2025-08-28 17:39:48 +02:00
Oshgnacknak 1f1050f115 Remove unmaintained serial crate on favor of serialport 2025-08-28 17:39:48 +02:00
Christian df0f86ce7e feat(extruder): Add total energy consumption tracking and related metrics 2025-08-28 16:55:26 +02:00
Icedsoda 007def4a01 Merge pull request #635 from qitechgmbh/627-add-documentation-for-hardware-tests-memtestcyclictest
627 add documentation for hardware tests memtestcyclictest
2025-08-28 16:39:18 +02:00
Icedsoda 3737cc4292 Merge pull request #636 from qitechgmbh/511-add-a-code-styling-document
511 add a code styling document
2025-08-28 16:38:40 +02:00
Icedsoda 8723eb1e55 Merge pull request #638 from qitechgmbh/circular-converter
Add `CircularConverter`
2025-08-28 14:34:29 +02:00
Icedsoda 1192fc28a3 refactor(converters): Introduce CircularConverter
This patch introduces a new `CircularConverter` and refactors the `LinearStepConverter` to use it. This change separates the concerns of geometric conversion from step-based conversion, leading to a more modular and maintainable design.

- **feat(converters): Add `CircularConverter`**
  - A new `CircularConverter` is added to handle all conversions between linear and angular quantities (position, velocity, acceleration, jerk).
  - It can be initialized from radius, diameter, or circumference.
  - This centralizes the geometric conversion logic into a single, well-tested module.

- **refactor(converters): Update `LinearStepConverter`**
  - The `LinearStepConverter` is refactored to compose and use the new `CircularConverter`.
  - It no longer stores `radius` or `circumference` directly.
  - All linear-to-angular calculations are now delegated to the `CircularConverter`, simplifying the `LinearStepConverter`'s implementation and removing duplicated code.
2025-08-28 14:32:07 +02:00
Oshgnacknak 23af0a82ec Merge pull request #637 from qitechgmbh/transmission
Add `Transmission` trait and `FixedTransmission` struct
2025-08-28 14:02:49 +02:00
Icedsoda a2ee1d91d9 Refactor: Introduce generic Transmission trait
This patch refactors the transmission calculation logic by replacing the specific `TransmissionConverter` with a more generic `Transmission` trait.

- A new `transmission` module is created, containing the `Transmission` trait and a `FixedTransmission` implementation.
- The `Transmission` trait provides a generic interface for converting between input and output values for various `uom` types (e.g., `AngularVelocity`, `Angle`, `Velocity`).
- The hardcoded `TransmissionConverter` is removed.
- The `ScrewSpeedController` is updated to use the new `FixedTransmission`, making the ratio configuration more explicit and improving type safety.
2025-08-28 13:45:22 +02:00
93094049+kraemr@users.noreply.github.com eb9830f8a7 updated docs 2025-08-28 13:31:14 +02:00
93094049+kraemr@users.noreply.github.com 3f92b11864 added code-styling backend doc 2025-08-28 13:31:14 +02:00
93094049+kraemr@users.noreply.github.com 96785e8876 updated docs 2025-08-28 13:01:17 +02:00
93094049+kraemr@users.noreply.github.com d36925f616 added memtest docs 2025-08-28 13:01:17 +02:00
Robin Krämer bdc8d7bbd0 Merge pull request #621 from qitechgmbh/no-driver-message-hex
refactor(devices): Display device IDs in hex format
2025-08-27 14:31:46 +02:00
Icedsoda 268685858d refactor(devices): Display device IDs in hex format
- Change the error message for unknown devices to display IDs in hexadecimal format.
- This improves readability and makes it easier to look up device information.
2025-08-27 14:29:22 +02:00
Icedsoda eeafd93e3e Merge pull request #630 from qitechgmbh/629-ethercrab-submodule-on-master
removed ethercrab submodule
2025-08-27 14:28:48 +02:00
93094049+kraemr@users.noreply.github.com 8fa6213f9c removed submodule 2025-08-27 14:23:55 +02:00
Robin Krämer f8b186ec5d Merge pull request #618 from qitechgmbh/fail-early
Fail early in run script if compile fails
2025-08-27 14:23:48 +02:00
Oshgnacknak 4f6a1a0493 Fail early in run script if compile fails 2025-08-27 13:53:24 +02:00
Icedsoda 8ee9b233f6 Merge pull request #608 from qitechgmbh/copilot-instructions
Add copilot-instructions.md
2025-08-27 13:39:18 +02:00
IcedsodaandCopilot 4f6f148c70 add compilot-instructions.md
Update .github/copilot-instructions.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 13:36:46 +02:00
Icedsoda 3ea8f38139 Merge pull request #628 from qitechgmbh/changelog-2.5.0
Update CHANGELOG.md
2025-08-27 13:15:27 +02:00
Robin Krämer 3657bbf53e Update CHANGELOG.md 2025-08-27 13:14:30 +02:00
Robin Krämer 92b098c240 Update CHANGELOG.md 2025-08-27 12:48:14 +02:00
Robin Krämer 7350eeb354 Merge pull request #626 from qitechgmbh/591-improve-elctron-frame-times
591 improve electron frame times
2025-08-27 11:37:23 +02:00
93094049+kraemr@users.noreply.github.com 67e2b33db7 intel driver properly loads now
added comments and increased niceness values

added intel gpu driver as module

added mesa mesa_drivers

mesa_drivers has been removed

enable drm render

force i915 enable

fixed config issue

commented kernelPatches

hopefully fixed  now

added intel as xvideo driver

removed driSupport

fixed config file

removed deprecated powermanagement

does not exist ...

downgrade to lts rt kernel

nixos is not behaving

added neofetch and pciutils
2025-08-27 11:33:54 +02:00
Icedsoda d9eb49c37c Merge pull request #623 from qitechgmbh/el2008-identity-b
Add `EL2008_IDENTITY_B`
2025-08-25 16:52:30 +02:00
Icedsoda dba7ce7494 Add EL2008_IDENTITY_B 2025-08-25 16:26:27 +02:00
Icedsoda 50d16feb3d Merge pull request #620 from qitechgmbh/re-introduce-io-uring
Re-introduce `io_uring`
2025-08-25 15:57:27 +02:00
Icedsoda 437f94659c Re-introduce io_uring 2025-08-25 14:20:59 +02:00
Melvin Spieß 53efecc636 Merge pull request #614 from qitechgmbh/613-io_uring-causes-setup-to-fail
removed io_uring
2025-08-21 12:15:16 +02:00
93094049+kraemr@users.noreply.github.com c2371d095e use tx_rx_task import 2025-08-20 16:33:00 +02:00
93094049+kraemr@users.noreply.github.com cacde7868c removed io_uring 2025-08-20 15:33:34 +02:00
Icedsoda 7cf06e6a9d Merge pull request #607 from qitechgmbh/copilot/fix-3cec0eaa-f61d-4097-a3a3-fb391de9205b
Add EtherCAT IO performance metrics logging (fixes #578)
2025-08-20 12:46:16 +02:00
Icedsoda 83688daaf4 Refactor: Rename cycle metrics to loop and adjust config
This patch refactors the performance metrics collection for better clarity and tunes its parameters.

- Renamed "cycle" metrics to "loop" metrics to more accurately reflect the timing of the main processing loop. This change is applied to variable names and log messages.
- Increased the metrics window size from 10,000 to 30,000 samples.
- Extended the logging interval from 5 to 30 seconds for less verbose output.
- Simplified log messages for brevity.
2025-08-20 12:44:49 +02:00
copilot-swe-agent[bot]and1cedsoda f55a6c6569 Add EtherCAT performance metrics module and integrate into app state
Co-authored-by: 1cedsoda <29167146+1cedsoda@users.noreply.github.com>
2025-08-20 12:37:41 +02:00
copilot-swe-agent[bot] e42cc64f5d Initial plan 2025-08-20 12:37:41 +02:00
Robin Krämer 5c0a9f3bb6 Merge pull request #602 from qitechgmbh/594-remove-motor-volts-graph
Remove motor voltage references from extruder components
2025-08-20 12:30:41 +02:00
Christian b719731926 Remove motor voltage references from extruder components 2025-08-20 12:22:56 +02:00
Icedsoda 5b4d81fec2 Merge pull request #599 from qitechgmbh/593-Fix-Graph-Labels-for-Temperatures
Add title to temp value sensors in temperature graph
2025-08-20 12:17:32 +02:00
Robin Krämer 4f50395eb9 Merge pull request #600 from qitechgmbh/595-Extend-Power-Outputs-Graph
Add combined power and motor power graphs to Extruder2GraphsPage, cor…
2025-08-20 12:09:51 +02:00
Christian 30a7134db9 Add combined power and motor power graphs to Extruder2GraphsPage, correct the order of the values by front to back 2025-08-19 13:57:32 +02:00
Robin Krämer 474d64c2a2 Merge pull request #601 from qitechgmbh/598-Images-in-the-manual-are-not-loading
Fix images in the manual not loading
2025-08-19 13:53:52 +02:00
Christian 0293654803 fix code styling 2025-08-18 15:51:54 +02:00
Christian 80ca509998 Move images to electron public folder 2025-08-18 15:26:38 +02:00
Christian a84157bd94 Add title to temp value sensors in temperature graph 2025-08-15 14:18:12 +02:00
Oshgnacknak 0007f14296 Merge pull request #592 from qitechgmbh/540-long-preset-names-mess-with-ui
Fix 540: long preset names mess with ui
2025-08-14 18:06:17 +02:00
Oshgnacknak 307ad265a9 Move preset menu options into hamburger menu 2025-08-14 18:05:02 +02:00
Oshgnacknak 41f36fdf2e Fix ellipsis when rendering long preset names 2025-08-14 18:05:02 +02:00
Oshgnacknak 86c28fef8a Merge pull request #590 from qitechgmbh/changelog_2.4.0_update
Update CHANGELOG.md
2025-08-14 17:37:21 +02:00
Robin Krämer c01c09548c Update CHANGELOG.md 2025-08-14 17:34:40 +02:00
Oshgnacknak 8f76bb88e7 Merge pull request #589 from qitechgmbh/588-limit-backend-and-frontend-to-30-fps
588 limit backend and frontend to 30 fps
2025-08-14 17:19:04 +02:00
93094049+kraemr@users.noreply.github.com ea24c2f85c replaced 60fps with 30fps 2025-08-14 17:14:35 +02:00
93094049+kraemr@users.noreply.github.com 806603c583 Every machine now sends live events every 33.3 ms 2025-08-14 17:13:18 +02:00
93094049+kraemr@users.noreply.github.com 4b9a788be4 changed comments and timeouts to 30fps 2025-08-14 17:13:18 +02:00
93094049+kraemr@users.noreply.github.com 2d91d34e9a Introduced a 30FPS Constant 2025-08-14 17:13:18 +02:00
Oshgnacknak 7e50cce009 Merge pull request #582 from qitechgmbh/dependabot/cargo/libc-0.2.175
Bump libc from 0.2.172 to 0.2.175
2025-08-14 16:53:39 +02:00
Robin Krämer 2f642a11d0 Merge pull request #587 from qitechgmbh/574-isolate-core-for-realtime-kernel
testing with cores 2,3 isolated
2025-08-14 16:19:39 +02:00
93094049+kraemr@users.noreply.github.com 6cb027b12e added comments 2025-08-14 16:15:35 +02:00
93094049+kraemr@users.noreply.github.com 58903a885d testing with cores 2,3 isolated 2025-08-14 16:15:35 +02:00
Oshgnacknak eda4b7a9b5 Merge pull request #584 from qitechgmbh/dependabot/cargo/syn-2.0.105
Bump syn from 2.0.101 to 2.0.105
2025-08-14 16:14:19 +02:00
Oshgnacknak 2f48b4093f Merge pull request #556 from qitechgmbh/dependabot/npm_and_yarn/electron/tmp-0.2.4
Bump tmp from 0.2.3 to 0.2.4 in /electron
2025-08-14 16:14:03 +02:00
dependabot[bot] 676f19ea0d Bump libc from 0.2.172 to 0.2.175
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.172 to 0.2.175.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.175/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.172...0.2.175)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.175
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 14:02:55 +00:00
dependabot[bot] 0252cd5ef3 Bump syn from 2.0.101 to 2.0.105
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.101 to 2.0.105.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.101...2.0.105)

---
updated-dependencies:
- dependency-name: syn
  dependency-version: 2.0.105
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 14:01:45 +00:00
dependabot[bot] ac248e31a1 Bump tmp from 0.2.3 to 0.2.4 in /electron
Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.3 to 0.2.4.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/raszi/node-tmp/compare/v0.2.3...v0.2.4)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 14:01:19 +00:00
Oshgnacknak 58e43f4fc8 Merge pull request #545 from qitechgmbh/dependabot/cargo/tokio-1.47.1
Bump tokio from 1.45.0 to 1.47.1
2025-08-14 15:58:45 +02:00
Oshgnacknak 3845926b97 Merge pull request #581 from qitechgmbh/dependabot/npm_and_yarn/electron/tanstack/react-query-5.84.2
Bump @tanstack/react-query from 5.84.1 to 5.84.2 in /electron
2025-08-14 15:56:30 +02:00
Oshgnacknak 78c99580bf Merge pull request #583 from qitechgmbh/dependabot/cargo/rand-0.9.2
Bump rand from 0.9.1 to 0.9.2
2025-08-14 15:55:40 +02:00
dependabot[bot] 3526711f4d Bump rand from 0.9.1 to 0.9.2
Bumps [rand](https://github.com/rust-random/rand) from 0.9.1 to 0.9.2.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/rand_core-0.9.1...rand_core-0.9.2)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.9.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 13:47:44 +00:00
dependabot[bot] 5ab97839c6 Bump @tanstack/react-query from 5.84.1 to 5.84.2 in /electron
Bumps [@tanstack/react-query](https://github.com/TanStack/query/tree/HEAD/packages/react-query) from 5.84.1 to 5.84.2.
- [Release notes](https://github.com/TanStack/query/releases)
- [Commits](https://github.com/TanStack/query/commits/v5.84.2/packages/react-query)

---
updated-dependencies:
- dependency-name: "@tanstack/react-query"
  dependency-version: 5.84.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 13:42:48 +00:00
Oshgnacknak c92455226f Merge pull request #566 from qitechgmbh/dependabot/npm_and_yarn/electron/eslint-plugin-prettier-5.5.4
Bump eslint-plugin-prettier from 5.5.3 to 5.5.4 in /electron
2025-08-14 15:41:27 +02:00
Oshgnacknak 3b91162fd3 Merge pull request #565 from qitechgmbh/dependabot/npm_and_yarn/electron/types/node-24.2.1
Bump @types/node from 22.17.0 to 24.2.1 in /electron
2025-08-14 15:40:57 +02:00
dependabot[bot] c3da8bb357 Bump tokio from 1.45.0 to 1.47.1
Dependabot couldn't find the original pull request head commit, 32fa361c9bbd7a001d6efe407f2697c376ee0d54.
2025-08-14 13:36:08 +00:00
Oshgnacknak 70dd9d2072 Merge pull request #586 from qitechgmbh/youtube-thumbnais
Add YouTube Thumbnail to README.md
2025-08-14 15:36:00 +02:00
Oshgnacknak 2a87e17909 Merge pull request #375 from qitechgmbh/dependabot/cargo/thread-priority-2.1.0
Bump thread-priority from 1.2.0 to 2.1.0
2025-08-14 15:33:57 +02:00
Oshgnacknak ac95e23e18 Merge pull request #585 from qitechgmbh/dependabot/npm_and_yarn/electron/electron/fuses-2.0.0
Bump @electron/fuses from 1.8.0 to 2.0.0 in /electron
2025-08-14 15:33:09 +02:00
dependabot[bot] 5e606e485f Bump @electron/fuses from 1.8.0 to 2.0.0 in /electron
Bumps [@electron/fuses](https://github.com/electron/fuses) from 1.8.0 to 2.0.0.
- [Release notes](https://github.com/electron/fuses/releases)
- [Changelog](https://github.com/electron/fuses/blob/main/.releaserc.json)
- [Commits](https://github.com/electron/fuses/compare/v1.8.0...v2.0.0)

---
updated-dependencies:
- dependency-name: "@electron/fuses"
  dependency-version: 2.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 13:32:50 +00:00
Icedsoda a35f65b8d0 Update README.md 2025-08-14 15:31:49 +02:00
dependabot[bot] 587f7f6c88 Bump thread-priority from 1.2.0 to 2.1.0
Bumps [thread-priority](https://github.com/iddm/thread-priority) from 1.2.0 to 2.1.0.
- [Commits](https://github.com/iddm/thread-priority/commits)

---
updated-dependencies:
- dependency-name: thread-priority
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 13:31:01 +00:00
dependabot[bot] eedf71b933 Bump eslint-plugin-prettier from 5.5.3 to 5.5.4 in /electron
Bumps [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) from 5.5.3 to 5.5.4.
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.5.3...v5.5.4)

---
updated-dependencies:
- dependency-name: eslint-plugin-prettier
  dependency-version: 5.5.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 13:30:43 +00:00
dependabot[bot] 671c36e9c1 Bump @types/node from 22.17.0 to 24.2.1 in /electron
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.17.0 to 24.2.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.2.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 13:30:31 +00:00
Oshgnacknak f59b1f4096 Merge pull request #564 from qitechgmbh/dependabot/npm_and_yarn/electron/electron-37.2.6
Bump electron from 36.7.3 to 37.2.6 in /electron
2025-08-14 15:29:15 +02:00
dependabot[bot] 138c5614d1 Bump electron from 36.7.3 to 37.2.6 in /electron
Bumps [electron](https://github.com/electron/electron) from 36.7.3 to 37.2.6.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](https://github.com/electron/electron/compare/v36.7.3...v37.2.6)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 37.2.6
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 13:28:18 +00:00
Oshgnacknak b0e1a09d61 Merge pull request #580 from qitechgmbh/depbot
Fix dependabot.yml
2025-08-14 15:26:45 +02:00
Oshgnacknak 29a8a5281b Fix dependabot.yml 2025-08-14 15:19:49 +02:00
Oshgnacknak 92cb25749a Merge pull request #579 from qitechgmbh/1cedsoda-patch-1
Make dependabot less verbose
2025-08-14 15:12:35 +02:00
Icedsoda 0b26dfe9de Update dependabot.yml 2025-08-14 15:10:38 +02:00
Oshgnacknak a1117ad09d Merge pull request #353 from qitechgmbh/dependabot/cargo/serialport-4.7.2
Bump serialport from 4.7.1 to 4.7.2
2025-08-14 15:10:07 +02:00
Oshgnacknak d39bd0b7fa Merge pull request #350 from qitechgmbh/dependabot/cargo/socketioxide-0.17.2
Bump socketioxide from 0.17.1 to 0.17.2
2025-08-14 15:09:29 +02:00
Oshgnacknak 51db45c341 Merge pull request #567 from qitechgmbh/dependabot/npm_and_yarn/electron/electron-forge/maker-rpm-7.8.3
Bump @electron-forge/maker-rpm from 7.8.2 to 7.8.3 in /electron
2025-08-14 15:06:32 +02:00
Oshgnacknak c74fabb1f0 Merge pull request #505 from qitechgmbh/build-frontend-in-ci
Build front-end in CI
2025-08-14 15:03:21 +02:00
Oshgnacknak afc9b2a135 Fix compile errors 2025-08-14 14:55:17 +02:00
Oshgnacknak e3cfb6d0a0 Build front-end in CI
Currently, electron-forge seems to mute a loot of the error messages.
This is why first compiling with tsc might help
2025-08-14 14:55:17 +02:00
Robin Krämer 30a521f27d Merge pull request #572 from qitechgmbh/io-uring
Use `io_uring` on linux
2025-08-14 14:53:11 +02:00
Icedsoda bba2759c1a use io_uring on linux 2025-08-14 14:48:59 +02:00
Oshgnacknak 4c1f870eaa Merge pull request #577 from qitechgmbh/576-missing-el2002-revision
576 missing el2002 revision
2025-08-14 14:45:53 +02:00
93094049+kraemr@users.noreply.github.com 5d317a9841 added missing properties 2025-08-13 15:22:38 +02:00
93094049+kraemr@users.noreply.github.com 4c750ec3be added missing revision to el2002 2025-08-13 15:10:21 +02:00
Robin Krämer da531208e5 Merge branch 'master' into dependabot/npm_and_yarn/electron/electron-forge/maker-rpm-7.8.3 2025-08-13 14:24:19 +02:00
Robin Krämer 554560681b Merge pull request #516 from qitechgmbh/format-write
Allow running linter with fix option
2025-08-13 14:23:43 +02:00
Oshgnacknak 05198ee7e9 Allow running linter with fix option 2025-08-13 14:17:33 +02:00
Robin Krämer a3b9f1b505 Merge pull request #551 from qitechgmbh/550-Allow-wound-distance-reset-during-winding
550 allow wound distance reset during winding
2025-08-13 14:14:39 +02:00
Christian 08578bf856 add warning dialog when wantig to reset while winding 2025-08-13 14:09:30 +02:00
Christian ea65f3cd2c make reset possible while winding 2025-08-13 14:09:30 +02:00
Robin Krämer 4df8815bfa Merge pull request #463 from qitechgmbh/445-implement-el3062-0030
Add `EL3062-0030`
2025-08-13 13:53:28 +02:00
Darmenov Alisher 5f645c3d3a working el3062-0030 2025-08-13 13:50:10 +02:00
Darmenov Alisher c774ace112 feat: Add support for EL3062-0030 device in EtherCAT HAL 2025-08-13 13:50:10 +02:00
Icedsoda 64a6ab0410 Add EL3062-0030 EEPROM dump 2025-08-13 13:50:10 +02:00
Robin Krämer def9c22b64 Merge pull request #571 from qitechgmbh/570-preempt_rt-causes-electron-to-lag
added niceness value to wrapper
2025-08-11 16:10:56 +02:00
93094049+kraemr@users.noreply.github.com 6d6f90bf9f added niceness value to wrapper 2025-08-11 14:06:07 +02:00
Robin Krämer 12dc482e91 Merge pull request #560 from qitechgmbh/fix-typo-in-traverse_controller
Fix typo in traverse controller
2025-08-11 14:04:49 +02:00
snacj b52c047cdf Fix typo in traverse controller 2025-08-11 13:59:10 +02:00
Robin Krämer fa75e91ce6 Merge pull request #569 from qitechgmbh/568-use-realtime-kernel-preempt_rt
fixed config for RT Kernel
2025-08-11 13:29:22 +02:00
93094049+kraemr@users.noreply.github.com c52d4d464d fixed config for RT 2025-08-11 12:17:25 +02:00
Robin Krämer 9719b5251c Merge pull request #563 from qitechgmbh/562-Add-electrical-wiring-diagrams-for-extruder-and-winder
Add wiring diagrams for extruder and winder.
2025-08-11 11:20:53 +02:00
dependabot[bot] ea796bbea6 Bump @electron-forge/maker-rpm from 7.8.2 to 7.8.3 in /electron
Bumps [@electron-forge/maker-rpm](https://github.com/electron/forge) from 7.8.2 to 7.8.3.
- [Release notes](https://github.com/electron/forge/releases)
- [Changelog](https://github.com/electron/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/electron/forge/compare/v7.8.2...v7.8.3)

---
updated-dependencies:
- dependency-name: "@electron-forge/maker-rpm"
  dependency-version: 7.8.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 03:56:03 +00:00
Christian 594a8730a4 Refractor file naming 2025-08-10 14:56:23 +02:00
Christian 03ae4aeefd Add wiring diagrams for extruder and winder. 2025-08-10 14:52:21 +02:00
Oshgnacknak 57f6e50e0e Merge pull request #558 from qitechgmbh/557-fix-rust-formatting-error
removed unused imports
2025-08-07 15:05:49 +02:00
93094049+kraemr@users.noreply.github.com fcebb2d0f2 fixed formatting error 2025-08-07 14:55:07 +02:00
93094049+kraemr@users.noreply.github.com 56ebc80aab removed unused imports 2025-08-07 14:47:24 +02:00
Oshgnacknak 6d8aba1577 Merge pull request #555 from qitechgmbh/rust-formating
Run formatter for rust code in ci
2025-08-06 16:36:21 +02:00
Oshgnacknak ebaf033b36 Run formatter in ci 2025-08-06 16:35:40 +02:00
Oshgnacknak 71f314cf75 Fix warnings 2025-08-06 16:35:40 +02:00
Oshgnacknak f520c759ce Run formatter once 2025-08-06 16:35:40 +02:00
Robin Krämer b8d0b1a630 Update CHANGELOG.md
Update CHANGELOG.md
2025-08-06 16:30:24 +02:00
Icedsoda 11deedb75d Merge pull request #553 from qitechgmbh/552-show-all-branches-on-the-choosversionpage
Show all branches
2025-08-05 16:45:31 +02:00
Robin Krämer 50a61f9e21 Merge pull request #549 from qitechgmbh/519-show-inverter-voltagecurrent
519 show inverter voltagecurrent
2025-08-05 15:48:00 +02:00
Christian 2df5a06930 fix control page graph 2025-08-05 15:44:55 +02:00
TheBest6337 0ae30ba8fb fix styling 2025-08-05 15:44:55 +02:00
TheBest6337 2b80d6c806 Smaller Timewindow and sampleInterval to be more perfomant 2025-08-05 15:44:55 +02:00
Christian fd2ff77b62 fix formatting 2025-08-05 15:44:55 +02:00
Christian 46e699b745 Add combined power consumption calculation and graph it in the ui 2025-08-05 15:44:55 +02:00
Christian 5e0dbf9d7e Add motor power and current tracking to extruder graphs and add power calculation to the extruder api 2025-08-05 15:44:55 +02:00
93094049+kraemr@users.noreply.github.com eefc9b3834 fixed errors and fixed units 2025-08-05 15:44:55 +02:00
93094049+kraemr@users.noreply.github.com bbc9783961 fixed frontend and added timeseries 2025-08-05 15:44:55 +02:00
93094049+kraemr@users.noreply.github.com 3c998d2f5c fixed naming 2025-08-05 15:44:55 +02:00
93094049+kraemr@users.noreply.github.com 52cd1ce050 added backend to read frequency, voltage and current of motor 2025-08-05 15:44:55 +02:00
Icedsoda 5140410006 Show all branches 2025-08-04 15:53:46 +02:00
Christian 852beb5a06 Revert "flip plus and minus buttons"
This reverts commit 2cf150a541.
2025-07-31 13:52:42 +02:00
TheBest6337 2cf150a541 flip plus and minus buttons 2025-07-31 13:48:30 +02:00
Oshgnacknak 4f2f1b227c Merge pull request #541 from qitechgmbh/526-import-and-export-presets
Allow importing and exporting presets
2025-07-30 23:37:51 +02:00
Oshgnacknak 7c1f77ff7b Allow importing presets from file 2025-07-30 23:29:54 +02:00
Oshgnacknak 8b2b769435 Use typed storage instead of any 2025-07-30 23:29:54 +02:00
Oshgnacknak 5350ca8f53 General purpose file input matching our button style 2025-07-30 23:29:40 +02:00
Oshgnacknak 14f4ac1248 Allow exporting individual presets 2025-07-30 19:50:57 +02:00
Oshgnacknak 548ecf5723 Merge pull request #539 from qitechgmbh/537-developer-docs-for-presers
Create presets documentation
2025-07-29 16:01:07 +02:00
Oshgnacknak 99e74759b5 Create presets.md 2025-07-29 15:59:17 +02:00
Oshgnacknak ec177906c8 Merge pull request #538 from qitechgmbh/527-presets-for-the-laser
Implement presets for the laser
2025-07-29 14:44:38 +02:00
Oshgnacknak afdf38eaf2 Implement presets for the laser
Closes #527
2025-07-29 14:42:16 +02:00
Oshgnacknak d8d509812b Merge pull request #531 from qitechgmbh/525-preset-migrations
Validate presets after loading them from the store
2025-07-29 14:23:41 +02:00
Robin Krämer 3eeeadab5c Update CHANGELOG.md 2025-07-25 17:39:43 +02:00
Robin Krämer 657c3cff85 Update CHANGELOG.md 2025-07-25 17:38:46 +02:00
Oshgnacknak 7ea7721ea3 Validate presets after loading them from the store 2025-07-25 17:16:07 +02:00
Robin Krämer b5ccf10128 Merge pull request #528 from qitechgmbh/524-error-thrown-in-console-when-no-presets-exist
Fix loading presets if the store does not exist yet
2025-07-25 16:17:09 +02:00
Oshgnacknak a5a0b1a5e5 Fix loading presets if the store does not exist yet 2025-07-25 16:08:31 +02:00
Robin Krämer 1e8ef812e9 Merge pull request #523 from qitechgmbh/520-add-overload-warning
add overload warning for the inverter
2025-07-25 14:51:17 +02:00
93094049+kraemr@users.noreply.github.com 4965e73b0c fixed styling 2025-07-25 12:40:19 +02:00
Christian 6db2b91052 add overload warning for the inverter 2025-07-24 18:52:31 +02:00
Robin Krämer a930d058c2 Merge pull request #504 from qitechgmbh/winder-1-docs-v2
64 Winder 1 docs v2
2025-07-24 14:38:28 +02:00
93094049+kraemr@users.noreply.github.com 5b7acbc7f3 updated prettier version 2025-07-24 14:27:58 +02:00
93094049+kraemr@users.noreply.github.com 344d319d12 force line endings 2025-07-24 14:22:33 +02:00
93094049+kraemr@users.noreply.github.com d5534e0967 line endings caused issues 2025-07-24 14:18:38 +02:00
93094049+kraemr@users.noreply.github.com 680cb71dde added manual back to winder 2025-07-24 14:02:05 +02:00
93094049+kraemr@users.noreply.github.com a26ccb0a1f fixed regression 2025-07-24 14:02:05 +02:00
93094049+kraemr@users.noreply.github.com 9fa037a9f9 fixed styling again 2025-07-24 14:02:05 +02:00
93094049+kraemr@users.noreply.github.com f07dcbf8f8 fixed styling issues 2025-07-24 14:02:04 +02:00
Christian 783ee38a3a fix: sizing and formatting errors 2025-07-24 14:02:04 +02:00
Christian 4a7be41dfe add line under headings and make them bolt 2025-07-24 14:02:04 +02:00
Christian 8b6960ae64 fix: adjust list styling in Markdown component for better alignment 2025-07-24 14:02:04 +02:00
Christian cf0b71bb69 fix: typo 2025-07-24 14:02:04 +02:00
Christian e5608d061f fix: improve Markdown component styling 2025-07-24 14:02:04 +02:00
Christian 7eba9523d4 fix: update image paths in manuals for correct referencing 2025-07-24 14:02:04 +02:00
Christian 5ad85b1a8c add rehype-raw plugin to Markdown component for HTML support 2025-07-24 14:02:04 +02:00
93094049+kraemr@users.noreply.github.com 064a904975 for easier testing added winder doc to MockManual 2025-07-24 14:02:04 +02:00
93094049+kraemr@users.noreply.github.com ccbab4afba renamed winder-1 to manual 2025-07-24 14:02:04 +02:00
Janhegerq 79870d995a correction of winder usermanual 2025-07-24 14:02:04 +02:00
Janhegerq 0d95f1c44f renamed picture 2025-07-24 14:02:04 +02:00
Janhegerq 62aabaa36a fini9shed windr usermanual 2025-07-24 14:02:04 +02:00
Janhegerq b57b746379 pictures for winder 2025-07-24 14:02:04 +02:00
Janhegerq d1dbe7550d updated with pictures 2025-07-24 14:02:04 +02:00
Janhegerq 38d2364ac4 renamed file (Titelseite) 2025-07-24 14:02:04 +02:00
Janhegerq 581b4f7773 delted file(manual) 2025-07-24 14:02:04 +02:00
Janhegerq 0550ecec7b file moved to electron/src/assets/markdown/winder 2025-07-24 14:02:04 +02:00
Janhegerq 3071482a87 named winder description 2025-07-24 14:02:04 +02:00
Janhegerq 0c926a5acd renamed signs 2025-07-24 14:02:04 +02:00
Janhegerq 59387eb214 named mandatory sign 2025-07-24 14:02:04 +02:00
Janhegerq 9693af313f named mandatory signs 2025-07-24 14:02:04 +02:00
Janhegerq df1beabfa8 named security signs 2025-07-24 14:02:04 +02:00
Janhegerq 9630142921 named screenshots 2025-07-24 14:02:04 +02:00
Janhegerq fcef922ab1 named warning labels 2025-07-24 14:02:04 +02:00
Janhegerq edd8c83402 named warning labels 2025-07-24 14:02:04 +02:00
Janhegerq 09d9801482 Add files via upload 2025-07-24 14:02:04 +02:00
Janhegerq f50997ec23 Update winder-1.md
experiment Bild
2025-07-24 14:02:04 +02:00
Janhegerq 5524e9f10a Add files via upload 2025-07-24 14:02:04 +02:00
Janhegerq 7e73e2f879 Update winder-1.md 2025-07-24 14:02:04 +02:00
Robin Krämer 96719dae15 Merge pull request #517 from qitechgmbh/482-communicate-with-winder
482 communicate with winder
2025-07-23 12:18:26 +02:00
snacj e78e9ba9e3 Fixed Typo 2025-07-23 12:11:38 +02:00
snacj a730ed3228 Fixed Merge Conflicts 2025-07-23 12:04:24 +02:00
snacj c3b0a8643d Fixed unused imports unreachable code and unused configs 2025-07-23 11:55:12 +02:00
snacj 422d98bc7c Fixed machine connection backend errors 2025-07-23 11:55:12 +02:00
snacj f1b61dad9b Moved Machine Connection dropdown to settings page 2025-07-23 11:55:12 +02:00
snacj c97768975b Fixed Connection Errors 2025-07-23 11:54:29 +02:00
snacj 0b882e8bde added machine connection logic and dropdown to buffer and winder 2025-07-23 11:54:29 +02:00
snacj 6752b503bc Added Connected Machine State to Buffer and Winder 2025-07-23 11:54:29 +02:00
snacj 847963fb1c Changed Title of dropdown menu 2025-07-23 11:54:29 +02:00
snacj 4441b60d4a Added Connecting Machine Functionality to Winder and Buffer backend 2025-07-23 11:54:29 +02:00
snacj cb74f4fb6a Fixed Merge issues 2025-07-23 11:54:29 +02:00
snacj fae9c7151c Added frontend Connection Logic to Mock Machine 2025-07-23 11:54:29 +02:00
snacj 7aa36c0361 Added Reverse connection and fixed deadlock 2025-07-23 11:53:54 +02:00
snacj eb4b4e948d Fixed compiling errors due to new MachineAct trait 2025-07-23 11:53:54 +02:00
snacj 13af890e29 Added disconnection logic to backend 2025-07-23 11:53:54 +02:00
snacj d366f52127 Added Availability of machine to frontend 2025-07-23 11:53:54 +02:00
snacj 8f8535b6a3 Fixed Manager to also return weak serial machine 2025-07-23 11:53:54 +02:00
snacj 83fa27c7be Added clear selection and disconnectMachine functionality in frontend 2025-07-23 11:53:54 +02:00
snacj 8295496671 Fixed usage of component machineConnectionDropdown 2025-07-23 11:53:54 +02:00
snacj 9277521dbd Fixed Machine Selection dropdown 2025-07-23 11:53:54 +02:00
snacj 3797fc6469 Refactoring of registry 2025-07-23 11:53:54 +02:00
snacj 9700e47358 Implemented as_any function to machines 2025-07-23 11:53:54 +02:00
snacj 8ee1c63e8d Added machine manager reference to machines 2025-07-23 11:53:54 +02:00
snacj dae3def188 Added and implemented downcast function 2025-07-23 11:53:54 +02:00
snacj fa3dc0aa8c Added Buffer Speed Controller 2025-07-23 11:53:54 +02:00
snacj 69fcdb969d Changed Smartpointers from Box to Arc in machine manager 2025-07-23 11:53:54 +02:00
snacj 9b03b4d909 Fixed Typo 2025-07-23 11:53:54 +02:00
snacj 5e9fb93a21 Added MachineConnectionDropdown component 2025-07-23 11:53:54 +02:00
Robin Krämer b6842a71fb Merge pull request #514 from qitechgmbh/62-persist-config-values
Persist machine configuration in presets
2025-07-23 00:05:00 +02:00
Oshgnacknak f89645a516 Use types of schemas for type checking 2025-07-22 13:19:32 +02:00
Oshgnacknak d928a4ba81 Fix winder preset preview table 2025-07-22 13:17:02 +02:00
Oshgnacknak c457b21e64 Fix units in extruder preset preview 2025-07-22 13:17:02 +02:00
Oshgnacknak c63be3688b Introduce new preset dialog and thus fix styling 2025-07-22 13:17:02 +02:00
Oshgnacknak 21c40ac7ad Implement presets page for the extruder 2025-07-22 13:17:01 +02:00
Oshgnacknak 0938f68d8d Adapt to newer presets for winder 2 2025-07-22 13:17:01 +02:00
Oshgnacknak 87e903781b Have own zod schema for persisted presets 2025-07-22 13:17:01 +02:00
Oshgnacknak 6753f92128 Rename defaultData to defaultState 2025-07-22 13:17:01 +02:00
Oshgnacknak 59353ff06f Use z.coerce to always parse preset.lastModified as a date 2025-07-22 13:17:01 +02:00
Oshgnacknak 938bbc97a6 Parse presets from local storage via zod 2025-07-22 13:17:01 +02:00
Oshgnacknak bb02eeb2b0 Turn type Preset into zod schema 2025-07-22 13:16:57 +02:00
Oshgnacknak 7bc91d73a6 Use default state if state is not fully loaded yet 2025-07-22 13:12:10 +02:00
Oshgnacknak 59783bc2c3 Save latest settings in a preset upon machine change 2025-07-22 13:12:10 +02:00
Oshgnacknak d93ff842ab Don't show date for default preset 2025-07-22 13:12:10 +02:00
Oshgnacknak 78417edcb8 only show default preset of loaded from server 2025-07-22 13:12:10 +02:00
Oshgnacknak f0f1c2c69e Fix setting presets in mock page 2025-07-22 13:12:10 +02:00
Oshgnacknak b4043d1a75 Show a preset with the default settings to the user 2025-07-22 13:12:10 +02:00
Oshgnacknak 3614f812b9 Abstract rendering a preset's preview into its own component 2025-07-22 13:12:10 +02:00
Oshgnacknak 26d3af414f Sort presets by last modified 2025-07-22 13:12:10 +02:00
Oshgnacknak ec8eb6a835 Implement preset preview for winder2 2025-07-22 13:12:10 +02:00
Oshgnacknak 69f0f73087 Render preview dialog before applying presets 2025-07-22 13:12:09 +02:00
Oshgnacknak 0b3e4c8c96 Fix mock graph 2025-07-22 13:12:09 +02:00
Oshgnacknak b8777ee4da Filter presets to only show presets of the current machine 2025-07-22 13:12:09 +02:00
Oshgnacknak 0bc415271e Add presets page for winder2 2025-07-22 13:12:09 +02:00
Oshgnacknak efa32e91ee Implement PresetsPage in a generic manner 2025-07-22 13:12:03 +02:00
Oshgnacknak f0927513cd Allow saving and applying presets presets on the mock machine 2025-07-22 13:05:00 +02:00
Oshgnacknak 3599c26c54 Allow setting 3 frequencies in the UI 2025-07-22 13:05:00 +02:00
Oshgnacknak aa97091b98 Report multiple sine waves in the mock machine 2025-07-22 13:05:00 +02:00
Robin Krämer ea62de3fdc Merge pull request #503 from qitechgmbh/437-add-buffered-winder-base
437 add buffered winder base
2025-07-21 16:02:23 +02:00
Robin Krämer b42089e992 Merge branch 'master' into 437-add-buffered-winder-base 2025-07-21 15:58:31 +02:00
Robin Krämer ebffbb69ec Merge pull request #502 from qitechgmbh/fix-caps
Set caps also for real time
2025-07-21 15:54:48 +02:00
snacj c48b5b2292 Changed frontend Formatting 2025-07-21 15:54:36 +02:00
Oshgnacknak 8abd6558d1 Set caps also for real time clock 2025-07-21 15:51:02 +02:00
snacj dc0b4fada3 Removed unused imports and Debug messages 2025-07-21 15:49:03 +02:00
Robin Krämer 92cacbc6c8 Merge pull request #513 from qitechgmbh/510-add-a-getting-started-dev-documentation
510 add a getting started dev documentation
2025-07-21 14:28:26 +02:00
93094049+kraemr@users.noreply.github.com 4bad318ce7 updated readme and getting-started dev docs 2025-07-21 14:25:41 +02:00
93094049+kraemr@users.noreply.github.com 0eeb7f372e added Contributing 2025-07-21 14:18:30 +02:00
93094049+kraemr@users.noreply.github.com 1a72f3f8bb added inital dev docs and updated build script 2025-07-21 14:11:38 +02:00
Robin Krämer 522ace8a4f Merge pull request #508 from qitechgmbh/501-raise-pressure-limit-of-extruder-and-add-conifrmation
501 raise pressure limit of extruder and add confirmation to EditValue
2025-07-21 12:05:50 +02:00
snacj 7e776dc360 Fixed formatting 2025-07-17 16:15:54 +02:00
snacj 6487ddc6d2 Cleaned up Buffered winder base. Ready for review 2025-07-17 16:11:26 +02:00
93094049+kraemr@users.noreply.github.com 4ebd09d2eb fixed compile errors 2025-07-16 16:29:15 +02:00
snacj 330b000b6e Added start of controller logic 2025-07-16 16:24:02 +02:00
snacj 7a817945ee Added StateEvent to manipulate Live Event Data 2025-07-16 16:24:02 +02:00
snacj 47b1b7fc82 Added live event functionality with sineWave example live value. 2025-07-16 16:24:02 +02:00
snacj 7f2ea72ad3 Implemented Buffer Communication Frontend and Backend with new refactored style events. 2025-07-16 16:24:02 +02:00
snacj 62553d1a2e Buffer frontend accepts backend events. 2025-07-16 16:24:02 +02:00
snacj cff28876ee Added backend Event emits for Buffer1 2025-07-16 16:24:02 +02:00
snacj 56032ed59c Changed formatting 2025-07-16 16:24:01 +02:00
snacj 73245a31c6 added button logic to frontend buffer 2025-07-16 16:24:01 +02:00
snacj f423ac2a14 Added mutation and simulation for moving buffer motor 2025-07-16 16:24:01 +02:00
snacj 82377c2c25 Added constant for Buffer 2025-07-16 16:24:01 +02:00
snacj 08bd2c8cee Created and added Buffer1Page and Buffer1ControlPage to routes 2025-07-16 16:24:01 +02:00
snacj 7205fdea22 Changed Roles of Stepper Puller in backend to fit frontend 2025-07-16 16:24:01 +02:00
snacj c1c420ce8f Updated registry with Buffer1; Renamed BufferedWinder to Buffer1 2025-07-16 16:24:01 +02:00
snacj 576e80cc39 Added Buffer1 properties 2025-07-16 16:24:01 +02:00
snacj a51a871b70 Added different devices to new function of BufferedWinder 2025-07-16 16:24:01 +02:00
snacj f686420e1e added modes to api.rs&new.rs 2025-07-16 16:24:01 +02:00
snacj 2237a84d88 Added folder buffered_winder under server/src/machines/ ; added files act.rs;api.rs;mod.rs;new.rs to buffered_winder and added buffered_winder to mod.rs in server/src/machines 2025-07-16 16:24:01 +02:00
93094049+kraemr@users.noreply.github.com 5c00d28396 raised maximum for Target Pressure 2025-07-16 16:09:19 +02:00
93094049+kraemr@users.noreply.github.com 2b0cff358e added optional confirmation to EditValue 2025-07-16 16:08:49 +02:00
Robin Krämer c3b7f9d050 Merge pull request #498 from qitechgmbh/497-laser-control-page-diameter-circle-extends-over-the-boundaries
clamped diameter visualisation to avoid large circles
2025-07-15 16:08:17 +02:00
93094049+kraemr@users.noreply.github.com a7fce331a0 fixed lint error 2025-07-15 16:06:24 +02:00
93094049+kraemr@users.noreply.github.com 6dd8573584 removed console log and cleaned up code 2025-07-15 16:04:24 +02:00
93094049+kraemr@users.noreply.github.com 124418dc7a clamped diameter visualisation to avoid large circles 2025-07-15 16:00:49 +02:00
dependabot[bot] bf3ee15562 Bump serialport from 4.7.1 to 4.7.2
Bumps [serialport](https://github.com/serialport/serialport-rs) from 4.7.1 to 4.7.2.
- [Changelog](https://github.com/serialport/serialport-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/serialport/serialport-rs/compare/v4.7.1...v4.7.2)

---
updated-dependencies:
- dependency-name: serialport
  dependency-version: 4.7.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-28 13:59:48 +00:00
dependabot[bot] 48fac7f86c Bump socketioxide from 0.17.1 to 0.17.2
Bumps [socketioxide](https://github.com/totodore/socketioxide) from 0.17.1 to 0.17.2.
- [Release notes](https://github.com/totodore/socketioxide/releases)
- [Changelog](https://github.com/Totodore/socketioxide/blob/main/CHANGELOG.md)
- [Commits](https://github.com/totodore/socketioxide/compare/socketioxide-v0.17.1...socketioxide-v0.17.2)

---
updated-dependencies:
- dependency-name: socketioxide
  dependency-version: 0.17.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-28 13:59:45 +00:00
437 changed files with 84611 additions and 6891 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
.png filter=lfs diff=lfs merge=lfs -text
.jpg filter=lfs diff=lfs merge=lfs -text
.jpeg filter=lfs diff=lfs merge=lfs -text
+29
View File
@@ -0,0 +1,29 @@
This is a machine control software project.
## Repository structure
### Frontend
`/electron`: Frontend code for the control software built with React and Electron.
### Backend
`/server`: Implements machine setup & loop. Exposes a REST & Socket.io API for the electron frontend.
`/ethercat-hal`: Hardware abstraction layer for Beckhoff (and possibly other EtherCat) devices and protocols.
`/ethercat-hal-derive`: Macros for ethercat-hal
`/control-core`: Generic logic for the server.
### HMI Panel Operating System
`/nixos`: Custom Linux with realtime kernel & preconfigured for touchscreens.
### Other
/docs: Documentation for the project.
## Key Guidelines
1. Follow Rust & Typescript best practices and idiomatic patterns
2. Maintain existing code structure and organization
3. Write unit tests for new functionality where applicable.
4. Document public APIs and complex logic in code. Suggest changes to the `docs/` folder when appropriate
+14 -11
View File
@@ -1,16 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/electron" # Location of package manifests
- package-ecosystem: "npm"
directory: "/electron"
schedule:
interval: "weekly"
interval: "monthly"
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-minor"
- package-ecosystem: "cargo" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-minor"
+4 -1
View File
@@ -36,6 +36,9 @@ jobs:
- name: Install
run: npm i
- name: Build
run: tsc
- name: Format
run: npm run format
@@ -45,5 +48,5 @@ jobs:
- name: Test
run: npm run test
- name: Build
- name: Package
run: npm run package
+7
View File
@@ -21,6 +21,8 @@ jobs:
- uses: actions/checkout@v4
- name: Set Rust version
run: rustup override set ${{ env.RUST_VERSION }}
- name: Install Formatter
run: rustup component add rustfmt
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
@@ -35,7 +37,12 @@ jobs:
${{ runner.os }}-${{ env.RUST_VERSION }}-cargo-
- name: Build
env:
RUSTFLAGS: "-D warnings"
run: cargo build --verbose
- name: Format
run: cargo fmt --check --verbose
- name: Run tests
run: cargo test --verbose
+2
View File
@@ -3,3 +3,5 @@ dist/
.DS_Store
Cargo.lock
dhat-heap.json
build.sh
+49
View File
@@ -0,0 +1,49 @@
# Canonical identities on the left, aliases on the right.
# Format options:
# Canon Name <canon@example.com> <alias@example.com>
# Canon Name <canon@example.com> Alias Name <alias@example.com>
# Icedsoda -> Philipp
Philipp <29167146+1cedsoda@users.noreply.github.com> <29167146+1cedsoda@users.noreply.github.com>
# kraemr / Robin Krämer -> Robin
Robin <93094049+kraemr@users.noreply.github.com> <93094049+kraemr@users.noreply.github.com>
Robin <93094049+kraemr@users.noreply.github.com> Robin Krämer <93094049+kraemr@users.noreply.github.com>
# Oshgnacknak -> Josh
Josh <osh@oshgnacknak.de> <osh@oshgnacknak.de>
# Milan
Milan <61654753+MilanVDB@users.noreply.github.com>
# dependabot stays as bot
Dependabot <49699333+dependabot[bot]@users.noreply.github.com> <49699333+dependabot[bot]@users.noreply.github.com>
# Medformatik / Florian -> Florian
Florian <dev@fwcr.de> <dev@fwcr.de>
Florian <dev@fwcr.de> Medformatik <dev@fwcr.de>
# Anatomik5 -> Alisher (merge noreply + gmail under Alisher)
Alisher <115714693+Anatomik5@users.noreply.github.com> <115714693+Anatomik5@users.noreply.github.com>
Alisher <115714693+Anatomik5@users.noreply.github.com> Anatomik5 <darmenovalisher@gmail.com>
Alisher <115714693+Anatomik5@users.noreply.github.com> Darmenov Alisher <115714693+Anatomik5@users.noreply.github.com>
# snacj -> Melvin
Melvin <0xsnacj@proton.me> <0xsnacj@proton.me>
Melvin <0xsnacj@proton.me> snacj <bbmelvin@gmx.de>
Melvin <0xsnacj@proton.me> Melvin Spieß <0xsnacj@proton.me>
# Janhegerq -> Jan
Jan <219994445+Janhegerq@users.noreply.github.com> <219994445+Janhegerq@users.noreply.github.com>
Jan <219994445+Janhegerq@users.noreply.github.com> <19994445+Janhegerq@users.noreply.github.com>
# Christian / TheBest6337 -> christian
Christian <christian.zschoegner@outlook.de> <christian.zschoegner@outlook.de>
Christian <christian.zschoegner@outlook.de> TheBest6337 <christian.zschoegner@outlook.de>
Christian <christian.zschoegner@outlook.de> Christian <80114847+TheBest6337@users.noreply.github.com>
# nixos-install.sh
nixos-install.sh <nixos-install.sh@localhost> <nixos-install.sh@localhost>
# copilot-swe-agent bot
Copilot <198982749+Copilot@users.noreply.github.com> <198982749+Copilot@users.noreply.github.com>
+3 -2
View File
@@ -1,5 +1,6 @@
{
"typescript.inlayHints.enumMemberValues.enabled": false,
"git.detectSubmodules": true,
"git.detectSubmodulesLimit": 10,
"git.detectSubmodules": true,
"git.detectSubmodulesLimit": 10,
"rust-analyzer.check.command": "clippy",
}
+160
View File
@@ -1,3 +1,162 @@
# `2.11.0`
_21.10.2025_
## General
- [#829](https://github.com/qitechgmbh/control/pull/829), [#834](https://github.com/qitechgmbh/control/pull/834), Improved overall system stability
## Winder V2
- [#840](https://github.com/qitechgmbh/control/pull/840) Added XL Winder option
- [#827](https://github.com/qitechgmbh/control/pull/827) Spool can now be run in reverse
## Extruder V2
- [#826](https://github.com/qitechgmbh/control/pull/826) Fine grained Temperature-PID configuration now possible
# `2.10.0`
_16.10.2025_
## Winder V2
- [#776](https://github.com/qitechgmbh/control/pull/776) Added explanation for padding in winder manual
- [#804](https://github.com/qitechgmbh/control/pull/804) Added gearbox conversion
## General
- [#717](https://github.com/qitechgmbh/control/pull/717) Show from option for graphs added
- [#805](https://github.com/qitechgmbh/control/pull/805) Graphs run better now
# `2.9.1`
_10.10.2025_
## Winder V2
- [#796](https://github.com/qitechgmbh/control/pull/796) Winding in adaptive mode, while puller is in reverse mode is now possible
## General
- [#780](https://github.com/qitechgmbh/control/pull/780) Updates are faster now
- [#746](https://github.com/qitechgmbh/control/pull/746) Improved scrollbar styling for manuals
# `2.9.0`
_06.10.2025_
## Winder V2
- [#778](https://github.com/qitechgmbh/control/pull/778) Increased Winder Traverse Step size limit
## General
- [#725](https://github.com/qitechgmbh/control/pull/725) Improved troubleshooting and update page
- [#625](https://github.com/qitechgmbh/control/pull/625) Improved stability of Machine-Connections
# `2.8.0`
_30.09.2025_
## Laser V1
- [#741](https://github.com/qitechgmbh/control/pull/741) Added roundness measurement to two-axis Laser
## Winder V2
- [#745](https://github.com/qitechgmbh/control/pull/745), [#756](https://github.com/qitechgmbh/control/pull/756) improved Winder Frontend
## General
- [#447](https://github.com/qitechgmbh/control/pull/447) added AquaPath Machine
# `2.7.0`
_17.09.2025_
## Extruder V2
- [#695](https://github.com/qitechgmbh/control/pull/695) Pressure and Rpm Regulation properly switch again
## Winder V2
- [#727](https://github.com/qitechgmbh/control/pull/727) Removed estimated diameter
## Laser V1
- [#731](https://github.com/qitechgmbh/control/pull/731) Added Laser with two-axis measurements
## General
- [#679](https://github.com/qitechgmbh/control/pull/679),[#677](https://github.com/qitechgmbh/control/pull/677),[#698](https://github.com/qitechgmbh/control/pull/698), [#684](https://github.com/qitechgmbh/control/pull/684),[#706](https://github.com/qitechgmbh/control/pull/706) Greatly improved overall system latency and stability
- [#720](https://github.com/qitechgmbh/control/pull/720), [#686](https://github.com/qitechgmbh/control/pull/686) Improved User Interface
# `2.6.0`
_03.09.2025_
## Extruder V2
- [#658](https://github.com/qitechgmbh/control/pull/658) Added manual
- [#639](https://github.com/qitechgmbh/control/pull/639) Swapped order of screw speed regulation buttons
## Laser V1
- [#642](https://github.com/qitechgmbh/control/pull/642) Improved stability of laser connection
## General
- [#657](https://github.com/qitechgmbh/control/pull/657) Time frame for graphs is now remembered
- [#641](https://github.com/qitechgmbh/control/pull/641) Removed duplicate scrollbar from manuals
# `2.5.0`
_27.08.2025_
## Extruder V2
- [#595](https://github.com/qitechgmbh/control/pull/600) Simplified power graphs
- [#593](https://github.com/qitechgmbh/control/pull/599) Added identifiers for temperature sensors in temperature graph
## Winder V2
- [#598](https://github.com/qitechgmbh/control/pull/601) Images now load properly in the manual
## General
- [#540](https://github.com/qitechgmbh/control/pull/592) Improved readability of the presets
- [#591](https://github.com/qitechgmbh/control/pull/626) Significantly improved user interface performance and stability
# `2.4.0`
_14.08.2025_
## Winder V2
- [#550](https://github.com/qitechgmbh/control/pull/551) Can now reset wound distance while winding
## General
- [#568](https://github.com/qitechgmbh/control/pull/569),[#572](https://github.com/qitechgmbh/control/pull/572), [#574](https://github.com/qitechgmbh/control/pull/587) Improved EtherCAT performance
- [#588](https://github.com/qitechgmbh/control/pull/589) Improved frontend performance
# `2.3.0`
_06.08.2025_
## Extruder V2
- [#520](https://github.com/qitechgmbh/control/pull/523) added warning message incase inverter is overloaded
- [#501](https://github.com/qitechgmbh/control/pull/508) raised pressure limit of pressured PID mode for extruder
- [#519](https://github.com/qitechgmbh/control/pull/549) added total power consumption monitor and graphs for voltage,current and wattage of the motor
## Winder V2
- [#64](https://github.com/qitechgmbh/control/pull/504) added winder handbook
## Laser V1
- [#497](https://github.com/qitechgmbh/control/pull/498) improved diameter visualisation
## General
- [#62](https://github.com/qitechgmbh/control/pull/514),[#524](https://github.com/qitechgmbh/control/pull/528) added machine presets to load configurations
- [#526](https://github.com/qitechgmbh/control/pull/541) added import and export of presets
# `2.2.0`
_15.07.2025_
@@ -10,6 +169,7 @@ _15.07.2025_
- [#169](https://github.com/qitechgmbh/control/pull/492), Added a Confirmation Dialog when extruder has not reached 90% of target temperature
## Winder V2
- [#471](https://github.com/qitechgmbh/control/pull/480), Added a live value to track the pulled distance and the option of switching to a different Mode after a given distance.
## General
Generated
+98 -185
View File
@@ -99,9 +99,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.98"
version = "1.0.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
[[package]]
name = "approx"
@@ -256,7 +256,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -273,7 +273,7 @@ checksum = "99e1aca718ea7b89985790c94aad72d77533063fe00bc497bb79a7c2dae6a661"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -284,9 +284,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "axum"
version = "0.8.4"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5"
checksum = "8a18ed336352031311f4e0b4dd2ff392d4fbb370777c9d18d7fc9d7359f73871"
dependencies = [
"axum-core",
"axum-macros",
@@ -304,8 +304,7 @@ dependencies = [
"mime",
"percent-encoding",
"pin-project-lite",
"rustversion",
"serde",
"serde_core",
"serde_json",
"serde_path_to_error",
"serde_urlencoded",
@@ -319,9 +318,9 @@ dependencies = [
[[package]]
name = "axum-core"
version = "0.5.2"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6"
checksum = "59446ce19cd142f8833f856eb31f3eb097812d1479ab224f54d72428ca21ea22"
dependencies = [
"bytes",
"futures-core",
@@ -330,7 +329,6 @@ dependencies = [
"http-body-util",
"mime",
"pin-project-lite",
"rustversion",
"sync_wrapper",
"tower-layer",
"tower-service",
@@ -345,7 +343,7 @@ checksum = "604fde5e028fea851ce1d8570bbdc034bec850d157f7569d10f347d06808c05c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -539,7 +537,7 @@ dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -581,6 +579,7 @@ dependencies = [
"approx",
"axum",
"bitvec",
"control_core_derive",
"core_affinity",
"crc",
"erased-serde",
@@ -595,10 +594,20 @@ dependencies = [
"smol",
"socketioxide",
"textplots",
"tokio",
"tracing",
"uom",
]
[[package]]
name = "control_core_derive"
version = "0.1.0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.105",
]
[[package]]
name = "core-foundation"
version = "0.10.0"
@@ -728,7 +737,7 @@ dependencies = [
"deluxe-macros",
"once_cell",
"proc-macro2",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -741,7 +750,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim 0.10.0",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -756,7 +765,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -767,7 +776,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -804,7 +813,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -944,11 +953,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "erased-serde"
version = "0.4.6"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7"
checksum = "259d404d09818dec19332e31d94558aeb442fea04c817006456c24b5460bbd4b"
dependencies = [
"serde",
"serde_core",
"typeid",
]
@@ -1009,6 +1019,7 @@ dependencies = [
"futures",
"rand",
"smol",
"tracing",
"uom",
]
@@ -1019,7 +1030,7 @@ dependencies = [
"deluxe",
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -1071,7 +1082,7 @@ dependencies = [
"criterion",
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -1200,7 +1211,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -1667,15 +1678,6 @@ dependencies = [
"serde",
]
[[package]]
name = "is-docker"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3"
dependencies = [
"once_cell",
]
[[package]]
name = "is-terminal"
version = "0.4.16"
@@ -1687,16 +1689,6 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "is-wsl"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5"
dependencies = [
"is-docker",
"once_cell",
]
[[package]]
name = "is_terminal_polyfill"
version = "1.70.1"
@@ -1736,9 +1728,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.172"
version = "0.2.176"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174"
[[package]]
name = "libloading"
@@ -1815,11 +1807,11 @@ dependencies = [
[[package]]
name = "matchers"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
dependencies = [
"regex-automata 0.1.10",
"regex-automata",
]
[[package]]
@@ -1943,12 +1935,11 @@ checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65"
[[package]]
name = "nu-ansi-term"
version = "0.46.0"
version = "0.50.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399"
dependencies = [
"overload",
"winapi",
"windows-sys 0.52.0",
]
[[package]]
@@ -1991,17 +1982,6 @@ version = "11.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
[[package]]
name = "open"
version = "5.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2483562e62ea94312f3576a7aca397306df7990b8d89033e18766744377ef95"
dependencies = [
"is-wsl",
"libc",
"pathdiff",
]
[[package]]
name = "opentelemetry"
version = "0.30.0"
@@ -2076,12 +2056,6 @@ dependencies = [
"thiserror",
]
[[package]]
name = "overload"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "parking"
version = "2.2.1"
@@ -2117,12 +2091,6 @@ version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "pathdiff"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"
[[package]]
name = "pcap"
version = "2.2.0"
@@ -2175,7 +2143,7 @@ dependencies = [
"pest_meta",
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -2206,7 +2174,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -2342,7 +2310,7 @@ dependencies = [
"itertools",
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -2374,9 +2342,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
[[package]]
name = "rand"
version = "0.9.1"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
dependencies = [
"rand_chacha",
"rand_core",
@@ -2412,42 +2380,27 @@ dependencies = [
[[package]]
name = "regex"
version = "1.11.1"
version = "1.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
checksum = "8b5288124840bee7b386bc413c487869b360b2b4ec421ea56425128692f2a82c"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata 0.4.9",
"regex-syntax 0.8.5",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.1.10"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
dependencies = [
"regex-syntax 0.6.29",
]
[[package]]
name = "regex-automata"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
checksum = "833eb9ce86d40ef33cb1306d8accf7bc8ec2bfea4355cbdebb3df68b40925cad"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax 0.8.5",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.6.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
[[package]]
name = "regex-syntax"
version = "0.8.5"
@@ -2582,34 +2535,44 @@ checksum = "22f968c5ea23d555e670b449c1c5e7b2fc399fdaec1d304a17cd48e288abc107"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
name = "serde"
version = "1.0.219"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.219"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
name = "serde_json"
version = "1.0.140"
version = "1.0.143"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
dependencies = [
"itoa",
"memchr",
@@ -2683,9 +2646,9 @@ dependencies = [
[[package]]
name = "serialport"
version = "4.7.1"
version = "4.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2daa7abb9b965493e3c8f4184c6f46435484ff2538a332b886788cf6768b927b"
checksum = "2acaf3f973e8616d7ceac415f53fc60e190b2a686fbcf8d27d0256c741c5007b"
dependencies = [
"bitflags 2.9.0",
"cfg-if",
@@ -2709,28 +2672,23 @@ dependencies = [
"axum",
"bitvec",
"control_core",
"crc",
"control_core_derive",
"dhat",
"ethercat_hal",
"ethercrab",
"euclid",
"futures",
"lazy_static",
"open",
"opentelemetry",
"opentelemetry-otlp",
"opentelemetry_sdk",
"regex",
"serde",
"serde_json",
"serial",
"serialport",
"smol",
"socketioxide",
"textplots",
"thread-priority",
"tikv-jemalloc-ctl",
"tikv-jemallocator",
"tokio",
"tonic",
"tower-http",
@@ -2856,9 +2814,9 @@ dependencies = [
[[package]]
name = "socketioxide"
version = "0.17.1"
version = "0.17.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85fe8a90fd0cdac0bcb7b3c40c1084f5658f8737c62dfb277f5620cf78f3849a"
checksum = "476190583b592f1e3d55584269600f2d3c4f18af36adad03c41c27e82dcb6bd5"
dependencies = [
"bytes",
"engineioxide",
@@ -2963,9 +2921,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.101"
version = "2.0.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf"
checksum = "7bc3fcb250e53458e712715cf74285c1f889686520d79294a9ef3bd7aa1fc619"
dependencies = [
"proc-macro2",
"quote",
@@ -2989,7 +2947,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -3034,7 +2992,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -3043,20 +3001,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820"
[[package]]
name = "thread-priority"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfe075d7053dae61ac5413a34ea7d4913b6e6207844fd726bdd858b37ff72bf5"
dependencies = [
"bitflags 2.9.0",
"cfg-if",
"libc",
"log",
"rustversion",
"winapi",
]
[[package]]
name = "thread_local"
version = "1.1.8"
@@ -3067,37 +3011,6 @@ dependencies = [
"once_cell",
]
[[package]]
name = "tikv-jemalloc-ctl"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f21f216790c8df74ce3ab25b534e0718da5a1916719771d3fec23315c99e468b"
dependencies = [
"libc",
"paste",
"tikv-jemalloc-sys",
]
[[package]]
name = "tikv-jemalloc-sys"
version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "tikv-jemallocator"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865"
dependencies = [
"libc",
"tikv-jemalloc-sys",
]
[[package]]
name = "timerfd"
version = "1.6.0"
@@ -3129,9 +3042,9 @@ dependencies = [
[[package]]
name = "tokio"
version = "1.45.0"
version = "1.45.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165"
checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779"
dependencies = [
"backtrace",
"bytes",
@@ -3151,7 +3064,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -3313,7 +3226,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -3378,15 +3291,15 @@ dependencies = [
[[package]]
name = "tracing-subscriber"
version = "0.3.19"
version = "0.3.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
dependencies = [
"chrono",
"matchers",
"nu-ansi-term",
"once_cell",
"regex",
"regex-automata",
"sharded-slab",
"smallvec",
"thread_local",
@@ -3570,7 +3483,7 @@ dependencies = [
"log",
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
"wasm-bindgen-shared",
]
@@ -3605,7 +3518,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -3691,7 +3604,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -3702,14 +3615,14 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
name = "windows-link"
version = "0.1.1"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
[[package]]
name = "windows-registry"
@@ -3991,7 +3904,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
"synstructure",
]
@@ -4012,7 +3925,7 @@ checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
[[package]]
@@ -4032,7 +3945,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
"synstructure",
]
@@ -4066,5 +3979,5 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.101",
"syn 2.0.105",
]
+17
View File
@@ -5,6 +5,23 @@ members = [
"ethercat-hal-derive",
"control-core",
"ethercat-eeprom-dump",
"control-core-derive",
]
exclude = []
resolver = "2"
[workspace.lints.clippy]
# Individual lints (priority 0)
# don't lint poissbilities for let chains because they were introduces after Rust 1.86
collapsible_if = "allow"
# Lint groups (priority -1)
correctness = { level = "warn", priority = -1 }
suspicious = { level = "warn", priority = -1 }
complexity = { level = "warn", priority = -1 }
perf = { level = "warn", priority = -1 }
style = { level = "warn", priority = -1 }
pendantic = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
+17 -9
View File
@@ -4,6 +4,12 @@
QiTech Control is an industrial control panel software for the next generation of QiTech recycling machines built on top of Beckhoff Automation hardware.
[![](https://img.youtube.com/vi/KI3YeBwfV-s/maxresdefault.jpg)](https://www.youtube.com/watch?v=KI3YeBwfV-s)
*Click here to watch a video demo of our software.*
[![](https://img.youtube.com/vi/55egCAkQgyM/maxresdefault.jpg)](https://youtu.be/55egCAkQgyM)
*Click here to watch a full explainer Video of our Software.*
# Repo Structure
Frontend
@@ -29,7 +35,7 @@ Other
## Backend
To interface with Beckhoff and other EtherCAT devices we need an EtherCAY master stoftware. Possibilities are [PySOEM](https://github.com/bnjmnp/pysoem) (Python), [SOEM](https://github.com/OpenEtherCATsociety/SOEM) (C) and [Ethercrab](https://github.com/ethercrab-rs/ethercrab) (Rust). For realtime operation only C and Rust are suitable. We chose Rust because of safety and confidence in the written code.
To interface with Beckhoff and other EtherCAT devices we need an EtherCAT master stoftware. Possibilities are [PySOEM](https://github.com/bnjmnp/pysoem) (Python), [SOEM](https://github.com/OpenEtherCATsociety/SOEM) (C) and [Ethercrab](https://github.com/ethercrab-rs/ethercrab) (Rust). For realtime operation only C and Rust are suitable. We chose Rust because of safety and confidence in the written code.
[SocketIO](https://socket.io/) was chosen for performant event driven communication from the backend to the server. But we still use REST with [axum](https://docs.rs/axum/latest/axum/) for the communication thet benefits from the request/response model.
@@ -41,6 +47,8 @@ We could combine the code of the frontend and backend using [Doxius](https://dio
# Dev Setup
[Developer Documentation](./docs/developer-docs/)
## Backend
- Rust stable 1.86^ toolchain (install via [rustup](https://rustup.rs/))
@@ -59,13 +67,12 @@ We could combine the code of the frontend and backend using [Doxius](https://dio
| Machine Type | Version | Release Date | Description | Change to Previous Version | Vendor ID | Machine ID | Implemented | Docs |
| ------------ | ------- | ------------ | --------------------------- | ------------------------------------------------------ | -------------------------- | ---------- | ----------- | ------------------------------- |
| Winder | V1 | ??? | Winding Filaments & Similar | - | 1 (Qitech Industries GmbH) | 1 | Reserved | - |
| Winder | V2 | 2025 | Winding Filaments & Similar | Reengineered Traverse | 1 (Qitech Industries GmbH) | 2 | In Progress | [](./docs/machines/winder-1.md) |
| Winder | V2 | 2025 | Winding Filaments & Similar | Reengineered Traverse | 1 (Qitech Industries GmbH) | 2 | Yes | [](./docs/machines/winder-1.md) |
| Extruder | V1 | ??? | Single Screw Extruder | - | 1 (Qitech Industries GmbH) | 3 | Reserved | - |
| Extruder | V2 | 2025 | Single Screw Extruder | PT100 Thermometers, Optional Additional Heating Zone 4 | 1 (Qitech Industries GmbH) | 4 | Not Yet | |
| Waterway | V1 | 2025 | Filament Water Cooling | - | 1 (Qitech Industries GmbH) | 5 | Not Yet | |
| Laser | V1 | ??? | Diameter Measuring Laser | - | 1 (Qitech Industries GmbH) | 6 | Not Yet | |
| Mock | - | ??? | Mock Machine for Testing | - | 1 (Qitech Industries GmbH) | 7 | Not Yet | - |
| Extruder | V2 | 2025 | Single Screw Extruder | PT100 Thermometers, Optional Additional Heating Zone 4 | 1 (Qitech Industries GmbH) | 4 | Yes | |
| Waterway | V1 | 2025 | Filament Water Cooling | - | 1 (Qitech Industries GmbH) | 5 | In Progress | |
| Laser | V1 | ??? | Diameter Measuring Laser | - | 1 (Qitech Industries GmbH) | 6 | Yes | |
| Mock | - | ??? | Mock Machine for Testing | - | 1 (Qitech Industries GmbH) | 7 | Yes | - |
# More Docs
@@ -90,8 +97,9 @@ We could combine the code of the frontend and backend using [Doxius](https://dio
- Write Device Identification
- Server
- [X] [Threading](./docs/control-loop.md)
- [X] [Logging](./docs/logging.md)
- [x] [Threading](./docs/control-loop.md)
- [x] [Logging](./docs/logging.md)
- [ ] Control Loop Setup
- Control Loop Thread
- [ ] realtime
+25 -5
View File
@@ -1,13 +1,33 @@
#!/bin/bash
if [ $1 == "release" ]; then
set -e
FEATURE=""
# Check if "mock-machine" was passed as an argument
if [[ "$1" == "mock-machine" ]]; then
echo "Building Debug Code with mock-machine feature"
FEATURE="--features mock-machine"
fi
if [[ "$1" == "release" ]]; then
echo "building Release Code"
cargo build --release
else
echo "building Debug Code"
cargo build
echo "Building Debug Code"
cargo build $FEATURE --features development-build
fi
# set cap for server executable
sudo setcap cap_net_raw=eip ./target/debug/server
# Only setcap if not building with mock-machine
if [ "$1" != "mock-machine" ]; then
echo "Setting capabilities for server executable"
sudo setcap 'cap_dac_override,cap_net_raw,cap_sys_nice,cap_ipc_lock=eip' ./target/debug/server
if compgen -G "/dev/ttyUSB*" > /dev/null; then
echo "Setting permissions for serial ports"
sudo chown "root:$(groups | cut -f1 -d' ')" /dev/ttyUSB*
fi
fi
# run
./target/debug/server
+43
View File
@@ -0,0 +1,43 @@
#!/bin/bash
# Nix store uses sqlite ... SO HAHAHAHAHH NO CONCURRENT ACCESS AHAHAHHAHAHAHHAHAHAHAH
time nix build .#packages.x86_64-linux.server --impure --extra-experimental-features nix-command --extra-experimental-features flakes --out-link /tmp/server-result
serverstore=$(readlink -f /tmp/server-result)
time nix build .#packages.x86_64-linux.electron --impure --option sandbox false --extra-experimental-features nix-command --extra-experimental-features flakes --out-link /tmp/electron-result
electronstore=$(readlink -f /tmp/electron-result)
nix copy --to "file:///opt/dev-cache" \
$(readlink -f /tmp/server-result) \
$(readlink -f /tmp/electron-result) --extra-experimental-features nix-command
nix store sign \
--key-file /opt/dev-cache/cache-private-key.pem \
--store "file:///opt/dev-cache" \
--extra-experimental-features nix-command \
"$serverstore" "$electronstore"
nix path-info "$serverstore" --extra-experimental-features nix-command --extra-experimental-features flakes
# nix verify --store "file:///opt/dev-cache" \
# --trusted-public-keys "$(cat /opt/dev-cache/cache-public-key.pem)" --extra-experimental-features nix-command --extra-experimental-features flakes \
# "$FIRST_PATH" || echo "Verification failed!"
#time nix build .#packages.x86_64-linux.electron --extra-experimental-features nix-command --extra-experimental-features flakes --out-link /tmp/electron-result
#electronstore=$(readlink -f /tmp/electron-result)
#nix-store --generate-binary-cache-key cache.key cache.pem --extra-experimental-features nix-command
#nix store sign --key-file cache.key "$serverstore" --extra-experimental-features nix-command
#nix path-info --json "$serverstore" --extra-experimental-features nix-command --extra-experimental-features flakes
#export
#nix-store --export /nix/store/<hash>-server > nix-cache/server.nar
#nix-store --export /nix/store/<hash>-electron > nix-cache/electron.nar
# Any http server
# cd ~/nix-cache
# python3 -m http.server 8080
#
+15
View File
@@ -0,0 +1,15 @@
[package]
name = "control_core_derive"
version = "0.1.0"
edition = "2024"
[lints]
workspace = true
[lib]
proc-macro = true
[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "2.0", features = ["full"] }
File diff suppressed because it is too large. Load diff
+65
View File
@@ -0,0 +1,65 @@
use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use quote::quote;
use syn::{DeriveInput, Error};
#[proc_macro_derive(BuildEvent)]
pub fn build_event_derive(item: TokenStream) -> TokenStream {
build_event_derive2(item.into()).unwrap().into()
}
fn build_event_derive2(item: TokenStream2) -> Result<TokenStream2, Error> {
// Parse the input tokens into a syntax tree
let ast: DeriveInput = syn::parse2(item)?;
let ident = &ast.ident;
let (impl_generics, ty_generics, where_clause) = ast.generics.split_for_impl();
// Generate the BuildEvent impl
let expanded = quote! {
impl #impl_generics control_core::socketio::event::BuildEvent for #ident #ty_generics #where_clause {
#[doc = "Implemented by the BuildEvent derive macro"]
fn build(&self) -> control_core::socketio::event::Event<Self> {
control_core::socketio::event::Event::new(stringify!(#ident), self.clone())
}
}
};
Ok(expanded)
}
#[proc_macro_derive(Machine)]
pub fn machine_derive(item: TokenStream) -> TokenStream {
machine_derive2(item.into()).unwrap().into()
}
fn machine_derive2(item: TokenStream2) -> Result<TokenStream2, Error> {
// Parse the input tokens into a syntax tree
let ast: DeriveInput = syn::parse2(item)?;
let ident = &ast.ident;
let (impl_generics, ty_generics, where_clause) = ast.generics.split_for_impl();
let expanded = quote! {
impl #impl_generics control_core::machines::Machine for #ident #ty_generics #where_clause {
fn get_machine_identification_unique(&self) -> control_core::machines::identification::MachineIdentificationUnique {
self.machine_identification_unique.clone()
}
}
impl #impl_generics control_core::machines::AnyGetters for #ident #ty_generics #where_clause {
fn as_any(&self) -> &dyn std::any::Any {
self
}
fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
self
}
}
};
Ok(expanded)
}
+25 -8
View File
@@ -3,28 +3,45 @@ name = "control_core"
version = "0.1.0"
edition = "2024"
[lints]
workspace = true
[dependencies]
anyhow = "1.0.98"
axum = "0.8.4"
anyhow = "1.0.100"
axum = "0.8.6"
ethercat_hal = { path = "../ethercat-hal" }
ethercrab = "0.6"
interfaces = "0.0.9"
serde = "1.0.219"
serde_json = "1.0.140"
serialport = "4.7.1"
serde_json = "1.0.143"
serialport = "4.7.3"
smol = "2.0.2"
socketioxide = "0.17.1"
uom = "0.36.0"
socketioxide = "0.17.2"
uom = { version = "0.36.0", default-features = false, features = ["f64"] }
bitvec = { version = "1.0.1", features = ["alloc"] }
crc = "3.3.0"
serial = "0.4.0"
tracing = "0.1.41"
erased-serde = "0.4.6"
erased-serde = "0.4.8"
core_affinity = "0.8.3"
control_core_derive = { version = "0.1.0", path = "../control-core-derive" }
tokio = { version = "1.45.1", features = ["sync"], optional = true }
[target.'cfg(unix)'.dependencies]
libc = "0.2.172"
libc = "0.2.176"
[dev-dependencies]
approx = "0.5.1"
textplots = "0.8"
tokio = { version = "1.45.1", features = ["rt-multi-thread", "macros", "time"] }
[features]
default = []
video-streaming = ["dep:tokio"]
[package.metadata.cargo-machete]
ignored = ["axum","bitvec","control_core_derive"]
@@ -33,7 +33,7 @@ pub struct ClampingTimeagnosticPidController {
}
impl ClampingTimeagnosticPidController {
pub fn new(
pub const fn new(
kp: f64,
ki: f64,
kd: f64,
@@ -65,7 +65,7 @@ impl ClampingTimeagnosticPidController {
}
}
pub fn simple_new(kp: f64, ki: f64, kd: f64) -> Self {
pub const fn simple_new(kp: f64, ki: f64, kd: f64) -> Self {
Self {
kp,
ki,
@@ -85,26 +85,26 @@ impl ClampingTimeagnosticPidController {
}
}
pub fn get_kp(&self) -> f64 {
pub const fn get_kp(&self) -> f64 {
self.kp
}
pub fn get_ki(&self) -> f64 {
pub const fn get_ki(&self) -> f64 {
self.ki
}
pub fn get_kd(&self) -> f64 {
pub const fn get_kd(&self) -> f64 {
self.kd
}
pub fn configure(&mut self, ki: f64, kp: f64, kd: f64) {
pub const fn configure(&mut self, ki: f64, kp: f64, kd: f64) {
self.reset();
self.kp = kp;
self.ki = ki;
self.kd = kd;
}
pub fn optional_clamp(value: f64, min: Option<f64>, max: Option<f64>) -> f64 {
pub const fn optional_clamp(value: f64, min: Option<f64>, max: Option<f64>) -> f64 {
match (min, max) {
(Some(min), Some(max)) => value.clamp(min, max),
(Some(min), None) => value.max(min),
@@ -114,7 +114,7 @@ impl ClampingTimeagnosticPidController {
}
pub fn update(&mut self, error: f64, t: Instant) -> f64 {
let signal = match self.last {
match self.last {
// First update
None => {
// Calculate error
@@ -122,15 +122,10 @@ impl ClampingTimeagnosticPidController {
// Calculate signal
let signal = self.kp * ep;
let clamped_signal = ClampingTimeagnosticPidController::optional_clamp(
signal,
self.min_signal,
self.max_signal,
);
let clamped_signal = Self::optional_clamp(signal, self.min_signal, self.max_signal);
// Set values
self.ep =
ClampingTimeagnosticPidController::optional_clamp(ep, self.min_ep, self.max_ep);
self.ep = Self::optional_clamp(ep, self.min_ep, self.max_ep);
self.ei = 0.0;
self.ed = 0.0;
self.last = Some(t);
@@ -143,23 +138,11 @@ impl ClampingTimeagnosticPidController {
let dt = t.duration_since(last).as_secs_f64();
// Calculate errors
let ep = ClampingTimeagnosticPidController::optional_clamp(
error,
self.min_ep,
self.max_ep,
);
let ep = Self::optional_clamp(error, self.min_ep, self.max_ep);
let ei = ClampingTimeagnosticPidController::optional_clamp(
self.ei + ep * dt,
self.min_ei,
self.max_ei,
);
let ei = Self::optional_clamp(ep.mul_add(dt, self.ei), self.min_ei, self.max_ei);
let ed = ClampingTimeagnosticPidController::optional_clamp(
(ep - self.ep) / dt,
self.min_ed,
self.max_ed,
);
let ed = Self::optional_clamp((ep - self.ep) / dt, self.min_ed, self.max_ed);
// Make factors timeagnostic
let kp = self.kp * dt;
@@ -167,12 +150,8 @@ impl ClampingTimeagnosticPidController {
let kd = self.kd * dt;
// Calculate signal
let signal = kp * ep + ki * ei + kd * ed;
let clamped_signal = ClampingTimeagnosticPidController::optional_clamp(
signal,
self.min_signal,
self.max_signal,
);
let signal = kd.mul_add(ed, kp.mul_add(ep, ki * ei));
let clamped_signal = Self::optional_clamp(signal, self.min_signal, self.max_signal);
// Set values
self.ep = ep;
@@ -182,12 +161,10 @@ impl ClampingTimeagnosticPidController {
clamped_signal
}
};
signal
}
}
pub fn reset(&mut self) {
pub const fn reset(&mut self) {
self.ep = 0.0;
self.ei = 0.0;
self.ed = 0.0;
@@ -22,7 +22,7 @@ pub struct AccelerationSpeedController {
}
impl AccelerationSpeedController {
pub fn new(
pub const fn new(
min_speed: Option<f64>,
max_speed: Option<f64>,
min_acceleration: f64,
@@ -44,10 +44,10 @@ impl AccelerationSpeedController {
/// No speed limits are applied.
pub fn new_simple(max_acceleration: f64, initial_speed: f64) -> Self {
Self::new(
None, // min_speed
None, // max_speed
-max_acceleration, // min_acceleration (deceleration)
max_acceleration, // max_acceleration
None, // min_speed
None, // max_speed
-max_acceleration, // min_acceleration (deceleration)
max_acceleration, // max_acceleration
initial_speed,
)
}
@@ -98,16 +98,16 @@ impl AccelerationSpeedController {
new_speed
}
pub fn reset(&mut self, initial_speed: f64) {
pub const fn reset(&mut self, initial_speed: f64) {
self.last_speed = initial_speed;
self.last_t = None; // Reset the last update time
}
pub fn set_max_acceleration(&mut self, acceleration: f64) {
pub const fn set_max_acceleration(&mut self, acceleration: f64) {
self.max_acceleration = acceleration;
}
fn apply_speed_limits(&self, speed: f64) -> f64 {
const fn apply_speed_limits(&self, speed: f64) -> f64 {
let mut limited_speed = speed;
if let Some(min) = self.min_speed {
@@ -121,23 +121,23 @@ impl AccelerationSpeedController {
limited_speed
}
pub fn get_min_speed(&self) -> Option<f64> {
pub const fn get_min_speed(&self) -> Option<f64> {
self.min_speed
}
pub fn get_max_speed(&self) -> Option<f64> {
pub const fn get_max_speed(&self) -> Option<f64> {
self.max_speed
}
pub fn set_min_speed(&mut self, min_speed: Option<f64>) {
pub const fn set_min_speed(&mut self, min_speed: Option<f64>) {
self.min_speed = min_speed;
}
pub fn set_max_speed(&mut self, max_speed: Option<f64>) {
pub const fn set_max_speed(&mut self, max_speed: Option<f64>) {
self.max_speed = max_speed;
}
pub fn set_min_acceleration(&mut self, deceleration: f64) {
pub const fn set_min_acceleration(&mut self, deceleration: f64) {
self.min_acceleration = deceleration;
}
}
@@ -37,12 +37,15 @@ impl AngularAccelerationSpeedController {
/// Creates a new angular acceleration speed controller with simplified parameters.
/// Sets min_acceleration to -max_acceleration for symmetric behavior.
/// No speed limits are applied.
pub fn new_simple(max_acceleration: AngularAcceleration, initial_speed: AngularVelocity) -> Self {
pub fn new_simple(
max_acceleration: AngularAcceleration,
initial_speed: AngularVelocity,
) -> Self {
Self::new(
None, // min_speed
None, // max_speed
-max_acceleration, // min_acceleration (deceleration)
max_acceleration, // max_acceleration
None, // min_speed
None, // max_speed
-max_acceleration, // min_acceleration (deceleration)
max_acceleration, // max_acceleration
initial_speed,
)
}
@@ -50,7 +53,7 @@ impl AngularAccelerationSpeedController {
pub fn update(&mut self, target_speed: AngularVelocity, t: Instant) -> AngularVelocity {
let target_speed = target_speed.get::<radian_per_second>();
let new_speed = self.controller.update(target_speed, t);
return AngularVelocity::new::<radian_per_second>(new_speed);
AngularVelocity::new::<radian_per_second>(new_speed)
}
pub fn reset(&mut self, initial_speed: AngularVelocity) {
@@ -70,13 +73,13 @@ impl AngularAccelerationSpeedController {
pub fn get_min_speed(&self) -> Option<AngularVelocity> {
self.controller
.get_min_speed()
.map(|s| AngularVelocity::new::<radian_per_second>(s))
.map(AngularVelocity::new::<radian_per_second>)
}
pub fn get_max_speed(&self) -> Option<AngularVelocity> {
self.controller
.get_max_speed()
.map(|s| AngularVelocity::new::<radian_per_second>(s))
.map(AngularVelocity::new::<radian_per_second>)
}
pub fn set_min_speed(&mut self, min_speed: Option<AngularVelocity>) {
@@ -38,17 +38,17 @@ impl LinearAccelerationLimitingController {
/// No speed limits are applied.
pub fn new_simple(acceleration: Acceleration, initial_speed: Velocity) -> Self {
Self::new(
None, // min_speed
None, // max_speed
acceleration, // acceleration
-acceleration, // deceleration (negative for deceleration)
None, // min_speed
None, // max_speed
acceleration, // acceleration
-acceleration, // deceleration (negative for deceleration)
initial_speed,
)
}
pub fn update(&mut self, target_speed: Velocity, t: Instant) -> Velocity {
let target_speed = target_speed.get::<meter_per_second>();
let new_speed = self.controller.update(target_speed, t);
return Velocity::new::<meter_per_second>(new_speed);
Velocity::new::<meter_per_second>(new_speed)
}
pub fn reset(&mut self, initial_speed: Velocity) {
let initial_speed = initial_speed.get::<meter_per_second>();
@@ -65,12 +65,12 @@ impl LinearAccelerationLimitingController {
pub fn get_min_speed(&self) -> Option<Velocity> {
self.controller
.get_min_speed()
.map(|s| Velocity::new::<meter_per_second>(s))
.map(Velocity::new::<meter_per_second>)
}
pub fn get_max_speed(&self) -> Option<Velocity> {
self.controller
.get_max_speed()
.map(|s| Velocity::new::<meter_per_second>(s))
.map(Velocity::new::<meter_per_second>)
}
pub fn set_min_speed(&mut self, min_speed: Option<Velocity>) {
self.controller
+10 -12
View File
@@ -21,7 +21,7 @@ pub struct PidController {
}
impl PidController {
pub fn new(kp: f64, ki: f64, kd: f64) -> Self {
pub const fn new(kp: f64, ki: f64, kd: f64) -> Self {
Self {
kp,
ki,
@@ -33,27 +33,27 @@ impl PidController {
}
}
pub fn configure(&mut self, ki: f64, kp: f64, kd: f64) {
pub const fn configure(&mut self, ki: f64, kp: f64, kd: f64) {
self.reset();
self.kp = kp;
self.ki = ki;
self.kd = kd;
}
pub fn get_kp(&self) -> f64 {
pub const fn get_kp(&self) -> f64 {
self.kp
}
pub fn get_ki(&self) -> f64 {
pub const fn get_ki(&self) -> f64 {
self.ki
}
pub fn get_kd(&self) -> f64 {
pub const fn get_kd(&self) -> f64 {
self.kd
}
pub fn update(&mut self, error: f64, t: Instant) -> f64 {
let signal = match self.last {
match self.last {
// First update
None => {
// Calculate error
@@ -78,11 +78,11 @@ impl PidController {
// Calculate errors
let ep = error;
let ei = self.ei + ep * dt;
let ei = ep.mul_add(dt, self.ei);
let ed = (ep - self.ep) / dt;
// Calculate signal
let signal = self.kp * ep + self.ki * ei + self.kd * ed;
let signal = self.kd.mul_add(ed, self.kp.mul_add(ep, self.ki * ei));
// Set values
self.ep = ep;
@@ -92,12 +92,10 @@ impl PidController {
signal
}
};
signal
}
}
pub fn reset(&mut self) {
pub const fn reset(&mut self) {
self.ep = 0.0;
self.ei = 0.0;
self.ed = 0.0;
@@ -3,7 +3,7 @@ use std::fmt;
// Remove the anyhow::Ok import as it conflicts with std::result::Ok
/// Errors that can occur when creating or using the motion controller
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum MotionControllerError {
InvalidSpeedLimits,
InvalidAccelerationLimits,
@@ -14,25 +14,25 @@ pub enum MotionControllerError {
impl fmt::Display for MotionControllerError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
MotionControllerError::InvalidSpeedLimits => {
Self::InvalidSpeedLimits => {
write!(
f,
"Invalid speed limits: min_speed must be ≤ 0 and max_speed must be ≥ 0"
)
}
MotionControllerError::InvalidAccelerationLimits => {
Self::InvalidAccelerationLimits => {
write!(
f,
"Invalid acceleration limits: min_acceleration must be < 0 and max_acceleration must be > 0"
)
}
MotionControllerError::InvalidPositionLimits => {
Self::InvalidPositionLimits => {
write!(
f,
"Invalid position limits: min_position must be ≤ max_position"
)
}
MotionControllerError::ZeroDeceleration => {
Self::ZeroDeceleration => {
write!(
f,
"Zero deceleration rate: cannot plan motion without deceleration capability"
@@ -148,7 +148,7 @@ struct MotionConstants {
}
/// Represents the current phase of motion
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum MotionPhase {
Idle,
IncreasingSpeed,
@@ -170,7 +170,7 @@ pub struct ControllerBuilder {
impl ControllerBuilder {
/// Create a new builder
pub fn new() -> Self {
pub const fn new() -> Self {
Self {
min_speed: None,
max_speed: None,
@@ -184,28 +184,36 @@ impl ControllerBuilder {
}
/// Set speed limits (min_speed ≤ 0, max_speed ≥ 0)
pub fn speed_limits(mut self, min_speed: f64, max_speed: f64) -> Self {
pub const fn speed_limits(mut self, min_speed: f64, max_speed: f64) -> Self {
self.min_speed = Some(min_speed);
self.max_speed = Some(max_speed);
self
}
/// Set acceleration limits (min_acceleration < 0, max_acceleration > 0)
pub fn acceleration_limits(mut self, min_acceleration: f64, max_acceleration: f64) -> Self {
pub const fn acceleration_limits(
mut self,
min_acceleration: f64,
max_acceleration: f64,
) -> Self {
self.min_acceleration = Some(min_acceleration);
self.max_acceleration = Some(max_acceleration);
self
}
/// Set position limits (optional)
pub fn position_limits(mut self, min_position: Option<f64>, max_position: Option<f64>) -> Self {
pub const fn position_limits(
mut self,
min_position: Option<f64>,
max_position: Option<f64>,
) -> Self {
self.min_position = min_position;
self.max_position = max_position;
self
}
/// Set tolerances for position and speed comparisons
pub fn tolerances(mut self, position_tolerance: f64, speed_tolerance: f64) -> Self {
pub const fn tolerances(mut self, position_tolerance: f64, speed_tolerance: f64) -> Self {
self.position_tolerance = position_tolerance;
self.speed_tolerance = speed_tolerance;
self
@@ -322,7 +330,7 @@ impl AccelerationPositionController {
let motion_constants = Self::calculate_motion_constants(&config);
Ok(AccelerationPositionController {
Ok(Self {
config,
current_position: 0.0,
current_speed: 0.0,
@@ -366,19 +374,19 @@ impl AccelerationPositionController {
}
Self::new(
-speed, // min_speed
speed, // max_speed
-acceleration, // min_acceleration
acceleration, // max_acceleration
position.map(|p| -p), // min_position
position.map(|p| p), // max_position
1e-6, // position_tolerance (default)
1e-6, // speed_tolerance (default)
-speed, // min_speed
speed, // max_speed
-acceleration, // min_acceleration
acceleration, // max_acceleration
position.map(|p| -p.abs()), // min_position
position.map(|p| p.abs()), // max_position
1e-6, // position_tolerance (default)
1e-6, // speed_tolerance (default)
)
}
/// Create a new builder for the controller
pub fn builder() -> ControllerBuilder {
pub const fn builder() -> ControllerBuilder {
ControllerBuilder::new()
}
@@ -564,8 +572,10 @@ impl AccelerationPositionController {
// Calculate distance needed to reach cruise speed from current speed
let speed_change_distance = if current_speed_in_direction < cruise_speed.abs() {
(cruise_speed.abs().powi(2) - current_speed_in_direction.max(0.0).powi(2))
/ (2.0 * acceleration_rate)
current_speed_in_direction.max(0.0).mul_add(
-current_speed_in_direction.max(0.0),
cruise_speed.abs().powi(2),
) / (2.0 * acceleration_rate)
} else {
0.0
};
@@ -579,8 +589,10 @@ impl AccelerationPositionController {
// Using corrected kinematic equation: v_peak² = v_current² + 2*a*d_total*a_accel*a_decel/(a_accel + a_decel)
let accel_decel_factor =
(acceleration_rate * deceleration_rate) / (acceleration_rate + deceleration_rate);
let discriminant = current_speed_in_direction.max(0.0).powi(2)
+ 2.0 * abs_position_change * accel_decel_factor;
let discriminant = current_speed_in_direction.max(0.0).mul_add(
current_speed_in_direction.max(0.0),
2.0 * abs_position_change * accel_decel_factor,
);
if discriminant >= 0.0 {
self.peak_speed = discriminant.sqrt() * cruise_speed.signum();
@@ -634,7 +646,7 @@ impl AccelerationPositionController {
self.current_acceleration = self.config.max_acceleration * self.direction as f64;
// Update speed
let new_speed = self.current_speed + self.current_acceleration * dt;
let new_speed = self.current_acceleration.mul_add(dt, self.current_speed);
// Check if we've reached peak speed
if (self.direction > 0 && new_speed >= self.peak_speed)
@@ -665,7 +677,7 @@ impl AccelerationPositionController {
self.current_acceleration = self.config.min_acceleration * self.direction as f64;
// Update speed
let new_speed = self.current_speed + self.current_acceleration * dt;
let new_speed = self.current_acceleration.mul_add(dt, self.current_speed);
// Check if we've reached zero speed or target
if (self.current_speed > 0.0 && new_speed <= 0.0)
@@ -689,7 +701,7 @@ impl AccelerationPositionController {
}
// Update position based on current speed
let new_position = self.current_position + self.current_speed * dt;
let new_position = self.current_speed.mul_add(dt, self.current_position);
// Check position limits and handle violations
let mut position_limited = false;
@@ -742,7 +754,7 @@ impl AccelerationPositionController {
///
/// Returns the current position of the controlled object.
/// This value is updated with each call to `update()`.
pub fn get_position(&self) -> f64 {
pub const fn get_position(&self) -> f64 {
self.current_position
}
@@ -751,7 +763,7 @@ impl AccelerationPositionController {
/// Returns the current speed (velocity) of the controlled object.
/// Positive values indicate motion towards increasing position,
/// negative values indicate motion towards decreasing position.
pub fn get_speed(&self) -> f64 {
pub const fn get_speed(&self) -> f64 {
self.current_speed
}
@@ -759,32 +771,32 @@ impl AccelerationPositionController {
///
/// Returns the current acceleration of the controlled object.
/// Positive values indicate increasing speed, negative values indicate decreasing speed.
pub fn get_acceleration(&self) -> f64 {
pub const fn get_acceleration(&self) -> f64 {
self.current_acceleration
}
/// Get the target position
pub fn get_target_position(&self) -> f64 {
pub const fn get_target_position(&self) -> f64 {
self.target_position
}
/// Get the current motion phase
pub fn get_motion_phase(&self) -> MotionPhase {
pub const fn get_motion_phase(&self) -> MotionPhase {
self.motion_phase
}
/// Get the direction of motion
pub fn get_direction(&self) -> i8 {
pub const fn get_direction(&self) -> i8 {
self.direction
}
/// Get the calculated peak speed for current motion
pub fn get_peak_speed(&self) -> f64 {
pub const fn get_peak_speed(&self) -> f64 {
self.peak_speed
}
/// Get the position at which deceleration will begin
pub fn get_deceleration_position(&self) -> f64 {
pub const fn get_deceleration_position(&self) -> f64 {
self.deceleration_position
}
@@ -837,7 +849,7 @@ impl AccelerationPositionController {
}
/// Force the controller to stop at current position
pub fn emergency_stop(&mut self) {
pub const fn emergency_stop(&mut self) {
self.target_position = self.current_position;
self.current_speed = 0.0;
self.current_acceleration = 0.0;
@@ -1006,32 +1018,32 @@ impl AccelerationPositionController {
}
/// Get the minimum speed limit
pub fn get_min_speed(&self) -> f64 {
pub const fn get_min_speed(&self) -> f64 {
self.config.min_speed
}
/// Get the maximum speed limit
pub fn get_max_speed(&self) -> f64 {
pub const fn get_max_speed(&self) -> f64 {
self.config.max_speed
}
/// Get the minimum acceleration limit
pub fn get_min_acceleration(&self) -> f64 {
pub const fn get_min_acceleration(&self) -> f64 {
self.config.min_acceleration
}
/// Get the maximum acceleration limit
pub fn get_max_acceleration(&self) -> f64 {
pub const fn get_max_acceleration(&self) -> f64 {
self.config.max_acceleration
}
/// Get the minimum position limit
pub fn get_min_position(&self) -> Option<f64> {
pub const fn get_min_position(&self) -> Option<f64> {
self.config.min_position
}
/// Get the maximum position limit
pub fn get_max_position(&self) -> Option<f64> {
pub const fn get_max_position(&self) -> Option<f64> {
self.config.max_position
}
@@ -1068,17 +1080,17 @@ impl AccelerationPositionController {
}
/// Get the position tolerance
pub fn get_position_tolerance(&self) -> f64 {
pub const fn get_position_tolerance(&self) -> f64 {
self.config.position_tolerance
}
/// Get the speed tolerance
pub fn get_speed_tolerance(&self) -> f64 {
pub const fn get_speed_tolerance(&self) -> f64 {
self.config.speed_tolerance
}
/// Set tolerances for position and speed comparisons
pub fn set_tolerances(&mut self, position_tolerance: f64, speed_tolerance: f64) {
pub const fn set_tolerances(&mut self, position_tolerance: f64, speed_tolerance: f64) {
self.config.position_tolerance = position_tolerance;
self.config.speed_tolerance = speed_tolerance;
}
@@ -102,16 +102,12 @@ impl AngularAccelerationPositionController {
/// Get the minimum angle position limit
pub fn get_min_position(&self) -> Option<Angle> {
self.controller
.get_min_position()
.map(|angle| Angle::new::<radian>(angle))
self.controller.get_min_position().map(Angle::new::<radian>)
}
/// Get the maximum angle position limit
pub fn get_max_position(&self) -> Option<Angle> {
self.controller
.get_max_position()
.map(|angle| Angle::new::<radian>(angle))
self.controller.get_max_position().map(Angle::new::<radian>)
}
/// Set the minimum angle position limit
@@ -236,7 +236,7 @@ impl AngularJerkSpeedController {
pub fn get_min_speed(&self) -> Option<AngularVelocity> {
self.controller
.get_min_speed()
.map(|speed| AngularVelocity::new::<radian_per_second>(speed))
.map(AngularVelocity::new::<radian_per_second>)
}
/// Get the maximum angular velocity limit
@@ -248,7 +248,7 @@ impl AngularJerkSpeedController {
pub fn get_max_speed(&self) -> Option<AngularVelocity> {
self.controller
.get_max_speed()
.map(|speed| AngularVelocity::new::<radian_per_second>(speed))
.map(AngularVelocity::new::<radian_per_second>)
}
/// Set the minimum angular velocity limit
@@ -88,7 +88,7 @@ impl JerkSpeedController {
)
.expect("Failed to create AccelerationPositionController");
JerkSpeedController { base_controller }
Self { base_controller }
}
/// Create a new speed controller with simple symmetric limits
@@ -183,7 +183,7 @@ impl JerkSpeedController {
///
/// # Returns
/// Current speed as a floating-point value
pub fn get_speed(&self) -> f64 {
pub const fn get_speed(&self) -> f64 {
self.base_controller.get_position()
}
@@ -193,7 +193,7 @@ impl JerkSpeedController {
///
/// # Returns
/// Current acceleration as a floating-point value
pub fn get_acceleration(&self) -> f64 {
pub const fn get_acceleration(&self) -> f64 {
self.base_controller.get_speed()
}
@@ -203,7 +203,7 @@ impl JerkSpeedController {
///
/// # Returns
/// Current jerk as a floating-point value
pub fn get_jerk(&self) -> f64 {
pub const fn get_jerk(&self) -> f64 {
self.base_controller.get_acceleration()
}
@@ -213,7 +213,7 @@ impl JerkSpeedController {
///
/// # Returns
/// Target speed as a floating-point value
pub fn get_target_speed(&self) -> f64 {
pub const fn get_target_speed(&self) -> f64 {
self.base_controller.get_target_position()
}
@@ -223,7 +223,7 @@ impl JerkSpeedController {
///
/// # Returns
/// Minimum speed limit as an Option<f64>, None if no limit is set
pub fn get_min_speed(&self) -> Option<f64> {
pub const fn get_min_speed(&self) -> Option<f64> {
self.base_controller.get_min_position()
}
@@ -233,7 +233,7 @@ impl JerkSpeedController {
///
/// # Returns
/// Maximum speed limit as an Option<f64>, None if no limit is set
pub fn get_max_speed(&self) -> Option<f64> {
pub const fn get_max_speed(&self) -> Option<f64> {
self.base_controller.get_max_position()
}
@@ -205,9 +205,7 @@ impl LinearAccelerationPositionController {
/// # Returns
/// Minimum position limit as an Option<Length>, None if no limit is set
pub fn get_min_position(&self) -> Option<Length> {
self.controller
.get_min_position()
.map(|length| Length::new::<meter>(length))
self.controller.get_min_position().map(Length::new::<meter>)
}
/// Get the maximum position limit
@@ -217,9 +215,7 @@ impl LinearAccelerationPositionController {
/// # Returns
/// Maximum position limit as an Option<Length>, None if no limit is set
pub fn get_max_position(&self) -> Option<Length> {
self.controller
.get_max_position()
.map(|length| Length::new::<meter>(length))
self.controller.get_max_position().map(Length::new::<meter>)
}
/// Set the minimum position limit
@@ -195,14 +195,14 @@ impl LinearJerkSpeedController {
pub fn get_min_speed(&self) -> Option<Velocity> {
self.controller
.get_min_speed()
.map(|speed| Velocity::new::<meter_per_second>(speed))
.map(Velocity::new::<meter_per_second>)
}
/// Get the maximum velocity limit
pub fn get_max_speed(&self) -> Option<Velocity> {
self.controller
.get_max_speed()
.map(|speed| Velocity::new::<meter_per_second>(speed))
.map(Velocity::new::<meter_per_second>)
}
/// Set the minimum velocity limit
+40 -58
View File
@@ -1,8 +1,6 @@
use std::f32::consts::PI;
use uom::si::{angle::radian, f64::Angle};
use uom::si::angle::radian;
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct AngleConverter {
pub flip_x: bool, // true to flip X-axis (mirror horizontally)
pub flip_y: bool, // true to flip Y-axis (mirror vertically)
@@ -11,7 +9,7 @@ pub struct AngleConverter {
impl AngleConverter {
/// Create a custom coordinate system
pub fn new(flip_x: bool, flip_y: bool, is_cw: bool) -> Self {
pub const fn new(flip_x: bool, flip_y: bool, is_cw: bool) -> Self {
Self {
flip_x,
flip_y,
@@ -20,52 +18,52 @@ impl AngleConverter {
}
/// Standard mathematical coordinate system (CCW positive, 0° at positive X)
pub fn mathematical() -> Self {
pub const fn mathematical() -> Self {
Self::new(false, false, false)
}
/// Screen/graphics coordinate system (CW positive, 0° at positive X, Y-flipped)
pub fn screen() -> Self {
pub const fn screen() -> Self {
Self::new(false, true, false)
}
/// System where 0° points up, clockwise positive
pub fn y_up_cw() -> Self {
pub const fn y_up_cw() -> Self {
Self::new(false, false, true)
}
/// System where 0° points down, counter-clockwise positive
pub fn y_down_ccw() -> Self {
pub const fn y_down_ccw() -> Self {
Self::new(false, true, true)
}
/// System where 0° points left, clockwise positive
pub fn x_left_cw() -> Self {
pub const fn x_left_cw() -> Self {
Self::new(true, false, false)
}
/// System where 0° points right, counter-clockwise positive (same as mathematical)
pub fn x_right_ccw() -> Self {
pub const fn x_right_ccw() -> Self {
Self::mathematical()
}
/// System where 0° points up, counter-clockwise positive
pub fn y_up_ccw() -> Self {
pub const fn y_up_ccw() -> Self {
Self::new(false, false, false)
}
/// System where 0° points down, clockwise positive
pub fn y_down_cw() -> Self {
pub const fn y_down_cw() -> Self {
Self::new(false, true, false)
}
/// System where 0° points left, counter-clockwise positive
pub fn x_left_ccw() -> Self {
pub const fn x_left_ccw() -> Self {
Self::new(true, false, true)
}
/// Convert angle from mathematical system to this system (f32)
pub fn degrees_encode(&self, math_angle_degrees: f32) -> f32 {
pub fn degrees_encode(&self, math_angle_degrees: f64) -> f64 {
let normalized_input = self.normalize_angle(math_angle_degrees);
let mut result = normalized_input;
@@ -75,7 +73,7 @@ impl AngleConverter {
(false, false) => {} // No change
(true, false) => result = 180.0 - result, // X-flip: mirror across Y-axis
(false, true) => result = -result, // Y-flip: mirror across X-axis
(true, true) => result = 180.0 + result, // Both flips: 180° rotation
(true, true) => result += 180.0, // Both flips: 180° rotation
}
// Handle rotation direction
@@ -87,7 +85,7 @@ impl AngleConverter {
}
/// Convert angle from this system to mathematical system (f32)
pub fn degrees_decode(&self, system_angle_degrees: f32) -> f32 {
pub fn degrees_decode(&self, system_angle_degrees: f64) -> f64 {
let normalized_input = self.normalize_angle(system_angle_degrees);
let mut result = normalized_input;
@@ -102,24 +100,24 @@ impl AngleConverter {
(false, false) => {} // No change
(true, false) => result = 180.0 - result, // X-flip: mirror across Y-axis
(false, true) => result = -result, // Y-flip: mirror across X-axis
(true, true) => result = result - 180.0, // Both flips: inverse 180° rotation
(true, true) => result -= 180.0, // Both flips: inverse 180° rotation
}
self.normalize_angle(result)
}
/// Convert angle in radians from mathematical system to this system (f32)
pub fn radians_encode(&self, math_angle_radians: f32) -> f32 {
let degrees = math_angle_radians * 180.0 / PI;
pub fn radians_encode(&self, math_angle_radians: f64) -> f64 {
let degrees = math_angle_radians.to_degrees();
let converted_degrees = self.degrees_encode(degrees);
converted_degrees * PI / 180.0
converted_degrees.to_radians()
}
/// Convert angle in radians from this system to mathematical system (f32)
pub fn radians_decode(&self, system_angle_radians: f32) -> f32 {
let degrees = system_angle_radians * 180.0 / PI;
pub fn radians_decode(&self, system_angle_radians: f64) -> f64 {
let degrees = system_angle_radians.to_degrees();
let converted_degrees = self.degrees_decode(degrees);
converted_degrees * PI / 180.0
converted_degrees.to_radians()
}
/// Convert angle from mathematical system to this system (f64)
@@ -133,7 +131,7 @@ impl AngleConverter {
(false, false) => {} // No change
(true, false) => result = 180.0 - result, // X-flip: mirror across Y-axis
(false, true) => result = -result, // Y-flip: mirror across X-axis
(true, true) => result = 180.0 + result, // Both flips: 180° rotation
(true, true) => result += 180.0, // Both flips: 180° rotation
}
// Handle rotation direction
@@ -160,7 +158,7 @@ impl AngleConverter {
(false, false) => {} // No change
(true, false) => result = 180.0 - result, // X-flip: mirror across Y-axis
(false, true) => result = -result, // Y-flip: mirror across X-axis
(true, true) => result = result - 180.0, // Both flips: inverse 180° rotation
(true, true) => result -= 180.0, // Both flips: inverse 180° rotation
}
self.normalize_angle_f64(result)
@@ -168,20 +166,20 @@ impl AngleConverter {
/// Convert angle in radians from mathematical system to this system (f64)
pub fn radians_encode_f64(&self, math_angle_radians: f64) -> f64 {
let degrees = math_angle_radians * 180.0 / std::f64::consts::PI;
let degrees = math_angle_radians.to_degrees();
let converted_degrees = self.degrees_encode_f64(degrees);
converted_degrees * std::f64::consts::PI / 180.0
converted_degrees.to_radians()
}
/// Convert angle in radians from this system to mathematical system (f64)
pub fn radians_decode_f64(&self, system_angle_radians: f64) -> f64 {
let degrees = system_angle_radians * 180.0 / std::f64::consts::PI;
let degrees = system_angle_radians.to_degrees();
let converted_degrees = self.degrees_decode_f64(degrees);
converted_degrees * std::f64::consts::PI / 180.0
converted_degrees.to_radians()
}
/// Normalize angle to [0, 360) range (f32)
fn normalize_angle(&self, angle: f32) -> f32 {
fn normalize_angle(&self, angle: f64) -> f64 {
let mut normalized = angle % 360.0;
if normalized < 0.0 {
normalized += 360.0;
@@ -205,39 +203,23 @@ pub struct AngleConverterUom {
}
impl AngleConverterUom {
pub fn new(angle_converter: AngleConverter) -> Self {
pub const fn new(angle_converter: AngleConverter) -> Self {
Self { angle_converter }
}
pub fn encode(&self, angle: uom::si::f32::Angle) -> uom::si::f32::Angle {
uom::si::f32::Angle::new::<radian>(
self.angle_converter.radians_encode(angle.get::<radian>()),
)
pub fn encode(&self, angle: Angle) -> Angle {
Angle::new::<radian>(self.angle_converter.radians_encode(angle.get::<radian>()))
}
pub fn decode(&self, angle: uom::si::f32::Angle) -> uom::si::f32::Angle {
uom::si::f32::Angle::new::<radian>(
self.angle_converter.radians_decode(angle.get::<radian>()),
)
}
pub fn encode_f64(&self, angle: uom::si::f64::Angle) -> uom::si::f64::Angle {
uom::si::f64::Angle::new::<radian>(
self.angle_converter
.radians_encode_f64(angle.get::<radian>()),
)
}
pub fn decode_f64(&self, angle: uom::si::f64::Angle) -> uom::si::f64::Angle {
uom::si::f64::Angle::new::<radian>(
self.angle_converter
.radians_decode_f64(angle.get::<radian>()),
)
pub fn decode(&self, angle: Angle) -> Angle {
Angle::new::<radian>(self.angle_converter.radians_decode(angle.get::<radian>()))
}
}
#[cfg(test)]
mod tests {
use std::f32::consts::PI;
use super::*;
#[test]
@@ -297,8 +279,8 @@ mod tests {
let converter = AngleConverter::screen();
// Test radians_encode
let result = converter.radians_encode(PI / 2.0); // 90° in radians
let expected = 270.0 * PI / 180.0; // 270° in radians
let result = converter.radians_encode(PI as f64 / 2.0) as f64; // 90° in radians
let expected: f64 = 270.0f64 * PI as f64 / 180.0f64; // 270° in radians
assert!((result - expected).abs() < 1e-6);
}
@@ -306,10 +288,10 @@ mod tests {
fn test_roundtrip_conversion() {
let converter = AngleConverter::new(true, false, true); // X-flip + CW
let original = 75.0_f32;
let original = 75.0_f64;
let converted = converter.degrees_encode(original);
let roundtrip = converter.degrees_decode(converted);
assert!((original - roundtrip).abs() < 1e-6);
assert!((original - roundtrip as f64).abs() < 1e-6);
}
}
@@ -18,7 +18,7 @@ pub struct AngularStepConverter {
impl AngularStepConverter {
/// Create a new converter with the specified steps per revolution
pub fn new(steps_per_revolution: i16) -> Self {
pub const fn new(steps_per_revolution: i16) -> Self {
Self {
steps_per_revolution,
}
@@ -0,0 +1,279 @@
//! # Circular Converter
//!
//! This module provides the `CircularConverter` which handles transformations between
//! linear and angular measurements for circular motion systems.
//!
//! ## Usage
//!
//! The `CircularConverter` is designed to work alongside other converters:
//! - Use `AngularStepConverter` for angular-to-step conversions
//! - Use `LinearStepConverter` for complete linear-to-step conversions (uses `CircularConverter` internally)
//! - Use `CircularConverter` directly when you need linear-to-angular conversions without steps
//!
//! ## Examples
//!
//! ```rust
//! use control_core::converters::circular_converter::CircularConverter;
//! use uom::si::{f64::{Length, Velocity}, length::meter, velocity::meter_per_second};
//!
//! let converter = CircularConverter::from_radius(Length::new::<meter>(0.1));
//! let velocity = Velocity::new::<meter_per_second>(1.0);
//! let angular_velocity = converter.linear_to_angular_velocity(velocity);
//! ```
use uom::si::{
acceleration::meter_per_second_squared,
angle::radian,
angular_acceleration::radian_per_second_squared,
angular_velocity::radian_per_second,
f64::{Acceleration, Angle, AngularAcceleration, AngularVelocity, Length, Velocity},
length::meter,
velocity::meter_per_second,
};
/// A converter that handles transformations between linear and angular measurements
/// for circular motion. This includes conversions for position, velocity, acceleration,
/// and higher-order derivatives based on a circle's geometric properties.
#[derive(Debug, Clone)]
pub struct CircularConverter {
radius: Length,
circumference: Length,
diameter: Length,
}
impl CircularConverter {
/// Create a new converter from radius
pub fn from_radius(radius: Length) -> Self {
let diameter = radius * 2.0;
let circumference =
Length::new::<meter>(2.0 * std::f64::consts::PI * radius.get::<meter>());
Self {
radius,
diameter,
circumference,
}
}
/// Create a new converter from diameter
pub fn from_diameter(diameter: Length) -> Self {
let radius = diameter / 2.0;
Self::from_radius(radius)
}
/// Create a new converter from circumference
pub fn from_circumference(circumference: Length) -> Self {
let radius =
Length::new::<meter>(circumference.get::<meter>() / (2.0 * std::f64::consts::PI));
Self::from_radius(radius)
}
/// Get the radius
pub fn radius(&self) -> Length {
self.radius
}
/// Get the diameter
pub fn diameter(&self) -> Length {
self.diameter
}
/// Get the circumference
pub fn circumference(&self) -> Length {
self.circumference
}
// Linear to Angular Position Conversions
/// Convert linear distance to angular position
/// Formula: angle = distance / radius
pub fn linear_to_angular_position(&self, distance: Length) -> Angle {
let angle_rad = distance.get::<meter>() / self.radius.get::<meter>();
Angle::new::<radian>(angle_rad)
}
/// Convert angular position to linear distance
/// Formula: distance = angle * radius
pub fn angular_to_linear_position(&self, angle: Angle) -> Length {
let distance = angle.get::<radian>() * self.radius.get::<meter>();
Length::new::<meter>(distance)
}
// Linear to Angular Velocity Conversions
/// Convert linear velocity to angular velocity
/// Formula: angular_velocity = linear_velocity / radius
pub fn linear_to_angular_velocity(&self, velocity: Velocity) -> AngularVelocity {
let angular_velocity_rad_per_s =
velocity.get::<meter_per_second>() / self.radius.get::<meter>();
AngularVelocity::new::<radian_per_second>(angular_velocity_rad_per_s)
}
/// Convert angular velocity to linear velocity
/// Formula: linear_velocity = angular_velocity * radius
pub fn angular_to_linear_velocity(&self, angular_velocity: AngularVelocity) -> Velocity {
let velocity = angular_velocity.get::<radian_per_second>() * self.radius.get::<meter>();
Velocity::new::<meter_per_second>(velocity)
}
// Linear to Angular Acceleration Conversions
/// Convert linear acceleration to angular acceleration
/// Formula: angular_acceleration = linear_acceleration / radius
pub fn linear_to_angular_acceleration(
&self,
acceleration: Acceleration,
) -> AngularAcceleration {
let angular_acceleration_rad_per_s2 =
acceleration.get::<meter_per_second_squared>() / self.radius.get::<meter>();
AngularAcceleration::new::<radian_per_second_squared>(angular_acceleration_rad_per_s2)
}
/// Convert angular acceleration to linear acceleration
/// Formula: linear_acceleration = angular_acceleration * radius
pub fn angular_to_linear_acceleration(
&self,
angular_acceleration: AngularAcceleration,
) -> Acceleration {
let acceleration =
angular_acceleration.get::<radian_per_second_squared>() * self.radius.get::<meter>();
Acceleration::new::<meter_per_second_squared>(acceleration)
}
// Jerk Conversions (using f64 for now since UOM may not have jerk units)
/// Convert linear jerk to angular jerk
/// Formula: angular_jerk = linear_jerk / radius
/// Units: rad/s³ = (m/s³) / m
pub fn linear_to_angular_jerk(&self, linear_jerk: f64) -> f64 {
linear_jerk / self.radius.get::<meter>()
}
/// Convert angular jerk to linear jerk
/// Formula: linear_jerk = angular_jerk * radius
/// Units: m/s³ = (rad/s³) * m
pub fn angular_to_linear_jerk(&self, angular_jerk: f64) -> f64 {
angular_jerk * self.radius.get::<meter>()
}
// Arc Length Calculations
/// Calculate arc length from angle
/// Formula: arc_length = angle * radius
pub fn angle_to_arc_length(&self, angle: Angle) -> Length {
self.angular_to_linear_position(angle)
}
/// Calculate angle from arc length
/// Formula: angle = arc_length / radius
pub fn arc_length_to_angle(&self, arc_length: Length) -> Angle {
self.linear_to_angular_position(arc_length)
}
// Circumference-based calculations
/// Convert linear distance to number of revolutions
/// Formula: revolutions = distance / circumference
pub fn linear_distance_to_revolutions(&self, distance: Length) -> f64 {
distance.get::<meter>() / self.circumference.get::<meter>()
}
/// Convert number of revolutions to linear distance
/// Formula: distance = revolutions * circumference
pub fn revolutions_to_linear_distance(&self, revolutions: f64) -> Length {
Length::new::<meter>(revolutions * self.circumference.get::<meter>())
}
/// Convert linear velocity to revolutions per second
/// Formula: rps = velocity / circumference
pub fn linear_velocity_to_rps(&self, velocity: Velocity) -> f64 {
velocity.get::<meter_per_second>() / self.circumference.get::<meter>()
}
/// Convert revolutions per second to linear velocity
/// Formula: velocity = rps * circumference
pub fn rps_to_linear_velocity(&self, rps: f64) -> Velocity {
Velocity::new::<meter_per_second>(rps * self.circumference.get::<meter>())
}
}
#[cfg(test)]
mod tests {
use super::*;
use uom::si::length::centimeter;
#[test]
fn test_constructors() {
let radius = Length::new::<centimeter>(5.0);
let diameter = Length::new::<centimeter>(10.0);
let circumference = Length::new::<centimeter>(2.0 * std::f64::consts::PI * 5.0);
let converter1 = CircularConverter::from_radius(radius);
let converter2 = CircularConverter::from_diameter(diameter);
let converter3 = CircularConverter::from_circumference(circumference);
// All should have approximately the same values
assert!((converter1.radius().get::<centimeter>() - 5.0).abs() < 1e-10);
assert!((converter2.radius().get::<centimeter>() - 5.0).abs() < 1e-10);
assert!((converter3.radius().get::<centimeter>() - 5.0).abs() < 1e-10);
assert!((converter1.diameter().get::<centimeter>() - 10.0).abs() < 1e-10);
assert!((converter2.diameter().get::<centimeter>() - 10.0).abs() < 1e-10);
assert!((converter3.diameter().get::<centimeter>() - 10.0).abs() < 1e-10);
}
#[test]
fn test_position_conversions() {
let converter = CircularConverter::from_radius(Length::new::<meter>(1.0));
// Test linear to angular
let distance = Length::new::<meter>(std::f64::consts::PI);
let angle = converter.linear_to_angular_position(distance);
assert!((angle.get::<radian>() - std::f64::consts::PI).abs() < 1e-10);
// Test angular to linear
let angle = Angle::new::<radian>(std::f64::consts::PI / 2.0);
let distance = converter.angular_to_linear_position(angle);
assert!((distance.get::<meter>() - std::f64::consts::PI / 2.0).abs() < 1e-10);
}
#[test]
fn test_velocity_conversions() {
let converter = CircularConverter::from_radius(Length::new::<meter>(0.5));
// Test linear to angular
let velocity = Velocity::new::<meter_per_second>(1.0);
let angular_velocity = converter.linear_to_angular_velocity(velocity);
assert!((angular_velocity.get::<radian_per_second>() - 2.0).abs() < 1e-10);
// Test angular to linear
let angular_velocity = AngularVelocity::new::<radian_per_second>(4.0);
let velocity = converter.angular_to_linear_velocity(angular_velocity);
assert!((velocity.get::<meter_per_second>() - 2.0).abs() < 1e-10);
}
#[test]
fn test_revolution_conversions() {
let converter = CircularConverter::from_radius(Length::new::<meter>(1.0));
// One full revolution should equal circumference
let revolutions = 1.0;
let distance = converter.revolutions_to_linear_distance(revolutions);
assert!((distance.get::<meter>() - converter.circumference().get::<meter>()).abs() < 1e-10);
// Converting back should give 1 revolution
let calculated_revolutions = converter.linear_distance_to_revolutions(distance);
assert!((calculated_revolutions - 1.0).abs() < 1e-10);
}
#[test]
fn test_jerk_conversions() {
let converter = CircularConverter::from_radius(Length::new::<meter>(2.0));
let linear_jerk = 4.0; // m/s³
let angular_jerk = converter.linear_to_angular_jerk(linear_jerk);
assert!((angular_jerk - 2.0).abs() < 1e-10); // 4.0 / 2.0 = 2.0 rad/s³
let calculated_linear_jerk = converter.angular_to_linear_jerk(angular_jerk);
assert!((calculated_linear_jerk - linear_jerk).abs() < 1e-10);
}
}
@@ -1,14 +1,11 @@
use uom::si::{
acceleration::meter_per_second_squared,
angle::revolution,
angular_acceleration::radian_per_second_squared,
angular_velocity::revolution_per_second,
f64::{Acceleration, Angle, AngularAcceleration, AngularVelocity, Length, Velocity},
length::meter,
velocity::meter_per_second,
};
use super::angular_step_converter::AngularStepConverter;
use super::circular_converter::CircularConverter;
/// Converts between linear measurements and motor steps
///
@@ -18,57 +15,52 @@ use super::angular_step_converter::AngularStepConverter;
#[derive(Debug, Clone)]
pub struct LinearStepConverter {
angular_step_converter: AngularStepConverter,
radius: Length,
circumference: Length,
circular_converter: CircularConverter,
}
// Constructor and basic getters
impl LinearStepConverter {
/// Create a new converter from radius and steps per revolution
pub fn from_radius(steps_per_revolution: i16, radius: Length) -> Self {
let circumference =
Length::new::<meter>(2.0 * std::f64::consts::PI * radius.get::<meter>());
Self {
angular_step_converter: AngularStepConverter::new(steps_per_revolution),
radius,
circumference,
circular_converter: CircularConverter::from_radius(radius),
}
}
/// Create a new converter from diameter and steps per revolution
pub fn from_diameter(steps_per_revolution: i16, diameter: Length) -> Self {
let radius = diameter / 2.0;
Self::from_radius(steps_per_revolution, radius)
Self {
angular_step_converter: AngularStepConverter::new(steps_per_revolution),
circular_converter: CircularConverter::from_diameter(diameter),
}
}
/// Create a new converter from circumference and steps per revolution
pub fn from_circumference(steps_per_revolution: i16, circumference: Length) -> Self {
let radius =
Length::new::<meter>(circumference.get::<meter>() / (2.0 * std::f64::consts::PI));
Self {
angular_step_converter: AngularStepConverter::new(steps_per_revolution),
radius,
circumference,
circular_converter: CircularConverter::from_circumference(circumference),
}
}
/// Get the radius used by the converter
pub fn radius(&self) -> Length {
self.radius
self.circular_converter.radius()
}
/// Get the diameter of the system
pub fn diameter(&self) -> Length {
self.radius * 2.0
self.circular_converter.diameter()
}
/// Get the circumference of the system
pub fn circumference(&self) -> Length {
self.circumference
self.circular_converter.circumference()
}
/// Get the steps per revolution
pub fn steps_per_revolution(&self) -> i16 {
pub const fn steps_per_revolution(&self) -> i16 {
self.angular_step_converter.steps_per_revolution
}
}
@@ -79,8 +71,10 @@ impl LinearStepConverter {
///
/// Formula: steps = (distance / circumference) * steps_per_revolution
pub fn distance_to_steps(&self, distance: Length) -> f64 {
// Convert distance to angle: angle = distance/circumference (in revolutions)
let revolutions = distance.get::<meter>() / self.circumference.get::<meter>();
// Convert distance to revolutions using CircularConverter
let revolutions = self
.circular_converter
.linear_distance_to_revolutions(distance);
let angle = Angle::new::<revolution>(revolutions);
// Convert angle to steps
@@ -94,21 +88,19 @@ impl LinearStepConverter {
// Convert steps to angle
let angle = self.angular_step_converter.steps_to_angle(steps);
// Convert angle to distance: distance = angle * circumference
// Convert angle to distance using CircularConverter
let revolutions = angle.get::<revolution>();
let distance = revolutions * self.circumference.get::<meter>();
Length::new::<meter>(distance)
self.circular_converter
.revolutions_to_linear_distance(revolutions)
}
/// Convert linear velocity to steps/second
///
/// Formula: steps/second = (velocity / circumference) * steps_per_revolution
pub fn velocity_to_steps(&self, velocity: Velocity) -> f64 {
// Convert linear velocity to angular velocity: ω = v/circumference (in rev/s)
let linear_velocity = velocity.get::<meter_per_second>();
let angular_velocity_rps = linear_velocity / self.circumference.get::<meter>();
let angular_velocity = AngularVelocity::new::<revolution_per_second>(angular_velocity_rps);
// Convert linear velocity to revolutions per second using CircularConverter
let rps = self.circular_converter.linear_velocity_to_rps(velocity);
let angular_velocity = AngularVelocity::new::<revolution_per_second>(rps);
// Convert angular velocity to steps/second
self.angular_step_converter
@@ -124,23 +116,19 @@ impl LinearStepConverter {
.angular_step_converter
.steps_to_angular_velocity(steps_per_second);
// Convert angular velocity to linear velocity: v = ω * circumference
let angular_velocity_rps = angular_velocity.get::<revolution_per_second>();
let linear_velocity = angular_velocity_rps * self.circumference.get::<meter>();
Velocity::new::<meter_per_second>(linear_velocity)
// Convert angular velocity to linear velocity using CircularConverter
let rps = angular_velocity.get::<revolution_per_second>();
self.circular_converter.rps_to_linear_velocity(rps)
}
/// Convert linear acceleration to steps/second²
///
/// Formula: steps/second² = (acceleration / radius) * (steps_per_revolution / (2π))
pub fn acceleration_to_steps(&self, acceleration: Acceleration) -> f64 {
// Convert linear acceleration to angular acceleration: α = a/r
let linear_acceleration = acceleration.get::<meter_per_second_squared>();
// Calculate angular acceleration in radians per second squared
let angular_acceleration_rad_per_s2 = linear_acceleration / self.radius.get::<meter>();
let angular_acceleration =
AngularAcceleration::new::<radian_per_second_squared>(angular_acceleration_rad_per_s2);
// Convert linear acceleration to angular acceleration using CircularConverter
let angular_acceleration = self
.circular_converter
.linear_to_angular_acceleration(acceleration);
// Convert angular acceleration to steps/second²
self.angular_step_converter
@@ -156,12 +144,9 @@ impl LinearStepConverter {
.angular_step_converter
.steps_to_angular_acceleration(steps_per_second_squared);
// Convert angular acceleration to linear acceleration: a = α * r
let angular_acceleration_rad_per_s2 =
angular_acceleration.get::<radian_per_second_squared>();
let linear_acceleration = angular_acceleration_rad_per_s2 * self.radius.get::<meter>();
Acceleration::new::<meter_per_second_squared>(linear_acceleration)
// Convert angular acceleration to linear acceleration using CircularConverter
self.circular_converter
.angular_to_linear_acceleration(angular_acceleration)
}
}
@@ -171,7 +156,9 @@ impl LinearStepConverter {
///
/// Formula: angle (in revolutions) = distance / circumference
pub fn distance_to_angle(&self, distance: Length) -> Angle {
let revolutions = distance.get::<meter>() / self.circumference.get::<meter>();
let revolutions = self
.circular_converter
.linear_distance_to_revolutions(distance);
Angle::new::<revolution>(revolutions)
}
@@ -180,26 +167,24 @@ impl LinearStepConverter {
/// Formula: distance = angle (in revolutions) * circumference
pub fn angle_to_distance(&self, angle: Angle) -> Length {
let revolutions = angle.get::<revolution>();
let distance = revolutions * self.circumference.get::<meter>();
Length::new::<meter>(distance)
self.circular_converter
.revolutions_to_linear_distance(revolutions)
}
/// Convert linear velocity to angular velocity
///
/// Formula: angular velocity (in rev/s) = velocity / circumference
pub fn velocity_to_angular_velocity(&self, velocity: Velocity) -> AngularVelocity {
let linear_velocity = velocity.get::<meter_per_second>();
let angular_velocity_rps = linear_velocity / self.circumference.get::<meter>();
AngularVelocity::new::<revolution_per_second>(angular_velocity_rps)
let rps = self.circular_converter.linear_velocity_to_rps(velocity);
AngularVelocity::new::<revolution_per_second>(rps)
}
/// Convert angular velocity to linear velocity
///
/// Formula: velocity = angular velocity (in rev/s) * circumference
pub fn angular_velocity_to_velocity(&self, angular_velocity: AngularVelocity) -> Velocity {
let angular_velocity_rps = angular_velocity.get::<revolution_per_second>();
let linear_velocity = angular_velocity_rps * self.circumference.get::<meter>();
Velocity::new::<meter_per_second>(linear_velocity)
let rps = angular_velocity.get::<revolution_per_second>();
self.circular_converter.rps_to_linear_velocity(rps)
}
/// Convert linear acceleration to angular acceleration
@@ -209,9 +194,8 @@ impl LinearStepConverter {
&self,
acceleration: Acceleration,
) -> AngularAcceleration {
let linear_acceleration = acceleration.get::<meter_per_second_squared>();
let angular_acceleration_rad_per_s2 = linear_acceleration / self.radius.get::<meter>();
AngularAcceleration::new::<radian_per_second_squared>(angular_acceleration_rad_per_s2)
self.circular_converter
.linear_to_angular_acceleration(acceleration)
}
/// Convert angular acceleration to linear acceleration
@@ -221,10 +205,8 @@ impl LinearStepConverter {
&self,
angular_acceleration: AngularAcceleration,
) -> Acceleration {
let angular_acceleration_rad_per_s2 =
angular_acceleration.get::<radian_per_second_squared>();
let linear_acceleration = angular_acceleration_rad_per_s2 * self.radius.get::<meter>();
Acceleration::new::<meter_per_second_squared>(linear_acceleration)
self.circular_converter
.angular_to_linear_acceleration(angular_acceleration)
}
}
@@ -269,6 +251,10 @@ mod tests {
use super::*;
use approx::assert_relative_eq;
use std::f64::EPSILON;
use uom::si::{
acceleration::meter_per_second_squared, angular_acceleration::radian_per_second_squared,
length::meter, velocity::meter_per_second,
};
#[test]
fn test_new() {
+1 -1
View File
@@ -1,5 +1,5 @@
pub mod angle_converter;
pub mod angular_step_converter;
pub mod circular_converter;
pub mod linear_step_converter;
pub mod motor_converter;
pub mod transmission_converter;
@@ -1,22 +0,0 @@
use uom::si::f64::AngularVelocity;
#[derive(Debug, Clone)]
pub struct TransmissionConverter {
pub transmission_ratio: f64,
}
impl TransmissionConverter {
pub fn new() -> Self {
Self {
transmission_ratio: 34.0,
}
}
pub fn calculate_screw_output_rpm(&self, rpm: AngularVelocity) -> AngularVelocity {
rpm / self.transmission_ratio
}
pub fn calculate_screw_input_rpm(&self, screw_rpm: AngularVelocity) -> AngularVelocity {
screw_rpm * self.transmission_ratio
}
}
+36
View File
@@ -0,0 +1,36 @@
use anyhow::anyhow;
use smol::lock::Mutex;
use std::any::Any;
use std::sync::Arc;
pub trait Downcast<T> {
fn downcast(&self) -> Result<T, anyhow::Error>;
}
pub trait DowncastRef<T> {
fn downcast_ref(&self) -> Result<&T, anyhow::Error>;
}
impl<T: 'static, U: Any + 'static> Downcast<Arc<Mutex<T>>> for Arc<Mutex<U>> {
fn downcast(&self) -> Result<Arc<Mutex<T>>, anyhow::Error> {
// Acquire a read lock on the RwLock
let lock = self.lock_blocking();
// Check if the inner type can be downcasted to T
let any: &dyn Any = &*lock;
if any.is::<T>() {
// Clone the Arc and return it as the desired type
let cloned: Arc<Mutex<dyn Any>> = self.clone();
// Transmute the Arc to the desired type
unsafe {
let arc = Arc::from_raw(Arc::into_raw(cloned) as *const Mutex<T>);
Ok(arc)
}
} else {
Err(anyhow!("[{}::downcast] Downcast failed", module_path!()))
}
}
}
@@ -4,8 +4,10 @@ use ethercat_hal::devices::ek1100::EK1100_IDENTITY_A;
use ethercat_hal::devices::el1002::EL1002_IDENTITY_A;
use ethercat_hal::devices::el1008::EL1008_IDENTITY_A;
use ethercat_hal::devices::el2002::EL2002_IDENTITY_A;
use ethercat_hal::devices::el2002::EL2002_IDENTITY_B;
use ethercat_hal::devices::el2004::EL2004_IDENTITY_A;
use ethercat_hal::devices::el2008::EL2008_IDENTITY_A;
use ethercat_hal::devices::el2008::EL2008_IDENTITY_B;
use ethercat_hal::devices::el2521::{
EL2521_IDENTITY_0000_A, EL2521_IDENTITY_0000_B, EL2521_IDENTITY_0024_A,
};
@@ -13,8 +15,11 @@ use ethercat_hal::devices::el2522::EL2522_IDENTITY_A;
use ethercat_hal::devices::el3001::EL3001_IDENTITY_A;
use ethercat_hal::devices::el3021::EL3021_IDENTITY_A;
use ethercat_hal::devices::el3024::EL3024_IDENTITY_A;
use ethercat_hal::devices::el3062_0030::EL3062_0030_IDENTITY_A;
use ethercat_hal::devices::el3204::EL3204_IDENTITY_A;
use ethercat_hal::devices::el3204::EL3204_IDENTITY_B;
use ethercat_hal::devices::el4002::EL4002_IDENTITY_A;
use ethercat_hal::devices::el5152::EL5152_IDENTITY_A;
use ethercat_hal::devices::el6021::{
EL6021_IDENTITY_A, EL6021_IDENTITY_B, EL6021_IDENTITY_C, EL6021_IDENTITY_D,
};
@@ -41,7 +46,12 @@ pub struct MachineIdentificationAddresses {
}
impl MachineIdentificationAddresses {
pub fn new(vendor_word: u16, serial_word: u16, machine_word: u16, device_word: u16) -> Self {
pub const fn new(
vendor_word: u16,
serial_word: u16,
machine_word: u16,
device_word: u16,
) -> Self {
Self {
vendor_word,
serial_word,
@@ -71,7 +81,7 @@ pub async fn read_device_identifications<'maindevice>(
) -> Vec<Result<DeviceMachineIdentification, Error>> {
let mut result = Vec::new();
for subdevice in subdevices.iter() {
let identification = machine_device_identification(&subdevice, maindevice).await;
let identification = machine_device_identification(subdevice, maindevice).await;
result.push(identification);
}
result
@@ -218,33 +228,37 @@ pub async fn write_machine_device_identification<'maindevice, const MAX_PDI: usi
/// Returns the EEPROM addresses for the machine device identification
/// based on the subdevice's identity
pub fn get_identification_addresses<'maindevice>(
pub fn get_identification_addresses(
subdevice_identity: &SubDeviceIdentity,
subdevice_name: &str,
) -> Result<MachineIdentificationAddresses, Error> {
let identity_tuple = subdevice_identity_to_tuple(&subdevice_identity);
let identity_tuple = subdevice_identity_to_tuple(subdevice_identity);
Ok(match identity_tuple {
EK1100_IDENTITY_A => MachineIdentificationAddresses::default(),
EL1002_IDENTITY_A => MachineIdentificationAddresses::default(),
EL1008_IDENTITY_A => MachineIdentificationAddresses::default(),
EL2002_IDENTITY_A => MachineIdentificationAddresses::default(),
EL2002_IDENTITY_A | EL2002_IDENTITY_B => MachineIdentificationAddresses::default(),
EL2004_IDENTITY_A => MachineIdentificationAddresses::default(),
EL3204_IDENTITY_A | EL3204_IDENTITY_B => MachineIdentificationAddresses::default(),
EL2008_IDENTITY_A => MachineIdentificationAddresses::default(),
EL3001_IDENTITY_A => MachineIdentificationAddresses::default(),
EL2008_IDENTITY_A | EL2008_IDENTITY_B => MachineIdentificationAddresses::default(),
EL2521_IDENTITY_0000_A | EL2521_IDENTITY_0000_B | EL2521_IDENTITY_0024_A => {
MachineIdentificationAddresses::default()
}
EL2522_IDENTITY_A => MachineIdentificationAddresses::default(),
EL3024_IDENTITY_A => MachineIdentificationAddresses::default(),
EL3001_IDENTITY_A => MachineIdentificationAddresses::default(),
EL3021_IDENTITY_A => MachineIdentificationAddresses::default(),
EL7031_IDENTITY_A | EL7031_IDENTITY_B => MachineIdentificationAddresses::default(),
EL7031_0030_IDENTITY_A => MachineIdentificationAddresses::default(),
EL7041_0052_IDENTITY_A => MachineIdentificationAddresses::default(),
EL3024_IDENTITY_A => MachineIdentificationAddresses::default(),
EL3062_0030_IDENTITY_A => MachineIdentificationAddresses::default(),
EL3204_IDENTITY_A | EL3204_IDENTITY_B => MachineIdentificationAddresses::default(),
EL4002_IDENTITY_A => MachineIdentificationAddresses::default(),
EL5152_IDENTITY_A => MachineIdentificationAddresses::default(),
EL6021_IDENTITY_A | EL6021_IDENTITY_B | EL6021_IDENTITY_C | EL6021_IDENTITY_D => {
MachineIdentificationAddresses::default()
}
EL7031_IDENTITY_A | EL7031_IDENTITY_B => MachineIdentificationAddresses::default(),
EL7031_0030_IDENTITY_A => MachineIdentificationAddresses::default(),
EL7041_0052_IDENTITY_A => MachineIdentificationAddresses::default(),
_ => {
// block_on(u16dump(&subdevice, maindevice, 0x00, 0xff))?;
Err(anyhow!(
@@ -270,8 +284,8 @@ async fn u16dump<'maindevice>(
words.push(subdevice.eeprom_read(maindevice, word).await?);
}
print!(
"EEPROM dump for {} from 0x{:04x} to 0x{:04x}\n",
println!(
"EEPROM dump for {} from 0x{:04x} to 0x{:04x}",
subdevice.name(),
start_byte / 2,
end_byte / 2
@@ -286,7 +300,7 @@ fn u16print(start_byte: u16, end_byte: u16, data: Vec<u16>) {
let table_start_word = start_byte & 0xfff0;
let table_end_word = (end_byte & 0xfff0_u16) + 0x10_u16;
let rows = table_end_word - table_start_word >> 4;
let rows = (table_end_word - table_start_word) >> 4;
for row in 0..rows {
print!("0x{:04x} | ", (table_start_word + row * 0x10) / 2);
@@ -303,7 +317,7 @@ fn u16print(start_byte: u16, end_byte: u16, data: Vec<u16>) {
}
}
}
print!("\n");
println!();
}
}
@@ -1,4 +1,4 @@
use std::{sync::Arc, time::Duration};
use std::{process::Command, sync::Arc, time::Duration};
use ethercrab::{
MainDevice, MainDeviceConfig, PduStorage, Timeouts,
@@ -12,14 +12,46 @@ const IFACE_DISCOVERY_MAX_PDU_DATA: usize = PduStorage::element_size(1100);
const IFACE_DISCOVERY_MAX_FRAMES: usize = 16;
const IFACE_DISCOVERY_MAX_PDI_LEN: usize = 128;
/// Finds an ethernet interface that is suitable for EtherCAT communication.
///
/// ```ignore
/// match discover_ethercat_interface().await {
/// Ok(interface) => println!("Found working interface: {}", interface),
/// Err(_) => println!("No working interface found"),
/// }
/// ```
/// Sets a network interface to unmanaged by NetworkManager.
/// Returns true if the command succeeded.
pub fn set_interface_managed(interface: &str, managed: bool) -> bool {
let managed_str = match managed {
true => "yes",
false => "no",
};
tracing::info!(
"set_interface_managed for {} managed was set to: {}",
interface,
managed_str
);
let status = Command::new("nmcli")
.args(["dev", "set", interface, "managed", managed_str])
.status();
matches!(status, Ok(s) if s.success())
}
/// Returns true if the given network interface is Ethernet.
/// Prevents testing wlan,loopback and other non ethernet devices
fn is_ethernet(interface: &str) -> std::io::Result<bool> {
#[cfg(target_os = "linux")]
{
let base_path = format!("/sys/class/net/{}", interface);
let type_path = std::path::Path::new(&base_path).join("type");
let iface_type = std::fs::read_to_string(&type_path)?.trim().to_string();
// 1 means Ethernet
let reports_as_ethernet = iface_type == "1";
// Double-check that it's not a wireless interface
let uevent_path = std::path::Path::new(&base_path).join("uevent");
let uevent = std::fs::read_to_string(&uevent_path).unwrap_or_default();
// If "DEVTYPE=wlan" appears, it's lying
let actually_wifi = uevent.contains("DEVTYPE=wlan");
return Ok(reports_as_ethernet && !actually_wifi);
}
#[cfg(not(target_os = "linux"))]
return Ok(true);
}
pub async fn discover_ethercat_interface() -> Result<String, anyhow::Error> {
tracing::info!("Discovering EtherCAT interface...");
@@ -37,17 +69,17 @@ pub async fn discover_ethercat_interface() -> Result<String, anyhow::Error> {
} else {
tracing::debug!("Suppressed panic in interface test: {}", panic_info);
}
// Don't call the default hook, which would print the backtrace
}));
// Get eligible interfaces
let mut interfaces = Interface::get_all()
.or_else(|e| Err(anyhow::anyhow!("Failed to get network interfaces: {}", e)))?
.map_err(|e| anyhow::anyhow!("Failed to get network interfaces: {}", e))?
.into_iter()
.filter(|iface| {
iface.is_up()
&& iface.is_running()
&& !iface.is_loopback()
&& is_ethernet(&iface.name).unwrap_or(false)
&& !iface.name.starts_with("bridge")
&& !iface.name.starts_with("utun") // Exclude tunnel interfaces
&& !iface.name.starts_with("awdl") // Exclude Apple Wireless Direct Link
@@ -56,60 +88,40 @@ pub async fn discover_ethercat_interface() -> Result<String, anyhow::Error> {
})
.collect::<Vec<_>>();
// Sort interfaces by name
interfaces.sort_by(|a, b| a.name.cmp(&b.name));
let mut interface: Option<&str> = None;
// Try all interfaces concurrently
let tasks = interfaces
.iter()
.map(|iface| {
let name = iface.name.clone();
std::thread::Builder::new()
.name(format!("ethercat-test-{}", name))
.spawn(move || {
std::panic::catch_unwind(|| {
smol::block_on(async {
match test_interface(&name) {
Ok(_) => {
tracing::info!("Found working EtherCAT interface: {}", name);
Some(name.clone())
}
Err(_) => {
tracing::debug!("Interface {} failed", name);
None
}
}
})
})
.unwrap_or(None)
})
.expect("Failed to spawn thread")
})
.collect::<Vec<_>>();
for i in 0..interfaces.len() {
match test_interface(&interfaces[i].name) {
Ok(_) => {
// if interface found with ethercat Exit early, we expect only one interface with ethercat
interface = Some(&interfaces[i].name);
break;
}
Err(_) => (),
}
}
// Wait for all tasks to complete and collect successful results
let successful_interfaces: Vec<String> = tasks
.into_iter()
.filter_map(|task| match task.join().expect("Should join thread") {
Some(name) => Some(name),
None => None,
})
.collect();
// Return the first successful interface (they're sorted by name)
let result = successful_interfaces.into_iter().next();
for i in 0..interfaces.len() {
if interface.is_some() && interface.unwrap() == &interfaces[i].name {
set_interface_managed(&interfaces[i].name, false);
continue;
} else {
set_interface_managed(&interfaces[i].name, true);
}
}
// Restore the default panic hook
std::panic::set_hook(default_hook);
match result {
Some(name) => Ok(name),
None => Err(anyhow::anyhow!("No suitable EtherCAT interface found")),
match interface {
Some(interface) => return Ok(interface.to_string()),
None => return Err(anyhow::anyhow!("No suitable EtherCAT interface found")),
}
}
fn test_interface(interface: &str) -> Result<(), anyhow::Error> {
tracing::trace!("Testing interface: {}", interface);
tracing::info!("Testing interface: {}", interface);
let pdu_storage = Box::leak(Box::new(PduStorage::<
IFACE_DISCOVERY_MAX_FRAMES,
@@ -147,7 +159,7 @@ fn test_interface(interface: &str) -> Result<(), anyhow::Error> {
// Default 10000
dc_static_sync_iterations: 10000,
// Default None
retry_behaviour: ethercrab::RetryBehaviour::None,
retry_behaviour: ethercrab::RetryBehaviour::Count(3),
},
));
@@ -0,0 +1,337 @@
use serde::Serialize;
use serde::ser::{
SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, SerializeTuple,
SerializeTupleStruct, SerializeTupleVariant, Serializer,
};
use std::error::Error;
use std::fmt::Display;
use std::hash::{DefaultHasher, Hasher};
#[derive(Debug)]
pub struct HashSerializerError {}
impl std::fmt::Display for HashSerializerError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&format!("{:?}", self))
// f.debug_struct("HashSerialiyerError")
// .finish()
}
}
impl Error for HashSerializerError {}
impl serde::ser::Error for HashSerializerError {
fn custom<T>(_msg: T) -> Self
where
T: Display,
{
Self {}
}
}
pub struct HashSerializer<'a, H: Hasher>(&'a mut H);
impl<H: Hasher> SerializeSeq for HashSerializer<'_, H> {
type Ok = ();
type Error = HashSerializerError;
fn serialize_element<T>(&mut self, value: &T) -> Result<(), Self::Error>
where
T: ?Sized + Serialize,
{
value.serialize(HashSerializer(self.0))
}
fn end(self) -> Result<Self::Ok, Self::Error> {
Ok(())
}
}
impl<H: Hasher> SerializeTuple for HashSerializer<'_, H> {
type Ok = ();
type Error = HashSerializerError;
fn serialize_element<T>(&mut self, value: &T) -> Result<(), Self::Error>
where
T: ?Sized + Serialize,
{
value.serialize(HashSerializer(self.0))
}
fn end(self) -> Result<Self::Ok, Self::Error> {
Ok(())
}
}
impl<H: Hasher> SerializeTupleStruct for HashSerializer<'_, H> {
type Ok = ();
type Error = HashSerializerError;
fn serialize_field<T>(&mut self, value: &T) -> Result<(), Self::Error>
where
T: ?Sized + Serialize,
{
value.serialize(HashSerializer(self.0))
}
fn end(self) -> Result<Self::Ok, Self::Error> {
Ok(())
}
}
impl<H: Hasher> SerializeTupleVariant for HashSerializer<'_, H> {
type Ok = ();
type Error = HashSerializerError;
fn serialize_field<T>(&mut self, value: &T) -> Result<(), Self::Error>
where
T: ?Sized + Serialize,
{
value.serialize(HashSerializer(self.0))
}
fn end(self) -> Result<Self::Ok, Self::Error> {
Ok(())
}
}
impl<H: Hasher> SerializeMap for HashSerializer<'_, H> {
type Ok = ();
type Error = HashSerializerError;
fn serialize_key<T>(&mut self, key: &T) -> Result<(), Self::Error>
where
T: ?Sized + Serialize,
{
key.serialize(HashSerializer(self.0))
}
fn serialize_value<T>(&mut self, value: &T) -> Result<(), Self::Error>
where
T: ?Sized + Serialize,
{
value.serialize(HashSerializer(self.0))
}
fn end(self) -> Result<Self::Ok, Self::Error> {
Ok(())
}
}
impl<H: Hasher> SerializeStruct for HashSerializer<'_, H> {
type Ok = ();
type Error = HashSerializerError;
fn serialize_field<T>(&mut self, key: &'static str, value: &T) -> Result<(), Self::Error>
where
T: ?Sized + Serialize,
{
// Optional: hash the field name to avoid collisions
self.0.write(key.as_bytes());
value.serialize(HashSerializer(self.0))
}
fn end(self) -> Result<Self::Ok, Self::Error> {
Ok(())
}
}
impl<H: Hasher> SerializeStructVariant for HashSerializer<'_, H> {
type Ok = ();
type Error = HashSerializerError;
fn serialize_field<T>(&mut self, key: &'static str, value: &T) -> Result<(), Self::Error>
where
T: ?Sized + Serialize,
{
self.0.write(key.as_bytes());
value.serialize(HashSerializer(self.0))
}
fn end(self) -> Result<Self::Ok, Self::Error> {
Ok(())
}
}
impl<H: Hasher> Serializer for HashSerializer<'_, H> {
type Ok = ();
type Error = HashSerializerError;
type SerializeSeq = Self;
type SerializeTuple = Self;
type SerializeTupleStruct = Self;
type SerializeTupleVariant = Self;
type SerializeMap = Self;
type SerializeStruct = Self;
type SerializeStructVariant = Self;
fn serialize_bool(self, v: bool) -> Result<(), Self::Error> {
self.0.write_u8(v as u8);
Ok(())
}
fn serialize_i8(self, v: i8) -> Result<(), Self::Error> {
self.0.write_i8(v);
Ok(())
}
fn serialize_i16(self, v: i16) -> Result<(), Self::Error> {
self.0.write_i16(v);
Ok(())
}
fn serialize_i32(self, v: i32) -> Result<(), Self::Error> {
self.0.write_i32(v);
Ok(())
}
fn serialize_i64(self, v: i64) -> Result<(), Self::Error> {
self.0.write_i64(v);
Ok(())
}
fn serialize_u8(self, v: u8) -> Result<(), Self::Error> {
self.0.write_u8(v);
Ok(())
}
fn serialize_u16(self, v: u16) -> Result<(), Self::Error> {
self.0.write_u16(v);
Ok(())
}
fn serialize_u32(self, v: u32) -> Result<(), Self::Error> {
self.0.write_u32(v);
Ok(())
}
fn serialize_u64(self, v: u64) -> Result<(), Self::Error> {
self.0.write_u64(v);
Ok(())
}
fn serialize_f32(self, v: f32) -> Result<(), Self::Error> {
self.0.write_u32(v.to_bits());
Ok(())
}
fn serialize_f64(self, v: f64) -> Result<(), Self::Error> {
self.0.write_u64(v.to_bits());
Ok(())
}
fn serialize_char(self, v: char) -> Result<(), Self::Error> {
let mut buf = [0; 4];
self.0.write(v.encode_utf8(&mut buf).as_bytes());
Ok(())
}
fn serialize_str(self, v: &str) -> Result<(), Self::Error> {
self.0.write(v.as_bytes());
Ok(())
}
fn serialize_bytes(self, v: &[u8]) -> Result<(), Self::Error> {
self.0.write(v);
Ok(())
}
fn serialize_none(self) -> Result<(), Self::Error> {
self.0.write_u8(0); // type tag for None
Ok(())
}
fn serialize_some<T: ?Sized + Serialize>(self, value: &T) -> Result<(), Self::Error> {
self.0.write_u8(1); // type tag for Some
value.serialize(self)
}
fn serialize_unit(self) -> Result<(), Self::Error> {
self.0.write_u8(0);
Ok(())
}
fn serialize_unit_struct(self, _name: &'static str) -> Result<(), Self::Error> {
self.serialize_unit()
}
fn serialize_unit_variant(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
) -> Result<(), Self::Error> {
self.0.write_u32(variant_index);
Ok(())
}
fn serialize_newtype_struct<T: ?Sized + Serialize>(
self,
_name: &'static str,
value: &T,
) -> Result<(), Self::Error> {
value.serialize(self)
}
fn serialize_newtype_variant<T: ?Sized + Serialize>(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
value: &T,
) -> Result<(), Self::Error> {
self.0.write_u32(variant_index);
value.serialize(self)
}
// For sequences, tuples, maps, structs, just return self for now
fn serialize_seq(self, _len: Option<usize>) -> Result<Self::SerializeSeq, Self::Error> {
Ok(self)
}
fn serialize_tuple(self, _len: usize) -> Result<Self::SerializeTuple, Self::Error> {
Ok(self)
}
fn serialize_tuple_struct(
self,
_name: &'static str,
_len: usize,
) -> Result<Self::SerializeTupleStruct, Self::Error> {
Ok(self)
}
fn serialize_tuple_variant(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
_len: usize,
) -> Result<Self::SerializeTupleVariant, Self::Error> {
self.0.write_u32(variant_index);
Ok(self)
}
fn serialize_map(self, _len: Option<usize>) -> Result<Self::SerializeMap, Self::Error> {
Ok(self)
}
fn serialize_struct(
self,
_name: &'static str,
_len: usize,
) -> Result<Self::SerializeStruct, Self::Error> {
Ok(self)
}
fn serialize_struct_variant(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
_len: usize,
) -> Result<Self::SerializeStructVariant, Self::Error> {
self.0.write_u32(variant_index);
Ok(self)
}
}
// A helper that uses Serialize to feed into a Hasher without allocating a buffer:
pub fn hash_with_serde_model<T: Serialize>(value: T) -> u64 {
let mut h = DefaultHasher::new();
let ser = HashSerializer(&mut h);
value.serialize(ser).expect("serialize to hasher failed");
h.finish()
}
+7 -7
View File
@@ -63,11 +63,11 @@ pub fn scale<T>(normalized_value: f64, new_min: T, new_max: T) -> T
where
T: Into<f64> + From<f64>,
{
let normalized_value: f64 = normalized_value.into();
let normalized_value: f64 = normalized_value;
let new_min: f64 = new_min.into();
let new_max: f64 = new_max.into();
let result = normalized_value * (new_max - new_min) + new_min;
let result = normalized_value.mul_add(new_max - new_min, new_min);
T::from(result)
}
@@ -128,11 +128,11 @@ where
// If we are under X we scale linearly from 0 to y
// If we are over X we scale linearly from y to 1
if value_f64 < x_f64 {
return normalize(value_f64, 0.0, x_f64) * y_f64;
normalize(value_f64, 0.0, x_f64) * y_f64
} else if value_f64 > x_f64 {
return normalize(value_f64, x_f64, 1.0) * (1.0 - y_f64) + y_f64;
normalize(value_f64, x_f64, 1.0).mul_add(1.0 - y_f64, y_f64)
} else {
return y_f64;
y_f64
}
}
@@ -273,7 +273,7 @@ pub fn interpolate_exponential(normalized_value: f64, steepness: f64) -> f64 {
return normalized_value;
}
let numerator = steepness.exp().powf(normalized_value) - 1.0;
let denominator = steepness.exp() - 1.0;
let denominator = steepness.exp_m1();
clip(numerator / denominator)
}
@@ -414,7 +414,7 @@ pub fn interpolate_inflected_exponential(x: f64, steepness: f64) -> f64 {
// Use standard exponential interpolation
let result = interpolate_exponential(x_norm, steepness);
0.5 + 0.5 * result
0.5f64.mul_add(result, 0.5)
}
}
-189
View File
@@ -1,189 +0,0 @@
use smol::Timer;
use std::time::{Duration, Instant};
use tracing::instrument;
pub struct LoopThrottle {
target_cycle_time: Duration,
update_interval_cycles: usize,
window_start: Instant,
total_cycles: usize,
delay: Duration,
last_avg_cycle_time: Duration,
on_update: Option<Box<dyn Fn(LoopThrottleUpdate)>>,
}
pub struct LoopThrottleUpdate {
pub delay: Duration,
pub avg_cycle_time: Duration,
pub error: i128, // Error in nanoseconds
}
impl LoopThrottle {
pub fn new(
target_cycle_time: Duration,
update_interval_cycles: usize,
on_update: Option<Box<dyn Fn(LoopThrottleUpdate)>>,
) -> Self {
Self {
target_cycle_time,
update_interval_cycles,
window_start: Instant::now(),
total_cycles: 0,
delay: target_cycle_time,
last_avg_cycle_time: target_cycle_time,
on_update,
}
}
#[instrument(skip_all)]
pub async fn sleep(&mut self) {
self.total_cycles += 1;
// Check if it's time to update (every N cycles)
if self.total_cycles % self.update_interval_cycles == 0 {
let actual_total_time = self.window_start.elapsed();
// Use integer arithmetic where possible
let avg_actual_cycle_time_nanos =
actual_total_time.as_nanos() / self.update_interval_cycles as u128;
let target_cycle_time_nanos = self.target_cycle_time.as_nanos();
// Calculate error in nanoseconds (signed)
let error_nanos = target_cycle_time_nanos as i128 - avg_actual_cycle_time_nanos as i128;
// Update current delay, allowing zero or negative values to become zero
let new_delay_nanos = (self.delay.as_nanos() as i128 + error_nanos).max(0) as u64;
self.delay = Duration::from_nanos(new_delay_nanos);
self.last_avg_cycle_time = Duration::from_nanos(avg_actual_cycle_time_nanos as u64);
// Reset for next measurement window
self.window_start = Instant::now();
self.total_cycles = 0; // Reset to prevent overflow
// if we have an update callback, call it
if let Some(on_update) = &self.on_update {
on_update(LoopThrottleUpdate {
delay: self.delay,
avg_cycle_time: self.last_avg_cycle_time,
error: error_nanos,
});
}
}
Timer::after(self.delay).await;
}
pub fn get_cycle_time(&self) -> Duration {
self.last_avg_cycle_time
}
pub fn get_delay(&self) -> Duration {
self.delay
}
}
#[cfg(test)]
mod tests {
use super::*;
use smol::block_on;
#[test]
fn test_adaptive_throttle_timing() {
block_on(async {
let update_interval_cycles = 100;
let target_cycle_time = Duration::from_micros(5);
let mut throttle = LoopThrottle::new(target_cycle_time, update_interval_cycles, None);
let test_start = Instant::now();
let mut cycle_times = Vec::new();
// Run for several cycles to trigger multiple updates
for _ in 0..10000 {
let cycle_start = Instant::now();
// Simulate some work
Timer::after(Duration::from_micros(5)).await;
throttle.sleep().await;
let cycle_time = cycle_start.elapsed();
cycle_times.push(cycle_time);
}
let total_test_time = test_start.elapsed();
let avg_cycle_time = cycle_times.iter().sum::<Duration>() / cycle_times.len() as u32;
println!("Test completed in: {:?}", total_test_time);
println!("Average cycle time: {:?}", avg_cycle_time);
println!("Target cycle time: {:?}", target_cycle_time);
println!("Last measured avg: {:?}", throttle.get_cycle_time());
// Assert that we're reasonably close to target timing
let tolerance = Duration::from_millis(10);
assert!(
avg_cycle_time >= target_cycle_time.saturating_sub(tolerance)
&& avg_cycle_time <= target_cycle_time + tolerance,
"Average cycle time {:?} not within tolerance of target {:?}",
avg_cycle_time,
target_cycle_time
);
});
}
#[test]
fn test_throttle_adaptation() {
block_on(async {
let target_cycle_time = Duration::from_millis(100);
let update_interval_cycles = 3;
let mut throttle = LoopThrottle::new(target_cycle_time, update_interval_cycles, None);
let initial_delay = throttle.get_delay();
// Run enough cycles to trigger multiple updates
for _ in 0..12 {
// Add variable work to test adaptation
Timer::after(Duration::from_millis(10)).await;
throttle.sleep().await;
}
println!("Initial delay: {:?}", initial_delay);
println!("Final delay: {:?}", throttle.get_delay());
println!("Last avg cycle time: {:?}", throttle.get_cycle_time());
assert!(throttle.get_cycle_time() > Duration::ZERO);
});
}
#[test]
fn test_throttle_initialization() {
let update_interval_cycles = 10;
let target_cycle_time = Duration::from_millis(75);
let throttle = LoopThrottle::new(target_cycle_time, update_interval_cycles, None);
assert_eq!(throttle.get_delay(), target_cycle_time);
assert_eq!(throttle.get_cycle_time(), target_cycle_time);
assert_eq!(throttle.total_cycles, 0);
}
#[test]
fn test_overflow_protection() {
block_on(async {
let target_cycle_time = Duration::from_micros(1);
let update_interval_cycles = 5;
let mut throttle = LoopThrottle::new(target_cycle_time, update_interval_cycles, None);
// Run many cycles to ensure total_cycles resets properly
for i in 0..50 {
throttle.sleep().await;
// Verify that total_cycles never exceeds update_interval_cycles
assert!(
throttle.total_cycles <= update_interval_cycles,
"Cycle {}: total_cycles ({}) exceeded update_interval_cycles ({})",
i,
throttle.total_cycles,
update_interval_cycles
);
}
});
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
pub mod compare_lists;
pub mod hasher_serializer;
pub mod hashing;
pub mod interpolation;
pub mod loop_trottle;
pub mod moving_time_window;
pub mod retry;
+12 -30
View File
@@ -11,56 +11,40 @@ pub trait DivideByCount {
impl DivideByCount for f64 {
fn divide_by_count(self, count: usize) -> Self {
self / (count as f64)
self / (count as Self)
}
}
impl DivideByCount for f32 {
fn divide_by_count(self, count: usize) -> Self {
self / (count as f32)
self / (count as Self)
}
}
impl DivideByCount for i32 {
fn divide_by_count(self, count: usize) -> Self {
self / (count as i32)
self / (count as Self)
}
}
impl DivideByCount for i64 {
fn divide_by_count(self, count: usize) -> Self {
self / (count as i64)
self / (count as Self)
}
}
impl DivideByCount for u32 {
fn divide_by_count(self, count: usize) -> Self {
self / (count as u32)
self / (count as Self)
}
}
impl DivideByCount for u64 {
fn divide_by_count(self, count: usize) -> Self {
self / (count as u64)
self / (count as Self)
}
}
/// A generic moving time window that works with numeric types.
///
/// # Examples
///
/// ```rust
/// use std::time::{Duration, Instant};
/// use control_core::helpers::moving_time_window::MovingTimeWindow;
///
/// let mut window = MovingTimeWindow::new(Duration::from_secs(10), 100);
/// window.update(1.5, Instant::now());
/// window.update(2.5, Instant::now());
///
/// let average = window.average();
/// println!("Average: {}", average);
/// ```
// Type aliases for common use cases
pub type F64Window = MovingTimeWindow<f64>;
pub type F32Window = MovingTimeWindow<f32>;
@@ -194,15 +178,14 @@ where
.samples
.iter()
.map(|(v, _)| *v)
.fold(None, |acc, val| match acc {
None => Some(val),
Some(current_max) => {
.fold(None, |acc, val| {
acc.map_or(Some(val), |current_max| {
if val > current_max {
Some(val)
} else {
Some(current_max)
}
}
})
})
.unwrap_or_default();
@@ -229,15 +212,14 @@ where
.samples
.iter()
.map(|(v, _)| *v)
.fold(None, |acc, val| match acc {
None => Some(val),
Some(current_min) => {
.fold(None, |acc, val| {
acc.map_or(Some(val), |current_min| {
if val < current_min {
Some(val)
} else {
Some(current_min)
}
}
})
})
.unwrap_or_default();
+113
View File
@@ -0,0 +1,113 @@
#[cfg(target_os = "linux")]
use libc;
use std::ffi::CString;
use std::io;
use std::str;
#[cfg(target_os = "linux")]
fn read_proc_interrupts() -> Result<String, io::Error> {
let path = CString::new("/proc/interrupts").unwrap();
// O_RDONLY
let fd = unsafe { libc::open(path.as_ptr(), libc::O_RDONLY) };
if fd < 0 {
return Err(io::Error::from_raw_os_error(-fd));
}
let mut buf: Vec<u8> = Vec::new();
let mut chunk = [0u8; 8192];
loop {
let n = unsafe { libc::read(fd, chunk.as_mut_ptr() as *mut _, chunk.len()) };
if n < 0 {
let e = io::Error::from_raw_os_error(-n as i32);
unsafe { libc::close(fd) };
return Err(e);
} else if n == 0 {
break;
} else {
buf.extend_from_slice(&chunk[..n as usize]);
}
}
unsafe { libc::close(fd) };
Ok(String::from_utf8_lossy(&buf).into_owned())
}
#[cfg(target_os = "linux")]
fn get_interface_irq(proc_content: &str, interface_name: &str) -> Option<u32> {
for line in proc_content.lines() {
if line.contains(interface_name) {
if let Some(colon_pos) = line.find(':') {
let head = &line[..colon_pos].trim();
// try parse head as integer IRQ number
if let Ok(irq) = head.parse::<u32>() {
return Some(irq);
}
}
}
}
None
}
/// Since kernel 3.0 it’s possible to use the /proc/irq/<IRQ-NUMBER>/smp_affinity_list
/// With comma seperated values
/// This function takes the irq identifier and writes the cpu string
/// into /proc/irq/irq_number/smp_affinity_list
#[cfg(target_os = "linux")]
fn set_irq_affinity_raw(irq: u32, cpu: &str) -> Result<(), io::Error> {
let path: String = format!("/proc/irq/{}/smp_affinity_list", irq);
let cpath = CString::new(path.clone()).unwrap();
// We want to completely overwrite the smp affinities, so that we guarentee execution on the specified cores
let file_descriptor = unsafe { libc::open(cpath.as_ptr(), libc::O_WRONLY) };
if file_descriptor < 0 {
tracing::info!("Permission denied to write: {}", path);
return Err(io::Error::new(
io::ErrorKind::PermissionDenied,
format!("failed to open {}: errno {}", path, -file_descriptor),
));
}
// convert to "raw bytes"
// cpu needs to be a string because we need the raw ascii code 48 = '0' and so on as bytes
let bytes = cpu.as_bytes();
let mut bytes_written_total = 0usize;
while bytes_written_total < bytes.len() {
let to_write = &bytes[bytes_written_total..];
let bytes_written = unsafe {
libc::write(
file_descriptor,
to_write.as_ptr() as *const _,
to_write.len(),
)
};
if bytes_written < 0 {
let e = io::Error::from_raw_os_error(-bytes_written as i32);
unsafe { libc::close(file_descriptor) };
return Err(e);
}
bytes_written_total += bytes_written as usize;
}
unsafe { libc::close(file_descriptor) };
Ok(())
}
/// This is used to make sure that a given irq handler runs on the expected cpu
/// On Realtime systems this is the make or break fix for certain usecases like ethercrab
/// On our machines the 99.99th percentile of cycle times was very bad ~5-11 ms while ethercat is supposed to be in the microseconds
/// After pinning the ethernet irq to the core that the ethercat code ran on 99.99th percentile went down to ~200us (microseconds)
/// Example input: irq_name: "eno1" , cpu: 2
/// Remember that cpu cores are counted from 0
#[cfg(target_os = "linux")]
pub fn set_irq_affinity(irq_name: &str, cpu: u32) -> Result<(), anyhow::Error> {
let proc_contents = read_proc_interrupts()?;
let irq = get_interface_irq(&proc_contents, irq_name);
if irq.is_none() {
return Err(anyhow::anyhow!("Couldnt find irq number!"));
}
let res = set_irq_affinity_raw(irq.unwrap(), &cpu.to_string());
if res.is_err() {
return Err(anyhow::anyhow!("Couldnt write affinity list!"));
} else {
return Ok(());
}
}
+6
View File
@@ -1,14 +1,20 @@
pub mod controllers;
pub mod converters;
pub mod downcast;
pub mod ethercat;
pub mod helpers;
pub mod irq_handling;
pub mod machines;
pub mod modbus;
pub mod realtime;
pub mod rest;
pub mod serial;
pub mod socketio;
pub mod transmission;
pub mod uom_extensions;
#[cfg(feature = "video-streaming")]
pub mod video_streaming;
#[macro_use]
extern crate uom;
+20 -1
View File
@@ -1,8 +1,27 @@
use serde_json::Value;
use smol::lock::Mutex;
use std::sync::Arc;
use crate::socketio::namespace::Namespace;
pub trait MachineApi {
fn api_mutate(&mut self, value: Value) -> Result<(), anyhow::Error>;
fn api_event_namespace(&mut self) -> &mut Namespace;
fn api_event_namespace(&mut self) -> Arc<Mutex<Namespace>>;
/// Returns a list of available video stream identifiers for this machine
#[cfg(feature = "video-streaming")]
fn api_video_streams(&self) -> Vec<String> {
Vec::new()
}
/// Get a video stream receiver for the specified stream ID
/// Returns None if the stream doesn't exist
#[cfg(feature = "video-streaming")]
fn api_get_video_stream(
&mut self,
stream_id: &str,
) -> Option<tokio::sync::broadcast::Receiver<Vec<u8>>> {
let _ = stream_id;
None
}
}
+208
View File
@@ -0,0 +1,208 @@
use crate::downcast::Downcast;
use crate::machines::identification::MachineIdentificationUnique;
use crate::machines::manager::MachineManager;
use crate::socketio::{event::GenericEvent, namespace::Namespace};
use serde::Serialize;
use smol::block_on;
use smol::lock::RwLock;
use std::sync::Arc;
use std::sync::Weak;
use super::Machine;
use anyhow::anyhow;
use smol::{channel::Sender, lock::Mutex};
use socketioxide::extract::SocketRef;
#[derive(Debug)]
pub enum MachineConnection<M: Machine + ?Sized>
where
Self: Sized,
{
Error(anyhow::Error),
Disconnected,
Connected(Arc<Mutex<M>>),
}
#[derive(Debug)]
pub struct MachineSlot<M: Machine + ?Sized>
where
Self: Sized,
{
pub machine_connection: MachineConnection<M>,
pub namespace: Arc<Mutex<Namespace>>,
}
pub type MachineConnectionGeneric = MachineConnection<dyn Machine>;
pub type MachineSlotGeneric = MachineSlot<dyn Machine>;
impl<M: Machine> Clone for MachineConnection<M> {
fn clone(&self) -> Self {
match self {
Self::Connected(m) => Self::Connected(m.clone()),
Self::Error(e) => Self::Error(anyhow!(e.to_string())),
Self::Disconnected => Self::Disconnected,
}
}
}
impl<M: Machine + ?Sized> MachineConnection<M> {
pub fn to_error(&self) -> Option<anyhow::Error> {
match self {
MachineConnection::Error(err) => Some(anyhow!(err.to_string())),
Self::Disconnected => Some(anyhow!("Machine is disconnected")),
_ => None,
}
}
pub fn to_machine(&self) -> Option<Arc<Mutex<M>>> {
match self {
Self::Connected(machine) => Some(machine.clone()),
_ => None,
}
}
}
impl<M: Machine + ?Sized> MachineSlot<M> {
pub fn new(socket_queue_tx: Sender<(SocketRef, Arc<GenericEvent>)>) -> Self {
let namespace = Namespace::new(socket_queue_tx);
Self {
machine_connection: MachineConnection::Disconnected,
namespace: Arc::new(Mutex::new(namespace)),
}
}
pub const fn is_connected(&self) -> bool {
matches!(self.machine_connection, MachineConnection::Connected(_))
}
}
pub trait CrossConnectableMachine<
F: CrossConnectableMachine<F, T>,
T: CrossConnectableMachine<T, F>,
>: Machine
{
fn get_cross_connection(&mut self) -> &mut MachineCrossConnection<F, T>;
}
#[derive(Debug)]
pub struct MachineCrossConnection<
F: CrossConnectableMachine<F, T>,
T: CrossConnectableMachine<T, F>,
> {
machine_manager: Weak<RwLock<MachineManager>>,
machine_identification_unique: MachineIdentificationUnique,
connected_machine: Weak<Mutex<MachineSlot<T>>>,
_make_compiler_happy: std::marker::PhantomData<F>, // This marks tells the typechecker, that we
// need F in our type arguemnts. We are ok with
// it being used only in a fake field. Without
// F being fixed, we would not be anble to implement
// reverse connecting and disconnecting properly,
// as the type on the other side would decay
// to an unknown type. See also https://github.com/qitechgmbh/control/pull/625#discussion_r2379566315
}
#[derive(Serialize, Debug, Clone, Default)]
pub struct MachineCrossConnectionState {
/// Connected Machine
pub machine_identification_unique: Option<MachineIdentificationUnique>,
pub is_available: bool,
}
impl<F: CrossConnectableMachine<F, T>, T: CrossConnectableMachine<T, F>>
MachineCrossConnection<F, T>
{
pub fn new(
manager: Weak<RwLock<MachineManager>>,
machine_identification_unique: &MachineIdentificationUnique,
) -> Self {
Self {
machine_manager: manager,
connected_machine: Weak::new(),
machine_identification_unique: machine_identification_unique.clone(),
_make_compiler_happy: std::marker::PhantomData,
}
}
pub fn set_connected_machine(
&mut self,
machine_identification_unique: &MachineIdentificationUnique,
) {
if let Some(machine_manager) = self.machine_manager.upgrade() {
let machine_manager = block_on(machine_manager.read());
let slot: Arc<Mutex<MachineSlotGeneric>> =
match machine_manager.get(&machine_identification_unique) {
Some(c) => c,
None => return,
};
let slot: Arc<Mutex<MachineSlot<T>>> = match Downcast::downcast(&slot) {
Ok(s) => s,
Err(_) => return,
};
self.connected_machine = Arc::downgrade(&slot);
} else {
panic!("The machine manager has died, cannot do anything at this point");
}
}
pub fn reverse_connect(&self) {
if let Some(slot) = self.connected_machine.upgrade() {
let slot = &mut slot.lock_blocking();
if let MachineConnection::Connected(machine) = &slot.machine_connection {
let mut machine = machine.lock_blocking();
let cross_connection = machine.get_cross_connection();
if !cross_connection.is_connected() {
cross_connection.set_connected_machine(&self.machine_identification_unique);
}
};
}
}
pub fn disconnect(&mut self) {
self.connected_machine = Weak::new();
}
pub fn reverse_disconnect(&mut self) {
if let Some(slot) = self.connected_machine.upgrade() {
let slot = slot.lock_blocking();
if let MachineConnection::Connected(machine) = &slot.machine_connection {
let mut machine = machine.lock_blocking();
let cross_connection = machine.get_cross_connection();
cross_connection.disconnect();
};
}
}
pub fn is_connected(&self) -> bool {
let arc = self.connected_machine.upgrade();
arc.is_some()
}
pub fn to_state(&self) -> MachineCrossConnectionState {
if let Some(slot) = self.connected_machine.upgrade() {
let connection = &slot.lock_blocking().machine_connection;
if let MachineConnection::Connected(machine) = connection {
let machine = machine.lock_blocking();
return MachineCrossConnectionState {
machine_identification_unique: Some(
machine.get_machine_identification_unique(),
),
is_available: true,
};
}
}
MachineCrossConnectionState {
machine_identification_unique: None,
is_available: false,
}
}
}
+11 -11
View File
@@ -12,7 +12,7 @@ pub struct MachineIdentificationUnique {
impl MachineIdentificationUnique {
/// Check if values are non-zero
pub fn is_valid(&self) -> bool {
pub const fn is_valid(&self) -> bool {
self.machine_identification.is_valid() && self.serial != 0
}
}
@@ -36,12 +36,12 @@ pub struct MachineIdentification {
impl MachineIdentification {
/// Check if values are non-zero
pub fn is_valid(&self) -> bool {
pub const fn is_valid(&self) -> bool {
self.vendor != 0 && self.machine != 0
}
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct DeviceMachineIdentification {
pub machine_identification_unique: MachineIdentificationUnique,
pub role: u16,
@@ -49,7 +49,7 @@ pub struct DeviceMachineIdentification {
impl DeviceMachineIdentification {
/// Check if values are non-zero
pub fn is_valid(&self) -> bool {
pub const fn is_valid(&self) -> bool {
self.machine_identification_unique.is_valid()
&& self
.machine_identification_unique
@@ -59,7 +59,7 @@ impl DeviceMachineIdentification {
}
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct DeviceIdentification {
pub device_machine_identification: Option<DeviceMachineIdentification>,
pub device_hardware_identification: DeviceHardwareIdentification,
@@ -67,14 +67,14 @@ pub struct DeviceIdentification {
impl From<DeviceIdentificationIdentified> for DeviceIdentification {
fn from(value: DeviceIdentificationIdentified) -> Self {
DeviceIdentification {
Self {
device_machine_identification: Some(value.device_machine_identification),
device_hardware_identification: value.device_hardware_identification,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct DeviceIdentificationIdentified {
pub device_machine_identification: DeviceMachineIdentification,
pub device_hardware_identification: DeviceHardwareIdentification,
@@ -90,24 +90,24 @@ impl TryFrom<DeviceIdentification> for DeviceIdentificationIdentified {
module_path!()
))?;
Ok(DeviceIdentificationIdentified {
Ok(Self {
device_machine_identification,
device_hardware_identification: value.device_hardware_identification,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub enum DeviceHardwareIdentification {
Ethercat(DeviceHardwareIdentificationEthercat),
Serial(DeviceHardwareIdentificationSerial),
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct DeviceHardwareIdentificationEthercat {
pub subdevice_index: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct DeviceHardwareIdentificationSerial {
pub path: String,
}
+113 -36
View File
@@ -1,3 +1,9 @@
use super::{
Machine,
identification::{DeviceIdentification, DeviceIdentificationIdentified},
new::MachineNewHardwareSerial,
registry::MachineRegistry,
};
use smol::{
channel::Sender,
lock::{Mutex, RwLock},
@@ -6,26 +12,30 @@ use socketioxide::extract::SocketRef;
use crate::{
machines::{
connection::{
MachineConnection, MachineConnectionGeneric, MachineSlot, MachineSlotGeneric,
},
identification::MachineIdentificationUnique,
new::{MachineNewHardware, MachineNewHardwareEthercat, MachineNewParams},
},
serial::SerialDevice,
socketio::event::GenericEvent,
};
use std::{collections::HashMap, sync::Arc};
use super::{
Machine,
identification::{DeviceIdentification, DeviceIdentificationIdentified},
new::MachineNewHardwareSerial,
registry::MachineRegistry,
use std::{
collections::HashMap,
sync::{Arc, Weak},
};
#[derive(Debug)]
pub struct MachineManager {
pub ethercat_machines:
HashMap<MachineIdentificationUnique, Result<Box<Mutex<dyn Machine>>, anyhow::Error>>,
pub serial_machines:
HashMap<MachineIdentificationUnique, Result<Box<Mutex<dyn Machine>>, anyhow::Error>>,
pub ethercat_machines: HashMap<MachineIdentificationUnique, Arc<Mutex<MachineSlotGeneric>>>,
pub serial_machines: HashMap<MachineIdentificationUnique, Arc<Mutex<MachineSlotGeneric>>>,
}
impl Default for MachineManager {
fn default() -> Self {
Self::new()
}
}
impl MachineManager {
@@ -42,10 +52,8 @@ impl MachineManager {
machine_registry: &MachineRegistry,
hardware: &MachineNewHardwareEthercat,
socket_queue_tx: Sender<(SocketRef, Arc<GenericEvent>)>,
machine_manager: Weak<RwLock<Self>>,
) {
// empty ethercat machines
self.ethercat_machines.clear();
// group devices by machine device identification
let device_grouping_result = group_devices_by_identification(device_identifications);
@@ -59,33 +67,59 @@ impl MachineManager {
// iterate over all identified device groups but ignore unaffected machines
for device_group in device_grouping_result.device_groups.iter() {
// get the machine identification
let machine_identification = match device_group.first() {
Some(device_identification) => &device_identification.device_machine_identification,
None => continue, // Skip this group if empty
};
let machine_identification_unique: MachineIdentificationUnique =
match device_group.first() {
Some(device_identification) => device_identification
.device_machine_identification
.machine_identification_unique
.clone(),
None => continue, // Skip this group if empty
};
let slot =
self.get_or_create_slot(socket_queue_tx.clone(), machine_identification_unique);
let mut slot = slot.lock_blocking();
// create the machine
let new_machine = machine_registry.new_machine(&MachineNewParams {
device_group,
hardware: &machine_new_hardware,
socket_queue_tx: socket_queue_tx.clone(),
machine_manager: machine_manager.clone(),
namespace: slot.namespace.clone(),
});
// insert the machine into the ethercat machines map
self.ethercat_machines.insert(
machine_identification.machine_identification_unique.clone(),
new_machine,
);
slot.machine_connection = match new_machine {
Err(err) => MachineConnectionGeneric::Error(err),
Ok(machine) => MachineConnectionGeneric::Connected(machine),
};
}
}
fn get_or_create_slot(
&mut self,
socket_queue_tx: Sender<(SocketRef, Arc<GenericEvent>)>,
machine_identification: MachineIdentificationUnique,
) -> Arc<Mutex<MachineSlotGeneric>> {
if let Some(slot) = self.get(&machine_identification) {
return slot;
}
let slot = Arc::new(Mutex::new(MachineSlot::new(socket_queue_tx)));
self.ethercat_machines
.insert(machine_identification, slot.clone());
return slot;
}
pub fn get(
&self,
machine_identification: &MachineIdentificationUnique,
) -> Option<&Result<Box<Mutex<dyn Machine>>, anyhow::Error>> {
) -> Option<Arc<Mutex<MachineSlotGeneric>>> {
self.ethercat_machines
.get(machine_identification)
.or_else(|| self.serial_machines.get(machine_identification))
.map(|x| x.clone())
}
pub fn add_serial_device(
@@ -94,6 +128,7 @@ impl MachineManager {
device: Arc<RwLock<dyn SerialDevice>>,
machine_registry: &MachineRegistry,
socket_queue_tx: Sender<(SocketRef, Arc<GenericEvent>)>,
machine_manager: Weak<RwLock<Self>>,
) {
let hardware = MachineNewHardwareSerial { device };
@@ -103,20 +138,28 @@ impl MachineManager {
.try_into()
.expect("Serial devices always have machine identification");
let machine_identification: MachineIdentificationUnique = device_identification_identified
.device_machine_identification
.machine_identification_unique
.clone();
let slot = self.get_or_create_slot(socket_queue_tx.clone(), machine_identification);
let mut slot = slot.lock_blocking();
let new_machine = machine_registry.new_machine(&MachineNewParams {
device_group: &vec![device_identification_identified.clone()],
hardware: &MachineNewHardware::Serial(&hardware),
socket_queue_tx,
machine_manager: machine_manager.clone(),
namespace: slot.namespace.clone(),
});
tracing::info!("Adding serial machine {:?}", new_machine);
slot.machine_connection = match new_machine {
Err(err) => MachineConnectionGeneric::Error(err),
Ok(machine) => MachineConnectionGeneric::Connected(machine),
};
self.serial_machines.insert(
device_identification_identified
.device_machine_identification
.machine_identification_unique,
new_machine,
);
tracing::info!("Adding serial machine {:?}", slot);
}
pub fn remove_serial_device(&mut self, device_identification: &DeviceIdentification) {
@@ -131,11 +174,45 @@ impl MachineManager {
device_identification_identified
);
self.serial_machines.remove(
&device_identification_identified
.device_machine_identification
.machine_identification_unique,
);
let machine_identification_unique = &device_identification_identified
.device_machine_identification
.machine_identification_unique;
if let Some(slot) = self.serial_machines.get(machine_identification_unique) {
let mut slot = slot.lock_blocking();
slot.machine_connection = MachineConnection::Disconnected;
}
}
pub fn get_ethercat_weak(
&self,
machine_identification: &MachineIdentificationUnique,
) -> Option<Weak<Mutex<dyn Machine>>> {
self.get_weak(&self.ethercat_machines, machine_identification)
}
pub fn get_serial_weak(
&self,
machine_identification: &MachineIdentificationUnique,
) -> Option<Weak<Mutex<dyn Machine>>> {
self.get_weak(&self.serial_machines, machine_identification)
}
fn get_weak(
&self,
machines: &HashMap<MachineIdentificationUnique, Arc<Mutex<MachineSlotGeneric>>>,
machine_identification: &MachineIdentificationUnique,
) -> Option<Weak<Mutex<dyn Machine>>> {
let slot = machines.get(machine_identification).clone();
return slot.and_then(|slot| {
let connection = &slot.lock_blocking().machine_connection;
match connection {
MachineConnectionGeneric::Error(_) => None,
MachineConnectionGeneric::Disconnected => None,
MachineConnectionGeneric::Connected(machine) => Some(Arc::downgrade(&machine)),
}
});
}
}
+9 -7
View File
@@ -1,22 +1,25 @@
use std::collections::HashMap;
use std::sync::Arc;
use smol::lock::Mutex;
use super::{Machine, identification::MachineIdentificationUnique, manager::MachineManager};
use crate::machines::connection::MachineSlotGeneric;
use super::{identification::MachineIdentificationUnique, manager::MachineManager};
pub enum MachineManagerIter<'a> {
EthercatMachines {
iter: std::collections::hash_map::Iter<
'a,
MachineIdentificationUnique,
Result<Box<Mutex<dyn Machine>>, anyhow::Error>,
Arc<Mutex<MachineSlotGeneric>>,
>,
},
SerialMachines {
iter: std::collections::hash_map::Iter<
'a,
MachineIdentificationUnique,
Result<Box<Mutex<dyn Machine>>, anyhow::Error>,
Arc<Mutex<MachineSlotGeneric>>,
>,
},
Done,
@@ -24,14 +27,13 @@ pub enum MachineManagerIter<'a> {
pub struct MachineManagerIterator<'a> {
iter: MachineManagerIter<'a>,
serial_machines:
&'a HashMap<MachineIdentificationUnique, Result<Box<Mutex<dyn Machine>>, anyhow::Error>>,
serial_machines: &'a HashMap<MachineIdentificationUnique, Arc<Mutex<MachineSlotGeneric>>>,
}
impl<'a> Iterator for MachineManagerIterator<'a> {
type Item = (
&'a MachineIdentificationUnique,
&'a Result<Box<Mutex<dyn Machine>>, anyhow::Error>,
&'a Arc<Mutex<MachineSlotGeneric>>,
);
fn next(&mut self) -> Option<Self::Item> {
@@ -71,7 +73,7 @@ impl<'a> Iterator for MachineManagerIterator<'a> {
impl MachineManager {
// Returns an iterator over all machines (both ethercat and serial)
pub fn iter(&self) -> MachineManagerIterator {
pub fn iter(&self) -> MachineManagerIterator<'_> {
MachineManagerIterator {
iter: MachineManagerIter::EthercatMachines {
iter: self.ethercat_machines.iter(),
+13 -3
View File
@@ -1,13 +1,23 @@
use crate::machines::new::MachineAct;
use api::MachineApi;
use new::MachineNewTrait;
use std::any::Any;
use std::fmt::Debug;
use crate::machines::{
api::MachineApi, identification::MachineIdentificationUnique, new::MachineAct,
};
pub mod api;
pub mod connection;
pub mod identification;
pub mod manager;
pub mod manager_iter;
pub mod new;
pub mod registry;
pub trait Machine: MachineNewTrait + MachineApi + MachineAct + Any + Send + Sync + Debug {}
pub trait Machine: MachineAct + MachineNewTrait + MachineApi + Any + Debug + Send + Sync {
fn get_machine_identification_unique(&self) -> MachineIdentificationUnique;
}
pub trait AnyGetters: Any {
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
}
+29 -7
View File
@@ -1,4 +1,8 @@
use crate::serial::SerialDevice;
use crate::{
machines::{identification::MachineIdentificationUnique, manager::MachineManager},
serial::SerialDevice,
socketio::namespace::Namespace,
};
use super::identification::DeviceIdentificationIdentified;
use anyhow::Error;
@@ -6,22 +10,26 @@ use ethercat_hal::{
devices::EthercatDevice, helpers::ethercrab_types::EthercrabSubDevicePreoperational,
};
use ethercrab::{SubDevice, SubDeviceRef};
use smol::{channel::Sender, lock::RwLock};
use smol::{
channel::Sender,
lock::{Mutex, RwLock},
};
use socketioxide::extract::SocketRef;
use std::{pin::Pin, sync::Arc, time::Instant};
use std::{
sync::{Arc, Weak},
time::Instant,
};
use crate::socketio::event::GenericEvent;
pub trait MachineNewTrait {
fn new<'maindevice, 'subdevices>(
params: &MachineNewParams<'maindevice, 'subdevices, '_, '_, '_, '_, '_>,
) -> Result<Self, Error>
fn new(params: &MachineNewParams<'_, '_, '_, '_, '_, '_, '_>) -> Result<Self, Error>
where
Self: Sized;
}
pub trait MachineAct {
fn act(&mut self, now: Instant) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>;
fn act(&mut self, now: Instant);
}
pub struct MachineNewParams<
@@ -47,6 +55,20 @@ pub struct MachineNewParams<
'machine_new_hardware_serial,
>,
pub socket_queue_tx: Sender<(SocketRef, Arc<GenericEvent>)>,
pub machine_manager: Weak<RwLock<MachineManager>>,
pub namespace: Arc<Mutex<Namespace>>,
}
impl MachineNewParams<'_, '_, '_, '_, '_, '_, '_> {
pub fn get_machine_identification_unique(&self) -> MachineIdentificationUnique {
self.device_group
.first()
.expect("device group must have at least one device")
.device_machine_identification
.machine_identification_unique
.clone()
}
}
pub enum MachineNewHardware<
+11 -5
View File
@@ -1,15 +1,21 @@
use super::{Machine, identification::MachineIdentification, new::MachineNewParams};
use anyhow::Error;
use smol::lock::Mutex;
use std::{any::TypeId, collections::HashMap};
use std::{any::TypeId, collections::HashMap, sync::Arc};
pub type MachineNewClosure =
Box<dyn Fn(&MachineNewParams) -> Result<Box<Mutex<dyn Machine>>, Error> + Send + Sync>;
Box<dyn Fn(&MachineNewParams) -> Result<Arc<Mutex<dyn Machine>>, Error> + Send + Sync>;
pub struct MachineRegistry {
type_map: HashMap<TypeId, (MachineIdentification, MachineNewClosure)>,
}
impl Default for MachineRegistry {
fn default() -> Self {
Self::new()
}
}
impl MachineRegistry {
pub fn new() -> Self {
Self {
@@ -24,10 +30,10 @@ impl MachineRegistry {
self.type_map.insert(
TypeId::of::<T>(),
(
machine_identficiation,
machine_identficiation.clone(),
// create a machine construction closure
Box::new(|machine_new_params| {
Ok(Box::new(Mutex::new(T::new(machine_new_params)?)))
Ok(Arc::new(Mutex::new(T::new(machine_new_params)?)))
}),
),
);
@@ -36,7 +42,7 @@ impl MachineRegistry {
pub fn new_machine(
&self,
machine_new_params: &MachineNewParams,
) -> Result<Box<Mutex<dyn Machine>>, anyhow::Error> {
) -> Result<Arc<Mutex<dyn Machine>>, anyhow::Error> {
// get machiine identification
let device_identification =
&machine_new_params
+31 -39
View File
@@ -2,10 +2,10 @@ pub mod modbus_serial_interface;
use anyhow::Error;
use crc::{CRC_16_MODBUS, Crc};
use serial;
use serialport::SerialPort;
use std::time::Duration;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ParityType {
Even,
Odd,
@@ -62,17 +62,17 @@ impl From<ModbusExceptionCode> for u8 {
impl From<u8> for ModbusExceptionCode {
fn from(value: u8) -> Self {
match value {
0 => ModbusExceptionCode::None,
1 => ModbusExceptionCode::IllegalFunction,
2 => ModbusExceptionCode::IllegalDataAddress,
3 => ModbusExceptionCode::IllegalDataValue,
4 => ModbusExceptionCode::SlaveDeviceFailure,
5 => ModbusExceptionCode::Acknowledge,
6 => ModbusExceptionCode::SlaveDeviceBusy,
8 => ModbusExceptionCode::MemoryParityError,
10 => ModbusExceptionCode::GatewayPathUnavailable,
11 => ModbusExceptionCode::GatewayTargetDeviceFailedToRespond,
other => ModbusExceptionCode::Unknown(other),
0 => Self::None,
1 => Self::IllegalFunction,
2 => Self::IllegalDataAddress,
3 => Self::IllegalDataValue,
4 => Self::SlaveDeviceFailure,
5 => Self::Acknowledge,
6 => Self::SlaveDeviceBusy,
8 => Self::MemoryParityError,
10 => Self::GatewayPathUnavailable,
11 => Self::GatewayTargetDeviceFailedToRespond,
other => Self::Unknown(other),
}
}
}
@@ -97,10 +97,10 @@ impl TryFrom<u8> for ModbusFunctionCode {
fn try_from(value: u8) -> Result<Self, Self::Error> {
match value {
0x03 => Ok(ModbusFunctionCode::ReadHoldingRegister),
0x04 => Ok(ModbusFunctionCode::ReadInputRegister),
0x06 => Ok(ModbusFunctionCode::PresetHoldingRegister),
0x08 => Ok(ModbusFunctionCode::DiagnoseFunction),
0x03 => Ok(Self::ReadHoldingRegister),
0x04 => Ok(Self::ReadInputRegister),
0x06 => Ok(Self::PresetHoldingRegister),
0x08 => Ok(Self::DiagnoseFunction),
_ => Err(anyhow::anyhow!("Error: Modbus Function Code doesnt exist!")),
}
}
@@ -119,7 +119,7 @@ impl From<ModbusFunctionCode> for u8 {
impl From<ModbusRequest> for Vec<u8> {
fn from(request: ModbusRequest) -> Self {
let mut buffer = Vec::new();
let mut buffer = Self::new();
buffer.push(request.slave_id);
buffer.push(request.function_code.into()); // convert functioncode into u8 and push it
@@ -132,7 +132,7 @@ impl From<ModbusRequest> for Vec<u8> {
// convert u16 value to le_bytes and add it to the end of the frame
buffer.extend_from_slice(&result_crc.to_le_bytes());
return buffer;
buffer
}
}
/// Reads data from a Modbus device via a serial port.
@@ -143,9 +143,7 @@ impl From<ModbusRequest> for Vec<u8> {
/// # Returns
/// A `Result` containing an `Option` with the raw Modbus response as a `Vec<u8>` if successful,
/// or `None` if the response is invalid or an error occurs.
pub fn receive_data_modbus(
port: &mut dyn serial::SerialPort,
) -> Result<Option<Vec<u8>>, anyhow::Error> {
pub fn receive_data_modbus(port: &mut dyn SerialPort) -> Result<Option<Vec<u8>>, anyhow::Error> {
let mut buf: [u8; 256] = [0; 256];
let data_length = port.read(&mut buf)?;
if data_length == 0 {
@@ -155,7 +153,7 @@ pub fn receive_data_modbus(
}
/// Computes Modbus CRC-16 using `crc` crate.
pub fn modbus_crc16(data: &[u8]) -> u16 {
pub const fn modbus_crc16(data: &[u8]) -> u16 {
let modbus: Crc<u16> = Crc::<u16>::new(&CRC_16_MODBUS);
modbus.checksum(data)
}
@@ -206,23 +204,17 @@ fn extract_crc(raw_data: &Vec<u8>) -> Result<u16, Error> {
}
impl TryFrom<Vec<u8>> for ModbusResponse {
type Error = anyhow::Error;
fn try_from(value: Vec<u8>) -> Result<ModbusResponse, Error> {
let crc = match extract_crc(&value) {
Ok(crc_value) => crc_value,
Err(err) => return Err(err),
};
fn try_from(value: Vec<u8>) -> Result<Self, Error> {
let crc = extract_crc(&value)?;
let function_code_res = ModbusFunctionCode::try_from(value[1]);
let function_code = match function_code_res {
Ok(code) => code,
Err(err) => return Err(err),
};
let function_code = function_code_res?;
Ok(ModbusResponse {
Ok(Self {
slave_id: value[0],
function_code: function_code,
function_code,
data: value[2..value.len() - 2].to_vec(), // get data without the crc
crc: crc,
crc,
})
}
}
@@ -234,23 +226,23 @@ impl TryFrom<Vec<u8>> for ModbusResponse {
/// machine_operation_delay_nano: Delay for the given operation in nanoseconds as specified by the slaves datasheet (example: mitsubishi csfr84 has 12ms for read write in RAM)
/// baudrate: bits per second
/// message_size: size of original message in bytes
pub fn calculate_modbus_rtu_timeout(
pub const fn calculate_modbus_rtu_timeout(
bits: u8,
machine_operation_delay_nano: Duration,
baudrate: u32,
message_size: usize,
) -> Duration {
let nanoseconds_per_bit: u64 = (1000000 / baudrate) as u64;
let nanoseconds_per_byte: u64 = bits as u64 * nanoseconds_per_bit as u64;
let nanoseconds_per_byte: u64 = bits as u64 * nanoseconds_per_bit;
let transmission_timeout: u64 = nanoseconds_per_byte * message_size as u64;
let silent_time: u64 = (nanoseconds_per_byte * (35)) / 10 as u64; // silent_time is 3.5x of character length,which is 11 bit for 8E1
let silent_time: u64 = (nanoseconds_per_byte * (35)) / 10_u64; // silent_time is 3.5x of character length,which is 11 bit for 8E1
let mut full_timeout: u64 = transmission_timeout;
full_timeout += machine_operation_delay_nano.as_nanos() as u64;
full_timeout += silent_time;
return Duration::from_nanos(full_timeout);
Duration::from_nanos(full_timeout)
}
#[cfg(test)]
@@ -66,7 +66,7 @@ impl ModbusSerialInterface {
}
}
pub fn is_initialized(&self) -> bool {
pub const fn is_initialized(&self) -> bool {
!matches!(self.state, State::Uninitialized)
}
@@ -199,7 +199,7 @@ impl ModbusSerialInterface {
Some(Duration::from_nanos(total_timeout))
}
pub fn get_response(&self) -> Option<&ModbusResponse> {
pub const fn get_response(&self) -> Option<&ModbusResponse> {
self.response.as_ref()
}
+8 -8
View File
@@ -1,7 +1,7 @@
use tracing::debug;
use tracing::error;
#[cfg(unix)]
#[cfg(target_os = "linux")]
/// Makes the current thread a real-time thread using the PREEMPT_RT capabilities of Linux.
///
/// This function configures the current thread with real-time scheduling properties by:
@@ -47,7 +47,7 @@ use tracing::error;
///
/// - `Ok(())` if the real-time priority was successfully set
/// - `Err` with the error message if setting the priority failed
#[cfg(unix)]
#[cfg(target_os = "linux")]
pub fn set_realtime_priority() -> Result<(), anyhow::Error> {
use anyhow::anyhow;
use libc::{SCHED_FIFO, pthread_setschedparam, sched_param};
@@ -84,9 +84,9 @@ pub fn set_realtime_priority() -> Result<(), anyhow::Error> {
Ok(())
}
#[cfg(not(unix))]
#[cfg(not(target_os = "linux"))]
pub fn set_realtime_priority() -> Result<(), anyhow::Error> {
log::error!("This platform does not support realtime threads");
tracing::error!("This platform does not support realtime threads");
Ok(())
}
@@ -137,7 +137,7 @@ pub fn set_realtime_priority() -> Result<(), anyhow::Error> {
/// # How it works
///
/// [Rest of documentation as before...]
#[cfg(unix)]
#[cfg(target_os = "linux")]
pub fn lock_memory() -> Result<(), Box<dyn std::error::Error>> {
use libc::{MCL_FUTURE, mlockall};
@@ -154,13 +154,13 @@ pub fn lock_memory() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}
#[cfg(not(unix))]
#[cfg(not(target_os = "linux"))]
pub fn lock_memory() -> Result<(), Box<dyn std::error::Error>> {
log::error!("This platform does not support memory locking");
tracing::error!("This platform does not support memory locking");
Ok(())
}
pub fn set_core_affinity_first_core(core_id: usize) -> Result<(), anyhow::Error> {
pub fn set_core_affinity(core_id: usize) -> Result<(), anyhow::Error> {
let cores = core_affinity::get_core_ids().unwrap_or_default();
let core = cores.get(core_id);
if let Some(core) = core {
+18 -2
View File
@@ -11,13 +11,13 @@ pub struct MutationResponse {
}
impl MutationResponse {
pub fn success() -> Self {
pub const fn success() -> Self {
Self {
success: true,
error: None,
}
}
pub fn error(error: String) -> Self {
pub const fn error(error: String) -> Self {
Self {
success: false,
error: Some(error),
@@ -33,3 +33,19 @@ where
pub machine_identification_unique: MachineIdentificationUnique,
pub data: T,
}
#[derive(Debug, serde::Deserialize)]
pub struct MachineVideoStreamListBody {
pub machine_identification_unique: MachineIdentificationUnique,
}
#[derive(Debug, serde::Deserialize)]
pub struct MachineVideoStreamBody {
pub machine_identification_unique: MachineIdentificationUnique,
pub stream_id: String,
}
#[derive(Debug, Serialize)]
pub struct VideoStreamListResponse {
pub streams: Vec<String>,
}
+1 -3
View File
@@ -5,7 +5,6 @@ use std::fmt::Debug;
use crate::machines::identification::DeviceIdentification;
pub mod panic;
pub mod registry;
pub mod serial_detection;
@@ -25,10 +24,9 @@ pub trait SerialDeviceThread {
pub struct SerialDeviceNewParams {
pub path: String,
pub device_thread_panic_tx: smol::channel::Sender<(String, anyhow::Error)>,
}
#[derive(PartialEq, Clone, Debug)]
#[derive(PartialEq, Eq, Clone, Debug, Hash)]
pub struct SerialDeviceIdentification {
pub vendor_id: u16,
pub product_id: u16,
-52
View File
@@ -1,52 +0,0 @@
use smol::channel::Sender;
/// Device-level panic handler for individual device crashes
/// Sends device identifier and error information for cleanup
/// Used by serial devices and other individual components that need to be removed on panic
pub fn send_serial_device_panic<T>(
device_identifier: T,
thread_panic_tx: Sender<(T, anyhow::Error)>,
) where
T: Send + Sync + Clone + 'static,
{
// Ensure backtrace is enabled for panics
if std::env::var("RUST_BACKTRACE").is_err() {
unsafe {
std::env::set_var("RUST_BACKTRACE", "full");
}
}
let device_id_clone = device_identifier.clone();
std::panic::set_hook(Box::new(move |panic_info| {
let thread_name = std::thread::current()
.name()
.unwrap_or("unnamed")
.to_string();
let location = panic_info.location().map_or("unknown".to_string(), |loc| {
format!("{}:{}:{}", loc.file(), loc.line(), loc.column())
});
let message = panic_info
.payload()
.downcast_ref::<&str>()
.unwrap_or(&"Box<dyn Any>")
.to_string();
let panic_message = format!(
"Device panicked in thread '{}' at {}: {}",
thread_name, location, message
);
// Send device panic info through channel
smol::block_on(async {
let _ = thread_panic_tx
.send((
device_id_clone.clone(),
anyhow::anyhow!("{}", panic_message),
))
.await;
});
// Note: We don't call old_hook to avoid duplicate logging
// All logging is handled in the main thread when receiving panic details
}));
}
+6
View File
@@ -20,6 +20,12 @@ pub struct SerialDeviceRegistry {
pub type_map: HashMap<TypeId, (SerialDeviceIdentification, SerialDeviceNewClosure)>,
}
impl Default for SerialDeviceRegistry {
fn default() -> Self {
Self::new()
}
}
impl SerialDeviceRegistry {
pub fn new() -> Self {
Self {
+49 -154
View File
@@ -7,175 +7,70 @@
*/
use serialport::{SerialPortInfo, SerialPortType, UsbPortInfo};
use smol::{
channel::{Receiver, Sender, unbounded},
lock::RwLock,
};
use std::{collections::HashMap, sync::Arc};
use std::collections::HashMap;
use crate::{
helpers::compare_lists::compare_lists, machines::identification::DeviceIdentification,
};
use super::SerialDeviceIdentification;
/// Handles scanning and caching of connected USB serial devices.
pub struct SerialDetection {}
use super::{
SerialDevice, SerialDeviceIdentification, SerialDeviceNewParams, registry::SerialDeviceRegistry,
};
pub struct SerialDetection<'serialdeviceregistry> {
pub serial_device_registry: &'serialdeviceregistry SerialDeviceRegistry,
pub ports: HashMap<
String,
(
UsbPortInfo,
DeviceIdentification,
Arc<RwLock<dyn SerialDevice>>,
),
>,
pub device_removal_signal_rx: Receiver<(String, anyhow::Error)>,
pub device_removal_signal_tx: Sender<(String, anyhow::Error)>,
}
impl<'serialdeviceregistry> SerialDetection<'serialdeviceregistry> {
pub fn new(serial_device_registry: &'serialdeviceregistry SerialDeviceRegistry) -> Self {
let (device_removal_signal_tx, device_removal_signal_rx) =
unbounded::<(String, anyhow::Error)>();
SerialDetection {
serial_device_registry,
ports: HashMap::new(),
device_removal_signal_rx,
device_removal_signal_tx,
impl SerialDetection {
/// Returns all serial ports on the system (minus macOS "cu" noise).
fn get_ports() -> Vec<SerialPortInfo> {
match serialport::available_ports() {
Ok(ports) => ports
.into_iter()
.filter(|port| !port.port_name.contains("cu"))
.collect(),
Err(_) => Vec::new(),
}
}
/*
*@return: Option::None if there are no available ports on device
*@return: Option::Some(Vec) with all available ports
*
*@description: detects all available ports and returns them as list
*/
fn get_ports() -> Vec<SerialPortInfo> {
let all = match serialport::available_ports() {
Ok(ports) => ports,
Err(_) => return Vec::new(),
};
// exclude ports that contai "cu" in their name
all.into_iter()
.filter(|port| !port.port_name.contains("cu"))
.collect::<Vec<_>>()
}
/* @param: port_list -> list of available ports
*
* @return: Vec<(String, UsbPortInfo)> -> list of ports with their names and usb information
*
* @description: This function extracts the USB serial devices from the given list of ports.
*/
fn extract_usb_serial_devices(
&self,
port_list: Vec<SerialPortInfo>,
) -> Vec<(String, UsbPortInfo)> {
let mut usb_ports: Vec<(String, UsbPortInfo)> = Vec::new();
/// Extracts only USB serial devices from the port list.
fn extract_usb_serial_devices(port_list: Vec<SerialPortInfo>) -> HashMap<String, UsbPortInfo> {
let mut map = HashMap::new();
for port in port_list {
match &port.port_type {
SerialPortType::UsbPort(usb_info) => {
usb_ports.push((port.port_name.to_string(), usb_info.clone()));
}
_ => {}
};
if let SerialPortType::UsbPort(usb_info) = port.port_type {
map.insert(port.port_name, usb_info);
}
}
return usb_ports;
map
}
pub async fn check_ports(&mut self) -> CheckPortsResult {
// get available ports
/// Scans for connected USB serial devices and updates the internal map.
/// Returns a clone of the map for quick access.
pub fn detect_devices() -> HashMap<String, UsbPortInfo> {
let ports = Self::get_ports();
// extract all ports that are usb ports
let usb_ports = self.extract_usb_serial_devices(ports);
let last_usb_ports = self
.ports
.iter()
.map(|last_usb_port| (last_usb_port.0.clone(), last_usb_port.1.0.clone()))
.collect::<Vec<_>>();
let usb_ports_diff = compare_lists(&last_usb_ports, &usb_ports);
let mut result = CheckPortsResult {
added: Vec::new(),
removed: Vec::new(),
};
// reamove ports
for removed in usb_ports_diff.removed {
if let Some((_, device_identification, _)) = self.ports.remove(&removed.0) {
result.removed.push(device_identification);
}
tracing::trace!("Removed port: {}", removed.0);
}
// add new ports
for added in usb_ports_diff.added {
// add the port to the list
let serial_device_identification = SerialDeviceIdentification {
vendor_id: added.1.vid,
product_id: added.1.pid,
};
let device_result = self.serial_device_registry.new_serial_device(
&SerialDeviceNewParams {
path: added.0.clone(),
device_thread_panic_tx: self.device_removal_signal_tx.clone(),
},
&serial_device_identification,
);
// only if created device driver sucessfully
if let Ok((device_identification, device)) = device_result {
// add the device to the ports list
self.ports.insert(
added.0.clone(),
(
added.1.clone(),
device_identification.clone(),
device.clone(),
),
);
// add to result list
result.added.push((device_identification, device.clone()));
tracing::trace!("Added port: {}", added.0);
}
}
result
let usb_devices = Self::extract_usb_serial_devices(ports);
usb_devices
}
pub async fn check_remove_signals(&mut self) -> Vec<DeviceIdentification> {
let mut removed_signals: Vec<DeviceIdentification> = Vec::new();
match self.device_removal_signal_rx.try_recv() {
Ok((path, error)) => {
// remove the device when the tuple positon 1 equals signal
if let Some(info) = self.ports.get(&path.clone()) {
removed_signals.push(info.1.clone());
};
self.ports.remove(&path);
pub fn device_port_exists(device_path: &str) -> bool {
let ports = Self::get_ports();
return ports.iter().any(|p| p.port_name == device_path);
}
tracing::trace!("Removed device: {:?}: {}", path, error);
pub fn device_id_exists(sdevid: SerialDeviceIdentification) -> bool {
let ports = Self::get_ports();
for port in ports {
if let SerialPortType::UsbPort(usb_info) = port.port_type {
if usb_info.vid == sdevid.vendor_id && usb_info.pid == sdevid.product_id {
return true;
}
}
Err(_) => {}
}
removed_signals
return false;
}
pub fn get_path_by_id(
sdevid: SerialDeviceIdentification,
map: HashMap<String, UsbPortInfo>,
) -> Option<String> {
for (port, usbport) in map.iter() {
if usbport.vid == sdevid.vendor_id && usbport.pid == sdevid.product_id {
return Some(port.clone());
}
}
return None;
}
}
#[derive(Debug)]
pub struct CheckPortsResult {
pub added: Vec<(DeviceIdentification, Arc<RwLock<dyn SerialDevice>>)>,
pub removed: Vec<DeviceIdentification>,
}
+4
View File
@@ -21,6 +21,10 @@ impl std::fmt::Debug for GenericEvent {
}
}
pub trait BuildEvent: Serialize + Send + Sync + Clone {
fn build(&self) -> Event<Self>;
}
#[derive(Debug, Clone, Serialize)]
pub struct Event<T>
where
+9 -14
View File
@@ -30,7 +30,7 @@ impl Namespace {
#[instrument(skip_all)]
pub fn subscribe(&mut self, socket: SocketRef) {
// add the socket to the list
self.sockets.push(socket.clone());
self.sockets.push(socket);
}
/// Removes a socket from the namespace.
@@ -76,12 +76,12 @@ impl Namespace {
// Sort by event count (ascending - lowest count first)
event_groups.sort_by(|a, b| a.1.len().cmp(&b.1.len()));
tracing::info!("reemit: {:?}", self.events);
// Emit events in order of lowest count first
for (_event_name, events) in event_groups {
for event in events {
// Send to global queue instead of per-socket queue
self.send_to_queue(&socket, &event, "reemit");
self.send_to_queue(&socket, event, "reemit");
}
}
}
@@ -97,13 +97,10 @@ impl Namespace {
fn cache(
&mut self,
event: Arc<GenericEvent>,
buffer_fn: &Box<dyn Fn(&mut Vec<Arc<GenericEvent>>, &Arc<GenericEvent>) -> ()>,
buffer_fn: &Box<dyn Fn(&mut Vec<Arc<GenericEvent>>, &Arc<GenericEvent>)>,
) {
let mut cached_events_for_key = self
.events
.entry(event.name.clone())
.or_insert_with(Vec::new);
buffer_fn(&mut cached_events_for_key, &event);
let cached_events_for_key = self.events.entry(event.name.clone()).or_default();
buffer_fn(cached_events_for_key, &event);
}
/// Emits an event to all sockets in the namespace and caches it.
@@ -117,11 +114,10 @@ impl Namespace {
pub fn emit(
&mut self,
event: Arc<GenericEvent>,
buffer_fn: &Box<dyn Fn(&mut Vec<Arc<GenericEvent>>, &Arc<GenericEvent>) -> ()>,
buffer_fn: &Box<dyn Fn(&mut Vec<Arc<GenericEvent>>, &Arc<GenericEvent>)>,
) {
// cache the event
self.cache(event.clone(), &buffer_fn);
self.cache(event.clone(), buffer_fn);
// emit the event - inlined from emit function
// Send to global queue for each socket in the namespace
for socket in self.sockets.clone() {
@@ -191,7 +187,7 @@ pub trait CacheableEvents<Events> {
fn event_cache_fn(&self) -> CacheFn;
}
pub type CacheFn = Box<dyn Fn(&mut Vec<Arc<GenericEvent>>, &Arc<GenericEvent>) -> ()>;
pub type CacheFn = Box<dyn Fn(&mut Vec<Arc<GenericEvent>>, &Arc<GenericEvent>)>;
/// [`BufferFn`] that stores the last n events
pub fn cache_n_events(n: usize) -> CacheFn {
@@ -223,7 +219,6 @@ pub fn cache_first_and_last_event() -> CacheFn {
if events.len() == 2 {
events.remove(1);
events.push(event.clone());
return;
}
})
}
+7 -7
View File
@@ -17,8 +17,8 @@ impl Serialize for NamespaceId {
S: Serializer,
{
match self {
NamespaceId::Main => serializer.serialize_str("/main"),
NamespaceId::Machine(id) => {
Self::Main => serializer.serialize_str("/main"),
Self::Machine(id) => {
let path = format!(
"/machine/{}/{}/{}",
id.machine_identification.vendor, id.machine_identification.machine, id.serial
@@ -36,7 +36,7 @@ impl<'de> Deserialize<'de> for NamespaceId {
{
struct NamespaceIdVisitor;
impl<'de> Visitor<'de> for NamespaceIdVisitor {
impl Visitor<'_> for NamespaceIdVisitor {
type Value = NamespaceId;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
@@ -85,7 +85,7 @@ impl FromStr for NamespaceId {
fn from_str(s: &str) -> Result<Self, Self::Err> {
if s == "/main" {
return Ok(NamespaceId::Main);
return Ok(Self::Main);
}
if let Some(machine_path) = s.strip_prefix("/machine/") {
@@ -101,7 +101,7 @@ impl FromStr for NamespaceId {
.parse::<u16>()
.map_err(|_| "Invalid serial id".to_string())?;
return Ok(NamespaceId::Machine(MachineIdentificationUnique {
return Ok(Self::Machine(MachineIdentificationUnique {
machine_identification: MachineIdentification { vendor, machine },
serial,
}));
@@ -116,8 +116,8 @@ impl FromStr for NamespaceId {
impl fmt::Display for NamespaceId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
NamespaceId::Main => write!(f, "/main"),
NamespaceId::Machine(id) => {
Self::Main => write!(f, "/main"),
Self::Machine(id) => {
write!(
f,
"/machine/{}/{}/{}",
+27
View File
@@ -0,0 +1,27 @@
use crate::transmission::Transmission;
#[derive(Debug, Clone)]
pub struct FixedTransmission {
ratio: f64,
}
impl Transmission for FixedTransmission {
fn get_ratio(&self) -> f64 {
self.ratio
}
}
impl FixedTransmission {
/// Creates a new FixedTransmission with the specified ratio.
///
/// # Arguments
///
/// * `ratio` - The transmission ratio (output over input).
///
/// # Returns
///
/// A new instance of FixedTransmission.
pub const fn new(ratio: f64) -> Self {
Self { ratio }
}
}
+95
View File
@@ -0,0 +1,95 @@
use uom::si::{
angle::radian,
angular_velocity::radian_per_second,
f64::{Angle, AngularVelocity, Length, Velocity},
length::meter,
velocity::meter_per_second,
};
pub mod fixed;
/// A trait representing a mechanical transmission system that converts input to output
/// with a specific gear ratio.
///
/// This trait provides methods for working with transmission ratios and converting
/// between input and output values based on the transmission's gear ratio.
pub trait Transmission {
/// Returns the transmission ratio of this transmission system.
///
/// The ratio represents the relationship between input and output speeds/torques.
/// A ratio greater than 1.0 indicates speed reduction (torque multiplication),
/// while a ratio less than 1.0 indicates speed increase (torque reduction).
///
/// # Returns
///
/// The transmission ratio as a floating-point number.
fn get_ratio(&self) -> f64;
/// Converts an input value to the corresponding output value using the transmission ratio.
///
/// This method multiplies the input by the transmission ratio to calculate the output.
/// Typically used for converting input speed to output speed in a transmission system.
///
/// # Arguments
///
/// * `input` - The input value to be converted
///
/// # Returns
///
/// The output value after applying the transmission ratio.
fn calculate_output(&self, input: f64) -> f64 {
input * self.get_ratio()
}
/// Converts an output value to the corresponding input value using the transmission ratio.
///
/// This method divides the output by the transmission ratio to calculate the required input.
/// Typically used for determining what input is needed to achieve a desired output.
///
/// # Arguments
///
/// * `output` - The output value to be converted back to input
///
/// # Returns
///
/// The input value required to produce the given output.
fn calculate_input(&self, output: f64) -> f64 {
output / self.get_ratio()
}
fn calculate_angular_output(&self, input: Angle) -> Angle {
Angle::new::<radian>(self.calculate_output(input.get::<radian>()))
}
fn calculate_angular_input(&self, output: Angle) -> Angle {
Angle::new::<radian>(self.calculate_input(output.get::<radian>()))
}
fn calculate_angular_velocity_output(&self, input: AngularVelocity) -> AngularVelocity {
AngularVelocity::new::<radian_per_second>(
self.calculate_output(input.get::<radian_per_second>()),
)
}
fn calculate_angular_velocity_input(&self, output: AngularVelocity) -> AngularVelocity {
AngularVelocity::new::<radian_per_second>(
self.calculate_input(output.get::<radian_per_second>()),
)
}
fn calculate_linear_output(&self, input: Length) -> Length {
Length::new::<meter>(self.calculate_output(input.get::<meter>()))
}
fn calculate_linear_input(&self, output: Length) -> Length {
Length::new::<meter>(self.calculate_input(output.get::<meter>()))
}
fn calculate_linear_velocity_output(&self, input: Velocity) -> Velocity {
Velocity::new::<meter_per_second>(self.calculate_output(input.get::<meter_per_second>()))
}
fn calculate_linear_velocity_input(&self, output: Velocity) -> Velocity {
Velocity::new::<meter_per_second>(self.calculate_input(output.get::<meter_per_second>()))
}
}
+208
View File
@@ -0,0 +1,208 @@
use anyhow::Error;
use std::collections::HashMap;
use tokio::sync::broadcast;
/// Video stream manager that handles multiple video streams per machine with true broadcasting
/// Uses tokio broadcast channels to ensure all subscribers receive all messages without stealing
#[derive(Debug)]
pub struct VideoStreamManager {
/// Each stream has its own broadcast transmitter and template receiver
streams: HashMap<String, (broadcast::Sender<Vec<u8>>, broadcast::Receiver<Vec<u8>>)>,
}
impl VideoStreamManager {
pub fn new() -> Self {
Self {
streams: HashMap::new(),
}
}
/// Send a frame to all subscribers of a stream
/// Returns Ok if the frame was sent, Err if the stream doesn't exist
pub fn send_frame(&self, stream_id: &str, frame: Vec<u8>) -> Result<(), Error> {
if let Some((tx, _rx)) = self.streams.get(stream_id) {
match tx.send(frame) {
Ok(_) => Ok(()),
Err(_) => Ok(()), // No receivers, but that's not an error
}
} else {
Err(anyhow::anyhow!("Stream '{}' not found", stream_id))
}
}
/// Register a new video stream with the given ID
pub fn add_stream(&mut self, stream_id: String) {
let (tx, rx) = broadcast::channel::<Vec<u8>>(256); // 256 frame buffer capacity
self.streams.insert(stream_id, (tx, rx));
}
/// Get list of available stream IDs
pub fn get_streams(&self) -> Vec<String> {
self.streams.keys().cloned().collect()
}
/// Check if a stream exists
pub fn has_stream(&self, stream_id: &str) -> bool {
self.streams.contains_key(stream_id)
}
/// Remove a stream and all its subscribers
pub fn remove_stream(&mut self, stream_id: &str) -> bool {
self.streams.remove(stream_id).is_some()
}
/// Subscribe to a video stream and get a receiver
/// Returns the receiver for the new subscription
pub fn subscribe_to_stream(&self, stream_id: &str) -> Option<broadcast::Receiver<Vec<u8>>> {
self.streams
.get(stream_id)
.map(|(_tx, rx)| rx.resubscribe()) // Resubscribe to create a new independent receiver
}
/// Get subscriber count for a stream
pub fn get_subscriber_count(&self, stream_id: &str) -> usize {
self.streams
.get(stream_id)
.map_or(0, |(tx, _rx)| tx.receiver_count())
}
/// Get a stream transmitter for sending frames (used by machines to send video)
/// Returns None if the stream doesn't exist
pub fn get_sender(&self, stream_id: &str) -> Option<broadcast::Sender<Vec<u8>>> {
self.streams.get(stream_id).map(|(tx, _rx)| tx.clone())
}
}
impl Default for VideoStreamManager {
fn default() -> Self {
Self::new()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[tokio::test]
async fn test_video_stream_manager() {
let mut manager = VideoStreamManager::new();
// Register streams
manager.register_stream("camera1".to_string());
manager.register_stream("camera2".to_string());
assert_eq!(manager.get_stream_ids().len(), 2);
assert!(manager.has_stream("camera1"));
assert!(manager.has_stream("camera2"));
assert!(!manager.has_stream("camera3"));
// Subscribe to streams
let mut rx1 = manager.subscribe_to_stream("camera1").unwrap();
let mut rx2 = manager.subscribe_to_stream("camera1").unwrap();
let mut rx3 = manager.subscribe_to_stream("camera2").unwrap();
assert_eq!(manager.get_subscriber_count("camera1"), 3); // Original + 2 clones
assert_eq!(manager.get_subscriber_count("camera2"), 2); // Original + 1 clone
assert_eq!(manager.get_subscriber_count("nonexistent"), 0);
// Send frames
let frame1 = vec![1, 2, 3, 4];
let frame2 = vec![5, 6, 7, 8];
assert!(manager.send_single_frame("camera1", frame1.clone()));
assert!(manager.send_single_frame("camera2", frame2.clone()));
assert!(!manager.send_single_frame("nonexistent", vec![]));
// Both camera1 subscribers should receive the frame
assert_eq!(rx1.recv().await.unwrap(), frame1);
assert_eq!(rx2.recv().await.unwrap(), frame1);
// Camera2 subscriber should receive its frame
assert_eq!(rx3.recv().await.unwrap(), frame2);
}
#[tokio::test]
async fn test_video_frame_broadcasting() {
let mut manager = VideoStreamManager::new();
manager.register_stream("main_camera".to_string());
// Multiple clients subscribe to the same camera
let mut rx1 = manager.subscribe_to_stream("main_camera").unwrap();
let mut rx2 = manager.subscribe_to_stream("main_camera").unwrap();
let mut rx3 = manager.subscribe_to_stream("main_camera").unwrap();
// Simulate video frames
let frames = vec![
vec![0xFF, 0xD8, 0xFF, 0xE0], // JPEG header
vec![0x00, 0x01, 0x02, 0x03], // Frame 1
vec![0x04, 0x05, 0x06, 0x07], // Frame 2
];
for frame in &frames {
assert!(manager.send_single_frame("main_camera", frame.clone()));
}
// All clients should receive all frames in order
for frame in &frames {
assert_eq!(rx1.recv().await.unwrap(), *frame);
assert_eq!(rx2.recv().await.unwrap(), *frame);
assert_eq!(rx3.recv().await.unwrap(), *frame);
}
}
#[test]
fn test_stream_management() {
let mut manager = VideoStreamManager::new();
// Initially no streams
assert_eq!(manager.get_stream_ids().len(), 0);
// Add streams
manager.register_stream("front_camera".to_string());
manager.register_stream("rear_camera".to_string());
manager.register_stream("side_camera".to_string());
let mut stream_ids = manager.get_stream_ids();
stream_ids.sort(); // Sort for consistent testing
assert_eq!(
stream_ids,
vec!["front_camera", "rear_camera", "side_camera"]
);
// Remove a stream
assert!(manager.remove_stream("rear_camera"));
assert!(!manager.remove_stream("rear_camera")); // Already removed
assert!(!manager.has_stream("rear_camera"));
assert_eq!(manager.get_stream_ids().len(), 2);
}
#[tokio::test]
async fn test_send_frame_results() {
let mut manager = VideoStreamManager::new();
manager.register_stream("test_camera".to_string());
// One initial receiver (the original one created in register_stream)
let result = manager.send_frame("test_camera", vec![1, 2, 3]).unwrap();
assert_eq!(result, 1); // Number of subscribers
// Add subscribers by cloning the receiver
let _rx1 = manager.subscribe_to_stream("test_camera").unwrap();
let _rx2 = manager.subscribe_to_stream("test_camera").unwrap();
// Send frame to multiple subscribers (original + 2 clones = 3 total)
let result = manager.send_frame("test_camera", vec![4, 5, 6]).unwrap();
assert_eq!(result, 3); // Number of subscribers
// Try sending to non-existent stream
let result = manager.send_frame("nonexistent", vec![7, 8, 9]);
assert!(result.is_err());
assert_eq!(result.unwrap_err(), "Stream 'nonexistent' not found");
}
#[test]
fn test_default_video_stream_manager() {
let manager = VideoStreamManager::default();
assert_eq!(manager.get_stream_ids().len(), 0);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

+145
View File
@@ -0,0 +1,145 @@
# How can I add a new Machine?
Adding a new machine follows a common structure in `server/machines/`.
# TLDR
Summary
When adding a new machine:
- Create Folder server/machines/YOUR_MACHINE_NAME/.
- Add the 4 files (mod.rs, new.rs, act.rs, api.rs).
- Register it in machines/mod.rs with a unique constant.
- mod.rs: define the struct + emit functions.
- new.rs: assemble devices/controllers into the machine.
- act.rs: implement the machine loop (MachineAct).
- api.rs: define request (mutations) and response (events) types.
Tip: Start simple (copy MockMachine) and grow complexity as needed (add EtherCAT devices, controllers, etc.).
---
## 1. Create the folder
Create a new directory:
server/machines/YOUR_MACHINE_NAME
At a minimum, this folder needs the following files:
- `mod.rs`
- `new.rs`
- `act.rs`
- `api.rs`
---
## 2. Register the module
Add your machine to `server/machines/mod.rs`:
```rust
// mod.rs
pub mod buffer1;
pub mod extruder1;
pub mod laser;
pub mod mock;
pub mod registry;
pub mod winder2;
pub mod YOUR_MACHINE;
pub const VENDOR_QITECH: u16 = 0x0001;
pub const MACHINE_WINDER_V1: u16 = 0x0002;
pub const MACHINE_EXTRUDER_V1: u16 = 0x0004;
pub const MACHINE_LASER_V1: u16 = 0x0006;
pub const MACHINE_MOCK: u16 = 0x0007;
pub const MACHINE_BUFFER_V1: u16 = 0x0008;
pub const YOUR_MACHINE_V1: u16 = 0xffff; // pick a unique ID to avoid collisions also DO NOT touch any already defined ids!!
```
## 3. mod.rs
This file defines your machine struct and the required event emitters.
Look at MockMachine’s mod.rs for the simplest possible version.
At a minimum, you need:
- emit_state
- emit_live_values
- A machine struct for state(e.g. MockMachine, Extruder, Laser, Winder, …)
More complex machines (e.g. Extruder, Winder) encapsulate controllers that in turn manage devices like EtherCAT terminals.
## 4 new.rs
This file implements MachineNewTrait for your machine.
Here you assemble your machine from its parts — devices, controllers, and any state.
Minimal example: see MockMachine → basically no devices, just returns a struct.
Medium complexity: see Laser → wraps a single serial USB device.
High complexity: see Extruder → configures multiple EtherCAT devices inside controllers.
Think of new.rs as the factory:
This is the place to declare which devices make up your machine and how they’re configured.
## 5. act.rs
This file implements the machine control loop using MachineAct.
The act() method is called repeatedly by the control runtime.
```rs
impl MachineAct for YourMachine {
fn act(&mut self, _now_ts: Instant) -> Pin<Box<dyn Future<Output = ()> + Send + '_>> {
Box::pin(async move {
let now = Instant::now();
// Update state, e.g. step a controller
self.some_controller.update();
// Emit live values ~30 Hz if machine is in Running mode
if now.duration_since(self.last_measurement_emit) > Duration::from_secs_f64(1.0 / 30.0) {
self.maybe_emit_state_event();
self.emit_live_values();
self.last_measurement_emit = now;
}
})
}
}
```
## 6. api.rs
Defines the frontend-facing API for your machine:
Mutations → requests that the machine accepts
(e.g. start/stop commands, setpoints, configuration updates).
Events → responses emitted to the frontend
(e.g. live sensor data, alarms, machine state changes).
Look at MockMachine’s api.rs for a minimal version.
```rs
/// Mutations are API requests to control the machine
#[derive(Debug, Clone, serde::Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum YourMachineMutation {
Start,
Stop,
SetSpeed { rpm: f64 },
}
/// Events are responses sent to the frontend
#[derive(Debug, Clone, serde::Serialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum YourMachineEvent {
StateChanged { state: String },
LiveValues { rpm: f64, torque: f64 },
}
```
+94
View File
@@ -0,0 +1,94 @@
# Code Style
# General Code styling
Try to adhere to the rust style guide:
https://doc.rust-lang.org/nightly/style-guide/
# Beckhoff terminals and Machines
For Beckhoff terminals you should first implement the basic functionality, then an Interpreter of the device/data is built on top.
A good example of how to do this is by looking at the following code:
el3021.rs , AnalogInputDevice
El3021 implements a so called AnalogInputDevice, which acts like an interface.
This allows us to use AnalogInputDevice instead of having to always specify which device should be used.
In Essence any Device that implements AnalogInputDevice can be used.
AnalogInputDevice is then used for creating an AnalogInput, which is plug and play for machines.
Then a further layer of Abstraction is used on top,
where the data is interpreted and incorporated into a sort of control loop for certain functions, for example:
```rust
// ScrewSpeedController controlls the speed (frequency) and direction of the motor
// AnalogInput is used to collect measurements from the pressure sensor.
// screw_speed_controller.rs
#[derive(Debug)]
pub struct ScrewSpeedController {
pub pid: ClampingTimeagnosticPidController,
pub target_pressure: Pressure,
pub target_rpm: AngularVelocity,
pub inverter: MitsubishiCS80,
pressure_sensor: AnalogInput,
last_update: Instant,
uses_rpm: bool,
forward_rotation: bool,
transmission_converter: TransmissionConverter,
frequency: Frequency,
maximum_frequency: Frequency,
minimum_frequency: Frequency,
motor_on: bool,
nozzle_pressure_limit: Pressure,
nozzle_pressure_limit_enabled: bool,
}
// Under the hood for ExtruderV2 a El3021 is used:
// (from new.rs of extruder)
let pressure_sensor = AnalogInput::new(el3021, EL3021Port::AI1);
// But the extruder does not directly use the AnalogInput, instead the logic is decoupled in the screw_speed_controller:
let mut extruder: ExtruderV2 = Self {
namespace: ExtruderV2Namespace::new(params.socket_queue_tx.clone()),
last_measurement_emit: Instant::now(),
mode: ExtruderV2Mode::Standby,
temperature_controller_front: temperature_controller_front,
temperature_controller_middle: temperature_controller_middle,
temperature_controller_back: temperature_controller_back,
temperature_controller_nozzle: temperature_controller_nozzle,
screw_speed_controller: screw_speed_controller,
emitted_default_state: false,
};
// Then in act.rs
// The extruder simply calls the update function of the screw_speed_controller,
// which contains "all" of the logic needed to properly drive the motor
self.screw_speed_controller.update(now_ts, true);
```
This is desired behaviour for all implemented devices, the machines should stay as modular as possible.
# Representing physical Units (Volt,Ampere,Hz,RPM etc)
To represent physical units like voltage ampere etc... we use uom (units of measurement), which acts as a wrapper for units and supplies all conversions between certain units.
For example:
```rust
// Lets say a device measures voltage, you just got the raw value
let volts : ElectricPotential = ElectricPotential::new::<volt>(raw_value_here);
// Then you can do this to get milli_volts
// In api responses we always use the RAW float value (64bit):
let milli_volts : f64 = volts.get::<millivolt>();
```
# General Advice
- Try to avoid duplicate code (DRY principle)
- Try to avoid lifetimes if at all possible
- Avoid excessive abstractions
- Avoid async code unless it is required
- Avoid taking Ownership of values, instead borrow the value
- When implementing a Trait for a struct, do it in the same file as the struct definition
- Split up large impl blocks into smaller impl blocks
+84
View File
@@ -0,0 +1,84 @@
# Environment Setup
Working on this repository requires you to use cargo and npm. In the following document the installation process will be shown
## Ubuntu/Debian Installation
```bash
# Just press enter when prompted
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install npm
apt install nodejs
# assuming you dont have git already, Git setup not included in here
apt install git
git clone git@github.com:qitechgmbh/control.git
cd control
cd electron
npm install
```
# Running Backend and Frontend Linux
## Backend
To Compile backend code and run it on Linux:
```bash
./cargo_run_linux.sh
```
The script sets capabilities on the compiled binary like raw socket access.
Here it is required that you are connected to atleast one machine that is communicated with over ethercat or usb/serial.
The Most minimal working setup would be to connect over ethernet to an ek1100 beckhoff terminal.
## Mock-Machine
The Mock-Machine can be used to test code that does not require an actual machine connection.
Like Frontend Code for example.
Mock machines can be used if the compile feature mock-machine is enabled.
```bash
# in root git folder
./cargo_run_linux.sh mock-machine
```
## Frontend
To run the Frontend Code:
```bash
# need to be in the electron folder and an additional terminal
cd electron
npm run start
```
# Contributing
Generally you contribute to the codebase by:
1. Opening or Choosing an existing issue (Bug,Feature,Task etc)
2. Work on it locally
3. Commit your changes locally
4. Before pushing changes, if there were changes on the master branch, rebase your branch like so:
```bash
git fetch
git rebase origin/master
```
5. Push changes
```bash
# IF you needed to rebase
git push --force-with-lease
# ELSE you just push
git push
```
6. Open a Pull Request on Github and link the issue by writing fix #issue_number, after the pull request is merged into master the branch is closed automatically
7. Request a Review and hope for the best :)
# Recommended Editor Setup
We recommend you to use an Editor with rust-analyzer support like VSCode to speed up development and detect errors before compiling.
@@ -0,0 +1,128 @@
# Performance/Stability Tweaks
## EtherCrab Config
We set ethercrab to default settings for everything except for RetryBehaviour, so that one unlikely failure doesnt destroy the EtherCAT network.
```rust
let maindevice = MainDevice::new(
pdu,
Timeouts {
// Default 5000ms
state_transition: Duration::from_millis(5000),
// Default 30_000us
pdu: Duration::from_micros(30_000),
// Default 10ms
eeprom: Duration::from_millis(10),
// Default 0ms
wait_loop_delay: Duration::from_millis(0),
// Default 100ms
mailbox_echo: Duration::from_millis(100),
// Default 1000ms
mailbox_response: Duration::from_millis(1000),
},
MainDeviceConfig {
// Default RetryBehaviour::None
retry_behaviour: RetryBehaviour::Count(5),
// Default 10_000
dc_static_sync_iterations: 10_000,
},
);
```
wait_loop_delay CAN in theory also decrease CPU usage if set exactly as the loop_delay we set, however this setting has caused us some issues, so we just leave it as is.
## Realtime Kernel
In our nixOs Config we use the latest realtime kernel and isolate TWO cores out of the Four available for the machines we use.
```nix
#From configuration.nix
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages-rt_latest;
boot.kernelModules = [ "i915" ];
```
Notice how we hardcode the intel gpu kernel module. This is because only the GPU driver gets blacklisted for some reason. By specifying it manually it loads like before.
One Core is used for the EtherCrab TXRX Thread and one is used for the machine Thread.
```
"isolcpus=2,3" # Isolate cpus 2 and 3 from scheduler for better latency, 2 runs ethercatthread and 3 runs server control-loop
"nohz_full=2,3" # In this mode, the periodic scheduler tick is stopped when only one task is running, reducing kernel interruptions on those CPUs.
"rcu_nocbs=2,3" # Moves RCU (Read-Copy Update) callback processing away from CPUs 2 and 3.
```
Essentially we completely disable acces from the operating system to these two cpus, which saves scheduler overhead, which would introduce noticable latency.
Its not entirely clear yet if what we did here is overkill. Maybe we could use only one core and get away with that?
Processor load normally hovers around 18% for one of the cores and like 9% for the other.
We also have some minor cpu tweaks in configuration.nix
```
# Graphical
"logo.nologo" # Remove kernel logo during boot
# Performance
# Specific Vulnerabilities Addressed by Mitigations:
# - Spectre variants (V1, V2, V4, SWAPGS, SpectreRSB, etc.)
# - Meltdown (Rogue Data Cache Load)
# - Foreshadow/L1TF (L1 Terminal Fault)
# - Microarchitectural Data Sampling (MDS, RIDL, Fallout, ZombieLoad)
# - SRBDS (Special Register Buffer Data Sampling)
# - TSX Asynchronous Abort (TAA)
# - iTLB Multihit
# - And others as they're discovered and mitigated
#
# With mitigations=off
# - PROS: Maximum performance, equivalent to pre-2018 behavior
# - CONS: Vulnerable to Spectre, Meltdown, Foreshadow, ZombieLoad, etc.
# Should ONLY be used in completely trusted environments
# - Improves performance by 7-43%
"mitigation=off"
"intel_pstate=performance" # Intel CPU-specific performance mode (if applicable)
# Memory Management
"transparent_hugepage=always" # Use larger memory pages for memory intense applications
"nmi_watchdog=0" # Disable NMI watchdog for reduced CPU overhead and realtime execution
# High-throughput ethernet parameters
"pcie_aspm=off" # Disable PCIe power management for NICs
"intel_iommu=off" # Disable IOMMU (performance gain)
# Reliability
"panic=10" # Auto-reboot 10 seconds after kernel panic
"oops=panic" # Treat kernel oops as panic for auto-recovery
"usbcore.autosuspend=-1" # Possibly fixes dre disconnect issue?
```
We should check if its really required to turn mitigations off as well.
## Rust Code Optimizations
In General we try to avoid memory allocations in our loop as much as possible, as it is not deterministic
One problem we found, is that due to the realtime kernel our ethernet driver caused us quite large spikes in our tx_rx cycle time for EtherCAT.
These spikes happen when CPU Load is very high on the two usable cores, causing the interrupt handler for Ethernet to stall.
Which is why we reassign the interrupt handler on startup to the same core that the EtherCatTxRx Thread runs on:
```rust
#[cfg(target_os = "linux")]
match set_irq_affinity(&interface, 3) {
Ok(_) => tracing::info!("ethernet interrupt handler now runs on cpu:{}", 3),
Err(e) => tracing::error!("set_irq_affinity failed: {:?}", e),
}
// Set core affinity to 4th core
let _ = set_core_affinity(3);
// Set the thread to real-time priority
let _ = set_realtime_priority();
```
This means that the Interrupt Handler ALWAYS has enough ressources to cope with our demand for realtime communication with EtherCAT
One Problem we have at the moment (we think) is the locking and async code blocking our server loop.
Note that this doesnt affect the EtherCAT communication at all.
## Electron Optimizations (Not Yet Implemented)
Currently we are struggling with the fact, that apparently Electron doesnt really have good support for HW acceleration on Linux.
Electron runs with the software-renderer, which is VERY slow compared to a gpu.
This would eliminate the weird stuttering seen on Graphs and make them run buttery smooth, while also alleviating load off of the CPU.
+166
View File
@@ -0,0 +1,166 @@
# Presets
To allow the user to save the current configuration of a machine, they can create a preset in the presets page. Presets are presited in electron's local storage.
Presets are all handled by the `PresetsPage`. To use the `PresetsPage` for a single machine, one must implement the following.
Create a zod schema for the data, the presets contain.
```tsx
const mock1PresetDataSchema = z
.object({
frequency1: z.number(),
frequency2: z.number(),
frequency3: z.number(),
})
.partial();
type Mock1 = typeof mock1PresetDataSchema;
```
Here, intensionally, `Mock1` is the schema type itself. It can be used as a type argument everything that uses presets.
Next, create a map containing all schema versions currently supported (the new schema, to be precise).
```tsx
const schemas = new Map([[1, mock1PresetDataSchema]]);
```
New, the schema will be used to parse version `1`. To create new versions, see migrations below.
One also needs to define a table, how the preset data should be shown to the user.
```tsx
const previewEntries: PresetPreviewEntries<Mock1> = [
{
name: "Frequency 1",
unit: "mHz",
renderValue: (data: PresetData<Mock1>) => data?.frequency1?.toFixed(3),
},
{
name: "Frequency 2",
unit: "mHz",
renderValue: (data: PresetData<Mock1>) => data?.frequency2?.toFixed(3),
},
{
name: "Frequency 3",
unit: "mHz",
renderValue: (data: PresetData<Mock1>) => data?.frequency3?.toFixed(3),
},
];
```
`renderValue` gets the data itself and renders the corresponding part of it. Returning undefined will automatically be rendered as the value is not set, showing "N/A".
Create a function for the new react component and use the appropreate machine.
```tsx
export function Mock1PresetsPage() {
const { setFrequency1, setFrequency2, setFrequency3, defaultState, state } =
useMock1();
// ...
}
```
Here, two more functions need to be created. const toPresetData = (s: typeof state): PresetData<Mock1> => ({
frequency1: s?.frequency1 ?? defaultState?.frequency1,
frequency2: s?.frequency2 ?? defaultState?.frequency2,
frequency3: s?.frequency3 ?? defaultState?.frequency3,The first takes in a preset and applies it on the machine. If data is missing, use the default defined by the backend.
```tsx
export function Mock1PresetsPage() {
const { setFrequency1, setFrequency2, setFrequency3, defaultState, state } =
useMock1();
const applyPreset = (preset: Preset<Mock1>) => {
const frequency1 = preset.data?.frequency1 ?? 100;
const frequency2 = preset.data?.frequency2 ?? 200;
const frequency3 = preset.data?.frequency3 ?? 500;
setFrequency1(frequency1);
setFrequency2(frequency2);
setFrequency3(frequency3);
};
// ...
}
```
The later does the opposite, it turns a machine state, comming from the backend, into the preset data
```tsx
export function Mock1PresetsPage() {
const { setFrequency1, setFrequency2, setFrequency3, defaultState, state } =
useMock1();
// ...
const toPresetData = (s: typeof state): PresetData<Mock1> => ({
frequency1: s?.frequency1 ?? defaultState?.frequency1,
frequency2: s?.frequency2 ?? defaultState?.frequency2,
frequency3: s?.frequency3 ?? defaultState?.frequency3,
});
// ...
}
```
Having all this, we can simple pass it to the `PresetsPage`
```tsx
export function Mock1PresetsPage() {
// ...
return (
<PresetsPage
machine_identification={mock1.machine_identification}
currentState={toPresetData(state)}
schemas={schemas}
schemaVersion={1}
applyPreset={applyPreset}
previewEntries={previewEntries}
defaultState={toPresetData(defaultState)}
/>
);
}
```
Also mind the machine identification, that has to match the machine we are using and the schema versionen. Here we pass `1`, as we also used `1` in the schemas map.
## Migrations
Migrations are handled by the `PresetsPage`, however, one still has to define what to migrate.
To do so, first create the new schema.
```tsx
const fancyNewMock1PresetDataSchema = z
.object({
frequency1_now_with_ai: z.number(),
frequency2: z.number(),
frequency3: z.number(),
frequency4: z.number(),
})
.partial();
type Mock1 = typeof fancyNewMock1PresetDataSchema;
```
and then, also create a migration that uses the new schema, but can handle the old format.
```tsx
const mock1PresetDataSchemaMigration: PresetSchema = z.preprocess(
(obj: any): PresetData<Mock1> => ({
frequency1_now_with_ai: obj?.frequency1, // Here, a field have been renamed
frequency2: obj?.frequency2,
frequency3: obj?.frequency3,
frequency4: 666.0, // A new field is added. Initialize it with default the value
}),
fancyNewMock1PresetDataSchema,
);
```
Usings zods preprocessing step,
we can first transform the data as needed and then validate using the new schema accordingly.
We have to register both schemas in our schema map.
```tsx
const schemas = new Map<number, Mock1>([
[1, mock1PresetDataSchemaMigration as Mock1],
[2, fancyNewMock1PresetDataSchema],
]);
```
Mind the cast, which is ok, because `mock1PresetDataSchemaMigration` parses `fancyNewMock1PresetDataSchema` by construction.
Lastly, simply change the schema version being passed to the `PresetsPage`.
```diff
@@ -62,7 +77,7 @@ export function Mock1PresetsPage() {
machine_identification={mock1.machine_identification}
currentState={toPresetData(state)}
schemas={schemas}
- schemaVersion={1}
+ schemaVersion={2}
applyPreset={applyPreset}
previewEntries={previewEntries}
defaultState={toPresetData(defaultState)}
```
Make sure, that all (exsiting and new migrations) return a schema version 2 conform format.
Of corse, one can chain migrations of needed - just the end result must be complient.
+27
View File
@@ -0,0 +1,27 @@
# Testing Ram and Cpu (Hardware)
There were instability problems on one of the hmi panel pc's related to ram.
To test Ram and Cpu for stability problems we use memtest86.
You can download it here: https://www.memtest86.com/download.htm
Then in the unzipped folder you have to flash the .img file to a USB drive with atleast 2GB of space.
We already have USB-Sticks flashed with memtest though.
1. When starting up the Pc mash Del (Entf in german) on an external keyboard and enter the bios
2. Select the Memtest86 usb stick in the Bios
3. Save changes and exit
4. Now memtest boots up, just let it do its thing from here
It works if the screen looks something like this:
![](../assets/Memtest86_v83p.png)
Simply let it do one Pass ~20 minutes and shutdown and unplug usb stick afterwards
If it freezes completely -> unstable
If it shows errors the ram should be swapped out and the test repeated
+127
View File
@@ -115,3 +115,130 @@ pub fn (
}
}
```
# Device Implementation Guide
This section describes how to implement EtherCAT devices in the framework used by the QiTech Control project (via `ethercat-hal`, `server`, etc.). We include a running example of a simple digital output device (EL2004) and discuss how it fits into the larger architecture.
## Architecture & Context
The QiTech Control system is built as:
- `ethercat-hal` / `ethercat-hal-derive`: Hardware abstraction, PDO / CoE handling, device traits.
- `server`: Glue code that reads device identities, instantiates the correct device types, performs CoE configuration, and runs cyclic process data.
- The `docs` directory documents APIs and device patterns.
:contentReference[oaicite:0]{index=0}
In this architecture:
1. During initialization, subdevice identity tuples (Vendor ID, Product ID, Revision) are read.
2. The `server` matches identity tuples to concrete `Device` types and constructs them (via `NewEthercatDevice`).
3. The device instance then handles PDO exchange, and optional CoE (configuration) writes.
4. Higher-level application code interacts with devices via traits like `DigitalOutputDevice`, `DigitalInputDevice`, etc.
---
## Example: Simple Digital Output Device (EL2004)
Below is a minimal example of a digital-output-only EtherCAT device. It shows how to map PDOs, implement traits, and define identity constants.
```rust
use super::{EthercatDeviceProcessing, NewEthercatDevice, SubDeviceIdentityTuple};
use crate::helpers::ethercrab_types::EthercrabSubDevicePreoperational;
use crate::io::digital_output::{DigitalOutputDevice, DigitalOutputOutput};
use crate::pdo::{RxPdo, basic::BoolPdoObject};
use ethercat_hal_derive::{EthercatDevice, RxPdo};
/// EL2004 4-channel digital output device — 24 V DC, 0.5 A per channel
#[derive(EthercatDevice)]
pub struct EL2004 {
/// The Rx PDO where output bits are written by the master
pub rxpdo: EL2004RxPdo,
is_used: bool,
}
impl EthercatDeviceProcessing for EL2004 {}
impl std::fmt::Debug for EL2004 {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "EL2004")
}
}
impl NewEthercatDevice for EL2004 {
fn new() -> Self {
Self {
rxpdo: EL2004RxPdo::default(),
is_used: false,
}
}
}
impl DigitalOutputDevice<EL2004Port> for EL2004 {
fn set_output(&mut self, port: EL2004Port, value: DigitalOutputOutput) {
let expect_text = "All channels should be Some(_)";
match port {
EL2004Port::DO1 => {
self.rxpdo.channel1.as_mut().expect(expect_text).value = value.into()
}
EL2004Port::DO2 => {
self.rxpdo.channel2.as_mut().expect(expect_text).value = value.into()
}
EL2004Port::DO3 => {
self.rxpdo.channel3.as_mut().expect(expect_text).value = value.into()
}
EL2004Port::DO4 => {
self.rxpdo.channel4.as_mut().expect(expect_text).value = value.into()
}
}
}
fn get_output(&self, port: EL2004Port) -> DigitalOutputOutput {
let expect_text = "All channels should be Some(_)";
DigitalOutputOutput(match port {
EL2004Port::DO1 => self.rxpdo.channel1.as_ref().expect(expect_text).value,
EL2004Port::DO2 => self.rxpdo.channel2.as_ref().expect(expect_text).value,
EL2004Port::DO3 => self.rxpdo.channel3.as_ref().expect(expect_text).value,
EL2004Port::DO4 => self.rxpdo.channel4.as_ref().expect(expect_text).value,
})
}
}
#[derive(Debug, Clone)]
pub enum EL2004Port {
DO1,
DO2,
DO3,
DO4,
}
#[derive(Debug, Clone, RxPdo)]
pub struct EL2004RxPdo {
#[pdo_object_index(0x1600)]
pub channel1: Option<BoolPdoObject>,
#[pdo_object_index(0x1601)]
pub channel2: Option<BoolPdoObject>,
#[pdo_object_index(0x1602)]
pub channel3: Option<BoolPdoObject>,
#[pdo_object_index(0x1603)]
pub channel4: Option<BoolPdoObject>,
}
impl Default for EL2004RxPdo {
fn default() -> Self {
Self {
channel1: Some(BoolPdoObject::default()),
channel2: Some(BoolPdoObject::default()),
channel3: Some(BoolPdoObject::default()),
channel4: Some(BoolPdoObject::default()),
}
}
}
/// Identity constants for EL2004
pub const EL2004_VENDOR_ID: u32 = 0x2;
pub const EL2004_PRODUCT_ID: u32 = 131346514;
pub const EL2004_REVISION_A: u32 = 1179648;
pub const EL2004_IDENTITY_A: SubDeviceIdentityTuple =
(EL2004_VENDOR_ID, EL2004_PRODUCT_ID, EL2004_REVISION_A);
+13
View File
@@ -0,0 +1,13 @@
# Electrical Diagrams
This directory contains electrical wiring diagrams for various machines and systems supported by the control system.
## Available Diagrams
### Extruder
- **Location**: [`extruder/`](extruder/)
- **File**: [QiTech Pro Extruder Electrical Diagram 2025.pdf](extruder/QiTech_Pro_Extruder_Electrical_Diagram_2025.pdf)
### Winder
- **Location**: [`winder/`](winder/)
- **File**: [QiTech Pro Winder Electrical Diagram.pdf](winder/QiTech_Pro_Winder_Electrical_Diagram.pdf)
Binary file not shown.
View File
Whitespace-only changes.
+40
View File
@@ -0,0 +1,40 @@
# Ethercat Tab shows no Ethercat Terminals!
When the Ethercat page does not show any terminals, this can be due to multiple reasons
## 1: Incorrect Connection of EK1100
Check that the computers ethernet cable is properly connected to the EK1100 IN port
Check the cabling if more than one EK1100 is used.
When you have multiple EK the connection should be like this:
Master (Your pc) -> Ethernet cable -> IN EK1100 (A)
OUT EK1100 (A) -> Ethernet cable -> IN EK1100 (B)
If you connected any part of this incorrectly the ethercat software will try to communicate but will fail, because the protocol works only if all devices are connect in series.
## 2: Defective EtherCAT Terminal
If a Terminal is somehow defective it can disrupt the communication flow expected by EtherCAT thus causing no devices to show up, as ethercat requires all terminals to work properly.
To identify the defective terminal start unplugging terminals starting from the End terminal. Working your way backwards. Every time you unplug a terminal restart the backend process.
You know that you have removed the defective terminal when the ethercat tab shows devices after your restart.
Replace that terminal with an appropriate one and repeat this if the error persists.
## 3: Corrupt Firmware on EtherCAT Terminal
Another reason, that an Ethercat Terminal doesnt work properly, is that the firmware is corrupt. This could happen due to overvoltage,undervoltage or shorts, in some cases this is recoverable by reflashing the firmware.
Our repository contains dumps for all of the EtherCAT Terminals, that we have used. To upload the firmware you can follow this guide: https://infosys.beckhoff.com/english.php?content=../content/1033/ethercatsystem/402909835.html&id=
To follow this guide, you need to have TwinCat installed and a License.
# Motor does not start!
If the Motor does not start after trying to talk to the inverter, the most common reason is that the inverter's serial connection settings (baudrate,encoding ...) are incorrect.
The correct settings can be found in mitsubishi_inverter.md under `All Settings needed for the Inverter Communication/Operation with Extruder`
+1 -1
View File
@@ -3,6 +3,6 @@
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"endOfLine": "auto",
"endOfLine": "lf",
"plugins": ["prettier-plugin-tailwindcss"]
}
+1335 -1538
View File
File diff suppressed because it is too large. Load diff
+20 -16
View File
@@ -11,6 +11,7 @@
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "eslint .",
"lint:write": "eslint . --fix",
"format": "prettier --check .",
"format:write": "prettier --write .",
"test": "vitest run",
@@ -23,63 +24,64 @@
"devDependencies": {
"@electron-forge/cli": "^7.6.1",
"@electron-forge/maker-deb": "^7.8.0",
"@electron-forge/maker-rpm": "^7.6.1",
"@electron-forge/maker-rpm": "^7.8.3",
"@electron-forge/maker-squirrel": "^7.6.1",
"@electron-forge/maker-zip": "^7.6.1",
"@electron-forge/plugin-auto-unpack-natives": "^7.6.1",
"@electron-forge/plugin-fuses": "^7.8.0",
"@electron-forge/plugin-vite": "^7.6.1",
"@electron-forge/shared-types": "^7.4.0",
"@electron/fuses": "^1.8.0",
"@electron/fuses": "^2.0.0",
"@eslint/compat": "^1.2.6",
"@eslint/js": "^9.18.0",
"@playwright/test": "^1.50.1",
"@playwright/test": "^1.56.1",
"@tailwindcss/postcss": "^4.0.6",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/electron-squirrel-startup": "^1.0.2",
"@types/eslint-config-prettier": "^6.11.3",
"@types/node": "^22.13.4",
"@types/react": "^19.0.10",
"@types/node": "^24.2.1",
"@types/react": "^19.1.16",
"@types/react-dom": "^19.0.4",
"electron": "36.4.0",
"@types/react-virtualized": "^9.22.2",
"electron": "^37.3.1",
"electron-playwright-helpers": "^1.7.1",
"eslint": "^9.20.1",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-compiler": "^19.0.0-beta-714736e-20250131",
"globals": "^16.2.0",
"jsdom": "^26.0.0",
"postcss": "^8.5.2",
"prettier": "^3.5.1",
"prettier-plugin-tailwindcss": "^0.6.11",
"prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.14",
"tailwindcss": "^4.1.4",
"ts-node": "^10.9.2",
"typescript": "^5.7.3",
"typescript-eslint": "^8.24.1",
"vite": "^6.2.6",
"vite": "^6.4.1",
"vitest": "^3.0.6"
},
"dependencies": {
"@hookform/resolvers": "^4.1.2",
"@icons-pack/react-simple-icons": "^11.2.0",
"@jub3i/tree-kill": "^0.0.15",
"@radix-ui/react-collapsible": "^1.1.8",
"@radix-ui/react-collapsible": "^1.1.12",
"@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-dropdown-menu": "^2.1.15",
"@radix-ui/react-label": "^2.1.2",
"@radix-ui/react-navigation-menu": "^1.2.5",
"@radix-ui/react-navigation-menu": "^1.2.14",
"@radix-ui/react-popover": "^1.1.7",
"@radix-ui/react-select": "^2.1.6",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-separator": "^1.1.3",
"@radix-ui/react-slider": "^1.2.3",
"@radix-ui/react-slot": "^1.1.2",
"@radix-ui/react-toggle": "^1.1.1",
"@radix-ui/react-toggle-group": "^1.1.2",
"@tanstack/react-query": "^5.66.7",
"@tanstack/react-router": "^1.105.0",
"@tanstack/react-query": "^5.84.2",
"@tanstack/react-router": "^1.130.17",
"@tanstack/react-table": "^8.21.2",
"@tanstack/router-devtools": "^1.105.0",
"@tanstack/zod-adapter": "^1.116.0",
@@ -98,6 +100,8 @@
"react-hook-form": "^7.57.0",
"react-i18next": "^15.4.1",
"react-markdown": "^10.1.0",
"react-virtualized": "^9.22.6",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.1",
"socket.io-client": "^4.8.1",
"socket.io-msgpack-parser": "^3.0.2",
@@ -108,6 +112,6 @@
"xlsx": "^0.18.5",
"zod": "^3.24.2",
"zod-validation-error": "^3.4.0",
"zustand": "^5.0.3"
"zustand": "^5.0.8"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 850 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Loaded 100 of 437 files, more files were not shown because too many files have changed in this diff. Show more