Merge remote-tracking branch 'BS/v1.7.2'

Signed-off-by: SoftFever <103989404+SoftFever@users.noreply.github.com>

# Conflicts:
#	.github/ISSUE_TEMPLATE/bug_report.md
#	.github/workflows/build_ubuntu.yml
#	.gitignore
#	Containerfile
#	Dockerfile
#	README.md
#	deps/Boost/Boost.cmake
#	deps/OpenEXR/OpenEXR.cmake
#	deps/OpenVDB/OpenVDB.cmake
#	doc/How to build - Mac OS.md
#	localization/i18n/OrcaSlicer.pot
#	localization/i18n/de/OrcaSlicer_de.po
#	localization/i18n/en/OrcaSlicer_en.po
#	localization/i18n/es/OrcaSlicer_es.po
#	localization/i18n/fr/OrcaSlicer_fr.po
#	localization/i18n/hu/OrcaSlicer_hu.po
#	localization/i18n/it/OrcaSlicer_it.po
#	localization/i18n/ja/OrcaSlicer_ja.po
#	localization/i18n/list.txt
#	localization/i18n/nl/OrcaSlicer_nl.po
#	localization/i18n/sv/OrcaSlicer_sv.po
#	localization/i18n/zh_cn/OrcaSlicer_zh_CN.po
#	resources/i18n/de/BambuStudio.mo
#	resources/i18n/en/BambuStudio.mo
#	resources/i18n/es/BambuStudio.mo
#	resources/i18n/fr/BambuStudio.mo
#	resources/i18n/hu/BambuStudio.mo
#	resources/i18n/it/BambuStudio.mo
#	resources/i18n/ja/BambuStudio.mo
#	resources/i18n/nl/BambuStudio.mo
#	resources/i18n/sv/BambuStudio.mo
#	resources/i18n/zh_cn/BambuStudio.mo
#	resources/images/im_all_plates_stats.svg
#	resources/profiles/Anker.json
#	resources/profiles/Anker/filament/Generic ASA @Anker.json
#	resources/profiles/Anker/filament/Generic PA @Anker.json
#	resources/profiles/Anker/filament/Generic PA-CF @Anker.json
#	resources/profiles/Anker/filament/Generic PC @Anker.json
#	resources/profiles/Anker/filament/Generic PETG @Anker.json
#	resources/profiles/Anker/filament/Generic PLA-CF @Anker.json
#	resources/profiles/Anker/filament/Generic PVA @Anker.json
#	resources/profiles/Anker/filament/Generic TPU @Anker.json
#	resources/profiles/Anker/machine/Anker M5 0.4 nozzle.json
#	resources/profiles/Anker/machine/Anker M5.json
#	resources/profiles/Anker/machine/Anker M5C 0.4 nozzle.json
#	resources/profiles/Anker/machine/Anker M5C.json
#	resources/profiles/Anker/machine/fdm_machine_common.json
#	resources/profiles/Anker/process/0.05mm Ultradetail @Anker.json
#	resources/profiles/Anker/process/0.15mm Fast @Anker.json
#	resources/profiles/Anker/process/0.20mm Fast @Anker.json
#	resources/profiles/Anker/process/0.20mm Standard @Anker.json
#	resources/profiles/Anker/process/0.25mm Fast @Anker.json
#	resources/profiles/Anker/process/fdm_process_common.json
#	resources/profiles/Anycubic.json
#	resources/profiles/Anycubic/machine/Anycubic 4Max Pro 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic 4Max Pro 2 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic 4Max Pro 2.json
#	resources/profiles/Anycubic/machine/Anycubic 4Max Pro.json
#	resources/profiles/Anycubic/machine/Anycubic Chiron 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic Chiron.json
#	resources/profiles/Anycubic/machine/Anycubic Kobra 2 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic Kobra Max 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic Kobra Max.json
#	resources/profiles/Anycubic/machine/Anycubic Vyper 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic Vyper.json
#	resources/profiles/Anycubic/machine/Anycubic i3 Mega S 0.4 nozzle.json
#	resources/profiles/Anycubic/machine/Anycubic i3 Mega S.json
#	resources/profiles/Anycubic/machine/fdm_machine_common.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic 4MaxPro2.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic Chiron.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic Kobra2.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic KobraMax.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic Vyper.json
#	resources/profiles/Anycubic/process/0.15mm Optimal @Anycubic i3MegaS.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic 4MaxPro.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic 4MaxPro2.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic Chiron.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic Kobra2.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic KobraMax.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic Vyper.json
#	resources/profiles/Anycubic/process/0.20mm Standard @Anycubic i3MegaS.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic 4MaxPro2.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic Chiron.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic Kobra2.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic KobraMax.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic Vyper.json
#	resources/profiles/Anycubic/process/0.30mm Draft @Anycubic i3MegaS.json
#	resources/profiles/Anycubic/process/fdm_process_common.json
#	resources/profiles/BBL.json
#	resources/profiles/BBL/process/fdm_process_bbl_common.json
#	resources/profiles/Creality.json
#	resources/profiles/Creality/filament/fdm_filament_abs.json
#	resources/profiles/Creality/filament/fdm_filament_pla.json
#	resources/profiles/Creality/machine/Creality CR-10 Max 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality CR-10 Max.json
#	resources/profiles/Creality/machine/Creality CR-10 V2 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality CR-10 V2.json
#	resources/profiles/Creality/machine/Creality Ender-3 S1 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-3 S1 Pro 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-3 S1 Pro.json
#	resources/profiles/Creality/machine/Creality Ender-3 S1.json
#	resources/profiles/Creality/machine/Creality Ender-3 V2 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-3 V2.json
#	resources/profiles/Creality/machine/Creality Ender-5 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-5 Plus 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-5 Plus.json
#	resources/profiles/Creality/machine/Creality Ender-5 S1 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-5 S1.json
#	resources/profiles/Creality/machine/Creality Ender-5.json
#	resources/profiles/Creality/machine/Creality Ender-5S 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-5S.json
#	resources/profiles/Creality/machine/Creality Ender-6 0.4 nozzle.json
#	resources/profiles/Creality/machine/Creality Ender-6.json
#	resources/profiles/Creality/machine/fdm_creality_common.json
#	resources/profiles/Creality/machine/fdm_machine_common.json
#	resources/profiles/Creality/process/0.12mm Fine @Creality CR10Max.json
#	resources/profiles/Creality/process/0.12mm Fine @Creality Ender3V2.json
#	resources/profiles/Creality/process/0.15mm Optimal @Creality CR10Max.json
#	resources/profiles/Creality/process/0.15mm Optimal @Creality Ender3V2.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality CR10V2.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender3S1.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender3S1Pro.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender5.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender5Plus.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender5S.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender5S1.json
#	resources/profiles/Creality/process/0.16mm Optimal @Creality Ender6.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality CR10Max.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality CR10V2.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender3S1.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender3S1Pro.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender3V2.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender5.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender5Plus.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender5S.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender5S1.json
#	resources/profiles/Creality/process/0.20mm Standard @Creality Ender6.json
#	resources/profiles/Creality/process/0.24mm Draft @Creality CR10Max.json
#	resources/profiles/Creality/process/0.24mm Draft @Creality Ender3V2.json
#	resources/profiles/Creality/process/0.24mm Draft @Creality.json
#	resources/profiles/Creality/process/fdm_process_creality_common.json
#	resources/profiles/Custom/filament/My Generic PETG.json
#	resources/profiles/Custom/filament/My Generic PLA.json
#	resources/profiles/Elegoo.json
#	resources/profiles/Elegoo/filament/fdm_filament_common.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2D 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2D.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2S 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 2S.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Max 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Max.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Plus 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Plus.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Pro 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3 Pro.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune 3.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune X 0.4 nozzle.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune X.json
#	resources/profiles/Elegoo/machine/Elegoo Neptune.json
#	resources/profiles/Elegoo/machine/fdm_machine_common.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.08mm Extra Fine @Elegoo NeptuneX.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.12mm Fine @Elegoo NeptuneX.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.16mm Optimal @Elegoo NeptuneX.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.20mm Standard @Elegoo NeptuneX.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.24mm Draft @Elegoo NeptuneX.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune2.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune2D.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune2S.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune3.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune3Max.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune3Plus.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo Neptune3Pro.json
#	resources/profiles/Elegoo/process/0.28mm Extra Draft @Elegoo NeptuneX.json
#	resources/profiles/Prusa.json
#	resources/profiles/Prusa/filament/fdm_filament_common.json
#	resources/profiles/Prusa/machine/Prusa MINI 0.4 nozzle.json
#	resources/profiles/Prusa/machine/Prusa MINI.json
#	resources/profiles/Prusa/machine/Prusa MK3S 0.4 nozzle.json
#	resources/profiles/Prusa/machine/Prusa MK3S.json
#	resources/profiles/Prusa/machine/fdm_machine_common.json
#	resources/profiles/Prusa/process/0.20mm Standard @MINI.json
#	resources/profiles/Prusa/process/0.20mm Standard @MK3S.json
#	resources/profiles/Qidi.json
#	resources/profiles/Qidi/filament/fdm_filament_abs.json
#	resources/profiles/Qidi/filament/fdm_filament_asa.json
#	resources/profiles/Qidi/filament/fdm_filament_common.json
#	resources/profiles/Qidi/filament/fdm_filament_pa.json
#	resources/profiles/Qidi/filament/fdm_filament_pc.json
#	resources/profiles/Qidi/filament/fdm_filament_pet.json
#	resources/profiles/Qidi/filament/fdm_filament_pla.json
#	resources/profiles/Qidi/filament/fdm_filament_pva.json
#	resources/profiles/Qidi/filament/fdm_filament_tpu.json
#	resources/profiles/Qidi/machine/Qidi X-CF Pro 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-CF Pro.json
#	resources/profiles/Qidi/machine/Qidi X-Max 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-Max 3 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-Max 3.json
#	resources/profiles/Qidi/machine/Qidi X-Max.json
#	resources/profiles/Qidi/machine/Qidi X-Plus 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-Plus 3 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-Plus 3.json
#	resources/profiles/Qidi/machine/Qidi X-Plus.json
#	resources/profiles/Qidi/machine/Qidi X-Smart 3 0.4 nozzle.json
#	resources/profiles/Qidi/machine/Qidi X-Smart 3.json
#	resources/profiles/Qidi/machine/fdm_machine_common.json
#	resources/profiles/Qidi/machine/fdm_qidi_common.json
#	resources/profiles/Qidi/machine/fdm_qidi_x3_common.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XCFPro.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XMax.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XMax3.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XPlus.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XPlus3.json
#	resources/profiles/Qidi/process/0.12mm Fine @Qidi XSmart3.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XCFPro.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XMax.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XMax3.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XPlus.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XPlus3.json
#	resources/profiles/Qidi/process/0.16mm Optimal @Qidi XSmart3.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XCFPro.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XMax.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XMax3.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XPlus.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XPlus3.json
#	resources/profiles/Qidi/process/0.20mm Standard @Qidi XSmart3.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XCFPro.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XMax.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XMax3.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XPlus.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XPlus3.json
#	resources/profiles/Qidi/process/0.25mm Draft @Qidi XSmart3.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XCFPro.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XMax.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XMax3.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XPlus.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XPlus3.json
#	resources/profiles/Qidi/process/0.30mm Extra Draft @Qidi XSmart3.json
#	resources/profiles/Qidi/process/fdm_process_common.json
#	resources/profiles/Qidi/process/fdm_process_qidi_common.json
#	resources/profiles/Qidi/process/fdm_process_qidi_x3_common.json
#	resources/profiles/Tronxy/filament/Tronxy Generic ABS.json
#	resources/profiles/Tronxy/process/0.12mm Fine @Tronxy.json
#	resources/profiles/Tronxy/process/0.15mm Optimal @Tronxy.json
#	resources/profiles/Tronxy/process/0.20mm Standard @Tronxy.json
#	resources/profiles/Tronxy/process/0.24mm Draft @Tronxy.json
#	resources/profiles/Voron.json
#	resources/profiles/Voron/filament/Generic ABS @Voron.json
#	resources/profiles/Voron/filament/Generic ASA @Voron.json
#	resources/profiles/Voron/filament/Generic PA @Voron.json
#	resources/profiles/Voron/filament/Generic PETG @Voron.json
#	resources/profiles/Voron/filament/Generic PVA @Voron.json
#	resources/profiles/Voron/filament/Voron Generic PA-CF.json
#	resources/profiles/Voron/filament/Voron Generic PC.json
#	resources/profiles/Voron/filament/Voron Generic PLA-CF.json
#	resources/profiles/Voron/filament/Voron Generic PLA.json
#	resources/profiles/Voron/filament/Voron Generic TPU.json
#	resources/profiles/Voron/machine/Voron 0.1.json
#	resources/profiles/Voron/machine/Voron 2.4 250.json
#	resources/profiles/Voron/machine/Voron 2.4 300.json
#	resources/profiles/Voron/machine/Voron 2.4 350.json
#	resources/profiles/Voron/machine/Voron Trident 250.json
#	resources/profiles/Voron/machine/Voron Trident 300.json
#	resources/profiles/Voron/machine/Voron Trident 350.json
#	resources/profiles/Voron/process/fdm_process_voron_common.json
#	resources/profiles/Voxelab.json
#	resources/profiles/Voxelab/filament/Generic ABS @Voxelab.json
#	resources/profiles/Voxelab/filament/Generic PLA @Voxelab.json
#	resources/profiles/Voxelab/filament/fdm_filament_common.json
#	resources/profiles/Voxelab/machine/Voxelab Aquila X2 0.4 nozzle.json
#	resources/profiles/Voxelab/machine/Voxelab Aquila X2.json
#	resources/profiles/Voxelab/machine/fdm_machine_common.json
#	resources/profiles/Voxelab/process/0.16mm Optimal @Voxelab AquilaX2.json
#	resources/profiles/Voxelab/process/0.20mm Standard @Voxelab AquilaX2.json
#	resources/web/data/text.js
#	resources/web/guide/21/21.js
#	resources/web/guide/24/24.js
#	src/BaseException.cpp
#	src/OrcaSlicer.cpp
#	src/libslic3r/AppConfig.cpp
#	src/libslic3r/BoundingBox.hpp
#	src/libslic3r/Extruder.hpp
#	src/libslic3r/Fill/Fill.cpp
#	src/libslic3r/Format/bbs_3mf.cpp
#	src/libslic3r/GCode.cpp
#	src/libslic3r/GCode.hpp
#	src/libslic3r/GCode/CoolingBuffer.cpp
#	src/libslic3r/GCode/GCodeProcessor.cpp
#	src/libslic3r/GCode/GCodeProcessor.hpp
#	src/libslic3r/GCode/WipeTower.cpp
#	src/libslic3r/GCodeWriter.cpp
#	src/libslic3r/GCodeWriter.hpp
#	src/libslic3r/Model.cpp
#	src/libslic3r/PerimeterGenerator.cpp
#	src/libslic3r/Preset.cpp
#	src/libslic3r/Preset.hpp
#	src/libslic3r/PresetBundle.cpp
#	src/libslic3r/PresetBundle.hpp
#	src/libslic3r/Print.cpp
#	src/libslic3r/Print.hpp
#	src/libslic3r/PrintBase.hpp
#	src/libslic3r/PrintConfig.cpp
#	src/libslic3r/PrintConfig.hpp
#	src/libslic3r/PrintObject.cpp
#	src/libslic3r/TreeSupport.cpp
#	src/libslic3r/Utils.hpp
#	src/mcut/CMakeLists.txt
#	src/slic3r/CMakeLists.txt
#	src/slic3r/GUI/3DBed.cpp
#	src/slic3r/GUI/AMSMaterialsSetting.cpp
#	src/slic3r/GUI/AMSMaterialsSetting.hpp
#	src/slic3r/GUI/BBLTopbar.cpp
#	src/slic3r/GUI/BBLTopbar.hpp
#	src/slic3r/GUI/BackgroundSlicingProcess.hpp
#	src/slic3r/GUI/BindDialog.cpp
#	src/slic3r/GUI/ConfigManipulation.cpp
#	src/slic3r/GUI/DeviceManager.cpp
#	src/slic3r/GUI/Field.cpp
#	src/slic3r/GUI/GLCanvas3D.cpp
#	src/slic3r/GUI/GUI_App.cpp
#	src/slic3r/GUI/GUI_App.hpp
#	src/slic3r/GUI/GUI_Factories.cpp
#	src/slic3r/GUI/GUI_Factories.hpp
#	src/slic3r/GUI/GUI_ObjectList.cpp
#	src/slic3r/GUI/Gizmos/GLGizmoMeshBoolean.cpp
#	src/slic3r/GUI/Jobs/ArrangeJob.cpp
#	src/slic3r/GUI/Jobs/FillBedJob.cpp
#	src/slic3r/GUI/MainFrame.cpp
#	src/slic3r/GUI/MediaPlayCtrl.cpp
#	src/slic3r/GUI/Monitor.cpp
#	src/slic3r/GUI/PartPlate.cpp
#	src/slic3r/GUI/PartPlate.hpp
#	src/slic3r/GUI/PlateSettingsDialog.cpp
#	src/slic3r/GUI/PlateSettingsDialog.hpp
#	src/slic3r/GUI/Plater.cpp
#	src/slic3r/GUI/Plater.hpp
#	src/slic3r/GUI/PresetComboBoxes.cpp
#	src/slic3r/GUI/ReleaseNote.cpp
#	src/slic3r/GUI/SelectMachine.cpp
#	src/slic3r/GUI/StatusPanel.cpp
#	src/slic3r/GUI/Tab.cpp
#	src/slic3r/GUI/Widgets/Label.cpp
#	src/slic3r/GUI/Widgets/Label.hpp
#	src/slic3r/GUI/Widgets/SideButton.cpp
#	src/slic3r/GUI/calib_dlg.cpp
#	src/slic3r/GUI/calib_dlg.hpp
#	src/slic3r/GUI/wxExtensions.hpp
#	src/slic3r/Utils/NetworkAgent.cpp
#	src/slic3r/Utils/bambu_networking.hpp
#	version.inc
This commit is contained in:
SoftFever 2023-08-26 16:13:57 +08:00
commit e65b11a831
734 changed files with 72573 additions and 47919 deletions

