Compare commits

..
Author SHA1 Message Date
Ian Chua c6d3e755ec chore: remove orcasonar test changes 2026-10-05 16:37:13 +08:00
Ian Chua 797c2c1b33 refactor: move orcasonar changes to dedicated branch 2026-10-05 16:23:53 +08:00
Ian Chua 2b1dba272c Merge branch 'main' into feat/printer-agent-impl 2026-10-05 16:08:51 +08:00
Ian Chua f6ccc7a9f9 Merge branch 'main' into feat/printer-agent-impl 2026-10-01 15:09:51 +08:00
Ian Chua 6194c4f8bb chore: port add_platform_root_certificates from 16027 2026-10-01 14:21:26 +08:00
peachismomo 5af7140cb0 Merge remote-tracking branch 'origin/main' into feat/printer-agent-impl 2026-10-01 00:51:05 +08:00
peachismomo 1cac04eae8 refactor: separate out networking infra 2026-10-01 00:28:57 +08:00
Ian Chua b935a652b9 Merge branch 'feat/printer-agent-infra' into feat/printer-agent-impl 2026-09-30 19:31:28 +08:00
Ian Chua a1fd66362b Merge branch 'main' into feat/printer-agent-infra 2026-09-30 19:29:07 +08:00
peachismomo a6cad8a6e5 fix: printer agent and camera shutdown races 2026-09-30 19:27:50 +08:00
Ian Chua 9bac75dda5 Merge branch 'feat/printer-agent-infra' into feat/printer-agent-impl 2026-09-28 21:15:32 +08:00
Ian Chua 50c5ec2862 fix: remove redundant earlier expires_never call 2026-09-28 21:14:22 +08:00
Ian Chua b36a72e16a fix: orca mqtt session timeout after connack 2026-09-28 21:14:21 +08:00
Ian Chua 64371c191e Merge branch 'main' into feat/printer-agent-infra 2026-09-28 20:50:03 +08:00
Ian Chua 94702a5f8d Merge branch 'feat/printer-agent-infra' of https://github.com/OrcaSlicer/OrcaSlicer into feat/printer-agent-infra 2026-09-28 20:48:51 +08:00
Ian Chua 68cdd31852 Merge branch 'main' into feat/printer-agent-infra 2026-09-28 20:48:37 +08:00
Ian Chua 87eb8de001 fix: serialize MQTT ws I/O and dewcouple keepalive 2026-09-24 20:28:13 +08:00
Ian Chua 220508534a fix: cancel inflight cloud signaling requests 2026-09-24 19:03:58 +08:00
Ian Chua 5a0810365b fix: clarify OrcaCloud signaling endpoint contract 2026-09-24 18:18:48 +08:00
Ian Chua fa98ec5afe feat: add ssl and ca_cert for OrcaPrinterAgent 2026-09-24 17:53:46 +08:00
Ian Chua 3c1d8ac8b4 fix: allow input ip address dialog to validate if is valid endpoint 2026-09-24 17:53:12 +08:00
Ian Chua 936b0bbc17 feat: add https compatibility for moonraker based printer agents 2026-09-24 14:53:32 +08:00
Ian Chua 5222a37eff fix: command_ams_refresh_rfid function signature in test_printer_agent.cpp 2026-09-24 12:35:03 +08:00
peachismomo 6da938b660 fix: compilation after merge 2026-09-24 01:15:55 +08:00
peachismomo 2dcdf49185 Merge branch 'feat/printer-agent-infra' into feat/printer-agent-impl 2026-09-24 01:02:59 +08:00
peachismomo 52e845a821 fix: add include for non BBL_RELEASE_TO_PUBLIC path in BBLPrinterAgent 2026-09-24 00:23:47 +08:00
Ian Chua ffb4813510 fix: preserve moonraker device names 2026-09-23 20:17:06 +08:00
Ian Chua 7436f68e09 fix: make moonraker gcode commands asynchronous 2026-09-23 20:15:52 +08:00
Ian Chua ad956591ce fix: use correct device id for Moonraker connections 2026-09-23 20:14:21 +08:00
Ian Chua 8da8e9bee1 fix: persist input printer host and port 2026-09-23 20:12:18 +08:00
Ian Chua 0acc8608b1 refactor: make printer connection SSL agent-specific 2026-09-23 20:11:47 +08:00
Ian Chua a2a9b2ce94 refactor: collapse command_ams_refresh_rfid and command_ams_refresh_rfid2 2026-09-23 18:30:05 +08:00
Ian Chua 07bee6c7a4 Merge branch 'feat/printer-agent-infra' into feat/printer-agent-impl 2026-09-23 15:35:22 +08:00
Ian Chua 1615390182 Merge branch 'main' into feat/printer-agent-infra 2026-09-23 14:54:38 +08:00
Ian Chua cf20994b58 refactor: connect_printer api and dialog (#15827)
# Description

<!--
> Please provide a summary of the changes made in this PR. Include
details such as:
  > * What issue does this PR address or fix?
  > * What new features or enhancements does this PR introduce?
> * Are there any breaking changes or dependencies that need to be
considered?
-->

Changing the IP address input dialog and `connect_printer` API in
preparation for configurable Moonraker/Orca printer agent connections.

# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->
<img width="460" height="699" alt="image"
src="https://github.com/user-attachments/assets/35e3ce17-7594-4401-b140-100dea082221"
/>


## Tests

<!--
> Please describe the tests that you have conducted to verify the
changes made in this PR.
-->

<!--
> A guide for users on how to download the artifacts from this PR.
-->

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
2026-09-23 14:54:26 +08:00
Ian Chua 309bb3c6e2 Merge branch 'feat/printer-agent-infra' into feat/printer-agent-impl 2026-09-23 14:53:49 +08:00
Ian Chua 79f20c3996 Merge branch 'feat/printer-agent-infra' into refactor/connect-printer-api 2026-09-23 14:48:33 +08:00
Ian Chua 33179c1902 fix: make integration tests headless 2026-09-23 14:29:57 +08:00
peachismomo ccaafb3003 tests: cover WebMediaController lifecycle with wxWebView stub 2026-09-23 03:50:35 +08:00
peachismomo 7d4d8276a2 tests: add device manager integration coverage 2026-09-23 03:25:08 +08:00
peachismomo c492436228 refactor: centralize printer compatibility checks 2026-09-23 03:06:15 +08:00
peachismomo 99a1cd1b74 chore: reduce diagnostic logging level to trace 2026-09-23 02:58:30 +08:00
peachismomo 4b41bf7f4f fix: clear webview document on stop 2026-09-23 02:57:56 +08:00
peachismomo d5962052ca fix: handle malformed printer progress values safely 2026-09-23 02:53:10 +08:00
peachismomo f1410c8cac feat: extend optional printer model warnings to calibration & ams workflows 2026-09-23 02:49:27 +08:00
peachismomo 7283a05040 fix: validate windows FFmpeg avformat library 2026-09-23 02:33:47 +08:00
peachismomo c32c87863b test: cover printer agent default command dispatch 2026-09-23 01:54:23 +08:00
peachismomo 06f7016d6a fix: preserve printer agent defaults in PrinterAgentPluginCapabilityTrampoline 2026-09-23 01:53:56 +08:00
peachismomo be9ae6ffbf fix(tests): make omitted printer agent operations answer like a missing agent 2026-09-23 00:35:33 +08:00
Ian Chua cda25c3715 refactor: connect_printer api and dialog 2026-09-22 21:54:10 +08:00
Ian Chua 2dcdfe2d32 fix: refresh token before configuring printer MQTT 2026-09-22 21:46:09 +08:00
Ian Chua 9e34ca536b fix: port BBL implementations from #15711 2026-09-22 21:11:03 +08:00
Ian Chua 201617a6c0 fix: guard DeviceManager command dispatch when no printer agent is bound 2026-09-22 21:09:58 +08:00
Ian Chua 2dcbee3d76 Merge branch 'main' into feat/printer-agent-infra 2026-09-22 20:55:29 +08:00
Ian Chua 6c353d9596 feat: add ssl compatibility with moonrakerprinteragent 2026-09-22 18:30:30 +08:00
Ian Chua ce0c759ded fix: snapmakerprinteragent use moonraker's lifecycle-owned command worker 2026-09-22 16:06:18 +08:00
Ian Chua 9a7e925790 fix: re-implement missing commands on BBLPrinterAgent 2026-09-22 15:49:22 +08:00
Ian Chua f27b0a1f9d Merge branch main into feat/printer-agent-infra 2026-09-22 12:11:40 +08:00
Ian Chua cf1c164546 feat: add printer-agent.md doc to HLSD 2026-09-21 18:40:24 +08:00
Ian Chua d9f1f8b207 fix: camera signaling API 2026-09-21 16:19:31 +08:00
Ian Chua a096e1ab8c Merge branch 'feat/printer-agent-infra' into feat/printer-agent-impl 2026-09-21 16:02:11 +08:00
Ian Chua bca8dd00dd Merge branch 'feat/printer-agent-infra' of https://github.com/OrcaSlicer/OrcaSlicer into feat/printer-agent-infra 2026-09-21 15:45:49 +08:00
Ian Chua 8b7f8cac82 fix: follow external-packages for flatpak libdatachannel deps & add flatpak path to use source_dir 2026-09-21 15:45:39 +08:00
Ian Chua aae03257ed Merge branch 'main' into feat/printer-agent-infra 2026-09-21 11:54:23 +08:00
Ian Chua 3fba237c9a fix: shift camera signaling channel to network agent 2026-09-21 11:48:16 +08:00
Ian Chua cfb6349695 fix: update printer agent plugin API 2026-09-21 11:46:36 +08:00
Ian Chua f53ad6993a fix: update windows ffmpeg prebuild 2026-09-21 11:02:20 +08:00
peachismomo 91c6d1d3d5 Merge branch 'feat/printer-agent-impl' of https://github.com/OrcaSlicer/OrcaSlicer into feat/printer-agent-impl 2026-09-18 22:31:37 +08:00
peachismomo b91f48141d fix: load windows roots for cloud MQTT and camera signaling 2026-09-18 22:31:25 +08:00
Ian Chua e168d900f2 fix: stop flatpak DataChannel build from re-cloning over the sandboxed network 2026-09-18 22:10:30 +08:00
Ian Chua 467e249b3d Merge branch 'feat/printer-agent-infra' into feat/printer-agent-impl 2026-09-18 20:46:18 +08:00
Ian Chua bc03e3be2f fix: bump libdatachannel ver & update flatpak to use tar instead 2026-09-18 20:45:29 +08:00
Ian Chua 5287fd0160 fix: swtich start print command from http to mqtt command 2026-09-18 15:59:57 +08:00
Ian Chua c441fd2fa4 Merge branch feat/printer-agent-infra into feat/printer-agent-impl 2026-09-18 15:59:25 +08:00
Ian Chua f224b8e4a6 refactor: media controller playback routing and ownership 2026-09-18 13:36:46 +08:00
Ian Chua 8b479c9af3 fix: default impl for vendor agnostic gcode commansd 2026-09-17 18:46:56 +08:00
Ian Chua d8299c388e fix: regression bug, connecting to bambu needs bblp username 2026-09-17 18:44:54 +08:00
Ian Chua 771d455d12 Merge branch 'feat/printer-agent-infra' into feat/printer-agent-impl 2026-09-17 16:33:38 +08:00
Ian Chua a7ab01b815 fix: remove unimplemented pure virtual functions 2026-09-17 16:33:11 +08:00
Ian Chua 4d85b6627e fix: wrap command_* with small wrapper 2026-09-17 12:51:17 +08:00
Ian Chua 38e35dbff4 Merge branch 'feat/printer-agent-infra' into feat/printer-agent-impl 2026-09-16 22:59:22 +08:00
Ian Chua dcddb9283c fix: updated stale docs 2026-09-16 22:54:54 +08:00
Ian Chua ba9cf6e897 Revert "fix: latent ams in use bug"
This reverts commit 910dbcd2e6.
2026-09-16 22:54:54 +08:00
Ian Chua d1f2ecb903 feat: restore printer agent implementations 2026-09-16 22:54:46 +08:00
Ian Chua ee2b4ccf70 Merge branch 'main' into feat/printer-agent-infra 2026-09-16 22:32:32 +08:00
Ian Chua 753c793ea0 revert: filament sync work 2026-09-16 22:20:35 +08:00
Ian Chua 9c5494b19f fix: disable unused DataChannel media support 2026-09-16 22:08:53 +08:00
Ian Chua 93a119427a Merge branch main into feat/printer-agent-infra 2026-09-16 22:06:09 +08:00
Ian Chua d264fcaef4 fix: always build bundled DataChannel dep 2026-09-16 22:04:27 +08:00
Ian Chua b4ab6dedfd fix: move printer agent plugin tests into test_plugin_lifecycle.cpp 2026-09-16 21:33:04 +08:00
Ian Chua ed59f93456 fix: scope get_my_machine_list to printers listed under the current printer agent 2026-09-16 19:48:59 +08:00
Ian Chua cf52c81dcd fix: stop the correct media controller 2026-09-16 18:44:06 +08:00
Ian Chua 803a2a3239 fix: dedupe compatible printer type check 2026-09-16 17:18:59 +08:00
Ian Chua 985092bb46 fix: move non-mandatory printer agent function stubs to IPrinterAgent 2026-09-16 16:56:43 +08:00
Ian Chua cb16a2e547 feat: enable https camera stream mode 2026-09-16 16:24:29 +08:00
Ian Chua 2c2e91b629 fix: remove hardcoded ICE servers 2026-09-16 14:36:49 +08:00
Ian Chua c3faf903ca fix: use ORCA_CLOUD_PROVIDER instead of hardcoded string 2026-09-16 14:24:40 +08:00
Ian Chua 5f3c957597 fix: remove stale comment 2026-09-16 14:23:00 +08:00
Ian Chua 8557285389 fix: revert moonraker specific behavior 2026-09-16 14:21:09 +08:00
Ian Chua a9edab78a8 fix: inject provider, agent id and generation to get_user_print_info to ensure correct metadata 2026-09-16 14:15:24 +08:00
Ian Chua 79dede7d59 fix: change rtc log level 2026-09-16 14:14:21 +08:00
Ian Chua 2ac45b2f78 fix: invoke js clearInterval on WebMediaController::stop 2026-09-16 14:13:37 +08:00
Ian Chua b4f33e71e9 fix: add internal_developer_mode chekc back to MediaPlayCtrl::load() 2026-09-16 14:12:48 +08:00
Ian Chua 8c91cab971 fix(ci): add libdatachannel to flatpak manifest 2026-09-15 20:01:48 +08:00
Ian Chua 79077518e9 fix: re-include apply header guarded by ifdef __APPLE__ 2026-09-15 19:45:14 +08:00
Ian Chua 56aa348c89 fix(ci): set depends openssl 2026-09-15 18:16:50 +08:00
Lam Wei Lun ae1752fbf2 Resolve printer agent first before getting cloud printer agent 2026-09-15 18:02:02 +08:00
Ian Chua cf3f36a1c6 Merge branch 'feat/printer-agent-infra' of https://github.com/OrcaSlicer/OrcaSlicer into feat/printer-agent-infra 2026-09-15 17:37:57 +08:00
Ian Chua cca7d8adb1 fix(ci): deps build order for datachannel 2026-09-15 17:35:25 +08:00
Ian Chua 396d9ff51a Merge branch 'main' into feat/printer-agent-infra 2026-09-15 16:47:15 +08:00
Ian Chua 81540c81e0 Merge branch 'feat/printer-agent-infra' of https://github.com/OrcaSlicer/OrcaSlicer into feat/printer-agent-infra 2026-09-15 16:46:38 +08:00
Ian Chua e7ace6cc99 fix: unit tests & unused variables 2026-09-15 16:46:28 +08:00
Lam Wei Lun 79c20a1fad Guard libdatachannel. Remove unused code 2026-09-15 16:33:12 +08:00
Ian Chua e48f9f47d2 Revert "fix: parameterize orcaslicer_copy_test_dlls() for printer_agent_plugin_tests"
This reverts commit 2f566e3779.
2026-09-15 16:12:33 +08:00
Ian Chua 2f566e3779 fix: parameterize orcaslicer_copy_test_dlls() for printer_agent_plugin_tests 2026-09-15 16:08:10 +08:00
Ian Chua 37d1edf69a fix: printer agent virutal optional functions 2026-09-15 15:54:55 +08:00
Lam Wei Lun f1cf9c69b1 Log first before std::move 2026-09-15 15:49:15 +08:00
Lam Wei Lun 1df362888e Fixes nullptr deref 2026-09-15 15:47:48 +08:00
Ian Chua 4b2466b179 fix: uninitialized ams state blocking print 2026-09-15 14:40:04 +08:00
Ian Chua 3adcb3e953 fix: split infra from impl 2026-09-15 13:27:17 +08:00
Ian Chua 104dbb2140 fix: camera auto-play on startup 2026-09-14 16:17:17 +08:00
Ian Chua e482cbbdd7 fix: warnings 2026-09-14 14:56:34 +08:00
Ian Chua 2a5ddd9edb fix: warnings 2026-09-14 14:16:02 +08:00
Ian Chua c10f83cf61 Merge branch 'main' into feat/printer-agent-impl 2026-09-14 13:01:03 +08:00
Ian Chua 8eeec6935e Merge branch 'main' of https://github.com/OrcaSlicer/OrcaSlicer_priv into feat/printer-agent-impl 2026-09-14 12:53:04 +08:00
Ian Chua 131a2abf99 Merge pull request #138 from OrcaSlicer/feat/orca-printer-agent
feat: orca printer agent
2026-09-14 12:14:53 +08:00
peachismomo 9daecc59b4 temp: doc for intended change 2026-09-12 02:32:01 +08:00
peachismomo 58e000d842 feat: cloud download via HTTP 2026-09-12 02:31:27 +08:00
Ian Chua af6be5858e fix: cloud printers were using the wrong MQTT endpoint 2026-09-11 17:38:56 +08:00
Ian Chua 3fc7fd99d6 fix: shim layer for any compatibiliity changes 2026-09-10 21:55:31 +08:00
Ian Chua 3fe043651b fix: moonraker printer agent hang on printer power cut 2026-09-09 18:40:01 +08:00
Ian Chua b0b78c296c feat: check printer storage status before sending 2026-09-09 18:35:38 +08:00
Ian Chua 62791fabfa fix: revert sdcard check 2026-09-09 14:10:12 +08:00
Ian Chua b0ada2dee5 fix: ffmpeg http camera stream jittering due to incomplete frames 2026-09-09 13:40:51 +08:00
Ian Chua 8f4df1aa8c fix: model_id resolution method for non bambu printers 2026-09-09 13:40:24 +08:00
Ian Chua 5fec9b8d19 Merge pull request #139 from OrcaSlicer/feat/webrtc-impl
feat: webrtc implementation
2026-09-08 19:37:31 +08:00
Ian Chua 75ed5afbac Merge branch 'feat/orca-printer-agent' into feat/webrtc-impl 2026-09-08 19:31:14 +08:00
Ian Chua 01c553bad9 feat: LAN impl for Orca Printer Agent 2026-09-08 19:13:48 +08:00
Ian Chua a4376c77c3 Merge branch 'feat/orca-printer-agent' of https://github.com/OrcaSlicer/OrcaSlicer_priv into feat/orca-printer-agent 2026-09-08 12:06:25 +08:00
peachismomo c459994290 fix: connect via ip dialog 2026-09-08 04:40:12 +08:00
Ian Chua 3a0fda7d18 fix: make model_id/dev_type optional instead of blocking 2026-09-07 17:28:40 +08:00
Ian Chua eb8733f0f4 Merge branch 'feat/orca-printer-agent' into feat/webrtc-impl 2026-09-04 18:28:48 +08:00
Ian Chua 55acb940a8 Merge branch 'feat/printer-agent-impl' into feat/orca-printer-agent 2026-09-04 18:28:25 +08:00
Ian Chua 0d691403de Merge branch 'main' into feat/printer-agent-impl 2026-09-04 18:26:58 +08:00
Ian Chua 9b2b75a51d Merge branch 'feat/orca-printer-agent' into feat/webrtc-impl 2026-09-04 18:23:26 +08:00
Ian Chua 25da273ea0 Merge pull request #142 from OrcaSlicer/fix/orca-printer-agent-refactor
fix: orcaprinteragent refactor
2026-09-04 18:05:27 +08:00
Ian Chua dbcb82075f feat: use ffmpeg to render http camera stream 2026-09-04 16:42:36 +08:00
Ian Chua 2f82cfe40f fix: LAN paths and camera stream 2026-09-04 16:18:43 +08:00
Ian Chua 972031cf06 fix: orcaprinteragent refactor 2026-09-03 19:42:25 +08:00
Ian Chua 2a4792e762 feat: remove frame assembler and change config to set protocol 2026-09-02 15:59:13 +08:00
Ian Chua dd15ac6146 fix: cmake 2026-09-02 11:51:40 +08:00
Ian Chua b0469254bc Merge branch 'feat/orca-printer-agent' into feat/webrtc-impl 2026-09-01 19:24:04 +08:00
Ian Chua 2228589e16 Merge branch 'feat/printer-agent-impl' into feat/orca-printer-agent 2026-09-01 19:23:47 +08:00
Ian Chua 4d8480e1a1 fix: build 2026-09-01 19:21:23 +08:00
Ian Chua 4320cc78d9 feat: camera via webrtc 2026-09-01 18:59:20 +08:00
Ian Chua d9d9678a7e Merge branch 'feat/orca-printer-agent' into feat/webrtc-impl 2026-09-01 18:38:01 +08:00
Ian Chua d55a0bfec6 fix: build errors 2026-09-01 18:37:04 +08:00
Ian Chua 3b1017df51 Merge branch 'feat/orca-printer-agent' of https://github.com/OrcaSlicer/OrcaSlicer_priv into feat/orca-printer-agent 2026-09-01 18:17:23 +08:00
Ian Chua f5b81d2ffc Merge branch 'feat/webrtc-impl' of https://github.com/OrcaSlicer/OrcaSlicer_priv into feat/webrtc-impl 2026-09-01 18:16:20 +08:00
Ian Chua eb9cfe0ecb feat: connect to cloud printer and monitor 2026-09-01 18:15:53 +08:00
Ian Chua 1e8805d43d feat: connect to cloud printer and monitor 2026-09-01 18:15:53 +08:00
Ian Chua e8f089dfa4 fix: build & access code UI 2026-09-01 18:13:11 +08:00
Ian Chua 84e929ea24 feat: generic camera stream support for http snapshot and rtsp 2026-09-01 18:13:11 +08:00
Ian Chua abec603e73 fix: build & access code UI 2026-09-01 18:04:37 +08:00
Ian Chua 0ed19d4826 feat: generic camera stream support for http snapshot and rtsp 2026-09-01 18:02:53 +08:00
Ian Chua b747c13ef4 Merge branch 'feat/orca-printer-agent' of https://github.com/OrcaSlicer/OrcaSlicer_priv into feat/orca-printer-agent 2026-09-01 17:40:07 +08:00
Ian Chua 6a12aca495 feat: connect to cloud printer and monitor 2026-09-01 17:38:52 +08:00
Ian Chua d486db6459 Merge branch 'main' into feat/printer-agent-impl 2026-09-01 16:51:34 +08:00
Ian Chua fe777b8801 feat: printer agent impl 2026-09-01 16:49:04 +08:00
Ian Chua 1b3e206f34 feat: connect to cloud printer and monitor 2026-08-28 18:10:31 +08:00
Ian Chua 4df1607ec4 fix: clear up some unrelated changes 2026-08-28 16:45:01 +08:00
Ian Chua a0ec8bec8a fix: merge artifact 2026-08-27 15:08:06 +08:00
Ian Chua 36c362cbd2 Merge branch 'main' into feat/printer-agent-impl 2026-08-27 14:54:22 +08:00
Ian Chua 84fde32616 Merge branch 'main' into refactor/printer-agent-interface 2026-08-27 14:52:50 +08:00
Ian Chua 34e349e323 fix: snapmaker U1 SelectMachineDialog blocking print 2026-08-27 14:47:09 +08:00
Ian Chua 44941e571f fix: remove unused variable 2026-08-26 18:40:48 +08:00
Ian Chua 876d6e2499 fix: printer agent switching on preset change 2026-08-26 18:40:47 +08:00
Ian Chua 858b3024ff fix: tests 2026-08-26 12:04:02 +08:00
Ian Chua 6595557c34 fix: access codes regression 2026-08-25 18:32:02 +08:00
Ian Chua c729849843 cleanup moonraker and snapmaker printer agents 2026-08-25 16:39:08 +08:00
Ian Chua c0563be36e Merge branch 'feat/printer-agent-impl' of https://github.com/OrcaSlicer/OrcaSlicer into feat/printer-agent-impl 2026-08-25 14:47:12 +08:00
Ian Chua 462f8dce30 fix: remote do_fetch_filament_info from tests 2026-08-25 14:46:11 +08:00
Ian Chua b2a0485139 fix: defer filesystem and camera abstractions 2026-08-25 14:34:11 +08:00
Ian Chua f16071f083 fix: remove heavy includes from IPrinterAgent 2026-08-25 13:54:40 +08:00
Ian Chua a1505e9bed Merge branch 'main' into refactor/printer-agent-interface 2026-08-25 13:50:25 +08:00
Ian Chua 8e48312b1f Merge branch 'main' into feat/printer-agent-impl 2026-08-25 13:47:11 +08:00
Ian Chua ba7fdb8ceb Merge branch 'main' into feat/printer-agent-impl 2026-08-21 14:17:56 +08:00
Ian Chua 8be9800567 remove irrelevant docs 2026-08-21 14:16:49 +08:00
Ian Chua c4eabc3c52 fix: extend access code requirements t 0, 8 or more characters. 2026-08-21 14:14:23 +08:00
Ian Chua 0d0d281d0c feat: parse nozzle information for qidi and moonraker printer agents 2026-08-20 20:11:31 +08:00
Ian Chua c4bbcd322b fix: skip filament sync dialog if filamentSyncMode is none 2026-08-20 19:28:02 +08:00
Ian Chua 7aea1b1235 Merge branch 'main' into feat/printer-agent-impl 2026-08-20 16:39:54 +08:00
Ian Chua 41c16436bf Merge branch 'main' into refactor/printer-agent-interface 2026-08-20 16:09:10 +08:00
Ian Chua 2bbb229c91 Merge branch 'main' into refactor/printer-agent-interface 2026-08-19 23:30:22 +08:00
Ian Chua c2a43157d2 Merge branch 'main' into feat/printer-agent-impl 2026-08-19 18:29:36 +08:00
Ian Chua 738b30a743 fix: ams sync info and periodic ams sync via subscription workflow 2026-08-19 18:29:19 +08:00
Ian Chua 6e6ffe13f8 Merge branch 'refactor/printer-agent-interface' of https://github.com/OrcaSlicer/OrcaSlicer into refactor/printer-agent-interface 2026-08-19 17:11:14 +08:00
Ian Chua eb96d127b0 fix: resolve stubgen byte header conflict 2026-08-19 17:11:10 +08:00
SoftFever 60421c33f4 Merge branch 'main' into refactor/printer-agent-interface 2026-08-19 14:32:42 +08:00
SoftFever 300c4b8afb Merge branch 'main' into refactor/printer-agent-interface 2026-08-18 20:44:56 +08:00
Ian Chua 96092ef2d3 feat: update qidi to use subscription based filament sync mode 2026-08-18 19:05:17 +08:00
Ian Chua d9002ad87d fix: ams filament mapping workflow 2026-08-18 18:07:22 +08:00
Ian Chua 4c1ea0a602 Merge branch 'main' into 'feat/printer-agent-impl' 2026-08-17 14:51:04 +08:00
Ian Chua 9415812d85 Merge branch 'main' into refactor/printer-agent-interface 2026-08-17 14:24:23 +08:00
Ian Chua d3c728557e Merge 'main' into 'refactor/printer-agent-interface' 2026-08-17 14:24:05 +08:00
Ian Chua 6558c52849 revert file transfer abstraction 2026-08-17 14:19:41 +08:00
Ian Chua a34d056de2 specify api for getting file transfer url 2026-08-14 15:31:42 +08:00
Ian Chua 7ba5718be6 fix: remove redundant cache 2026-08-12 18:41:51 +08:00
Ian Chua c1163ce7e5 Merge branch 'refactor/printer-agent-interface' of https://github.com/OrcaSlicer/OrcaSlicer into refactor/printer-agent-interface 2026-08-12 15:29:56 +08:00
Ian Chua da187eaaf9 fix callback error 2026-08-12 15:29:50 +08:00
Ian Chua de0268ce86 Merge branch 'main' into refactor/printer-agent-interface 2026-08-12 15:28:53 +08:00
Ian Chua 108923bdaa fix: default impl 2026-08-12 14:02:04 +08:00
Ian Chua 44793f7a21 remove unused 2026-08-12 13:51:54 +08:00
Ian Chua 7cb1805272 refactor: push bbl workflows to bbl printer agent 2026-08-12 13:50:47 +08:00
Ian Chua d5c528b7c7 Merge branch 'refactor/printer-agent-interface' of https://github.com/OrcaSlicer/OrcaSlicer into refactor/printer-agent-interface 2026-08-11 15:00:42 +08:00
Ian Chua 742cb712d8 refactor: abstract bambu specific protocol to printer agent 2026-08-11 15:00:34 +08:00
Ian Chua fd1c5d826c Merge branch 'main' into refactor/printer-agent-interface 2026-08-07 18:37:56 +08:00
Ian Chua 58be7f4861 feat: abstract remaining gcode commands in devicemanager 2026-08-07 18:36:38 +08:00
Ian Chua 4031b00915 Merge branch 'main' into refactor/printer-agent-interface 2026-08-06 16:27:57 +08:00
Ian Chua 07c62112b8 Reconcile implementation split with PR tip 2026-08-04 18:12:51 +08:00
Ian Chua f23e4963bf fix: merge access codes into one 2026-08-04 18:12:43 +08:00
Andrew 95279f7084 docs: document the printer-agent subsystem 2026-08-04 18:12:43 +08:00
Andrew 1014558c91 Keep printer-agent progress in sync
Keep the shared task progress aligned with agent
reports that lack Bambu cloud task identity.

Release the lazily allocated task during reset to
avoid leaks when machine objects reconnect.
2026-08-04 18:12:42 +08:00
Andrew 6515062a3a fix: stop Qidi slot parse throwing on null 2026-08-04 18:12:42 +08:00
Andrew 8153e26b6d fix: start stream when camera URL changes 2026-08-04 18:12:42 +08:00
Andrew 79fd33d49a Show Snapmaker U1 camera in Device tab
The U1 exposes no /server/webcams/list entry;
its camera only captures after an explicit
camera.start_monitor RPC, which the Moonraker
websocket executes unauthenticated but only
answers over MQTT - so the call is fire and
forget.

Start the camera when the camera view is
shown and renew every 300 s: the printer
retires the capture task at ~362 s and
stop_monitor is accepted but ineffective,
so teardown is simply to stop renewing.

Frames land in monitor.jpg as still JPEGs
(~2 fps at interval 0), so the webview loads
a local HTML wrapper that repolls with a
cache buster.
2026-08-04 18:12:41 +08:00
Andrew cdb662d4b2 Move Moonraker commands off the UI thread
Pause/resume/stop, g-code sends, temps, and
light ran synchronous HTTP on the UI thread,
freezing the app up to 10s per click on slow
or unreachable printers.

Run them on a single agent-owned FIFO worker
so g-code ordering is preserved, while command
translation stays synchronous so unsupported-
command dialogs still work.

Add a pending-disabled state to the pause,
resume, and abort buttons for Moonraker-family
printers: the icon only flips once the
WebSocket reports the real state, which also
rules out double-click races.
2026-08-04 18:12:41 +08:00
Andrew a27fa7b5df Fix multi-color filament logic
Reuse color decoding across functions to improve
code readability and maintain consistency in
multi-color filament handling.
2026-08-04 18:12:40 +08:00
Andrew cdeed107c5 Keep Bambu AMS dialect out of the agent waist
M620 is Bambu firmware dialect, not a
neutral command. Composing it in
MachineObject let non-Bambu agents
(Moonraker/Klipper) forward it and
report success on firmware that
cannot run it.

Agents now own the dialect: the
default refusal on IPrinterAgent
returns not-supported so the UI
can say so; BBLPrinterAgent keeps
the byte-identical composition.
2026-08-04 18:12:40 +08:00
Andrew be92f7e78c Surface Moonraker webcams and gate unrunnable controls 2026-08-04 18:12:39 +08:00
Andrew 76f9de4cfb fix: make Klipper macro lamp control reliable 2026-08-04 18:12:39 +08:00
Andrew cd6d2cbf5e Stop blocking print on unreported nozzle data 2026-08-04 18:12:39 +08:00
Andrew deaca0189f Bring Moonraker device panel to feature parity
The monitor panel showed wrong or missing
data for Moonraker printers, and its
controls did nothing.

Push payload now carries layer number and
total layers. Remaining time replaces the
wrong total_duration - print_duration
formula. The chamber light toggle maps to
Klipper SET_PIN / SET_LED, and pause,
resume and stop post to
/printer/print/{action}. Task thumbnails
resolve via /server/files/thumbnails onto
a new MachineObject thumbnail url.

Filament sync switches to pull mode so the
agent is queried on demand.

Not compiled or run.
2026-08-04 18:12:38 +08:00
Andrew 7d54ee286d fix: pin HTTP to prevent connection refusal
Set `use_ssl` to false to ensure Moonraker
connectivity, as the service uses HTTP rather
than HTTPS, preventing connection issues. Initialize
device info early for reliable name resolution.
2026-08-04 18:12:38 +08:00
Andrew dddfc7a8ad Add printer-agent and plugin status tests
Ports the agent lifecycle, duplicate
agent-id, built-in-id clash and
status-resolution tests. The loader
runs on a detached worker thread, so
the lifecycle tests live in their own
executable. Tests install the
production unload-side registry
wiring themselves (no GUI in the
test binary) and register agents
manually so concurrent loads stay
deterministic.
2026-08-04 18:12:37 +08:00
Andrew 673bfb0dee Track BBLPrinterAgentPlugin.py 2026-08-04 18:12:37 +08:00
Andrew b9e8c5a38c Gate agent mode behind use_printer_agents toggle
Replace per-printer auto-activation
(is_current_printer_agent_plugin)
with a global experimental AppConfig
toggle, default off: legacy
print-host behavior is unchanged
until the user opts in. The toggle
drives device-tab routing, print
button defaults, connect-button
visibility and sidebar layout, and
dedups machine-select dialog opens.
2026-08-04 18:12:36 +08:00
Andrew a2a4ca20e4 Reset device selection on agent swap or unload (#124)
set_live_printer_agent centralizes
the swap: deselect the machine,
clear stale sidebar state and the
previous agent's Other Devices, then
install the new agent (or null when
its provider vanished). Plugin
load/unload callbacks refresh the
dropdown and re-run agent selection.
load_last_machine no longer falls
back to the first available machine.
2026-08-04 18:12:36 +08:00
Andrew 12075459d2 Replace fake-enum printer agent dropdown (#121)
A dedicated PrinterAgentChoice field
reads rows straight from the live
agent registry and stores the agent
id string, replacing the fake-coEnum
index mapping. The field moves to
TabPrinter and registers with the
searcher so UnsavedChanges renders
it; the PhysicalPrinterDialog copy
and its update hook are removed
(#125). switch_printer_agent now
resolves ids via
resolve_printer_agent_id.
2026-08-04 18:12:36 +08:00
Andrew f3770f3106 fix: checkbox should depend on plugin is_loaded status 2026-08-04 18:12:35 +08:00
Andrew 90fbf1770f Resolve duplicate agent ID conflicts
Reject a printer-agent capability
whose agent ID is already owned by
another capability or built-in:
flag the plugin error, disable the
capability, and warn the user
instead of silently ignoring it.
2026-08-04 18:12:35 +08:00
Andrew bde94ab37f Add support for runtime error status in plugins
Distinguish a loaded plugin whose
capability errored (RuntimeError,
warn-styled, stays checked) from a
load-time Error. Status now derives
via resolve_plugin_status(); enum
ordinal keeps dialog sort priority.
Unloading clears stale errors.
2026-08-04 18:12:34 +08:00
Ian Chua 6d25e1777e Working Moonraker and Qidi printer agent transport (#104)
Folds the Qidi AMS box-mapping print
overrides (apply_box_mapping +
start_* wrappers) that the transport
fix builds on.
2026-08-04 18:12:34 +08:00
Andrew 7ce26ca8e5 Harden send flow and separate upload failure recovery (#111)
* fix(send): harden FT send path + IP pre-flight UX

* Remove early returns
2026-08-04 18:12:33 +08:00
Andrew 367fcce634 Prevent loss of user access code on LAN reselect
Keep user access code intact to maintain access rights even if
device slot is unpopulated, ensuring continuous connection
and status message reception.
2026-08-04 18:12:33 +08:00
Andrew 9b3a44b339 Parse user print info on the UI thread to prevent heap corruption (#119)
get_user_print_info()'s HTTP fetch can run on a worker thread (e.g. BindJob),
but parse_user_print_info() mutates userMachineList (insert/erase/delete
MachineObject). on_machine_alive (SSDP) mutates the same maps on the UI thread
without locking, so parsing off-thread races the map and frees MachineObjects
out from under it -> heap corruption.

Keep all device-list mutation on the UI thread: parse inline when already on
the main thread, otherwise marshal via CallAfter so it stays serialized with
on_machine_alive.
2026-08-04 18:12:33 +08:00
Ian Chua 6384191102 Add developer flag for printer agents 2026-08-04 18:12:32 +08:00
641 changed files with 2711 additions and 2840 deletions
+3 -7
View File
@@ -1,11 +1,7 @@
# clang-tidy configuration, enforced by the clang-tidy CI job on the lines a pull
# request changes (scripts/clang_tidy_diff.py). Only missing includes are reported
# for now: a file should include the header for every symbol it uses, not rely on
# the precompiled header or another header's includes. Run with --fix to add them.
# Every check listed here gates pull requests, so enable a new one only once the
# code it flags on touched lines is reasonable to fix in passing.
# clang-tidy configuration. Only missing includes are reported for now: a file
# should include the header for every symbol it uses, not rely on the
# precompiled header or another header's includes. Run with --fix to add them.
Checks: '-*,misc-include-cleaner'
WarningsAsErrors: '*'
CheckOptions:
# Missing includes only. Builds without the precompiled header break on these.
misc-include-cleaner.UnusedIncludes: false
-89
View File
@@ -1,89 +0,0 @@
name: clang-tidy
# Runs clang-tidy, with the checks in .clang-tidy, over the C++ lines a pull
# request changes (scripts/clang_tidy_diff.py). The compile database is
# configured without the precompiled header, so code that only builds because
# the PCH supplied an include fails here.
#
# No paths filter: the job is a required check, and a workflow skipped by a
# paths filter leaves a required check pending forever. A PR with no C++
# changes finishes after the first step.
on:
pull_request:
branches:
- main
- release/*
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
clang_tidy:
# Branch protection requires this check by name. Renaming the job disables
# that gate.
name: clang-tidy
runs-on: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
lfs: 'false'
# The PR merge commit plus its first parent, the base it is diffed against.
fetch-depth: 2
- name: Look for changed C++ files
id: changes
run: |
if git diff --name-only HEAD^1 -- src tests | grep -qE '\.(cpp|cc|cxx|hpp|h|hxx)$'; then
echo "cpp=true" >> "$GITHUB_OUTPUT"
else
echo "No C++ changes under src/ or tests/."
fi
# Parsing needs the dependency headers, not a build of this PR's deps/, so
# a PR that changes deps/ falls back to the newest cache main has.
- name: Restore cached deps
if: steps.changes.outputs.cpp == 'true'
uses: actions/cache/restore@v6
with:
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep
key: linux-clang-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }}
restore-keys: linux-clang-cache-orcaslicer_deps-build-
fail-on-cache-miss: true
- name: Apt-Install Dependencies
if: steps.changes.outputs.cpp == 'true' && !vars.SELF_HOSTED
uses: ./.github/actions/apt-install-deps
- name: Install clang-tidy
if: steps.changes.outputs.cpp == 'true'
run: |
python3 -m venv "$RUNNER_TEMP/clang-tidy"
"$RUNNER_TEMP/clang-tidy/bin/pip" install --quiet -r scripts/clang_tidy_requirements.txt
# DEP_BUILD_DIR is named outright: CMake would otherwise derive it from the build
# directory's name and look for the dependencies in deps/build-tidy.
- name: Configure without the precompiled header
if: steps.changes.outputs.cpp == 'true'
run: >
cmake -S . -B build-tidy -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DSLIC3R_PCH=OFF -DORCA_TOOLS=ON -DBUILD_TESTS=ON
-DDEP_BUILD_DIR=${{ github.workspace }}/deps/build
# The one header the build generates rather than the configure.
- name: Generate git_commit_hash.h
if: steps.changes.outputs.cpp == 'true'
run: cmake --build build-tidy --target git_commit_hash_header
- name: Run clang-tidy on the changed lines
if: steps.changes.outputs.cpp == 'true'
run: >
python3 scripts/clang_tidy_diff.py -p build-tidy --base HEAD^1
--clang-tidy "$RUNNER_TEMP/clang-tidy/bin/clang-tidy" -j "$(nproc)"
-1
View File
@@ -36,7 +36,6 @@ ctest --test-dir ./tests/fff_print -C Release
- C++17, selective C++20. PascalCase classes, snake_case functions/variables
- `#pragma once` for headers. Smart pointers and RAII preferred
- Include what you use: include the header for every symbol a file uses, and keep headers compilable on their own. Never rely on the precompiled header or a transitive include. The `clang-tidy` CI job enforces this on changed lines; run the same check locally with `scripts/run_clang_tidy.sh` (`scripts\run_clang_tidy.ps1` on Windows), which sets up everything it needs
- Parallelization via TBB — be mindful of shared state
- Always use `SetSizerAndFit(sizer)` instead of `SetSizer(sizer)` on top level window. Unless `SetSizer` must be called before the full layout is built, call `sizer->SetSizeHints(window)` afterwards in this case.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "OrcaFilamentLibrary",
"version": "02.04.00.19",
"version": "02.04.00.18",
"force_update": "0",
"description": "Orca Filament Library",
"filament_list": [
@@ -6,7 +6,7 @@
"filament_id": "OFvgE0Zh",
"instantiation": "false",
"fan_cooling_layer_time": [
"80"
"85"
],
"fan_min_speed": [
"50"
-285
View File
@@ -1,285 +0,0 @@
#!/usr/bin/env python3
"""Run clang-tidy on the C++ files changed since a base revision.
Check findings are reported only on added or modified lines, so existing code
is not held to checks it predates. A changed source file that does not compile
(for example one that only built because the precompiled header supplied an
include) fails wherever the error is. Headers are compiled on their own, and
fail only on errors in their changed lines. Deleting an #include also fails
on every use, changed or not, that now lacks the header it provided.
The checks come from .clang-tidy at the repository root. The compile database
must come from a configure with SLIC3R_PCH=OFF, or the precompiled header hides
missing includes.
python3 scripts/clang_tidy_diff.py -p build-tidy --base origin/main
"""
import argparse
import json
import os
import re
import subprocess
import sys
import tempfile
from collections import Counter
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass, field
from pathlib import PurePosixPath
SOURCE_EXTENSIONS = {".cpp", ".cc", ".cxx"}
HEADER_EXTENSIONS = {".hpp", ".h", ".hxx"}
CHECKED_DIRS = ("src/", "tests/")
# Vendored code inside the checked directories.
EXCLUDED_DIRS = ("src/glad/", "tests/catch2/")
# Per file. A deleted include can leave hundreds of follow-on errors.
MAX_REPORTED = 30
HUNK_RE = re.compile(r"^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@")
DIAGNOSTIC_RE = re.compile(r"^(.+?):(\d+):(\d+): (error|warning): (.*)$")
FIX_MESSAGE_RE = re.compile(r"^\s+Message:\s+(['\"])(.*)\1$")
FIX_INCLUDE_RE = re.compile(r"^\s+ReplacementText:\s+['\"]#include ([^\\'\"]*)")
REMOVED_INCLUDE_RE = re.compile(r'^-\s*#\s*include\s*[<"]([^>"]+)[>"]')
@dataclass
class FileChange:
lines: list = field(default_factory=list) # [first, last] ranges of added lines
removed_includes: set = field(default_factory=set) # header names whose #include was deleted
@dataclass
class Diagnostic:
file: str
line: int
col: int
level: str
message: str
include: str = "" # header named by the fix, when the fix adds an #include
@property
def is_compile_error(self):
return self.message.endswith("[clang-diagnostic-error]")
def __str__(self):
return self.message + (f" (add #include {self.include})" if self.include else "")
def parse_diff(diff):
"""Map each file in a `git diff -U0` to the lines it adds and the includes it deletes."""
changes = {}
change = None
for line in diff.splitlines():
if line.startswith("+++ "):
target = line[4:]
change = changes.setdefault(target[2:], FileChange()) if target.startswith("b/") else None
continue
if change is None:
continue
match = HUNK_RE.match(line)
if match:
first = int(match.group(1))
count = int(match.group(2) or 1)
if count > 0:
change.lines.append([first, first + count - 1])
continue
match = REMOVED_INCLUDE_RE.match(line)
if match:
change.removed_includes.add(match.group(1))
return changes
def is_checked(path):
if not path.startswith(CHECKED_DIRS) or path.startswith(EXCLUDED_DIRS):
return False
return PurePosixPath(path).suffix in SOURCE_EXTENSIONS | HEADER_EXTENSIONS
def changed_files(merge_base):
# Against the working tree, so a local run covers uncommitted edits too.
diff = subprocess.run(["git", "diff", "-U0", "--no-color", "--no-ext-diff", "--diff-filter=AMR", merge_base],
check=True, capture_output=True, text=True).stdout
return {path: change for path, change in parse_diff(diff).items() if is_checked(path)}
def compiled_sources(build_dir):
with open(os.path.join(build_dir, "compile_commands.json"), encoding="utf-8") as f:
return {os.path.realpath(os.path.join(entry["directory"], entry["file"])) for entry in json.load(f)}
def run_clang_tidy(clang_tidy, build_dir, path, lines, extra_args):
"""Run clang-tidy on one file, limited to `lines` unless it is None."""
with tempfile.TemporaryDirectory() as tmp:
fixes = os.path.join(tmp, "fixes.yaml")
# The compile database comes from the system clang, which may know warning
# flags a newer clang-tidy has dropped.
cmd = [clang_tidy, "-p", build_dir, "--quiet", "--export-fixes=" + fixes,
"--extra-arg=-Wno-unknown-warning-option", "--extra-arg=-ferror-limit=0", *extra_args, path]
if lines is not None:
cmd.insert(1, "--line-filter=" + json.dumps([{"name": path, "lines": lines}]))
result = subprocess.run(cmd, capture_output=True, text=True)
suggestions = parse_suggested_includes(fixes)
output = result.stdout + result.stderr
return result.returncode, output, parse_diagnostics(output, suggestions)
def parse_suggested_includes(fixes_path):
"""Map each message in an --export-fixes file to the header its fix includes."""
if not os.path.exists(fixes_path):
return {}
suggestions = {}
message = None
with open(fixes_path, encoding="utf-8") as f:
for line in f:
match = FIX_MESSAGE_RE.match(line)
if match:
message = match.group(2).replace("''", "'")
continue
match = FIX_INCLUDE_RE.match(line)
if match and message:
suggestions[message] = match.group(1)
message = None
return suggestions
def parse_diagnostics(output, suggestions):
diagnostics = []
for line in output.splitlines():
match = DIAGNOSTIC_RE.match(line)
if match:
file, row, col, level, message = match.groups()
include = suggestions.get(re.sub(r" \[[^]]*\]$", "", message), "")
diagnostics.append(Diagnostic(file, int(row), int(col), level, message, include))
return diagnostics
def in_ranges(line, ranges):
return any(first <= line <= last for first, last in ranges)
def names_removed_include(include, removed):
"""Whether `include` (<a/b.hpp>) is one of the deleted includes, however it was spelled."""
name = include.strip('<>"')
return bool(name) and any(name == r or name.endswith("/" + r) or r.endswith("/" + name) for r in removed)
def own_errors(diagnostics, path):
real = os.path.realpath(path)
return [d for d in diagnostics if d.is_compile_error and os.path.realpath(d.file) == real]
def error_sites(errors, text):
"""Where each error points, as (source line, column): stable across edits to other lines,
unlike line numbers, and across a removed include, unlike clang's wording."""
lines = text.splitlines()
return Counter((lines[d.line - 1].strip() if d.line <= len(lines) else "", d.col) for d in errors)
def errors_alone_at(revision, clang_tidy, build_dir, path):
"""The error sites a header had when compiled on its own at `revision`."""
shown = subprocess.run(["git", "show", f"{revision}:{path}"], capture_output=True, text=True)
if shown.returncode != 0:
return Counter()
# Beside the original, so its quoted includes resolve the same way.
p = PurePosixPath(path)
copy = str(p.with_name(f".{p.stem}.clang-tidy-base{p.suffix}"))
try:
with open(copy, "w", encoding="utf-8") as f:
f.write(shown.stdout)
_, _, diagnostics = run_clang_tidy(clang_tidy, build_dir, copy, None, [])
finally:
os.remove(copy)
return error_sites(own_errors(diagnostics, copy), shown.stdout)
def check_file(clang_tidy, build_dir, merge_base, path, change, extra_args):
"""Run clang-tidy on one file and return (failed, output, failing diagnostics)."""
# A deleted include can orphan uses on unchanged lines, so such a file is
# checked whole and the findings narrowed here. --fix keeps the line filter
# so it never rewrites unrelated code.
whole = bool(change.removed_includes) and not extra_args
returncode, output, diagnostics = run_clang_tidy(clang_tidy, build_dir, path,
None if whole else change.lines, extra_args)
real = os.path.realpath(path)
def introduced(d):
return os.path.realpath(d.file) == real and (
in_ranges(d.line, change.lines) or names_removed_include(d.include, change.removed_includes))
if PurePosixPath(path).suffix in HEADER_EXTENSIONS:
# Many existing headers only compile after what their includers include
# first, so a header is held to errors it introduces: on its changed
# lines, or anywhere a deleted include leaves it with new errors.
failing = [d for d in diagnostics if introduced(d)]
errors = own_errors(diagnostics, path)
if errors and change.removed_includes:
with open(path, encoding="utf-8") as f:
text = f.read()
before = errors_alone_at(merge_base, clang_tidy, build_dir, path)
failing += [d for d in errors if d not in failing
and (error_sites([d], text) - before)]
return bool(failing), output, failing
if whole:
failing = [d for d in diagnostics if d.is_compile_error or introduced(d)]
return bool(failing), output, failing
return returncode != 0, output, diagnostics
def main():
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
parser.add_argument("-p", "--build-dir", required=True, help="directory holding compile_commands.json")
parser.add_argument("--base", default="origin/main", help="revision to diff against (default: origin/main)")
parser.add_argument("--clang-tidy", default="clang-tidy", help="clang-tidy executable")
parser.add_argument("-j", "--jobs", type=int, default=os.cpu_count())
parser.add_argument("extra_args", nargs="*", help="passed to clang-tidy after --, e.g. -- --fix")
args = parser.parse_args()
merge_base = subprocess.run(["git", "merge-base", args.base, "HEAD"], check=True,
capture_output=True, text=True).stdout.strip()
files = changed_files(merge_base)
sources = compiled_sources(args.build_dir)
todo = []
for path, change in sorted(files.items()):
is_source = PurePosixPath(path).suffix in SOURCE_EXTENSIONS
if is_source and os.path.realpath(path) not in sources:
print(f"Skipping {path}: not compiled in this configuration")
elif change.lines or change.removed_includes:
todo.append((path, change))
if not todo:
print("No changed C++ lines to check.")
return 0
print(f"Checking {len(todo)} file(s) with {args.clang_tidy}")
annotate = os.environ.get("GITHUB_ACTIONS") == "true"
root = os.getcwd() + os.sep
failed = []
with ThreadPoolExecutor(max_workers=args.jobs) as pool:
jobs = {path: pool.submit(check_file, args.clang_tidy, args.build_dir, merge_base, path, change, args.extra_args)
for path, change in todo}
for path, job in jobs.items():
file_failed, output, diagnostics = job.result()
if not file_failed:
continue
failed.append(path)
print(f"\n==== {path}")
if not diagnostics:
print(output, end="")
for d in diagnostics[:MAX_REPORTED]:
file = d.file.removeprefix(root)
print(f"{file}:{d.line}:{d.col}: {d.level}: {d}")
if annotate:
print(f"::{d.level} file={file},line={d.line},col={d.col}::{d}")
if len(diagnostics) > MAX_REPORTED:
print(f"... and {len(diagnostics) - MAX_REPORTED} more")
if failed:
print(f"\nclang-tidy failed on {len(failed)} file(s). Add the includes it names, or apply its "
"suggestions locally with scripts/run_clang_tidy.sh --fix (scripts\\run_clang_tidy.ps1 -Fix on Windows).")
return 1
print("clang-tidy passed.")
return 0
if __name__ == "__main__":
sys.exit(main())
-1
View File
@@ -1 +0,0 @@
clang-tidy==22.1.8
-225
View File
@@ -1,225 +0,0 @@
<#
.SYNOPSIS
Runs the clang-tidy check that gates pull requests (.github/workflows/clang_tidy.yml) on
your branch. Windows.
.DESCRIPTION
Configures a separate build directory (build-tidy) without the precompiled header, installs
the pinned clang-tidy into a virtual environment inside it, and runs
scripts/clang_tidy_diff.py the way CI does. Uncommitted changes are checked too.
CI runs on Linux. Here clang-tidy also sees Windows-only code and MSVC's standard library,
so it can report findings CI does not; a change that passes here and on Linux passes CI.
.EXAMPLE
powershell -ExecutionPolicy Bypass -File scripts\run_clang_tidy.ps1
.EXAMPLE
powershell -ExecutionPolicy Bypass -File scripts\run_clang_tidy.ps1 -Fix
#>
param(
# Revision to compare against (default: main of the remote that points at
# OrcaSlicer/OrcaSlicer, else origin/main).
[string]$Base = "",
# Do not fetch that remote's main first.
[switch]$NoFetch,
# Build directory for the compile database.
[string]$BuildDir = "build-tidy",
# Dependency build directory (default: the deps\build* tree build_win.bat made).
[string]$DepsDir = "",
# x64 or arm64 (default: this machine's).
[string]$Arch = "",
# Parallel clang-tidy runs (default: all cores).
[int]$Jobs = 0,
# Apply clang-tidy's fixes (adds the missing includes).
[switch]$Fix,
# Install missing tools without asking.
[switch]$Yes
)
$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent $PSScriptRoot
Set-Location $Root
if (-not [System.IO.Path]::IsPathRooted($BuildDir)) { $BuildDir = Join-Path $Root $BuildDir }
# Ask before installing anything. Without a console, or with "no", print the command
# instead so it can be run by hand.
function Ask([string]$Question) {
if ($Yes) { return $true }
if ([Console]::IsInputRedirected) { return $false }
$reply = Read-Host "$Question [y/N]"
return $reply -match '^[Yy]'
}
function Has([string]$Command) {
return [bool](Get-Command $Command -ErrorAction SilentlyContinue)
}
function Request-Install([string]$What, [string]$Command) {
Write-Host "Missing: $What"
if (Ask "Install it now with: $Command ?") {
& cmd /c $Command
if ($LASTEXITCODE -ne 0) { throw "Installing $What failed." }
Write-Host "Installed. Open a new terminal so PATH picks it up, then run this again."
} else {
Write-Host "To install it yourself, run:"
Write-Host " $Command"
}
exit 1
}
if (-not $Arch) {
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { $Arch = "arm64" } else { $Arch = "x64" }
}
# --- System tools -------------------------------------------------------------
if (-not (Has "git")) { Request-Install "Git" "build_win.bat --install-deps" }
# Python: the py launcher, else a python.exe that is not the Microsoft Store stub.
$Python = $null
if (Has "py") {
& py -3 --version *> $null
if ($LASTEXITCODE -eq 0) { $Python = @("py", "-3") }
}
if (-not $Python -and (Has "python")) {
& python --version *> $null
if ($LASTEXITCODE -eq 0) { $Python = @("python") }
}
if (-not $Python) { Request-Install "Python 3" "winget install -e --id Python.Python.3.12" }
$PyExe = $Python[0]
$PyArgs = @($Python | Select-Object -Skip 1)
# Visual Studio provides the compiler, and its CMake component provides CMake and Ninja.
$Vswhere = Join-Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe"
$VsPath = $null
if (Test-Path $Vswhere) {
$VsPath = & $Vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
}
if (-not $VsPath) { Request-Install "Visual Studio with the C++ tools" "build_win.bat --install-vs buildtools" }
# Load the developer environment, as build_win.bat does.
$HostArch = if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { "arm64" } else { "x64" }
$VsDevCmd = Join-Path $VsPath "Common7\Tools\VsDevCmd.bat"
$envLines = & cmd /c "`"$VsDevCmd`" -arch=$Arch -host_arch=$HostArch -no_logo >nul && set"
foreach ($line in $envLines) {
$i = $line.IndexOf("=")
if ($i -gt 0) { Set-Item -Path ("env:" + $line.Substring(0, $i)) -Value $line.Substring($i + 1) }
}
if (-not (Has "cmake")) { Request-Install "CMake" "build_win.bat --install-deps" }
if (-not (Has "ninja")) { Request-Install "Ninja" "winget install -e --id Ninja-build.Ninja" }
# --- clang-tidy ---------------------------------------------------------------
$Requirements = Join-Path $Root "scripts\clang_tidy_requirements.txt"
$Pinned = ((Get-Content $Requirements | Select-String '^clang-tidy==(.+)$').Matches[0].Groups[1].Value).Trim()
$Venv = Join-Path $BuildDir "clang-tidy-venv"
$ClangTidy = $env:CLANG_TIDY
function Test-Pinned([string]$Exe) {
if (-not $Exe -or -not (Test-Path $Exe)) { return $false }
return [bool]((& $Exe --version) -match "version $([regex]::Escape($Pinned))")
}
if (-not $ClangTidy) {
$ClangTidy = Join-Path $Venv "Scripts\clang-tidy.exe"
if (-not (Test-Pinned $ClangTidy)) {
if (Ask "clang-tidy $Pinned (the version CI uses) is not installed. Install it into $Venv?") {
New-Item -ItemType Directory -Force -Path $BuildDir | Out-Null
& $PyExe @PyArgs -m venv $Venv
if ($LASTEXITCODE -ne 0) { throw "Could not create a Python virtual environment." }
& "$Venv\Scripts\python.exe" -m pip install --quiet --upgrade pip
& "$Venv\Scripts\python.exe" -m pip install --quiet -r $Requirements
if ($LASTEXITCODE -ne 0) { throw "Installing clang-tidy $Pinned failed." }
} else {
Write-Host "To install it yourself, run:"
Write-Host " $($Python -join ' ') -m venv $Venv"
Write-Host " $Venv\Scripts\python.exe -m pip install -r scripts\clang_tidy_requirements.txt"
exit 1
}
}
}
if (-not (Test-Pinned $ClangTidy)) {
Write-Warning "$ClangTidy is not clang-tidy $Pinned, so results may differ from CI."
}
# --- Dependencies -------------------------------------------------------------
# build_win.bat names the tree after the compiler and architecture: deps\build for cl,
# deps\build-clang for clang-cl, with -arm64 appended on ARM64.
$Suffix = if ($Arch -eq "arm64") { "-arm64" } else { "" }
$Compiler = "cl"
# A configured build directory remembers where its dependencies are.
$Cache = Join-Path $BuildDir "CMakeCache.txt"
if (-not $DepsDir -and (Test-Path $Cache)) {
$m = Select-String -Path $Cache -Pattern '^DEP_BUILD_DIR:[A-Z]*=(.+)$' | Select-Object -First 1
if ($m) { $DepsDir = $m.Matches[0].Groups[1].Value }
}
if (-not $DepsDir) {
if (Test-Path "deps\build$Suffix\OrcaSlicer_dep") {
$DepsDir = "deps\build$Suffix"
} elseif (Test-Path "deps\build-clang$Suffix\OrcaSlicer_dep") {
$DepsDir = "deps\build-clang$Suffix"
}
}
if ($DepsDir -and ($DepsDir -match 'clang')) { $Compiler = "clang-cl" }
if (-not $DepsDir -or -not (Test-Path (Join-Path $DepsDir "OrcaSlicer_dep"))) {
$BuildDeps = "build_win.bat -d --arch $Arch"
Write-Host "OrcaSlicer's dependencies are not built."
if (Ask "Build them now with $BuildDeps? This takes a while.") {
& cmd /c $BuildDeps
if ($LASTEXITCODE -ne 0) { throw "Building the dependencies failed." }
$DepsDir = "deps\build$Suffix"
} else {
Write-Host "Build them with $BuildDeps, or point to an existing build with -DepsDir."
exit 1
}
}
$DepsDir = (Resolve-Path $DepsDir).Path
if ($Compiler -eq "clang-cl" -and -not (Has "clang-cl")) {
Request-Install "clang-cl (the Visual Studio C++ Clang tools)" "build_win.bat --install-vs buildtools"
}
# --- Compile database ---------------------------------------------------------
# The same configure as CI, with Ninja so CMake writes compile_commands.json. Forward
# slashes keep CMake from reading a backslash as an escape.
$cmakeArgs = @("-S", ".", "-B", $BuildDir, "-G", "Ninja", "-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_C_COMPILER=$Compiler", "-DCMAKE_CXX_COMPILER=$Compiler",
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", "-DSLIC3R_PCH=OFF", "-DORCA_TOOLS=ON", "-DBUILD_TESTS=ON",
"-DDEP_BUILD_DIR=$($DepsDir -replace '\\', '/')")
Write-Host "Configuring $BuildDir with $Compiler"
New-Item -ItemType Directory -Force -Path $BuildDir | Out-Null
$Log = Join-Path $BuildDir "configure.log"
& cmake @cmakeArgs *> $Log
if ($LASTEXITCODE -ne 0) {
Get-Content $Log -Tail 20
throw "Configuring failed; the full log is in $Log."
}
& cmake --build $BuildDir --target git_commit_hash_header *> $null
if ($LASTEXITCODE -ne 0) { throw "Generating git_commit_hash.h failed." }
# --- Base revision ------------------------------------------------------------
if (-not $Base) {
$Remote = "origin"
foreach ($line in (& git remote -v)) {
if ($line -match '^(\S+)\s+\S*github\.com[:/]OrcaSlicer/OrcaSlicer(\.git)?\s+\(fetch\)') {
$Remote = $Matches[1]
break
}
}
if (-not $NoFetch) {
& git fetch --quiet $Remote main
if ($LASTEXITCODE -ne 0) { throw "git fetch $Remote main failed." }
}
$Base = "$Remote/main"
}
Write-Host "Comparing against $Base"
# --- Run ----------------------------------------------------------------------
$diffArgs = @("scripts\clang_tidy_diff.py", "-p", $BuildDir, "--base", $Base, "--clang-tidy", $ClangTidy)
if ($Jobs -gt 0) { $diffArgs += @("-j", "$Jobs") }
if ($Fix) { $diffArgs += @("--", "--fix") }
& $PyExe @PyArgs @diffArgs
exit $LASTEXITCODE
-233
View File
@@ -1,233 +0,0 @@
#!/usr/bin/env bash
# Runs the clang-tidy check that gates pull requests (.github/workflows/clang_tidy.yml)
# on your branch, so its findings match what CI reports. Linux and macOS.
#
# scripts/run_clang_tidy.sh check your changes against OrcaSlicer's main
# scripts/run_clang_tidy.sh --fix also add the missing includes it names
#
# It configures a separate build directory (build-tidy) without the precompiled
# header, installs the pinned clang-tidy into a virtual environment inside it, and
# runs scripts/clang_tidy_diff.py the way CI does. Uncommitted changes are checked too.
set -euo pipefail
usage() {
cat <<'EOF'
Usage: scripts/run_clang_tidy.sh [options]
-b, --base REV revision to compare against (default: main of the remote that
points at OrcaSlicer/OrcaSlicer, else origin/main)
--no-fetch do not fetch that remote's main first
-B, --build-dir DIR build directory for the compile database (default: build-tidy)
-d, --deps-dir DIR dependency build directory (default: deps/build on Linux,
deps/build/<arch> on macOS)
-j, --jobs N parallel clang-tidy runs (default: all cores)
--fix apply clang-tidy's fixes (adds the missing includes)
-y, --yes install missing tools without asking
-h, --help show this help
EOF
}
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
cd "$ROOT"
BASE=""
FETCH=1
BUILD_DIR=build-tidy
DEPS_DIR=""
JOBS=""
FIX=0
YES=0
while [ $# -gt 0 ]; do
case "$1" in
-b|--base) BASE="$2"; shift 2 ;;
--no-fetch) FETCH=0; shift ;;
-B|--build-dir) BUILD_DIR="$2"; shift 2 ;;
-d|--deps-dir) DEPS_DIR="$2"; shift 2 ;;
-j|--jobs) JOBS="$2"; shift 2 ;;
--fix) FIX=1; shift ;;
-y|--yes) YES=1; shift ;;
-h|--help) usage; exit 0 ;;
*) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;;
esac
done
case "$BUILD_DIR" in
/*) ;;
*) BUILD_DIR="$ROOT/$BUILD_DIR" ;;
esac
OS=$(uname -s)
case "$OS" in
Linux) ;;
Darwin) ;;
*) echo "Unsupported system $OS. On Windows, use scripts/run_clang_tidy.ps1." >&2; exit 1 ;;
esac
# Ask before installing anything. Without a terminal, or with "no", print the
# command instead so it can be run by hand.
ask() {
[ "$YES" = 1 ] && return 0
[ -t 0 ] || return 1
local reply
read -r -p "$1 [y/N] " reply
[[ "$reply" =~ ^[Yy] ]]
}
# --- System tools -------------------------------------------------------------
missing=()
command -v git >/dev/null || missing+=(git)
command -v python3 >/dev/null || missing+=(python3)
command -v cmake >/dev/null || missing+=(cmake)
command -v ninja >/dev/null || missing+=(ninja)
if [ "$OS" = Linux ]; then
# CI builds its compile database with clang; another compiler's flags change what
# clang-tidy sees.
command -v clang >/dev/null && command -v clang++ >/dev/null || missing+=(clang)
fi
if [ ${#missing[@]} -gt 0 ]; then
echo "Missing: ${missing[*]}"
install_cmd=""
if [ "$OS" = Darwin ]; then
pkgs=()
for m in "${missing[@]}"; do
case "$m" in
git|python3|cmake|ninja) pkgs+=("${m/python3/python}") ;;
esac
done
if command -v brew >/dev/null; then
install_cmd="brew install ${pkgs[*]}"
else
echo "Install Homebrew from https://brew.sh, then run: brew install ${pkgs[*]}" >&2
exit 1
fi
elif command -v apt-get >/dev/null; then
pkgs=()
for m in "${missing[@]}"; do
case "$m" in
ninja) pkgs+=(ninja-build) ;;
python3) pkgs+=(python3 python3-venv) ;;
*) pkgs+=("$m") ;;
esac
done
install_cmd="sudo apt-get install -y ${pkgs[*]}"
elif command -v dnf >/dev/null; then
install_cmd="sudo dnf install -y ${missing[*]/ninja/ninja-build}"
elif command -v pacman >/dev/null; then
install_cmd="sudo pacman -S --needed ${missing[*]/python3/python}"
else
echo "Install ${missing[*]} with your package manager and run this again." >&2
exit 1
fi
if ask "Install them now with: $install_cmd ?"; then
$install_cmd
else
echo "To install them yourself, run:" >&2
echo " $install_cmd" >&2
exit 1
fi
fi
# --- clang-tidy ---------------------------------------------------------------
REQUIREMENTS="$ROOT/scripts/clang_tidy_requirements.txt"
PINNED=$(sed -n 's/^clang-tidy==//p' "$REQUIREMENTS")
VENV="$BUILD_DIR/clang-tidy-venv"
if [ -n "${CLANG_TIDY:-}" ]; then
# Set by the caller: use it as is.
:
else
CLANG_TIDY="$VENV/bin/clang-tidy"
if [ ! -x "$CLANG_TIDY" ] || ! "$CLANG_TIDY" --version | grep -q "version $PINNED"; then
if ask "clang-tidy $PINNED (the version CI uses) is not installed. Install it into $VENV?"; then
mkdir -p "$BUILD_DIR"
if ! python3 -m venv "$VENV"; then
echo "Could not create a Python virtual environment." >&2
[ "$OS" = Linux ] && echo "On Debian or Ubuntu, install it with: sudo apt-get install -y python3-venv" >&2
exit 1
fi
"$VENV/bin/pip" install --quiet --upgrade pip
"$VENV/bin/pip" install --quiet -r "$REQUIREMENTS"
else
echo "To install it yourself, run:" >&2
echo " python3 -m venv $VENV && $VENV/bin/pip install -r scripts/clang_tidy_requirements.txt" >&2
exit 1
fi
fi
fi
if ! "$CLANG_TIDY" --version | grep -q "version $PINNED"; then
echo "Warning: $CLANG_TIDY is not clang-tidy $PINNED, so results may differ from CI." >&2
fi
# --- Dependencies -------------------------------------------------------------
# A configured build directory remembers where its dependencies are.
if [ -z "$DEPS_DIR" ] && [ -f "$BUILD_DIR/CMakeCache.txt" ]; then
DEPS_DIR=$(sed -n 's/^DEP_BUILD_DIR:[A-Z]*=//p' "$BUILD_DIR/CMakeCache.txt")
fi
if [ "$OS" = Darwin ]; then
ARCH=$(uname -m)
DEPS_DIR="${DEPS_DIR:-deps/build/$ARCH}"
BUILD_DEPS_CMD="./build_release_macos.sh -d -a $ARCH"
else
DEPS_DIR="${DEPS_DIR:-deps/build}"
BUILD_DEPS_CMD="./build_linux.sh -d"
fi
case "$DEPS_DIR" in
/*) ;;
*) DEPS_DIR="$ROOT/$DEPS_DIR" ;;
esac
if [ ! -d "$DEPS_DIR/OrcaSlicer_dep/usr/local" ]; then
echo "OrcaSlicer's dependencies are not built in $DEPS_DIR."
if ask "Build them now with $BUILD_DEPS_CMD? This takes a while."; then
$BUILD_DEPS_CMD
else
echo "Build them with $BUILD_DEPS_CMD, or point to an existing build with --deps-dir." >&2
exit 1
fi
fi
# --- Compile database ---------------------------------------------------------
# The same configure as CI. DEP_BUILD_DIR is named outright: CMake would otherwise
# derive it from the build directory's name.
cmake_args=(-S . -B "$BUILD_DIR" -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSLIC3R_PCH=OFF -DORCA_TOOLS=ON -DBUILD_TESTS=ON
-DDEP_BUILD_DIR="$DEPS_DIR")
if [ "$OS" = Darwin ]; then
cmake_args+=(-DCMAKE_OSX_ARCHITECTURES="$ARCH" "-DCMAKE_IGNORE_PREFIX_PATH=/opt/local;/usr/local;/opt/homebrew")
else
cmake_args+=(-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++)
fi
echo "Configuring $BUILD_DIR"
mkdir -p "$BUILD_DIR"
if ! cmake "${cmake_args[@]}" >"$BUILD_DIR/configure.log" 2>&1; then
tail -n 20 "$BUILD_DIR/configure.log" >&2
echo "Configuring failed; the full log is in $BUILD_DIR/configure.log." >&2
[ "$OS" = Linux ] && echo "Missing system libraries? Install them with: ./build_linux.sh -u" >&2
exit 1
fi
cmake --build "$BUILD_DIR" --target git_commit_hash_header >/dev/null
# --- Base revision ------------------------------------------------------------
if [ -z "$BASE" ]; then
REMOTE=$(git remote -v | awk '/github\.com[:\/]OrcaSlicer\/OrcaSlicer(\.git)? \(fetch\)/ { print $1; exit }')
REMOTE="${REMOTE:-origin}"
if [ "$FETCH" = 1 ]; then
git fetch --quiet "$REMOTE" main
fi
BASE="$REMOTE/main"
fi
echo "Comparing against $BASE"
# --- Run ----------------------------------------------------------------------
args=(-p "$BUILD_DIR" --base "$BASE" --clang-tidy "$CLANG_TIDY")
[ -n "$JOBS" ] && args+=(-j "$JOBS")
[ "$FIX" = 1 ] && args+=(-- --fix)
exec python3 scripts/clang_tidy_diff.py "${args[@]}"
-132
View File
@@ -1,132 +0,0 @@
#!/usr/bin/env python3
"""Tests for the diff handling in scripts/clang_tidy_diff.py (stdlib unittest, no
external deps).
Run from the repo root: python -m unittest discover -s scripts/tests -v
"""
import os
import sys
import tempfile
import unittest
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
import clang_tidy_diff # noqa: E402
DIFF = """\
diff --git a/src/libslic3r/Color.cpp b/src/libslic3r/Color.cpp
index 1111111..2222222 100644
--- a/src/libslic3r/Color.cpp
+++ b/src/libslic3r/Color.cpp
@@ -3,0 +4 @@
+#include <cassert>
@@ -8 +8,0 @@
-#include "libslic3r/Point.hpp"
@@ -20,2 +21,3 @@ void f()
- old();
- old();
+ a();
+ b();
+ c();
@@ -40 +42,0 @@ void g()
- gone();
diff --git a/src/libslic3r/New.hpp b/src/libslic3r/New.hpp
new file mode 100644
--- /dev/null
+++ b/src/libslic3r/New.hpp
@@ -0,0 +1,2 @@
+#pragma once
+int f();
diff --git a/src/libslic3r/Old.cpp b/src/libslic3r/Renamed.cpp
similarity index 100%
rename from src/libslic3r/Old.cpp
rename to src/libslic3r/Renamed.cpp
"""
class TestParseChangedLines(unittest.TestCase):
def setUp(self):
self.changed = clang_tidy_diff.parse_diff(DIFF)
def test_added_and_replaced_hunks_become_line_ranges(self):
self.assertEqual(self.changed["src/libslic3r/Color.cpp"].lines, [[4, 4], [21, 23]])
def test_deleted_includes_are_collected(self):
self.assertEqual(self.changed["src/libslic3r/Color.cpp"].removed_includes, {"libslic3r/Point.hpp"})
self.assertEqual(self.changed["src/libslic3r/New.hpp"].removed_includes, set())
def test_new_file_covers_every_line(self):
self.assertEqual(self.changed["src/libslic3r/New.hpp"].lines, [[1, 2]])
def test_pure_rename_has_no_changed_lines(self):
self.assertNotIn("src/libslic3r/Renamed.cpp", self.changed)
class TestNamesRemovedInclude(unittest.TestCase):
def test_matches_however_the_include_was_spelled(self):
removed = {"Point.hpp", "cassert"}
self.assertTrue(clang_tidy_diff.names_removed_include("<cassert>", removed))
self.assertTrue(clang_tidy_diff.names_removed_include("<libslic3r/Point.hpp>", removed))
self.assertTrue(clang_tidy_diff.names_removed_include('"Point.hpp"', {"libslic3r/Point.hpp"}))
def test_other_headers_and_no_suggestion_do_not_match(self):
removed = {"libslic3r/Point.hpp"}
self.assertFalse(clang_tidy_diff.names_removed_include("<libslic3r/MultiPoint.hpp>", removed))
self.assertFalse(clang_tidy_diff.names_removed_include("<vector>", removed))
self.assertFalse(clang_tidy_diff.names_removed_include("", removed))
class TestIsChecked(unittest.TestCase):
def test_project_sources_and_headers(self):
for path in ("src/libslic3r/Color.cpp", "src/slic3r/GUI/Tab.hpp", "tests/fff_print/test_flow.cpp",
"src/libslic3r/Format/bbs_3mf.h"):
self.assertTrue(clang_tidy_diff.is_checked(path), path)
def test_vendored_code_other_languages_and_other_dirs(self):
for path in ("src/glad/src/gl.c", "src/glad/include/glad/gl.h", "tests/catch2/src/catch.hpp",
"deps_src/imgui/imgui.cpp", "src/slic3r/Utils/MacUtils.mm", "src/CMakeLists.txt"):
self.assertFalse(clang_tidy_diff.is_checked(path), path)
FIXES = """\
---
MainSourceFile: '/repo/src/libslic3r/Color.cpp'
Diagnostics:
- DiagnosticName: misc-include-cleaner
DiagnosticMessage:
Message: 'no header providing "assert" is directly included'
FilePath: '/repo/src/libslic3r/Color.cpp'
FileOffset: 1974
Replacements:
- FilePath: '/repo/src/libslic3r/Color.cpp'
Offset: 39
Length: 0
ReplacementText: "#include <cassert>\\n"
Level: Error
- DiagnosticName: misc-include-cleaner
DiagnosticMessage:
Message: 'no header providing "Slic3r::comExpert" is directly included'
FilePath: '/repo/src/libslic3r/Color.cpp'
FileOffset: 2148
Replacements: []
Level: Error
...
"""
class TestParseSuggestedIncludes(unittest.TestCase):
def test_maps_each_message_to_the_include_its_fix_inserts(self):
with tempfile.TemporaryDirectory() as tmp:
path = os.path.join(tmp, "fixes.yaml")
with open(path, "w", encoding="utf-8") as f:
f.write(FIXES)
self.assertEqual(clang_tidy_diff.parse_suggested_includes(path),
{'no header providing "assert" is directly included': "<cassert>"})
def test_missing_file_means_no_suggestions(self):
self.assertEqual(clang_tidy_diff.parse_suggested_includes("/nonexistent/fixes.yaml"), {})
if __name__ == "__main__":
unittest.main()
-12
View File
@@ -141,18 +141,6 @@ using namespace nlohmann;
#include "slic3r/GUI/Plater.hpp"
#include "slic3r/GUI/GuiColor.hpp"
#include <GLFW/glfw3.h>
#include "libslic3r/AppConfig.hpp"
#include "libslic3r/BuildVolume.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Exception.hpp"
#include "libslic3r/GCode/GCodeProcessor.hpp"
#include "libslic3r/GCode/ToolOrdering.hpp"
#include "libslic3r/ObjectID.hpp"
#include "libslic3r/PresetBundle.hpp"
#include "libslic3r/ProjectTask.hpp"
#include "slic3r/GUI/GUI_ObjectList.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/Jobs/SendJob.hpp"
namespace fs = boost::filesystem;
+1 -4
View File
@@ -5,6 +5,7 @@
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/Format/bbs_3mf.hpp"
#include "libslic3r/GCode/ThumbnailData.hpp"
#include <set>
#include <string>
#include <vector>
@@ -13,10 +14,6 @@
#include "libslic3r/Model.hpp"
#include "libslic3r/Format/AssembleList.hpp"
namespace Slic3r { class Preset; }
namespace Slic3r { struct PlateBBoxData; }
namespace Slic3r { struct ThumbnailData; }
namespace Slic3r {
namespace IO {
@@ -57,8 +57,6 @@
#include <iostream>
#include <set>
#include <string>
#include "libslic3r/AppConfig.hpp"
#include "libslic3r/Format/STEP.hpp"
namespace fs = boost::filesystem;
-1
View File
@@ -26,7 +26,6 @@
#include <stdexcept>
#include <string>
#include <vector>
#include "libslic3r/PrintConfig.hpp"
using namespace Slic3r;
namespace fs = boost::filesystem;
@@ -20,7 +20,6 @@
#include <numeric>
#include <vector>
#include <utility>
#include "libslic3r/BoundingBox.hpp"
namespace Slic3r {
namespace Algorithm {
@@ -28,8 +28,6 @@
#include "libslic3r/Arachne/SkeletalTrapezoidationJoint.hpp"
#include "libslic3r/Arachne/utils/ExtrusionJunction.hpp"
#include "libslic3r/Arachne/utils/ExtrusionLine.hpp"
#include "libslic3r/Arachne/SkeletalTrapezoidationGraph.hpp"
#include "libslic3r/Arachne/utils/PolygonsSegmentIndex.hpp"
#ifndef NDEBUG
#include "libslic3r/EdgeGrid.hpp"
@@ -11,6 +11,7 @@
#include <list>
#include <vector>
#include "utils/HalfEdgeGraph.hpp"
#include "utils/PolygonsSegmentIndex.hpp"
#include "utils/ExtrusionJunction.hpp"
#include "utils/ExtrusionLine.hpp"
+1
View File
@@ -11,6 +11,7 @@
#include <vector>
#include <utility>
#include "BeadingStrategy/BeadingStrategyFactory.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Point.hpp"
#include "utils/ExtrusionLine.hpp"
@@ -14,6 +14,7 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Point.hpp"
#include "libslic3r/Arachne/utils/ExtrusionJunction.hpp"
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/Line.hpp"
#include "libslic3r/Polygon.hpp"
@@ -19,7 +19,9 @@
#include "ExtrusionJunction.hpp"
#include "../../Polyline.hpp"
#include "../../Polygon.hpp"
#include "../../BoundingBox.hpp"
#include "../../ExtrusionEntity.hpp"
#include "../../Flow.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Point.hpp"
@@ -15,6 +15,7 @@
#include "SparsePointGrid.hpp"
#include "PolygonsPointIndex.hpp"
#include "../../Polygon.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/libslic3r.h"
+1 -1
View File
@@ -29,6 +29,7 @@
#include <libnest2d/utils/rotcalipers.hpp>
#include <numeric>
#include <ClipperUtils.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <utility>
@@ -44,7 +45,6 @@
#include <boost/log/trivial.hpp>
#include <boost/multiprecision/integer.hpp>
#include <boost/rational.hpp>
#include "MultiMaterialSegmentation.hpp"
namespace libnest2d {
#if !defined(_MSC_VER) && defined(__SIZEOF_INT128__) && !defined(__APPLE__)
-5
View File
@@ -32,11 +32,6 @@
#include <boost/log/trivial.hpp>
#include <utility>
#include <vector>
#include "Config.hpp"
#include "ExtrusionEntityCollection.hpp"
#include "MultiMaterialSegmentation.hpp"
#include "SurfaceCollection.hpp"
#include "TriangleMesh.hpp"
#ifndef NDEBUG
// #define BRIM_DEBUG_TO_SVG
-4
View File
@@ -90,10 +90,6 @@
#include <string>
#include <vector>
#include <utility>
#include "libslic3r/Color.hpp"
#include "libslic3r/TriangleMesh.hpp"
class Geom2d_TrimmedCurve;
namespace Slic3r {
-2
View File
@@ -62,8 +62,6 @@
#include <vector>
#include <utility>
class Geom_TrimmedCurve;
namespace Slic3r {
// Single source of truth for the weld tolerance the viewport and the kernel share.
-1
View File
@@ -11,7 +11,6 @@
#include <unordered_map>
#include <vector>
#include <utility>
#include "libslic3r/Point.hpp"
namespace Slic3r {
+1 -4
View File
@@ -6,12 +6,9 @@
// hand-rolled SketchConstraints: full constraint set, real DoF counting, and
// over-constrained (bad-constraint) detection. Solves on a fixed 2D XY workplane.
#include "libslic3r/CAD/SketchEngine.hpp"
#include <vector>
namespace Slic3r { enum class SketchPointRole; }
namespace Slic3r { struct SketchEntity; }
namespace Slic3r { struct SketchEntityConstraintDef; }
namespace Slic3r {
struct SketchSolveResult {
+2
View File
@@ -5,8 +5,10 @@
#include <cstddef>
#include <utility>
#include <math.h>
#include "Geometry.hpp"
#include "Point.hpp"
#include "Line.hpp"
#include "Polygon.hpp"
#include "libslic3r.h"
+1 -2
View File
@@ -2,11 +2,10 @@
#define slic3r_Circle_hpp_
#include "Point.hpp"
#include "Line.hpp"
#include "libslic3r.h"
#include <cmath>
namespace Slic3r { class Line; }
namespace Slic3r {
constexpr double ZERO_TOLERANCE = 0.000005;
+1 -1
View File
@@ -12,6 +12,7 @@
#include "ClipperUtils.hpp"
#include "BoundingBox.hpp"
#include "ExPolygon.hpp"
#include "Geometry.hpp"
#include "Point.hpp"
#include "Polygon.hpp"
#include "Polyline.hpp"
@@ -23,7 +24,6 @@
#include <clipper2/clipper.h>
#include <utility>
#include <vector>
#include "ExtrusionEntity.hpp"
// #define CLIPPER_UTILS_DEBUG
-1
View File
@@ -3,7 +3,6 @@
#include <clipper2/clipper2_z.hpp>
#include <cstddef>
#include "Point.hpp"
namespace Slic3r {
namespace ClipperZUtils {
-1
View File
@@ -13,7 +13,6 @@
#include <libslic3r/ClipperUtils.hpp>
#include <libslic3r/Point.hpp>
#include <libslic3r/ExPolygon.hpp>
#include "Polygon.hpp"
namespace Slic3r {
-3
View File
@@ -14,9 +14,6 @@
#include <math.h>
#include <string>
#include <utility>
#include "Config.hpp"
#include "Polyline.hpp"
#include "PrintConfig.hpp"
namespace Slic3r {
+3
View File
@@ -1,4 +1,7 @@
#include "CustomGCode.hpp"
#include "Config.hpp"
#include "GCode.hpp"
#include "GCodeWriter.hpp"
#include <vector>
#include <utility>
#include <cstddef>
+1 -3
View File
@@ -6,9 +6,7 @@
#include <vector>
#include <admesh/stl.h> // indexed_triangle_set
#include "ExPolygon.hpp"
namespace Slic3r::Emboss { class IProject3d; }
namespace Slic3r::Emboss { class IProjection; }
#include "Emboss.hpp" // IProjection
namespace Slic3r{
-1
View File
@@ -19,7 +19,6 @@
#include <optional>
#include <math.h>
#include <cmath>
#include "BoundingBox.hpp"
namespace Slic3r {
+1 -1
View File
@@ -8,6 +8,7 @@
#include "ElephantFootCompensation.hpp"
#include "Flow.hpp"
#include "Geometry.hpp"
#include "SVG.hpp"
#include "Utils.hpp"
#include <algorithm>
@@ -18,7 +19,6 @@
#include <utility>
#include <math.h>
#include <limits>
#include "ExtrusionEntity.hpp"
// #define CONTOUR_DISTANCE_DEBUG_SVG
@@ -1,6 +1,7 @@
#ifndef slic3r_ElephantFootCompensation_hpp_
#define slic3r_ElephantFootCompensation_hpp_
#include "libslic3r.h"
#include "ExPolygon.hpp"
#include <vector>
+2
View File
@@ -1,5 +1,6 @@
#include "BoundingBox.hpp"
#include "ExPolygon.hpp"
#include "Exception.hpp"
#include "Geometry/MedialAxis.hpp"
#include "Point.hpp"
#include "MultiPoint.hpp"
@@ -7,6 +8,7 @@
#include "Line.hpp"
#include "ClipperUtils.hpp"
#include "Polyline.hpp"
#include "SVG.hpp"
#include "libslic3r.h"
#include <algorithm>
#include <cassert>
-1
View File
@@ -5,7 +5,6 @@
#include <vector>
#include <utility>
#include <algorithm>
#include "Polygon.hpp"
using namespace Slic3r;
// IMPROVE: use one dimensional vector for polygons offset with searching by std::lower_bound
-1
View File
@@ -6,7 +6,6 @@
#include <cassert>
#include <algorithm>
#include <cmath>
#include "Config.hpp"
namespace Slic3r {
+1
View File
@@ -2,6 +2,7 @@
#define slic3r_Extruder_hpp_
#include "libslic3r.h"
#include "Point.hpp"
#include <vector>
namespace Slic3r {
+1 -1
View File
@@ -2,6 +2,7 @@
#include "ExtrusionEntityCollection.hpp"
#include "ExPolygon.hpp"
#include "ClipperUtils.hpp"
#include "Extruder.hpp"
#include "Flow.hpp"
#include <algorithm>
#include <cassert>
@@ -20,7 +21,6 @@
#include <string_view>
#include "Utils.hpp"
#include "libslic3r.h"
#include "ArcFitter.hpp"
#define L(s) (s)
-1
View File
@@ -25,7 +25,6 @@
#include "ExtrusionEntity.hpp"
#include "libslic3r.h"
#include "ExtrusionSimulator.hpp"
#include "Polyline.hpp"
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
+1
View File
@@ -2,6 +2,7 @@
#define slic3r_ExtrusionSimulator_hpp_
#include "Point.hpp"
#include "libslic3r.h"
#include "ExtrusionEntity.hpp"
#include "BoundingBox.hpp"
+1
View File
@@ -2,6 +2,7 @@
#include "BoundingBox.hpp"
#include "TriangleMesh.hpp"
#include "SLA/IndexedMesh.hpp"
#include "Model.hpp"
#include <cstdint>
#include <cstddef>
#include <unordered_set>
@@ -5,12 +5,10 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Arachne/utils/ExtrusionJunction.hpp"
#include "libslic3r/Arachne/utils/ExtrusionLine.hpp"
#include "libslic3r/PerimeterGenerator.hpp"
#include <cstddef>
namespace Slic3r { class PerimeterGenerator; }
namespace Slic3r { struct FuzzySkinConfig; }
namespace Slic3r::Arachne { struct ExtrusionLine; }
namespace Slic3r::Feature::FuzzySkin {
void fuzzy_polyline(Points& poly, bool closed, coordf_t slice_z, const FuzzySkinConfig& cfg);
@@ -18,10 +18,6 @@
#include <algorithm>
#include <unordered_set>
#include <vector>
#include "libslic3r/Config.hpp"
#include "libslic3r/Print.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/SurfaceCollection.hpp"
namespace std {
template<> struct hash<Slic3r::GridPoint3>
@@ -6,15 +6,14 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Point.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Print.hpp"
#include "VoxelUtils.hpp"
#include <functional>
#include <cstddef>
#include <utility>
#include <unordered_set>
#include <vector>
#include "libslic3r/MultiMaterialSegmentation.hpp"
namespace Slic3r { class PrintObject; }
namespace Slic3r {
@@ -10,13 +10,13 @@
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r/Geometry.hpp"
#include "libslic3r/Fill/FillRectilinear.hpp"
#include "libslic3r/Surface.hpp"
#include <functional>
#include <limits>
#include <cassert>
#include <memory>
#include <utility>
#include "libslic3r/BoundingBox.hpp"
namespace Slic3r
{
-7
View File
@@ -41,13 +41,6 @@
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r.h"
#include "libslic3r/ExtrusionEntityCollection.hpp"
#include "libslic3r/MultiMaterialSegmentation.hpp"
#include "libslic3r/Slicing.hpp"
#include "libslic3r/SurfaceCollection.hpp"
namespace Slic3r::FillAdaptive { struct Octree; }
namespace Slic3r::FillLightning { class Generator; }
namespace Slic3r {
-1
View File
@@ -16,7 +16,6 @@
#include "libslic3r/Polyline.hpp"
#include <utility>
#include "Fill3DHoneycomb.hpp"
#include "libslic3r/Polygon.hpp"
namespace Slic3r {
-2
View File
@@ -11,8 +11,6 @@
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class Fill3DHoneycomb : public Fill
-3
View File
@@ -49,9 +49,6 @@
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/segment.hpp>
#include <boost/geometry/index/rtree.hpp>
#include "libslic3r/Config.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/SurfaceCollection.hpp"
namespace Slic3r {
-1
View File
@@ -48,7 +48,6 @@
#include "libslic3r/Line.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/Flow.hpp"
// #define INFILL_DEBUG_OUTPUT
namespace Slic3r {
+2 -3
View File
@@ -24,11 +24,10 @@
#include "../PrintConfig.hpp"
#include "../Flow.hpp"
#include "../ExtrusionEntity.hpp"
#include "../ExtrusionEntityCollection.hpp"
#include "../ShortestPath.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Point.hpp"
namespace Slic3r { class ExtrusionEntityCollection; }
namespace Slic3r {
-1
View File
@@ -20,7 +20,6 @@
#include <libslic3r/ShortestPath.hpp>
#include <utility>
#include <vector>
#include "libslic3r/ExtrusionEntity.hpp"
namespace Slic3r {
+1 -2
View File
@@ -4,10 +4,9 @@
#include "libslic3r/ExPolygon.hpp"
#include "FillBase.hpp"
#include <utility>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class FillConcentric : public Fill
@@ -19,11 +19,6 @@
#include <libslic3r/ShortestPath.hpp>
#include <vector>
#include <utility>
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Flow.hpp"
#include "libslic3r/PrintConfig.hpp"
namespace Slic3r { class Surface; }
namespace Slic3r {
@@ -4,8 +4,6 @@
#include "libslic3r/ExtrusionEntity.hpp"
#include "FillBase.hpp"
namespace Slic3r { class Surface; }
namespace Slic3r {
class FillConcentricInternal : public Fill
@@ -7,6 +7,7 @@
#include <utility>
#include <vector>
#include "../libslic3r.h"
#include "../Point.hpp"
#include "../Polygon.hpp"
#include "../Polyline.hpp"
+2 -1
View File
@@ -1,4 +1,6 @@
#include "../ClipperUtils.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include <algorithm>
#include <cmath>
#include <cstddef>
@@ -11,7 +13,6 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Polyline.hpp"
#include "FillCrossHatch.hpp"
#include "libslic3r/Polygon.hpp"
namespace Slic3r {
+2 -2
View File
@@ -4,13 +4,13 @@
#include <map>
#include <utility>
#include "../libslic3r.h"
#include "libslic3r/ExPolygon.hpp"
#include "FillBase.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class FillCrossHatch : public Fill
+2 -1
View File
@@ -1,5 +1,7 @@
#include "../ClipperUtils.hpp"
#include "../MarchingSquares.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include <cmath>
#include <algorithm>
#include <cstddef>
@@ -16,7 +18,6 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Polyline.hpp"
#include "FillGyroid.hpp"
#include "libslic3r/Polygon.hpp"
// ---------------------------------------------------------------------------
// Marching-squares scalar field for the optimized gyroid branch.
+2 -2
View File
@@ -1,14 +1,14 @@
#ifndef slic3r_FillGyroid_hpp_
#define slic3r_FillGyroid_hpp_
#include "../libslic3r.h"
#include "libslic3r/ExPolygon.hpp"
#include "FillBase.hpp"
#include <utility>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class FillGyroid : public Fill
+2 -1
View File
@@ -1,4 +1,6 @@
#include "../ClipperUtils.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include "libslic3r/Fill/FillBase.hpp"
#include "libslic3r/ExPolygon.hpp"
@@ -12,7 +14,6 @@
#include <cstddef>
#include <algorithm>
#include "FillHoneycomb.hpp"
#include "libslic3r/Polygon.hpp"
namespace Slic3r {
+1
View File
@@ -1,5 +1,6 @@
#include "../ClipperUtils.hpp"
#include "../Print.hpp"
#include "../ShortestPath.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Fill/Lightning/Layer.hpp"
#include "FillBase.hpp"
+1 -2
View File
@@ -6,10 +6,9 @@
#include <memory>
#include <functional>
#include <utility>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class PrintObject;
+1 -2
View File
@@ -1,6 +1,7 @@
#include "../ClipperUtils.hpp"
#include "../ExPolygon.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include "libslic3r/Fill/FillBase.hpp"
#include <utility>
#include "libslic3r/Point.hpp"
@@ -14,8 +15,6 @@
#include <cstdlib>
#include "FillLine.hpp"
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/Polygon.hpp"
namespace Slic3r {
+1 -1
View File
@@ -1,5 +1,6 @@
#include "../ClipperUtils.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Fill/FillBase.hpp"
@@ -17,7 +18,6 @@
#include <cstddef>
#include <type_traits>
#include "FillPlanePath.hpp"
#include "libslic3r/Config.hpp"
namespace Slic3r {
+1
View File
@@ -24,6 +24,7 @@
#include "../Geometry.hpp"
#include "../Surface.hpp"
#include "../ShortestPath.hpp"
#include "../VariableWidth.hpp"
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Fill/FillBase.hpp"
+1 -2
View File
@@ -12,11 +12,10 @@
#include <cstddef>
#include <vector>
#include <utility>
#include "libslic3r/Flow.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/Polygon.hpp"
namespace Slic3r { class Flow; }
namespace Slic3r {
class PrintRegionConfig;
+2 -3
View File
@@ -1,5 +1,7 @@
#include "../ClipperUtils.hpp"
#include "../ExPolygon.hpp"
#include "../Surface.hpp"
#include "../VariableWidth.hpp"
#include "Arachne/WallToolPaths.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Point.hpp"
@@ -20,9 +22,6 @@
#include <math.h>
#include <utility>
#include <vector>
#include "libslic3r/Arachne/utils/ExtrusionJunction.hpp"
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/Line.hpp"
namespace Slic3r {
+1 -2
View File
@@ -4,10 +4,9 @@
#include "libslic3r/ExPolygon.hpp"
#include "FillBase.hpp"
#include <utility>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class FillSpiralInset : public Fill
+1
View File
@@ -3,6 +3,7 @@
#include <utility>
#include "libslic3r/libslic3r.h"
#include "FillBase.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Polyline.hpp"
-1
View File
@@ -16,7 +16,6 @@
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include "libslic3r/Polygon.hpp"
namespace marchsq {
using namespace Slic3r;
+1
View File
@@ -3,6 +3,7 @@
#include <utility>
#include "libslic3r/libslic3r.h"
#include "FillBase.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Polyline.hpp"
@@ -30,9 +30,6 @@
#include <cmath>
#include <utility>
#include <cassert>
#include "libslic3r/Config.hpp"
#include "libslic3r/MultiMaterialSegmentation.hpp"
#include "libslic3r/SurfaceCollection.hpp"
/* Possible future tasks/optimizations,etc.:
* - Improve connecting heuristic to favor connecting to shorter trees
+1
View File
@@ -14,6 +14,7 @@
#include "../../ClipperUtils.hpp"
#include "../../Geometry.hpp"
#include "Utils.hpp"
#include "libslic3r/libslic3r.h"
#include <cassert>
@@ -19,7 +19,6 @@
#include "libslic3r/BoundingBox.hpp"
#include "SVG.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Line.hpp"
//#define LIGHTNING_TREE_NODE_DEBUG_OUTPUT
+1 -1
View File
@@ -1,6 +1,7 @@
#include "Flow.hpp"
#include "Exception.hpp"
#include "Config.hpp"
#include "I18N.hpp"
#include "Print.hpp"
#include "libslic3r.h"
#include <cmath>
@@ -9,7 +10,6 @@
#include <boost/algorithm/string/predicate.hpp>
#include <string>
#include <math.h>
#include "PrintConfig.hpp"
// Mark string for localization and translate.
#define L(s) Slic3r::I18N::translate(s)
+1
View File
@@ -4,6 +4,7 @@
#include <math.h>
#include "FlushVolPredictor.hpp"
#include "slic3r/Utils/ColorSpaceConvert.hpp"
#include "Utils.hpp"
#include "FlushVolCalc.hpp"
+2
View File
@@ -3,9 +3,11 @@
#include "../Model.hpp"
#include "../Utils.hpp"
#include "../LocalesUtils.hpp"
#include "../GCode.hpp"
#include "../Geometry.hpp"
#include "../GCode/ThumbnailData.hpp"
#include "../Semver.hpp"
#include "../Time.hpp"
#include "../I18N.hpp"
#include "libslic3r/Point.hpp"
+7
View File
@@ -12,10 +12,17 @@
#include <boost/nowide/cstdio.hpp>
#include "../libslic3r.h"
#include "../Exception.hpp"
#include "../Model.hpp"
#include "../GCode.hpp"
#include "../PrintConfig.hpp"
#include "../Utils.hpp"
#include "../I18N.hpp"
#include "../Geometry.hpp"
#include "../CustomGCode.hpp"
#include "../LocalesUtils.hpp"
#include "libslic3r/Config.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/TriangleMesh.hpp"
+1
View File
@@ -1,3 +1,4 @@
#include "../libslic3r.h"
#include "../Model.hpp"
#include "../TriangleMesh.hpp"
#include "../TexturePainting.hpp"
+2 -1
View File
@@ -1,6 +1,7 @@
#include "SL1.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Config.hpp"
#include "GCode/ThumbnailData.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Point.hpp"
@@ -34,6 +35,7 @@
#include "libslic3r/SlicesToTriangleMesh.hpp"
#include "libslic3r/MarchingSquares.hpp"
#include "libslic3r/ClipperUtils.hpp"
#include "libslic3r/MTUtils.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/SLA/RasterBase.hpp"
#include "libslic3r/miniz_extension.hpp"
@@ -48,7 +50,6 @@
#include <string>
#include <utility>
#include <string_view>
#include "libslic3r/SLA/Pad.hpp"
namespace marchsq {
+1
View File
@@ -1,3 +1,4 @@
#include "../libslic3r.h"
#include "../Model.hpp"
#include "../TriangleMesh.hpp"
#include "libslic3r/Exception.hpp"
+1
View File
@@ -1,3 +1,4 @@
#include "../libslic3r.h"
#include "../Model.hpp"
#include "../TriangleMesh.hpp"
+1 -1
View File
@@ -9,6 +9,7 @@
#include "../Geometry.hpp"
#include "../GCode/ThumbnailData.hpp"
#include "../Semver.hpp"
#include "../Time.hpp"
#include "../I18N.hpp"
#include "libslic3r/Point.hpp"
@@ -112,7 +113,6 @@ namespace pt = boost::property_tree;
#include "NSVGUtils.hpp"
#include <fast_float/fast_float.h>
#include "libslic3r/ProjectTask.hpp"
// Slightly faster than sprintf("%.9g"), but there is an issue with the karma floating point formatter,
// https://github.com/boostorg/spirit/pull/586
-1
View File
@@ -37,7 +37,6 @@
#include "TopoDS.hxx"
#include "BRepExtrema_SelfIntersection.hxx"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r {
const double STEP_TRANS_CHORD_ERROR = 0.005;
+1 -8
View File
@@ -120,6 +120,7 @@
#include <Shiny/Shiny.h>
#include "miniz_extension.hpp"
using namespace std::literals::string_view_literals;
@@ -131,14 +132,6 @@ using namespace std::literals::string_view_literals;
#endif
#include <assert.h>
#include "AABBTreeLines.hpp"
#include "Extruder.hpp"
#include "ExtrusionEntityCollection.hpp"
#include "FilamentMixer.hpp"
#include "Format/STEP.hpp"
#include "Model.hpp"
#include "MultiNozzleUtils.hpp"
#include "Slicing.hpp"
namespace fs = boost::filesystem;
+3 -4
View File
@@ -4,8 +4,10 @@
#include "ExtrusionEntity.hpp"
#include "Polygon.hpp"
#include "Config.hpp"
#include "ExtrusionEntityCollection.hpp"
#include "Print.hpp"
#include "libslic3r.h"
#include "ExPolygon.hpp"
#include "GCodeWriter.hpp"
#include "Layer.hpp"
#include "Point.hpp"
@@ -20,6 +22,7 @@
#include "GCode/WipeTower.hpp"
#include "GCode/SeamPlacer.hpp"
#include "GCode/GCodeProcessor.hpp"
#include "EdgeGrid.hpp"
#include "GCode/ThumbnailData.hpp"
#include "libslic3r/ObjectID.hpp"
#include "GCode/ExtrusionProcessor.hpp"
@@ -45,10 +48,6 @@
#include <cfloat>
#include <vector>
#include <utility>
#include "BoundingBox.hpp"
#include "Polyline.hpp"
namespace Slic3r { class ExtrusionEntityCollection; }
namespace Slic3r {
@@ -19,9 +19,6 @@
#include <cctype>
#include <string>
#include <utility>
#include "libslic3r/Config.hpp"
#include "libslic3r/GCodeWriter.hpp"
#include "libslic3r/PrintConfig.hpp"
namespace Slic3r {
@@ -6,6 +6,7 @@
#include "../ExPolygon.hpp"
#include "../Geometry.hpp"
#include "../ClipperUtils.hpp"
#include "../SVG.hpp"
#include "libslic3r/Line.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Point.hpp"
@@ -30,10 +31,6 @@
#include <boost/range/adaptor/reversed.hpp>
#include <vector>
#include <utility>
#include "libslic3r/Extruder.hpp"
#include "libslic3r/GCodeWriter.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/SurfaceCollection.hpp"
namespace Slic3r {
@@ -1,13 +1,13 @@
#ifndef slic3r_AvoidCrossingPerimeters_hpp_
#define slic3r_AvoidCrossingPerimeters_hpp_
#include "../libslic3r.h"
#include "../ExPolygon.hpp"
#include "../EdgeGrid.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/BoundingBox.hpp"
#include <vector>
#include "libslic3r/MultiMaterialSegmentation.hpp"
namespace Slic3r {
-1
View File
@@ -23,7 +23,6 @@
#include <atomic>
#include <utility>
#include <vector>
#include "libslic3r/Model.hpp"
namespace Slic3r {
+3 -2
View File
@@ -1,12 +1,15 @@
#ifndef slic3r_ConflictChecker_hpp_
#define slic3r_ConflictChecker_hpp_
#include "../Utils.hpp"
#include "../Model.hpp"
#include "../Print.hpp"
#include "../Layer.hpp"
#include "libslic3r/Line.hpp"
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r/ExtrusionEntityCollection.hpp"
#include "libslic3r/GCode/GCodeProcessor.hpp"
#include <queue>
@@ -17,8 +20,6 @@
#include <vector>
#include <optional>
namespace Slic3r { class ExtrusionEntityCollection; }
namespace Slic3r {
struct LineWithID
-3
View File
@@ -30,9 +30,6 @@
#endif
#include <assert.h>
#include "libslic3r/Config.hpp"
#include "libslic3r/GCodeWriter.hpp"
#include "libslic3r/PrintConfig.hpp"
namespace Slic3r {
+1
View File
@@ -1,6 +1,7 @@
#ifndef slic3r_CoolingBuffer_hpp_
#define slic3r_CoolingBuffer_hpp_
#include "../libslic3r.h"
#include "../Point.hpp"
#include <cstddef>
#include <map>
-2
View File
@@ -33,8 +33,6 @@
#include <boost/log/trivial.hpp>
#include <string>
#include <string_view>
#include "libslic3r/Config.hpp"
#include "libslic3r/GCodeWriter.hpp"
*/

Some files were not shown because too many files have changed in this diff Show More