View file

@ -5,7 +5,6 @@
#include <boost/log/trivial.hpp>
#include <iostream>
#include <float.h>
#include <unordered_map>
#if 0
#define DEBUG
@ -62,8 +61,7 @@ struct CoolingLine
TYPE_G2 = 1 << 12,
TYPE_G3 = 1 << 13,
TYPE_FORCE_RESUME_FAN = 1 << 14,
TYPE_SUPPORT_INTERFACE_FAN_START = 1 << 15,
TYPE_SUPPORT_INTERFACE_FAN_END = 1 << 16,
TYPE_SET_FAN_CHANGING_LAYER = 1 << 15,
};
CoolingLine(unsigned int type, size_t line_start, size_t line_end) :
@ -482,10 +480,6 @@ std::vector<PerExtruderAdjustments> CoolingBuffer::parse_layer_gcode(const std::
line.type = CoolingLine::TYPE_OVERHANG_FAN_START;
} else if (boost::starts_with(sline, ";_OVERHANG_FAN_END")) {
line.type = CoolingLine::TYPE_OVERHANG_FAN_END;
} else if (boost::starts_with(sline, ";_SUPP_INTERFACE_FAN_START")) {
line.type = CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_START;
} else if (boost::starts_with(sline, ";_SUPP_INTERFACE_FAN_END")) {
line.type = CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_END;
} else if (boost::starts_with(sline, "G4 ")) {
// Parse the wait time.
line.type = CoolingLine::TYPE_G4;
@ -497,6 +491,8 @@ std::vector<PerExtruderAdjustments> CoolingBuffer::parse_layer_gcode(const std::
(pos_P > 0) ? atof(sline.c_str() + pos_P + 1) * 0.001 : 0.);
} else if (boost::starts_with(sline, ";_FORCE_RESUME_FAN_SPEED")) {
line.type = CoolingLine::TYPE_FORCE_RESUME_FAN;
} else if (boost::starts_with(sline, ";_SET_FAN_SPEED_CHANGING_LAYER")) {
line.type = CoolingLine::TYPE_SET_FAN_CHANGING_LAYER;
}
if (line.type != 0)
adjustment->lines.emplace_back(std::move(line));
@ -729,9 +725,14 @@ std::string CoolingBuffer::apply_layer_cooldown(
new_gcode.reserve(gcode.size() * 2);
bool overhang_fan_control= false;
int overhang_fan_speed = 0;
bool supp_interface_fan_control= false;
int supp_interface_fan_speed = 0;
auto change_extruder_set_fan = [ this, layer_id, layer_time, &new_gcode, &overhang_fan_control, &overhang_fan_speed, &supp_interface_fan_control, &supp_interface_fan_speed](bool immediately_apply) {
enum class SetFanType {
sfChangingLayer = 0,
sfChangingFilament,
sfImmediatelyApply
};
auto change_extruder_set_fan = [ this, layer_id, layer_time, &new_gcode, &overhang_fan_control, &overhang_fan_speed](SetFanType type) {
#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_current_extruder)
int fan_min_speed = EXTRUDER_CONFIG(fan_min_speed);
int fan_speed_new = EXTRUDER_CONFIG(reduce_fan_stop_start_freq) ? fan_min_speed : 0;
@ -740,8 +741,6 @@ std::string CoolingBuffer::apply_layer_cooldown(
int close_fan_the_first_x_layers = EXTRUDER_CONFIG(close_fan_the_first_x_layers);
// Is the fan speed ramp enabled?
int full_fan_speed_layer = EXTRUDER_CONFIG(full_fan_speed_layer);
supp_interface_fan_speed = EXTRUDER_CONFIG(support_material_interface_fan_speed);
if (close_fan_the_first_x_layers <= 0 && full_fan_speed_layer > 0) {
// When ramping up fan speed from close_fan_the_first_x_layers to full_fan_speed_layer, force close_fan_the_first_x_layers above zero,
// so there will be a zero fan speed at least at the 1st layer.
@ -770,9 +769,6 @@ std::string CoolingBuffer::apply_layer_cooldown(
fan_speed_new = std::clamp(int(float(fan_speed_new) * factor + 0.5f), 0, 255);
overhang_fan_speed = std::clamp(int(float(overhang_fan_speed) * factor + 0.5f), 0, 255);
}
supp_interface_fan_speed = EXTRUDER_CONFIG(support_material_interface_fan_speed);
supp_interface_fan_control = supp_interface_fan_speed >= 0;
#undef EXTRUDER_CONFIG
overhang_fan_control= overhang_fan_speed > fan_speed_new;
} else {
@ -780,34 +776,34 @@ std::string CoolingBuffer::apply_layer_cooldown(
overhang_fan_speed = 0;
fan_speed_new = 0;
additional_fan_speed_new = 0;
supp_interface_fan_control= false;
supp_interface_fan_speed = 0;
}
if (fan_speed_new != m_fan_speed) {
m_fan_speed = fan_speed_new;
//BBS
m_current_fan_speed = fan_speed_new;
if (immediately_apply)
if (type == SetFanType::sfImmediatelyApply)
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, m_fan_speed);
else if (type == SetFanType::sfChangingLayer)
this->m_set_fan_changing_layer = true;
//BBS: don't need to handle change filament, because we are always force to resume fan speed when filament change is finished
}
//BBS
if (additional_fan_speed_new != m_additional_fan_speed) {
m_additional_fan_speed = additional_fan_speed_new;
if (immediately_apply && m_config.auxiliary_fan.value)
if (type == SetFanType::sfImmediatelyApply)
new_gcode += GCodeWriter::set_additional_fan(m_additional_fan_speed);
else if (type == SetFanType::sfChangingLayer)
this->m_set_addition_fan_changing_layer = true;
//BBS: don't need to handle change filament, because we are always force to resume fan speed when filament change is finished
}
};
const char *pos = gcode.c_str();
int current_feedrate = 0;
change_extruder_set_fan(true);
// Reduce set fan commands by deferring the GCodeWriter::set_fan calls. Inspired by SuperSlicer
// define fan_speed_change_requests and initialize it with all possible types fan speed change requests
std::unordered_map<int, bool> fan_speed_change_requests = {{CoolingLine::TYPE_OVERHANG_FAN_START, false},
{CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_START, false},
{CoolingLine::TYPE_FORCE_RESUME_FAN, false}};
bool need_set_fan = false;
//BBS
m_set_fan_changing_layer = false;
m_set_addition_fan_changing_layer = false;
change_extruder_set_fan(SetFanType::sfChangingLayer);
for (const CoolingLine *line : lines) {
const char *line_start = gcode.c_str() + line->line_start;
const char *line_end = gcode.c_str() + line->line_end;
@ -817,37 +813,37 @@ std::string CoolingBuffer::apply_layer_cooldown(
unsigned int new_extruder = (unsigned int)atoi(line_start + m_toolchange_prefix.size());
if (new_extruder != m_current_extruder) {
m_current_extruder = new_extruder;
change_extruder_set_fan(false); //BBS: will force to resume fan speed when filament change is finished
change_extruder_set_fan(SetFanType::sfChangingFilament); //BBS: will force to resume fan speed when filament change is finished
}
new_gcode.append(line_start, line_end - line_start);
} else if (line->type & CoolingLine::TYPE_OVERHANG_FAN_START) {
if (overhang_fan_control && !fan_speed_change_requests[CoolingLine::TYPE_OVERHANG_FAN_START]) {
need_set_fan = true;
fan_speed_change_requests[CoolingLine::TYPE_OVERHANG_FAN_START] = true;
}
if (overhang_fan_control) {
//BBS
m_current_fan_speed = overhang_fan_speed;
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, overhang_fan_speed);
}
} else if (line->type & CoolingLine::TYPE_OVERHANG_FAN_END) {
if (overhang_fan_control && fan_speed_change_requests[CoolingLine::TYPE_OVERHANG_FAN_START]) {
fan_speed_change_requests[CoolingLine::TYPE_OVERHANG_FAN_START] = false;
if (overhang_fan_control) {
//BBS
m_current_fan_speed = m_fan_speed;
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, m_fan_speed);
}
need_set_fan = true;
} else if (line->type & CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_START) {
if (supp_interface_fan_control && !fan_speed_change_requests[CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_START]) {
fan_speed_change_requests[CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_START] = true;
need_set_fan = true;
}
} else if (line->type & CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_END && fan_speed_change_requests[CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_START]) {
if (supp_interface_fan_control) {
fan_speed_change_requests[CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_START] = false;
}
need_set_fan = true;
} else if (line->type & CoolingLine::TYPE_FORCE_RESUME_FAN) {
// check if any fan speed change request is active
if (m_fan_speed != -1 && !std::any_of(fan_speed_change_requests.begin(), fan_speed_change_requests.end(), [](const std::pair<int, bool>& p) { return p.second; })){
fan_speed_change_requests[CoolingLine::TYPE_FORCE_RESUME_FAN] = true;
need_set_fan = true;
}
if (m_additional_fan_speed != -1 && m_config.auxiliary_fan.value)
//BBS: force to write a fan speed command again
if (m_current_fan_speed != -1)
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, m_current_fan_speed);
if (m_additional_fan_speed != -1)
new_gcode += GCodeWriter::set_additional_fan(m_additional_fan_speed);
} else if (line->type & CoolingLine::TYPE_SET_FAN_CHANGING_LAYER) {
//BBS: check whether fan speed need to changed when change layer
if (m_current_fan_speed != -1 && m_set_fan_changing_layer) {
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, m_current_fan_speed);
m_set_fan_changing_layer = false;
}
if (m_additional_fan_speed != -1 && m_set_addition_fan_changing_layer) {
new_gcode += GCodeWriter::set_additional_fan(m_additional_fan_speed);
m_set_addition_fan_changing_layer = false;
}
}
else if (line->type & CoolingLine::TYPE_EXTRUDE_END) {
// Just remove this comment.
@ -933,24 +929,6 @@ std::string CoolingBuffer::apply_layer_cooldown(
} else {
new_gcode.append(line_start, line_end - line_start);
}
if (need_set_fan) {
if (fan_speed_change_requests[CoolingLine::TYPE_OVERHANG_FAN_START]){
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, overhang_fan_speed);
m_current_fan_speed = overhang_fan_speed;
}
else if (fan_speed_change_requests[CoolingLine::TYPE_SUPPORT_INTERFACE_FAN_START]){
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, supp_interface_fan_speed);
m_current_fan_speed = supp_interface_fan_speed;
}
else if(fan_speed_change_requests[CoolingLine::TYPE_FORCE_RESUME_FAN] && m_current_fan_speed != -1){
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, m_current_fan_speed);
fan_speed_change_requests[CoolingLine::TYPE_FORCE_RESUME_FAN] = false;
}
else
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, m_fan_speed);
need_set_fan = false;
}
pos = line_end;
}
const char *gcode_end = gcode.c_str() + gcode.size();

View file

@ -59,6 +59,9 @@ private:
bool m_cooling_logic_proportional = false;
//BBS: current fan speed
int m_current_fan_speed;
//BBS:
bool m_set_fan_changing_layer = false;
bool m_set_addition_fan_changing_layer = false;
};
}

View file

@ -1,4 +1,3 @@
#include "ExtrusionEntity.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Utils.hpp"
#include "libslic3r/Print.hpp"
@ -17,7 +16,6 @@
#include <float.h>
#include <assert.h>
#include <regex>
#if __has_include(<charconv>)
#include <charconv>
@ -62,23 +60,6 @@ const std::vector<std::string> GCodeProcessor::Reserved_Tags = {
"_GP_TOTAL_LAYER_NUMBER_PLACEHOLDER"
};
const std::vector<std::string> GCodeProcessor::Reserved_Tags_compatible = {
"TYPE:",
"WIPE_START",
"WIPE_END",
"HEIGHT:",
"WIDTH:",
"LAYER_CHANGE",
"COLOR_CHANGE",
"PAUSE_PRINT",
"CUSTOM_GCODE",
"_GP_FIRST_LINE_M73_PLACEHOLDER",
"_GP_LAST_LINE_M73_PLACEHOLDER",
"_GP_ESTIMATED_PRINTING_TIME_PLACEHOLDER",
"_GP_TOTAL_LAYER_NUMBER_PLACEHOLDER"
};
const std::string GCodeProcessor::Flush_Start_Tag = " FLUSH_START";
const std::string GCodeProcessor::Flush_End_Tag = " FLUSH_END";
@ -92,8 +73,6 @@ const std::map<NozzleType,int> GCodeProcessor::Nozzle_Type_To_HRC={
const float GCodeProcessor::Wipe_Width = 0.05f;
const float GCodeProcessor::Wipe_Height = 0.05f;
bool GCodeProcessor::s_IsBBLPrinter = true;
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
const std::string GCodeProcessor::Mm3_Per_Mm_Tag = "MM3_PER_MM:";
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
@ -122,16 +101,16 @@ static float intersection_distance(float initial_rate, float final_rate, float a
static float speed_from_distance(float initial_feedrate, float distance, float acceleration)
{
// to avoid invalid negative numbers due to numerical errors
// to avoid invalid negative numbers due to numerical errors
float value = std::max(0.0f, sqr(initial_feedrate) + 2.0f * acceleration * distance);
return ::sqrt(value);
}
// Calculates the maximum allowable speed at this point when you must be able to reach target_velocity using the
// Calculates the maximum allowable speed at this point when you must be able to reach target_velocity using the
// acceleration within the allotted distance.
static float max_allowable_speed(float acceleration, float target_velocity, float distance)
{
// to avoid invalid negative numbers due to numerical errors
// to avoid invalid negative numbers due to numerical errors
float value = std::max(0.0f, sqr(target_velocity) - 2.0f * acceleration * distance);
return std::sqrt(value);
}
@ -182,7 +161,7 @@ void GCodeProcessor::TimeBlock::calculate_trapezoid()
float cruise_distance = distance - accelerate_distance - decelerate_distance;
// Not enough space to reach the nominal feedrate.
// This means no cruising, and we'll have to use intersection_distance() to calculate when to abort acceleration
// This means no cruising, and we'll have to use intersection_distance() to calculate when to abort acceleration
// and start braking in order to reach the exit_feedrate exactly at the end of this block.
if (cruise_distance < 0.0f) {
accelerate_distance = std::clamp(intersection_distance(feedrate_profile.entry, feedrate_profile.exit, acceleration, distance), 0.0f, distance);
@ -491,17 +470,12 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st
PrintEstimatedStatistics::ETimeMode mode = static_cast<PrintEstimatedStatistics::ETimeMode>(i);
if (mode == PrintEstimatedStatistics::ETimeMode::Normal || machine.enabled) {
char buf[128];
if(!s_IsBBLPrinter)
// SoftFever: compatibility with klipper_estimator
sprintf(buf, "; estimated printing time (normal mode) = %s\n", get_time_dhms(machine.time).c_str());
else {
//sprintf(buf, "; estimated printing time (%s mode) = %s\n",
// (mode == PrintEstimatedStatistics::ETimeMode::Normal) ? "normal" : "silent",
// get_time_dhms(machine.time).c_str());
sprintf(buf, "; model printing time: %s; total estimated time: %s\n",
get_time_dhms(machine.time - machine.prepare_time).c_str(),
get_time_dhms(machine.time).c_str());
}
ret += buf;
}
}
@ -662,7 +636,7 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st
if (processed && lines_added_count > 0)
offsets.push_back({ line_id, lines_added_count });
if (! processed && ! is_temporary_decoration(gcode_line) &&
(GCodeReader::GCodeLine::cmd_is(gcode_line, "G1") ||
(GCodeReader::GCodeLine::cmd_is(gcode_line, "G1") ||
GCodeReader::GCodeLine::cmd_is(gcode_line, "G2") ||
GCodeReader::GCodeLine::cmd_is(gcode_line, "G3"))) {
// remove temporary lines, add lines M73 where needed
@ -677,7 +651,7 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st
gcode_line.clear();
}
// Skip EOL.
it = it_end;
it = it_end;
if (it != it_bufend && *it == '\r')
++ it;
if (it != it_bufend && *it == '\n')
@ -848,12 +822,10 @@ void GCodeProcessorResult::reset() {
#endif // ENABLE_GCODE_VIEWER_STATISTICS
const std::vector<std::pair<GCodeProcessor::EProducer, std::string>> GCodeProcessor::Producers = {
//BBS: OrcaSlicer is also "bambu". Otherwise the time estimation didn't work.
//BBS: BambuStudio is also "bambu". Otherwise the time estimation didn't work.
//FIXME: Workaround and should be handled when do removing-bambu
{ EProducer::OrcaSlicer, SLIC3R_APP_NAME },
{ EProducer::OrcaSlicer, "generated by OrcaSlicer" },
{ EProducer::OrcaSlicer, "generated by BambuStudio" },
{ EProducer::OrcaSlicer, "BambuStudio" }
{ EProducer::BambuStudio, SLIC3R_APP_NAME },
{ EProducer::BambuStudio, "generated by BambuStudio" }
//{ EProducer::Slic3rPE, "generated by Slic3r Bambu Edition" },
//{ EProducer::Slic3r, "generated by Slic3r" },
//{ EProducer::SuperSlicer, "generated by SuperSlicer" },
@ -871,12 +843,11 @@ bool GCodeProcessor::contains_reserved_tag(const std::string& gcode, std::string
bool ret = false;
GCodeReader parser;
auto& _tags = s_IsBBLPrinter ? Reserved_Tags : Reserved_Tags_compatible;
parser.parse_buffer(gcode, [&ret, &found_tag, _tags](GCodeReader& parser, const GCodeReader::GCodeLine& line) {
parser.parse_buffer(gcode, [&ret, &found_tag](GCodeReader& parser, const GCodeReader::GCodeLine& line) {
std::string comment = line.raw();
if (comment.length() > 2 && comment.front() == ';') {
comment = comment.substr(1);
for (const std::string& s : _tags) {
for (const std::string& s : Reserved_Tags) {
if (boost::starts_with(comment, s)) {
ret = true;
found_tag = comment;
@ -899,12 +870,11 @@ bool GCodeProcessor::contains_reserved_tags(const std::string& gcode, unsigned i
CNumericLocalesSetter locales_setter;
GCodeReader parser;
auto& _tags = s_IsBBLPrinter ? Reserved_Tags : Reserved_Tags_compatible;
parser.parse_buffer(gcode, [&ret, &found_tag, max_count, _tags](GCodeReader& parser, const GCodeReader::GCodeLine& line) {
parser.parse_buffer(gcode, [&ret, &found_tag, max_count](GCodeReader& parser, const GCodeReader::GCodeLine& line) {
std::string comment = line.raw();
if (comment.length() > 2 && comment.front() == ';') {
comment = comment.substr(1);
for (const std::string& s : _tags) {
for (const std::string& s : Reserved_Tags) {
if (boost::starts_with(comment, s)) {
ret = true;
found_tag.push_back(comment);
@ -947,7 +917,6 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
m_result.filament_densities.resize(extruders_count);
m_result.filament_vitrification_temperature.resize(extruders_count);
m_extruder_temps.resize(extruders_count);
m_result.nozzle_hrc = static_cast<int>(config.nozzle_hrc.getInt());
m_result.nozzle_type = config.nozzle_type;
for (size_t i = 0; i < extruders_count; ++ i) {
m_extruder_offsets[i] = to_3d(config.extruder_offset.get_at(i).cast<float>().eval(), 0.f);
@ -958,17 +927,12 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
m_result.filament_vitrification_temperature[i] = static_cast<float>(config.temperature_vitrification.get_at(i));
}
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper || m_flavor == gcfRepRapFirmware) {
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper) {
m_time_processor.machine_limits = reinterpret_cast<const MachineEnvelopeConfig&>(config);
if (m_flavor == gcfMarlinLegacy) {
// Legacy Marlin does not have separate travel acceleration, it uses the 'extruding' value instead.
m_time_processor.machine_limits.machine_max_acceleration_travel = m_time_processor.machine_limits.machine_max_acceleration_extruding;
}
if (m_flavor == gcfRepRapFirmware) {
// RRF does not support setting min feedrates. Set them to zero.
m_time_processor.machine_limits.machine_min_travel_rate.values.assign(m_time_processor.machine_limits.machine_min_travel_rate.size(), 0.);
m_time_processor.machine_limits.machine_min_extruding_rate.values.assign(m_time_processor.machine_limits.machine_min_extruding_rate.size(), 0.);
}
}
// Filament load / unload times are not specific to a firmware flavor. Let anybody use it if they find it useful.
@ -1009,9 +973,6 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
if (nozzle_volume != nullptr)
m_nozzle_volume = nozzle_volume->value;
const ConfigOptionInt *nozzle_HRC = config.option<ConfigOptionInt>("nozzle_hrc");
if (nozzle_HRC != nullptr) m_result.nozzle_hrc = nozzle_HRC->value;
const ConfigOptionEnum<NozzleType>* nozzle_type = config.option<ConfigOptionEnum<NozzleType>>("nozzle_type");
if (nozzle_type != nullptr)
m_result.nozzle_type=nozzle_type->value;
@ -1119,7 +1080,7 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
}
}
}
if (m_extruder_offsets.size() < m_result.extruders_count) {
for (size_t i = m_extruder_offsets.size(); i < m_result.extruders_count; ++i) {
m_extruder_offsets.emplace_back(DEFAULT_EXTRUDER_OFFSET);
@ -1394,12 +1355,12 @@ void GCodeProcessor::process_file(const std::string& filename, std::function<voi
});
m_parser.reset();
// if the gcode was produced by OrcaSlicer,
// if the gcode was produced by BambuStudio,
// extract the config from it
if (m_producer == EProducer::OrcaSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
if (m_producer == EProducer::BambuStudio || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
DynamicPrintConfig config;
config.apply(FullPrintConfig::defaults());
// Silently substitute unknown values by new ones for loading configurations from OrcaSlicer's own G-code.
// Silently substitute unknown values by new ones for loading configurations from BambuStudio's own G-code.
// Showing substitution log or errors may make sense, but we are not really reading many values from the G-code config,
// thus a probability of incorrect substitution is low and the G-code viewer is a consumer-only anyways.
config.load_from_gcode_file(filename, ForwardCompatibilitySubstitutionRule::EnableSilent);
@ -1449,7 +1410,7 @@ void GCodeProcessor::initialize(const std::string& filename)
void GCodeProcessor::process_buffer(const std::string &buffer)
{
//FIXME maybe cache GCodeLine gline to be over multiple parse_buffer() invocations.
m_parser.parse_buffer(buffer, [this](GCodeReader&, const GCodeReader::GCodeLine& line) {
m_parser.parse_buffer(buffer, [this](GCodeReader&, const GCodeReader::GCodeLine& line) {
this->process_gcode_line(line, false);
});
}
@ -1491,7 +1452,7 @@ void GCodeProcessor::finalize(bool post_process)
else
m_result.moves[i].layer_duration = 0;
}
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
std::cout << "\n";
m_mm3_per_mm_compare.output();
@ -1647,7 +1608,7 @@ void GCodeProcessor::apply_config_simplify3d(const std::string& filename)
}
return false;
};
begin = skip_whitespaces(begin, end);
end = remove_eols(begin, end);
if (begin != end) {
@ -1705,6 +1666,7 @@ void GCodeProcessor::process_gcode_line(const GCodeReader::GCodeLine& line, bool
m_start_position = m_end_position;
const std::string_view cmd = line.cmd();
//OrcaSlicer
if (m_flavor == gcfKlipper)
{
if (boost::iequals(cmd, "SET_VELOCITY_LIMIT"))
@ -1728,7 +1690,7 @@ void GCodeProcessor::process_gcode_line(const GCodeReader::GCodeLine& line, bool
case '2':
case '3': { process_G2_G3(line); break; } // Move
//BBS
case 4: { process_G4(line); break; } // Delay
case '4': { process_G4(line); break; } // Delay
default: break;
}
break;
@ -1928,7 +1890,7 @@ template<typename T>
auto str_end = sv.data() + sv.size();
auto [end_ptr, error_code] = std::from_chars(sv.data(), str_end, out);
return error_code == std::errc() && end_ptr == str_end;
}
}
else
#endif
{
@ -2081,7 +2043,7 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers
return;
}
if (!producers_enabled || m_producer == EProducer::OrcaSlicer) {
if (!producers_enabled || m_producer == EProducer::BambuStudio) {
// height tag
if (boost::starts_with(comment, reserved_tag(ETags::Height))) {
if (!parse_number(comment.substr(reserved_tag(ETags::Height).size()), m_forced_height))
@ -2219,9 +2181,9 @@ bool GCodeProcessor::process_producers_tags(const std::string_view comment)
switch (m_producer)
{
case EProducer::Slic3rPE:
case EProducer::Slic3r:
case EProducer::Slic3r:
case EProducer::SuperSlicer:
case EProducer::OrcaSlicer: { return process_bambuslicer_tags(comment); }
case EProducer::BambuStudio: { return process_bambuslicer_tags(comment); }
case EProducer::Cura: { return process_cura_tags(comment); }
case EProducer::Simplify3D: { return process_simplify3d_tags(comment); }
case EProducer::CraftWare: { return process_craftware_tags(comment); }
@ -2326,7 +2288,7 @@ bool GCodeProcessor::process_simplify3d_tags(const std::string_view comment)
set_extrusion_role(erSkirt);
return true;
}
// ; outer perimeter
pos = cmt.find(" outer perimeter");
if (pos == 0) {
@ -2370,13 +2332,6 @@ bool GCodeProcessor::process_simplify3d_tags(const std::string_view comment)
return true;
}
// ; internal bridge
pos = cmt.find(" internal bridge");
if (pos == 0) {
set_extrusion_role(erInternalBridgeInfill);
return true;
}
// ; support
pos = cmt.find(" support");
if (pos == 0) {
@ -2528,8 +2483,6 @@ bool GCodeProcessor::process_ideamaker_tags(const std::string_view comment)
set_extrusion_role(erInternalInfill);
else if (type == "BRIDGE")
set_extrusion_role(erBridgeInfill);
else if (type == "INTERNAL BRIDGE")
set_extrusion_role(erInternalBridgeInfill);
else if (type == "SUPPORT")
set_extrusion_role(erSupportMaterial);
else {
@ -2729,7 +2682,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
type = (delta_pos[Z] == 0.0f) ? EMoveType::Unretract : EMoveType::Travel;
else if (delta_pos[X] != 0.0f || delta_pos[Y] != 0.0f)
type = EMoveType::Extrude;
}
}
else if (delta_pos[X] != 0.0f || delta_pos[Y] != 0.0f || delta_pos[Z] != 0.0f)
type = EMoveType::Travel;
@ -2802,7 +2755,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
else if (m_extrusion_role == erExternalPerimeter)
// cross section: rectangle
m_width = delta_pos[E] * static_cast<float>(M_PI * sqr(1.05f * filament_radius)) / (delta_xyz * m_height);
else if (m_extrusion_role == erBridgeInfill || m_extrusion_role == erInternalBridgeInfill || m_extrusion_role == erNone)
else if (m_extrusion_role == erBridgeInfill || m_extrusion_role == erNone)
// cross section: circle
m_width = static_cast<float>(m_result.filament_diameters[m_extruder_id]) * std::sqrt(delta_pos[E] / delta_xyz);
else
@ -2927,7 +2880,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
}
// calculates block acceleration
float acceleration =
float acceleration =
(type == EMoveType::Travel) ? get_travel_acceleration(static_cast<PrintEstimatedStatistics::ETimeMode>(i)) :
(is_extrusion_only_move(delta_pos) ?
get_retract_acceleration(static_cast<PrintEstimatedStatistics::ETimeMode>(i)) :
@ -3259,7 +3212,7 @@ void GCodeProcessor::process_G2_G3(const GCodeReader::GCodeLine& line)
else if (m_extrusion_role == erExternalPerimeter)
//BBS: cross section: rectangle
m_width = delta_pos[E] * static_cast<float>(M_PI * sqr(1.05f * filament_radius)) / (delta_xyz * m_height);
else if (m_extrusion_role == erBridgeInfill || m_extrusion_role == erInternalBridgeInfill || m_extrusion_role == erNone)
else if (m_extrusion_role == erBridgeInfill || m_extrusion_role == erNone)
//BBS: cross section: circle
m_width = static_cast<float>(m_result.filament_diameters[m_extruder_id]) * std::sqrt(delta_pos[E] / delta_xyz);
else
@ -3402,7 +3355,7 @@ void GCodeProcessor::process_G2_G3(const GCodeReader::GCodeLine& line)
}
else if (a == Y || a == Z) {
continue;
}
}
else {
float v_exit = prev.axis_feedrate[a];
float v_entry = curr.axis_feedrate[a];
@ -3625,7 +3578,7 @@ void GCodeProcessor::process_G92(const GCodeReader::GCodeLine& line)
simulate_st_synchronize();
if (!any_found && !line.has_unknown_axis()) {
// The G92 may be called for axes that PrusaSlicer does not recognize, for example see GH issue #3510,
// The G92 may be called for axes that PrusaSlicer does not recognize, for example see GH issue #3510,
// where G92 A0 B0 is called although the extruder axis is till E.
for (unsigned char a = X; a <= E; ++a) {
m_origin[a] = m_end_position[a];
@ -3873,7 +3826,7 @@ void GCodeProcessor::process_SET_VELOCITY_LIMIT(const GCodeReader::GCodeLine& li
{
_jerk = std::stof(matches[1]);
}
catch (...){}
catch (...) {}
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
set_option_value(m_time_processor.machine_limits.machine_max_jerk_x, i, _jerk);
set_option_value(m_time_processor.machine_limits.machine_max_jerk_y, i, _jerk);
@ -3903,8 +3856,8 @@ void GCodeProcessor::process_SET_VELOCITY_LIMIT(const GCodeReader::GCodeLine& li
}
catch (...) {}
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
set_option_value(m_time_processor.machine_limits.machine_max_speed_x, i, _speed);
set_option_value(m_time_processor.machine_limits.machine_max_speed_y, i, _speed);
set_option_value(m_time_processor.machine_limits.machine_max_speed_x, i, _speed);
set_option_value(m_time_processor.machine_limits.machine_max_speed_y, i, _speed);
}
}
@ -4336,9 +4289,7 @@ void GCodeProcessor::update_slice_warnings()
warning.params.clear();
warning.level=1;
int nozzle_hrc = m_result.nozzle_hrc;
if(nozzle_hrc <= 0)
nozzle_hrc = Nozzle_Type_To_HRC.find(m_result.nozzle_type)->second;
int nozzle_hrc = Nozzle_Type_To_HRC.find(m_result.nozzle_type)->second;
if (nozzle_hrc!=0) {
for (size_t i = 0; i < used_extruders.size(); i++) {
int HRC=0;
@ -4359,3 +4310,4 @@ void GCodeProcessor::update_slice_warnings()
}
} /* namespace Slic3r */

View file

@ -97,11 +97,11 @@ namespace Slic3r {
{
std::string _objName1;
std::string _objName2;
double _height;
float _height;
const void *_obj1; // nullptr means wipe tower
const void *_obj2;
int layer = -1;
ConflictResult(const std::string &objName1, const std::string &objName2, double height, const void *obj1, const void *obj2)
ConflictResult(const std::string &objName1, const std::string &objName2, float height, const void *obj1, const void *obj2)
: _objName1(objName1), _objName2(objName2), _height(height), _obj1(obj1), _obj2(obj2)
{}
ConflictResult() = default;
@ -192,7 +192,6 @@ namespace Slic3r {
std::vector<std::pair<float, std::pair<size_t, size_t>>> spiral_vase_layers;
//BBS
std::vector<SliceWarning> warnings;
int nozzle_hrc;
NozzleType nozzle_type;
BedType bed_type = BedType::btCount;
#if ENABLE_GCODE_VIEWER_STATISTICS
@ -236,7 +235,6 @@ namespace Slic3r {
class GCodeProcessor
{
static const std::vector<std::string> Reserved_Tags;
static const std::vector<std::string> Reserved_Tags_compatible;
static const std::string Flush_Start_Tag;
static const std::string Flush_End_Tag;
static const std::map<NozzleType, int>Nozzle_Type_To_HRC;
@ -258,8 +256,8 @@ namespace Slic3r {
Total_Layer_Number_Placeholder
};
static const std::string& reserved_tag(ETags tag) { return s_IsBBLPrinter ? Reserved_Tags[static_cast<unsigned char>(tag)] : Reserved_Tags_compatible[static_cast<unsigned char>(tag)]; }
// checks the given gcode for reserved tags and returns true when finding the 1st (which is returned into found_tag)
static const std::string& reserved_tag(ETags tag) { return Reserved_Tags[static_cast<unsigned char>(tag)]; }
// checks the given gcode for reserved tags and returns true when finding the 1st (which is returned into found_tag)
static bool contains_reserved_tag(const std::string& gcode, std::string& found_tag);
// checks the given gcode for reserved tags and returns true when finding any
// (the first max_count found tags are returned into found_tag)
@ -271,8 +269,6 @@ namespace Slic3r {
static const float Wipe_Width;
static const float Wipe_Height;
static bool s_IsBBLPrinter;
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
static const std::string Mm3_Per_Mm_Tag;
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
@ -369,7 +365,7 @@ namespace Slic3r {
AxisCoords axis_feedrate; // mm/s
AxisCoords abs_axis_feedrate; // mm/s
//BBS: unit vector of enter speed and exit speed in x-y-z space.
//BBS: unit vector of enter speed and exit speed in x-y-z space.
//For line move, there are same. For arc move, there are different.
Vec3f enter_direction;
Vec3f exit_direction;
@ -673,7 +669,7 @@ namespace Slic3r {
enum class EProducer
{
Unknown,
OrcaSlicer,
BambuStudio,
Slic3rPE,
Slic3r,
SuperSlicer,

View file

@ -128,9 +128,9 @@ public:
}
WipeTowerWriter& disable_linear_advance() {
if(m_gcode_flavor == gcfKlipper)
if (m_gcode_flavor == gcfKlipper)
m_gcode += "SET_PRESSURE_ADVANCE ADVANCE=0\n";
else if(m_gcode_flavor == gcfRepRapFirmware)
else if (m_gcode_flavor == gcfRepRapFirmware)
m_gcode += std::string("M572 D") + std::to_string(m_current_tool) + " S0\n";
else
m_gcode += "M900 K0\n";