mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
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:
commit
e65b11a831
734 changed files with 72573 additions and 47919 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <wx/simplebook.h>
|
||||
#include <wx/dcgraph.h>
|
||||
#include "CalibUtils.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
|
@ -33,7 +34,7 @@ wxDEFINE_EVENT(EVT_AMS_SHOW_HUMIDITY_TIPS, wxCommandEvent);
|
|||
wxDEFINE_EVENT(EVT_AMS_UNSELETED_VAMS, wxCommandEvent);
|
||||
wxDEFINE_EVENT(EVT_CLEAR_SPEED_CONTROL, wxCommandEvent);
|
||||
|
||||
bool AMSinfo::parse_ams_info(Ams *ams, bool remain_flag, bool humidity_flag)
|
||||
bool AMSinfo::parse_ams_info(MachineObject *obj, Ams *ams, bool remain_flag, bool humidity_flag)
|
||||
{
|
||||
if (!ams) return false;
|
||||
this->ams_id = ams->id;
|
||||
|
@ -87,9 +88,13 @@ bool AMSinfo::parse_ams_info(Ams *ams, bool remain_flag, bool humidity_flag)
|
|||
wxColour(255, 255, 255);
|
||||
}
|
||||
|
||||
info.k = it->second->k;
|
||||
info.n = it->second->n;
|
||||
|
||||
if (obj->get_printer_series() == PrinterSeries::SERIES_X1) {
|
||||
CalibUtils::get_pa_k_n_value_by_cali_idx(obj, it->second->cali_idx, info.k, info.n);
|
||||
}
|
||||
else {
|
||||
info.k = it->second->k;
|
||||
info.n = it->second->n;
|
||||
}
|
||||
} else {
|
||||
info.can_id = i;
|
||||
info.material_state = AMSCanType::AMS_CAN_TYPE_EMPTY;
|
||||
|
@ -181,7 +186,7 @@ void AMSrefresh::on_timer(wxTimerEvent &event)
|
|||
|
||||
void AMSrefresh::PlayLoading()
|
||||
{
|
||||
if (m_play_loading) return;
|
||||
if (m_play_loading | m_disable_mode) return;
|
||||
m_play_loading = true;
|
||||
//m_rotation_angle = 0;
|
||||
m_playing_timer->Start(AMS_REFRESH_PLAY_LOADING_TIMER);
|
||||
|
@ -190,7 +195,7 @@ void AMSrefresh::PlayLoading()
|
|||
|
||||
void AMSrefresh::StopLoading()
|
||||
{
|
||||
if (!m_play_loading) return;
|
||||
if (!m_play_loading | m_disable_mode) return;
|
||||
m_playing_timer->Stop();
|
||||
m_play_loading = false;
|
||||
Refresh();
|
||||
|
@ -214,6 +219,8 @@ void AMSrefresh::OnClick(wxMouseEvent &evt) {
|
|||
|
||||
void AMSrefresh::post_event(wxCommandEvent &&event)
|
||||
{
|
||||
if (m_disable_mode)
|
||||
return;
|
||||
event.SetString(m_info.can_id);
|
||||
event.SetEventObject(m_parent);
|
||||
wxPostEvent(m_parent, event);
|
||||
|
@ -230,22 +237,25 @@ void AMSrefresh::paintEvent(wxPaintEvent &evt)
|
|||
|
||||
auto pot = wxPoint((size.x - m_bitmap_selected.GetBmpSize().x) / 2, (size.y - m_bitmap_selected.GetBmpSize().y) / 2);
|
||||
|
||||
if (!m_play_loading) {
|
||||
dc.DrawBitmap(m_selected ? m_bitmap_selected.bmp() : m_bitmap_normal.bmp(), pot);
|
||||
} else {
|
||||
/* m_bitmap_rotation = ScalableBitmap(this, "ams_refresh_normal", 30);
|
||||
auto image = m_bitmap_rotation.bmp().ConvertToImage();
|
||||
wxPoint offset;
|
||||
auto loading_img = image.Rotate(m_rotation_angle, wxPoint(image.GetWidth() / 2, image.GetHeight() / 2), true, &offset);
|
||||
ScalableBitmap loading_bitmap;
|
||||
loading_bitmap.bmp() = wxBitmap(loading_img);
|
||||
dc.DrawBitmap(loading_bitmap.bmp(), offset.x , offset.y);*/
|
||||
m_rotation_angle++;
|
||||
if (m_rotation_angle >= m_rfid_bitmap_list.size()) {
|
||||
m_rotation_angle = 0;
|
||||
if (!m_disable_mode) {
|
||||
if (!m_play_loading) {
|
||||
dc.DrawBitmap(m_selected ? m_bitmap_selected.bmp() : m_bitmap_normal.bmp(), pot);
|
||||
}
|
||||
else {
|
||||
/* m_bitmap_rotation = ScalableBitmap(this, "ams_refresh_normal", 30);
|
||||
auto image = m_bitmap_rotation.bmp().ConvertToImage();
|
||||
wxPoint offset;
|
||||
auto loading_img = image.Rotate(m_rotation_angle, wxPoint(image.GetWidth() / 2, image.GetHeight() / 2), true, &offset);
|
||||
ScalableBitmap loading_bitmap;
|
||||
loading_bitmap.bmp() = wxBitmap(loading_img);
|
||||
dc.DrawBitmap(loading_bitmap.bmp(), offset.x , offset.y);*/
|
||||
m_rotation_angle++;
|
||||
if (m_rotation_angle >= m_rfid_bitmap_list.size()) {
|
||||
m_rotation_angle = 0;
|
||||
}
|
||||
if (m_rfid_bitmap_list.size() <= 0)return;
|
||||
dc.DrawBitmap(m_rfid_bitmap_list[m_rotation_angle].bmp(), pot);
|
||||
}
|
||||
if (m_rfid_bitmap_list.size() <= 0)return;
|
||||
dc.DrawBitmap(m_rfid_bitmap_list[m_rotation_angle].bmp(), pot);
|
||||
}
|
||||
|
||||
dc.SetPen(wxPen(colour));
|
||||
|
@ -474,7 +484,9 @@ void AMSextruder::doRender(wxDC& dc)
|
|||
dc.DrawRoundedRectangle(-size.x / 2, size.y * 0.1, size.x, size.y, 4);
|
||||
|
||||
if (m_vams_loading) {
|
||||
dc.SetPen(wxPen(m_current_colur, 6, wxSOLID));
|
||||
|
||||
if (m_current_colur.Alpha() == 0) { dc.SetPen(wxPen(*wxBLACK, 6, wxSOLID)); }
|
||||
else { dc.SetPen(wxPen(m_current_colur, 6, wxSOLID)); }
|
||||
dc.DrawRoundedRectangle(-size.x / 2, size.y * 0.1, size.x, size.y, 4);
|
||||
|
||||
if (m_current_colur == *wxWHITE && !wxGetApp().dark_mode()) {
|
||||
|
@ -485,7 +497,8 @@ void AMSextruder::doRender(wxDC& dc)
|
|||
}
|
||||
|
||||
if (m_ams_loading && !m_none_ams_mode) {
|
||||
dc.SetPen(wxPen(m_current_colur, 6, wxSOLID));
|
||||
if (m_current_colur.Alpha() == 0) {dc.SetPen(wxPen(*wxBLACK, 6, wxSOLID));}
|
||||
else {dc.SetPen(wxPen(m_current_colur, 6, wxSOLID));}
|
||||
dc.DrawLine(size.x / 2, -1, size.x / 2, size.y * 0.6 - 1);
|
||||
|
||||
if (m_current_colur == *wxWHITE && !wxGetApp().dark_mode()) {
|
||||
|
@ -497,7 +510,8 @@ void AMSextruder::doRender(wxDC& dc)
|
|||
}
|
||||
else {
|
||||
if (m_ams_loading) {
|
||||
dc.SetPen(wxPen(m_current_colur, 6, wxSOLID));
|
||||
if (m_current_colur.Alpha() == 0) { dc.SetPen(wxPen(*wxBLACK, 6, wxSOLID)); }
|
||||
else { dc.SetPen(wxPen(m_current_colur, 6, wxSOLID)); }
|
||||
dc.DrawLine(size.x / 2, -1, size.x / 2, size.y * 0.6 - 1);
|
||||
|
||||
if (m_current_colur == *wxWHITE && !wxGetApp().dark_mode()) {
|
||||
|
@ -574,7 +588,8 @@ void AMSVirtualRoad::doRender(wxDC& dc)
|
|||
|
||||
wxSize size = GetSize();
|
||||
if (m_vams_loading) {
|
||||
dc.SetPen(wxPen(m_current_color, 6, wxSOLID));
|
||||
if (m_current_color.Alpha() == 0) { dc.SetPen(wxPen(*wxBLACK, 6, wxSOLID)); }
|
||||
else { dc.SetPen(wxPen(m_current_color, 6, wxSOLID)); }
|
||||
}
|
||||
else {
|
||||
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID));
|
||||
|
@ -633,6 +648,7 @@ void AMSLib::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const w
|
|||
m_bitmap_editable_light = ScalableBitmap(this, "ams_editable_light", 14);
|
||||
m_bitmap_readonly = ScalableBitmap(this, "ams_readonly", 14);
|
||||
m_bitmap_readonly_light = ScalableBitmap(this, "ams_readonly_light", 14);
|
||||
m_bitmap_transparent = ScalableBitmap(this, "transparent_ams_lib", 68);
|
||||
|
||||
m_sizer_body->Add(0, 0, 1, wxEXPAND, 0);
|
||||
m_sizer_body->Add(m_sizer_edit, 0, wxALIGN_CENTER, 0);
|
||||
|
@ -713,7 +729,7 @@ void AMSLib::render(wxDC &dc)
|
|||
auto tmp_lib_colour = m_info.material_colour;
|
||||
auto temp_text_colour = AMS_CONTROL_GRAY800;
|
||||
|
||||
if (tmp_lib_colour.GetLuminance() < 0.5) {
|
||||
if (tmp_lib_colour.GetLuminance() < 0.6) {
|
||||
temp_text_colour = AMS_CONTROL_WHITE_COLOUR;
|
||||
} else {
|
||||
temp_text_colour = AMS_CONTROL_GRAY800;
|
||||
|
@ -723,9 +739,9 @@ void AMSLib::render(wxDC &dc)
|
|||
temp_text_colour = AMS_CONTROL_GRAY800;
|
||||
}
|
||||
|
||||
//if (!wxWindow::IsEnabled()) {
|
||||
//temp_text_colour = AMS_CONTROL_DISABLE_TEXT_COLOUR;
|
||||
//}
|
||||
if (tmp_lib_colour.Alpha() == 0) {
|
||||
temp_text_colour = AMS_CONTROL_GRAY800;
|
||||
}
|
||||
|
||||
dc.SetFont(::Label::Body_13);
|
||||
dc.SetTextForeground(temp_text_colour);
|
||||
|
@ -735,10 +751,10 @@ void AMSLib::render(wxDC &dc)
|
|||
|| m_info.material_state == AMSCanType::AMS_CAN_TYPE_BRAND
|
||||
|| m_info.material_state == AMSCanType::AMS_CAN_TYPE_VIRTUAL) {
|
||||
|
||||
if (m_info.material_name.empty() && m_info.material_state != AMSCanType::AMS_CAN_TYPE_VIRTUAL) {
|
||||
if (m_info.material_name.empty() /*&& m_info.material_state != AMSCanType::AMS_CAN_TYPE_VIRTUAL*/) {
|
||||
auto tsize = dc.GetMultiLineTextExtent("?");
|
||||
auto pot = wxPoint(0, 0);
|
||||
if (m_show_kn) {
|
||||
if (m_obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)) {
|
||||
pot = wxPoint((libsize.x - tsize.x) / 2, (libsize.y - tsize.y) / 2 - FromDIP(9));
|
||||
} else {
|
||||
pot = wxPoint((libsize.x - tsize.x) / 2, (libsize.y - tsize.y) / 2 + FromDIP(3));
|
||||
|
@ -767,25 +783,33 @@ void AMSLib::render(wxDC &dc)
|
|||
auto line_top_tsize = dc.GetMultiLineTextExtent(line_top);
|
||||
auto line_bottom_tsize = dc.GetMultiLineTextExtent(line_bottom);
|
||||
|
||||
auto pot_top = wxPoint((libsize.x - line_top_tsize.x) / 2, (libsize.y - line_top_tsize.y) / 2 - line_top_tsize.y + FromDIP(6));
|
||||
dc.DrawText(line_top, pot_top);
|
||||
if (!m_show_kn) {
|
||||
auto pot_top = wxPoint((libsize.x - line_top_tsize.x) / 2, (libsize.y - line_top_tsize.y) / 2 - line_top_tsize.y + FromDIP(6));
|
||||
dc.DrawText(line_top, pot_top);
|
||||
|
||||
auto pot_bottom = wxPoint((libsize.x - line_bottom_tsize.x) / 2, (libsize.y - line_bottom_tsize.y) / 2 + FromDIP(6));
|
||||
dc.DrawText(line_bottom, pot_bottom);
|
||||
auto pot_bottom = wxPoint((libsize.x - line_bottom_tsize.x) / 2, (libsize.y - line_bottom_tsize.y) / 2 + FromDIP(4));
|
||||
dc.DrawText(line_bottom, pot_bottom);
|
||||
}
|
||||
else {
|
||||
auto pot_top = wxPoint((libsize.x - line_top_tsize.x) / 2, (libsize.y - line_top_tsize.y) / 2 - line_top_tsize.y - FromDIP(6));
|
||||
dc.DrawText(line_top, pot_top);
|
||||
|
||||
auto pot_bottom = wxPoint((libsize.x - line_bottom_tsize.x) / 2, (libsize.y - line_bottom_tsize.y) / 2 - FromDIP(8));
|
||||
dc.DrawText(line_bottom, pot_bottom);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
auto pot = wxPoint(0, 0);
|
||||
if (m_obj && m_obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)) {
|
||||
if (m_obj) {
|
||||
pot = wxPoint((libsize.x - tsize.x) / 2, (libsize.y - tsize.y) / 2 - FromDIP(9));
|
||||
} else {
|
||||
pot = wxPoint((libsize.x - tsize.x) / 2, (libsize.y - tsize.y) / 2 + FromDIP(3));
|
||||
}
|
||||
}
|
||||
dc.DrawText(m_info.material_name, pot);
|
||||
}
|
||||
}
|
||||
|
||||
//draw k&n
|
||||
if (m_obj && m_obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)) {
|
||||
if (m_obj) {
|
||||
if (m_show_kn){
|
||||
wxString str_k = wxString::Format("K %1.3f", m_info.k);
|
||||
wxString str_n = wxString::Format("N %1.3f", m_info.n);
|
||||
|
@ -816,7 +840,7 @@ void AMSLib::doRender(wxDC &dc)
|
|||
dc.SetBrush(wxBrush(AMS_CONTROL_DEF_LIB_BK_COLOUR));
|
||||
dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4), size.x - FromDIP(8), size.y - FromDIP(8), m_radius);
|
||||
|
||||
if (tmp_lib_colour.GetLuminance() < 0.5) {
|
||||
if (tmp_lib_colour.GetLuminance() < 0.6) {
|
||||
temp_bitmap_third = m_bitmap_editable_light;
|
||||
temp_bitmap_brand = m_bitmap_readonly_light;
|
||||
} else {
|
||||
|
@ -829,9 +853,10 @@ void AMSLib::doRender(wxDC &dc)
|
|||
temp_bitmap_brand = m_bitmap_readonly;
|
||||
}
|
||||
|
||||
//if (!wxWindow::IsEnabled()) {
|
||||
//tmp_lib_colour = AMS_CONTROL_DISABLE_COLOUR;
|
||||
//}
|
||||
if (tmp_lib_colour.Alpha() == 0) {
|
||||
temp_bitmap_third = m_bitmap_editable;
|
||||
temp_bitmap_brand = m_bitmap_readonly;
|
||||
}
|
||||
|
||||
// selected
|
||||
if (m_selected) {
|
||||
|
@ -888,6 +913,12 @@ void AMSLib::doRender(wxDC &dc)
|
|||
|
||||
if (curr_height >= FromDIP(6)) {
|
||||
|
||||
//transparent
|
||||
auto alpha = m_info.material_colour.Alpha();
|
||||
if (alpha == 0) {
|
||||
dc.DrawBitmap(m_bitmap_transparent.bmp(),FromDIP(4), FromDIP(4));
|
||||
}
|
||||
|
||||
//gradient
|
||||
if (m_info.material_cols.size() > 1) {
|
||||
int left = FromDIP(4);
|
||||
|
@ -951,14 +982,15 @@ void AMSLib::doRender(wxDC &dc)
|
|||
dc.DrawRoundedRectangle(FromDIP(3), FromDIP(3), size.x - FromDIP(6), size.y - FromDIP(6), m_radius);
|
||||
#endif
|
||||
|
||||
|
||||
// edit icon
|
||||
if (m_info.material_state != AMSCanType::AMS_CAN_TYPE_EMPTY && m_info.material_state != AMSCanType::AMS_CAN_TYPE_NONE)
|
||||
{
|
||||
if (m_info.material_state == AMSCanType::AMS_CAN_TYPE_THIRDBRAND || m_info.material_state == AMSCanType::AMS_CAN_TYPE_VIRTUAL)
|
||||
dc.DrawBitmap(temp_bitmap_third.bmp(), (size.x - temp_bitmap_third.GetBmpSize().x) / 2, (size.y - FromDIP(10) - temp_bitmap_third.GetBmpSize().y));
|
||||
if (m_info.material_state == AMSCanType::AMS_CAN_TYPE_BRAND)
|
||||
dc.DrawBitmap(temp_bitmap_brand.bmp(), (size.x - temp_bitmap_brand.GetBmpSize().x) / 2, (size.y - FromDIP(10) - temp_bitmap_brand.GetBmpSize().y));
|
||||
if (!m_disable_mode) {
|
||||
// edit icon
|
||||
if (m_info.material_state != AMSCanType::AMS_CAN_TYPE_EMPTY && m_info.material_state != AMSCanType::AMS_CAN_TYPE_NONE)
|
||||
{
|
||||
if (m_info.material_state == AMSCanType::AMS_CAN_TYPE_THIRDBRAND || m_info.material_state == AMSCanType::AMS_CAN_TYPE_VIRTUAL)
|
||||
dc.DrawBitmap(temp_bitmap_third.bmp(), (size.x - temp_bitmap_third.GetBmpSize().x) / 2, (size.y - FromDIP(10) - temp_bitmap_third.GetBmpSize().y));
|
||||
if (m_info.material_state == AMSCanType::AMS_CAN_TYPE_BRAND)
|
||||
dc.DrawBitmap(temp_bitmap_brand.bmp(), (size.x - temp_bitmap_brand.GetBmpSize().x) / 2, (size.y - FromDIP(10) - temp_bitmap_brand.GetBmpSize().y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1003,6 +1035,11 @@ void AMSLib::UnSelected()
|
|||
|
||||
bool AMSLib::Enable(bool enable) { return wxWindow::Enable(enable); }
|
||||
|
||||
void AMSLib::msw_rescale()
|
||||
{
|
||||
m_bitmap_transparent.msw_rescale();
|
||||
}
|
||||
|
||||
/*************************************************
|
||||
Description:AMSRoad
|
||||
**************************************************/
|
||||
|
@ -1169,7 +1206,9 @@ void AMSRoad::doRender(wxDC &dc)
|
|||
// mode none
|
||||
// if (m_pass_rode_mode.size() == 1 && m_pass_rode_mode[0] == AMSPassRoadMode::AMS_ROAD_MODE_NONE) return;
|
||||
|
||||
dc.SetPen(wxPen(m_road_color, m_passroad_width, wxSOLID));
|
||||
if (m_road_color.Alpha() == 0) {dc.SetPen(wxPen(*wxBLACK, m_passroad_width, wxSOLID));}
|
||||
else {dc.SetPen(wxPen(m_road_color, m_passroad_width, wxSOLID));}
|
||||
|
||||
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
|
||||
|
||||
// left pass mode
|
||||
|
@ -1315,6 +1354,7 @@ void AMSItem::Update(AMSinfo amsinfo)
|
|||
|
||||
void AMSItem::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
|
||||
{
|
||||
m_ts_bitmap_cube = new ScalableBitmap(this, "ts_bitmap_cube", 14);
|
||||
wxWindow::Create(parent, id, pos, size);
|
||||
SetBackgroundColour(AMS_CONTROL_WHITE_COLOUR);
|
||||
HideHumidity();
|
||||
|
@ -1435,7 +1475,13 @@ void AMSItem::doRender(wxDC &dc)
|
|||
dc.DrawRoundedRectangle(left - 1, (size.y - AMS_ITEM_CUBE_SIZE.y) / 2 - 1, AMS_ITEM_CUBE_SIZE.x + 2, AMS_ITEM_CUBE_SIZE.y + 2, 2);
|
||||
|
||||
}else {
|
||||
dc.DrawRoundedRectangle(left, (size.y - AMS_ITEM_CUBE_SIZE.y) / 2, AMS_ITEM_CUBE_SIZE.x, AMS_ITEM_CUBE_SIZE.y, 2);
|
||||
if (iter->material_colour.Alpha() == 0) {
|
||||
dc.DrawBitmap(m_ts_bitmap_cube->bmp(),left,(size.y - AMS_ITEM_CUBE_SIZE.y) / 2);
|
||||
}
|
||||
else {
|
||||
dc.DrawRoundedRectangle(left, (size.y - AMS_ITEM_CUBE_SIZE.y) / 2, AMS_ITEM_CUBE_SIZE.x, AMS_ITEM_CUBE_SIZE.y, 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1574,7 +1620,7 @@ void AmsCans::AddCan(Caninfo caninfo, int canindex, int maxcan)
|
|||
m_panel_lib->m_info.can_id = caninfo.can_id;
|
||||
m_panel_lib->m_can_index = canindex;
|
||||
auto m_panel_road = new AMSRoad(amscan, wxID_ANY, caninfo, canindex, maxcan, wxDefaultPosition, AMS_CAN_ROAD_SIZE);
|
||||
m_sizer_ams->Add(m_panel_lib, 1, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, FromDIP(4));
|
||||
m_sizer_ams->Add(m_panel_lib, 1, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, FromDIP(3));
|
||||
m_sizer_ams->Add(m_panel_road, 0, wxALL, 0);
|
||||
|
||||
amscan->SetSizer(m_sizer_ams);
|
||||
|
@ -1745,6 +1791,11 @@ void AmsCans::msw_rescale()
|
|||
Canrefreshs *refresh = m_can_refresh_list[i];
|
||||
refresh->canrefresh->msw_rescale();
|
||||
}
|
||||
|
||||
for (auto i = 0; i < m_can_lib_list.GetCount(); i++) {
|
||||
CanLibs* lib = m_can_lib_list[i];
|
||||
lib->canLib->msw_rescale();
|
||||
}
|
||||
}
|
||||
|
||||
void AmsCans::show_sn_value(bool show)
|
||||
|
@ -1838,13 +1889,11 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
|
||||
|
||||
//backup tips
|
||||
|
||||
#ifdef FILAMENT_BACKUP
|
||||
auto m_ams_backup_tip = new Label(m_amswin, _L("Ams filament backup"));
|
||||
m_ams_backup_tip = new Label(m_amswin, _L("Auto Refill"));
|
||||
m_ams_backup_tip->SetFont(::Label::Head_12);
|
||||
m_ams_backup_tip->SetForegroundColour(wxColour(0x00AE42));
|
||||
m_ams_backup_tip->SetBackgroundColour(*wxWHITE);
|
||||
auto m_img_ams_backup = new wxStaticBitmap(m_amswin, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
|
||||
m_img_ams_backup = new wxStaticBitmap(m_amswin, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
|
||||
m_img_ams_backup->SetBackgroundColour(*wxWHITE);
|
||||
|
||||
m_sizer_ams_tips->Add(0, 0, 1, wxEXPAND, 0);
|
||||
|
@ -1859,11 +1908,8 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
|
||||
m_ams_backup_tip->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {post_event(SimpleEvent(EVT_AMS_FILAMENT_BACKUP)); });
|
||||
m_img_ams_backup->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {post_event(SimpleEvent(EVT_AMS_FILAMENT_BACKUP)); });
|
||||
#endif // FILAMENT_BACKUP
|
||||
|
||||
|
||||
|
||||
|
||||
//ams cans
|
||||
m_panel_can = new StaticBox(m_amswin, wxID_ANY, wxDefaultPosition, AMS_CANS_SIZE, wxBORDER_NONE);
|
||||
m_panel_can->SetMinSize(AMS_CANS_SIZE);
|
||||
|
@ -1960,18 +2006,24 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
m_button_extrusion_cali->SetBorderColor(btn_bd_green);
|
||||
m_button_extrusion_cali->SetTextColor(btn_text_green);
|
||||
m_button_extrusion_cali->SetFont(Label::Body_13);
|
||||
if (wxGetApp().app_config->get("language") == "de_DE") m_button_extrusion_cali->SetFont(Label::Body_9);
|
||||
if (wxGetApp().app_config->get("language") == "fr_FR") m_button_extrusion_cali->SetFont(Label::Body_9);
|
||||
|
||||
m_button_extruder_feed = new Button(m_button_area, _L("Load Filament"));
|
||||
m_button_extruder_feed->SetBackgroundColor(btn_bg_green);
|
||||
m_button_extruder_feed->SetBorderColor(btn_bd_green);
|
||||
m_button_extruder_feed->SetTextColor(btn_text_green);
|
||||
m_button_extruder_feed->SetFont(Label::Body_13);
|
||||
if (wxGetApp().app_config->get("language") == "de_DE") m_button_extruder_feed->SetFont(Label::Body_9);
|
||||
if (wxGetApp().app_config->get("language") == "fr_FR") m_button_extruder_feed->SetFont(Label::Body_9);
|
||||
|
||||
m_button_extruder_back = new Button(m_button_area, _L("Unload Filament"));
|
||||
m_button_extruder_back->SetBackgroundColor(btn_bg_white);
|
||||
m_button_extruder_back->SetBorderColor(btn_bd_white);
|
||||
m_button_extruder_back->SetTextColor(btn_text_white);
|
||||
m_button_extruder_back->SetFont(Label::Body_13);
|
||||
if (wxGetApp().app_config->get("language") == "de_DE") m_button_extruder_back->SetFont(Label::Body_9);
|
||||
if (wxGetApp().app_config->get("language") == "fr_FR") m_button_extruder_back->SetFont(Label::Body_9);
|
||||
|
||||
m_sizer_button_area->Add(0, 0, 1, wxEXPAND, 0);
|
||||
m_sizer_button_area->Add(m_button_extrusion_cali, 0, wxLEFT, FromDIP(5));
|
||||
|
@ -2144,6 +2196,8 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
|
||||
m_button_guide = new Button(m_amswin, _L("Guide"));
|
||||
m_button_guide->SetFont(Label::Body_13);
|
||||
if (wxGetApp().app_config->get("language") == "de_DE") m_button_guide->SetFont(Label::Body_9);
|
||||
if (wxGetApp().app_config->get("language") == "fr_FR") m_button_guide->SetFont(Label::Body_9);
|
||||
m_button_guide->SetCornerRadius(FromDIP(12));
|
||||
m_button_guide->SetBorderColor(btn_bd_white);
|
||||
m_button_guide->SetTextColor(btn_text_white);
|
||||
|
@ -2152,6 +2206,8 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
|
||||
m_button_retry = new Button(m_amswin, _L("Retry"));
|
||||
m_button_retry->SetFont(Label::Body_13);
|
||||
if (wxGetApp().app_config->get("language") == "de_DE") m_button_retry->SetFont(Label::Body_9);
|
||||
if (wxGetApp().app_config->get("language") == "fr_FR") m_button_retry->SetFont(Label::Body_9);
|
||||
m_button_retry->SetCornerRadius(FromDIP(12));
|
||||
m_button_retry->SetBorderColor(btn_bd_white);
|
||||
m_button_retry->SetTextColor(btn_text_white);
|
||||
|
@ -2293,6 +2349,11 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
|||
EnterNoneAMSMode();
|
||||
}
|
||||
|
||||
void AMSControl::on_retry()
|
||||
{
|
||||
post_event(wxCommandEvent(EVT_AMS_RETRY));
|
||||
}
|
||||
|
||||
void AMSControl::init_scaled_buttons()
|
||||
{
|
||||
m_button_extrusion_cali->SetMinSize(wxSize(-1, FromDIP(24)));
|
||||
|
@ -2346,8 +2407,9 @@ void AMSControl::SetActionState(bool button_status[])
|
|||
else m_button_extruder_back->Disable();
|
||||
}
|
||||
|
||||
void AMSControl::EnterNoneAMSMode(bool support_vt_load)
|
||||
void AMSControl::EnterNoneAMSMode()
|
||||
{
|
||||
if(m_is_none_ams_mode) return;
|
||||
m_simplebook_amsitems->Hide();
|
||||
m_panel_top->Hide();
|
||||
m_simplebook_amsitems->SetSelection(1);
|
||||
|
@ -2355,14 +2417,9 @@ void AMSControl::EnterNoneAMSMode(bool support_vt_load)
|
|||
m_extruder->no_ams_mode(true);
|
||||
m_button_ams_setting->Hide();
|
||||
m_button_guide->Hide();
|
||||
m_button_retry->Hide();
|
||||
if (support_vt_load) {
|
||||
m_button_extruder_feed->Show();
|
||||
m_button_extruder_back->Show();
|
||||
} else {
|
||||
m_button_extruder_feed->Hide();
|
||||
m_button_extruder_back->Hide();
|
||||
}
|
||||
//m_button_retry->Hide();
|
||||
m_button_extruder_feed->Show();
|
||||
m_button_extruder_back->Show();
|
||||
|
||||
ShowFilamentTip(false);
|
||||
m_amswin->Layout();
|
||||
|
@ -2373,6 +2430,7 @@ void AMSControl::EnterNoneAMSMode(bool support_vt_load)
|
|||
|
||||
void AMSControl::ExitNoneAMSMode()
|
||||
{
|
||||
if(!m_is_none_ams_mode) return;
|
||||
m_simplebook_amsitems->Show();
|
||||
m_panel_top->Show();
|
||||
m_simplebook_ams->SetSelection(0);
|
||||
|
@ -2451,6 +2509,7 @@ void AMSControl::msw_rescale()
|
|||
m_button_ams_setting->SetMinSize(wxSize(FromDIP(25), FromDIP(24)));
|
||||
m_button_guide->SetMinSize(wxSize(-1, FromDIP(24)));
|
||||
m_button_retry->SetMinSize(wxSize(-1, FromDIP(24)));
|
||||
m_vams_lib->msw_rescale();
|
||||
|
||||
for (auto i = 0; i < m_ams_cans_list.GetCount(); i++) {
|
||||
AmsCansWindow *cans = m_ams_cans_list[i];
|
||||
|
@ -2493,8 +2552,8 @@ void AMSControl::UpdateStepCtrl(bool is_extrusion)
|
|||
|
||||
wxString VT_TRAY_LOAD_STEP_STRING[VT_LOAD_STEP_COUNT] = {
|
||||
_L("Heat the nozzle"),
|
||||
_L("Feed new filament from external spool"),
|
||||
_L("Confirm whether the filament has been extruded"),
|
||||
_L("Push new filament into the extruder"),
|
||||
_L("Grab new filament"),
|
||||
_L("Purge old filament"),
|
||||
};
|
||||
|
||||
|
@ -2554,7 +2613,7 @@ void AMSControl::Reset()
|
|||
m_current_senect = "";
|
||||
}
|
||||
|
||||
void AMSControl::show_noams_mode(bool show, bool support_virtual_tray, bool support_extrustion_cali, bool support_vt_load)
|
||||
void AMSControl::show_noams_mode(bool show, bool support_virtual_tray, bool support_extrustion_cali)
|
||||
{
|
||||
show_vams(support_virtual_tray);
|
||||
m_sizer_ams_tips->Show(support_virtual_tray);
|
||||
|
@ -2562,10 +2621,19 @@ void AMSControl::show_noams_mode(bool show, bool support_virtual_tray, bool supp
|
|||
if (!support_extrustion_cali)
|
||||
m_button_extrusion_cali->Hide();
|
||||
else {
|
||||
m_button_extrusion_cali->Show();
|
||||
//m_button_extrusion_cali->Show();
|
||||
m_button_extrusion_cali->Hide();
|
||||
}
|
||||
|
||||
show?ExitNoneAMSMode() : EnterNoneAMSMode(support_vt_load);
|
||||
show?ExitNoneAMSMode() : EnterNoneAMSMode();
|
||||
}
|
||||
|
||||
void AMSControl::show_auto_refill(bool show)
|
||||
{
|
||||
m_ams_backup_tip->Show(show);
|
||||
m_img_ams_backup->Show(show);
|
||||
m_amswin->Layout();
|
||||
m_amswin->Fit();
|
||||
}
|
||||
|
||||
void AMSControl::show_vams(bool show)
|
||||
|
@ -2594,10 +2662,21 @@ void AMSControl::show_vams_kn_value(bool show)
|
|||
void AMSControl::update_vams_kn_value(AmsTray tray, MachineObject* obj)
|
||||
{
|
||||
m_vams_lib->m_obj = obj;
|
||||
m_vams_info.k = tray.k;
|
||||
m_vams_info.n = tray.n;
|
||||
m_vams_lib->m_info.k = tray.k;
|
||||
m_vams_lib->m_info.n = tray.n;
|
||||
if (obj->get_printer_series() == PrinterSeries::SERIES_X1) {
|
||||
float k_value = 0;
|
||||
float n_value = 0;
|
||||
CalibUtils::get_pa_k_n_value_by_cali_idx(obj, tray.cali_idx, k_value, n_value);
|
||||
m_vams_info.k = k_value;
|
||||
m_vams_info.n = n_value;
|
||||
m_vams_lib->m_info.k = k_value;
|
||||
m_vams_lib->m_info.n = n_value;
|
||||
}
|
||||
else { // the remaining printer types
|
||||
m_vams_info.k = tray.k;
|
||||
m_vams_info.n = tray.n;
|
||||
m_vams_lib->m_info.k = tray.k;
|
||||
m_vams_lib->m_info.n = tray.n;
|
||||
}
|
||||
m_vams_info.material_name = tray.get_display_filament_type();
|
||||
m_vams_info.material_colour = tray.get_color();
|
||||
m_vams_lib->m_info.material_name = tray.get_display_filament_type();
|
||||
|
@ -2605,10 +2684,6 @@ void AMSControl::update_vams_kn_value(AmsTray tray, MachineObject* obj)
|
|||
m_vams_lib->Refresh();
|
||||
}
|
||||
|
||||
void AMSControl::show_filament_backup(bool show)
|
||||
{
|
||||
}
|
||||
|
||||
void AMSControl::reset_vams()
|
||||
{
|
||||
m_vams_lib->m_info.k = 0;
|
||||
|
@ -2664,27 +2739,11 @@ void AMSControl::UpdateAms(std::vector<AMSinfo> info, bool keep_selection, bool
|
|||
if (ifo.ams_id == cans->amsIndex) {
|
||||
cans->amsCans->m_info = ifo;
|
||||
cans->amsCans->Update(ifo);
|
||||
cans->amsCans->show_sn_value(has_extrusion_cali);
|
||||
cans->amsCans->show_sn_value(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*if (m_current_senect.empty() && info.size() > 0) {
|
||||
if (curr_ams_id.empty()) {
|
||||
SwitchAms(info[0].ams_id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (keep_selection) {
|
||||
SwitchAms(curr_ams_id);
|
||||
for (auto i = 0; i < m_ams_cans_list.GetCount(); i++) {
|
||||
AmsCansWindow *cans = m_ams_cans_list[i];
|
||||
if (i < info.size()) { cans->amsCans->SelectCan(curr_can_id); }
|
||||
}
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
if ( m_current_show_ams.empty() && !is_reset ) {
|
||||
if (info.size() > 0) {
|
||||
SwitchAms(info[0].ams_id);
|
||||
|
@ -2795,14 +2854,18 @@ void AMSControl::SetFilamentStep(int item_idx, FilamentStepType f_type, bool is_
|
|||
|
||||
if (f_type == FilamentStepType::STEP_TYPE_LOAD) {
|
||||
if (item_idx > 0 && item_idx < FilamentStep::STEP_COUNT) {
|
||||
m_simplebook_right->SetSelection(1);
|
||||
if (m_simplebook_right->GetSelection() != 1) {
|
||||
m_simplebook_right->SetSelection(1);
|
||||
}
|
||||
m_filament_load_step->SelectItem(item_idx - 1);
|
||||
} else {
|
||||
m_filament_load_step->Idle();
|
||||
}
|
||||
} else if (f_type == FilamentStepType::STEP_TYPE_UNLOAD) {
|
||||
if (item_idx > 0 && item_idx < FilamentStep::STEP_COUNT) {
|
||||
m_simplebook_right->SetSelection(2);
|
||||
if (m_simplebook_right->GetSelection() != 2) {
|
||||
m_simplebook_right->SetSelection(2);
|
||||
}
|
||||
m_filament_unload_step->SelectItem(item_idx - 1);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -150,7 +150,7 @@ public:
|
|||
int curreent_filamentstep;
|
||||
int ams_humidity = 0;
|
||||
|
||||
bool parse_ams_info(Ams *ams, bool remain_flag = false, bool humidity_flag = false);
|
||||
bool parse_ams_info(MachineObject* obj, Ams *ams, bool remain_flag = false, bool humidity_flag = false);
|
||||
};
|
||||
|
||||
/*************************************************
|
||||
|
@ -175,6 +175,7 @@ public:
|
|||
void paintEvent(wxPaintEvent &evt);
|
||||
void Update(std::string ams_id, Caninfo info);
|
||||
void msw_rescale();
|
||||
void set_disable_mode(bool disable) { m_disable_mode = disable; }
|
||||
Caninfo m_info;
|
||||
|
||||
|
||||
|
@ -202,6 +203,8 @@ protected:
|
|||
wxString m_refresh_id;
|
||||
wxBoxSizer * m_size_body;
|
||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
bool m_disable_mode{ false };
|
||||
};
|
||||
|
||||
/*************************************************
|
||||
|
@ -298,6 +301,8 @@ public:
|
|||
void show_kn_value(bool show) { m_show_kn = show; };
|
||||
void support_cali(bool sup) { m_support_cali = sup; Refresh(); };
|
||||
virtual bool Enable(bool enable = true);
|
||||
void set_disable_mode(bool disable) { m_disable_mode = disable; }
|
||||
void msw_rescale();
|
||||
|
||||
|
||||
protected:
|
||||
|
@ -307,6 +312,8 @@ protected:
|
|||
ScalableBitmap m_bitmap_editable_light;
|
||||
ScalableBitmap m_bitmap_readonly;
|
||||
ScalableBitmap m_bitmap_readonly_light;
|
||||
ScalableBitmap m_bitmap_transparent;
|
||||
|
||||
bool m_unable_selected = {false};
|
||||
bool m_enable = {false};
|
||||
bool m_selected = {false};
|
||||
|
@ -318,6 +325,7 @@ protected:
|
|||
wxColour m_border_color;
|
||||
wxColour m_road_def_color;
|
||||
wxColour m_lib_color;
|
||||
bool m_disable_mode{ false };
|
||||
|
||||
void on_enter_window(wxMouseEvent &evt);
|
||||
void on_leave_window(wxMouseEvent &evt);
|
||||
|
@ -407,6 +415,7 @@ protected:
|
|||
bool m_selected = {false};
|
||||
bool m_show_humidity = {false};
|
||||
int m_humidity = {0};
|
||||
ScalableBitmap* m_ts_bitmap_cube;
|
||||
|
||||
void paintEvent(wxPaintEvent &evt);
|
||||
void render(wxDC &dc);
|
||||
|
@ -460,7 +469,6 @@ public:
|
|||
void StopRridLoading(wxString canid);
|
||||
void msw_rescale();
|
||||
void show_sn_value(bool show);
|
||||
|
||||
std::string GetCurrentCan();
|
||||
|
||||
public:
|
||||
|
@ -484,6 +492,17 @@ class AmsCansWindow
|
|||
public:
|
||||
wxString amsIndex;
|
||||
AmsCans *amsCans;
|
||||
bool m_disable_mode{ false };
|
||||
|
||||
void set_disable_mode(bool disable) {
|
||||
m_disable_mode = disable;
|
||||
for (auto can_lib : amsCans->m_can_lib_list) {
|
||||
can_lib->canLib->set_disable_mode(disable);
|
||||
}
|
||||
for (auto can_refresh : amsCans->m_can_refresh_list) {
|
||||
can_refresh->canrefresh->set_disable_mode(disable);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class AmsItems
|
||||
|
@ -509,6 +528,7 @@ class AMSControl : public wxSimplebook
|
|||
public:
|
||||
AMSControl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
|
||||
void on_retry();
|
||||
void init_scaled_buttons();
|
||||
|
||||
protected:
|
||||
|
@ -543,6 +563,7 @@ protected:
|
|||
wxBoxSizer* m_vams_sizer = {nullptr};
|
||||
wxBoxSizer* m_sizer_vams_tips = {nullptr};
|
||||
|
||||
Label* m_ams_backup_tip = {nullptr};
|
||||
Caninfo m_vams_info;
|
||||
StaticBox* m_panel_virtual = {nullptr};
|
||||
AMSLib* m_vams_lib = {nullptr};
|
||||
|
@ -562,6 +583,7 @@ protected:
|
|||
Button *m_button_extruder_feed = {nullptr};
|
||||
Button *m_button_extruder_back = {nullptr};
|
||||
wxStaticBitmap* m_button_ams_setting = {nullptr};
|
||||
wxStaticBitmap* m_img_ams_backup = {nullptr};
|
||||
ScalableBitmap m_button_ams_setting_normal;
|
||||
ScalableBitmap m_button_ams_setting_hover;
|
||||
ScalableBitmap m_button_ams_setting_press;
|
||||
|
@ -583,7 +605,7 @@ public:
|
|||
|
||||
bool m_is_none_ams_mode{false};
|
||||
void SetActionState(bool button_status[]);
|
||||
void EnterNoneAMSMode(bool support_vt_load = false);
|
||||
void EnterNoneAMSMode();
|
||||
void ExitNoneAMSMode();
|
||||
|
||||
void EnterCalibrationMode(bool read_to_calibration);
|
||||
|
@ -617,11 +639,11 @@ public:
|
|||
void on_clibration_cancel_click(wxMouseEvent &event);
|
||||
void Reset();
|
||||
|
||||
void show_noams_mode(bool show, bool support_virtual_tray, bool support_extrustion_cali, bool support_vt_load = false);
|
||||
void show_noams_mode(bool show, bool support_virtual_tray, bool support_extrustion_cali);
|
||||
void show_auto_refill(bool show);
|
||||
void show_vams(bool show);
|
||||
void show_vams_kn_value(bool show);
|
||||
void update_vams_kn_value(AmsTray tray, MachineObject* obj);
|
||||
void show_filament_backup(bool show);
|
||||
|
||||
void reset_vams();
|
||||
void post_event(wxEvent&& event);
|
||||
|
|
|
@ -19,7 +19,19 @@ END_EVENT_TABLE()
|
|||
* calling Refresh()/Update().
|
||||
*/
|
||||
|
||||
ComboBox::ComboBox(wxWindow * parent,
|
||||
static wxWindow *GetScrollParent(wxWindow *pWindow)
|
||||
{
|
||||
wxWindow *pWin = pWindow;
|
||||
while (pWin->GetParent()) {
|
||||
auto pWin2 = pWin->GetParent();
|
||||
if (auto top = dynamic_cast<wxScrollHelper *>(pWin2))
|
||||
return dynamic_cast<wxWindow *>(pWin);
|
||||
pWin = pWin2;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ComboBox::ComboBox(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &value,
|
||||
const wxPoint & pos,
|
||||
|
@ -47,9 +59,9 @@ ComboBox::ComboBox(wxWindow * parent,
|
|||
std::make_pair(*wxWHITE, (int) StateColor::Normal)));
|
||||
TextInput::SetLabelColor(StateColor(std::make_pair(0x909090, (int) StateColor::Disabled),
|
||||
std::make_pair(0x262E30, (int) StateColor::Normal)));
|
||||
} else {
|
||||
GetTextCtrl()->Bind(wxEVT_KEY_DOWN, &ComboBox::keyDown, this);
|
||||
}
|
||||
if (auto scroll = GetScrollParent(this))
|
||||
scroll->Bind(wxEVT_MOVE, &ComboBox::onMove, this);
|
||||
drop.Bind(wxEVT_COMBOBOX, [this](wxCommandEvent &e) {
|
||||
SetSelection(e.GetInt());
|
||||
e.SetEventObject(this);
|
||||
|
@ -68,11 +80,17 @@ int ComboBox::GetSelection() const { return drop.GetSelection(); }
|
|||
|
||||
void ComboBox::SetSelection(int n)
|
||||
{
|
||||
if (n == drop.selection)
|
||||
return;
|
||||
drop.SetSelection(n);
|
||||
SetLabel(drop.GetValue());
|
||||
if (drop.selection >= 0)
|
||||
if (drop.selection >= 0 && drop.iconSize.y > 0)
|
||||
SetIcon(icons[drop.selection]);
|
||||
}
|
||||
void ComboBox::SelectAndNotify(int n) {
|
||||
SetSelection(n);
|
||||
sendComboBoxEvent();
|
||||
}
|
||||
|
||||
void ComboBox::SelectAndNotify(int n) {
|
||||
SetSelection(n);
|
||||
|
@ -95,7 +113,7 @@ void ComboBox::SetValue(const wxString &value)
|
|||
{
|
||||
drop.SetValue(value);
|
||||
SetLabel(value);
|
||||
if (drop.selection >= 0)
|
||||
if (drop.selection >= 0 && drop.iconSize.y > 0)
|
||||
SetIcon(icons[drop.selection]);
|
||||
}
|
||||
|
||||
|
@ -281,6 +299,12 @@ void ComboBox::keyDown(wxKeyEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
void ComboBox::onMove(wxMoveEvent &event)
|
||||
{
|
||||
event.Skip();
|
||||
drop.Hide();
|
||||
}
|
||||
|
||||
void ComboBox::OnEdit()
|
||||
{
|
||||
auto value = GetTextCtrl()->GetValue();
|
||||
|
|
|
@ -88,6 +88,7 @@ private:
|
|||
void mouseDown(wxMouseEvent &event);
|
||||
void mouseWheelMoved(wxMouseEvent &event);
|
||||
void keyDown(wxKeyEvent &event);
|
||||
void onMove(wxMoveEvent &event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
|
|
@ -89,6 +89,10 @@ void DropDown::SetSelection(int n)
|
|||
n = -1;
|
||||
if (selection == n) return;
|
||||
selection = n;
|
||||
if (need_sync) { // for icon Size
|
||||
messureSize();
|
||||
need_sync = true;
|
||||
}
|
||||
paintNow();
|
||||
}
|
||||
|
||||
|
@ -299,6 +303,8 @@ void DropDown::render(wxDC &dc)
|
|||
if (!text_off && !text.IsEmpty()) {
|
||||
wxSize tSize = dc.GetMultiLineTextExtent(text);
|
||||
if (pt.x + tSize.x > rcContent.GetRight()) {
|
||||
if (i == hover_item)
|
||||
SetToolTip(text);
|
||||
text = wxControl::Ellipsize(text, dc, wxELLIPSIZE_END,
|
||||
rcContent.GetRight() - pt.x);
|
||||
}
|
||||
|
@ -443,8 +449,7 @@ void DropDown::mouseMove(wxMouseEvent &event)
|
|||
if (hover >= (int) texts.size()) hover = -1;
|
||||
if (hover == hover_item) return;
|
||||
hover_item = hover;
|
||||
if (hover >= 0)
|
||||
SetToolTip(texts[hover]);
|
||||
SetToolTip("");
|
||||
}
|
||||
paintNow();
|
||||
}
|
||||
|
@ -475,11 +480,10 @@ void DropDown::mouseWheelMoved(wxMouseEvent &event)
|
|||
// currently unused events
|
||||
void DropDown::sendDropDownEvent()
|
||||
{
|
||||
selection = hover_item;
|
||||
wxCommandEvent event(wxEVT_COMBOBOX, GetId());
|
||||
event.SetEventObject(this);
|
||||
event.SetInt(selection);
|
||||
event.SetString(GetValue());
|
||||
event.SetInt(hover_item);
|
||||
event.SetString(texts[hover_item]);
|
||||
GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,8 @@ void ImageSwitchButton::SetLabels(wxString const &lbl_on, wxString const &lbl_of
|
|||
labels[0] = lbl_on;
|
||||
labels[1] = lbl_off;
|
||||
auto fina_txt = GetValue() ? labels[0] : labels[1];
|
||||
SetToolTip(fina_txt);
|
||||
if (GetToolTipText() != fina_txt)
|
||||
SetToolTip(fina_txt);
|
||||
messureSize();
|
||||
Refresh();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "libslic3r/Utils.hpp"
|
||||
#include "Label.hpp"
|
||||
#include "StaticBox.hpp"
|
||||
#include <wx/intl.h> // For wxLocale
|
||||
|
||||
wxFont Label::sysFont(int size, bool bold)
|
||||
{
|
||||
|
@ -12,22 +11,13 @@ wxFont Label::sysFont(int size, bool bold)
|
|||
size = size * 4 / 5;
|
||||
#endif
|
||||
|
||||
wxString face = "HarmonyOS Sans SC";
|
||||
|
||||
// Check if the current locale is Korean
|
||||
if (wxLocale::GetSystemLanguage() == wxLANGUAGE_KOREAN) {
|
||||
face = "Noto Sans KR";
|
||||
}
|
||||
|
||||
auto face = wxString::FromUTF8("HarmonyOS Sans SC");
|
||||
wxFont font{size, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL, false, face};
|
||||
font.SetFaceName(face);
|
||||
if (!font.IsOk()) {
|
||||
BOOST_LOG_TRIVIAL(warning) << boost::format("Can't find %1% font") % face;
|
||||
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||
BOOST_LOG_TRIVIAL(warning) << boost::format("Use system font instead: %1%") % font.GetFaceName();
|
||||
if (bold)
|
||||
font.MakeBold();
|
||||
font.SetPointSize(size);
|
||||
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||
if (bold) font.MakeBold();
|
||||
font.SetPointSize(size);
|
||||
}
|
||||
return font;
|
||||
}
|
||||
|
@ -55,25 +45,16 @@ wxFont Label::Body_9;
|
|||
|
||||
void Label::initSysFont()
|
||||
{
|
||||
#if defined(__linux__) || defined(_WIN32)
|
||||
const std::string &resource_path = Slic3r::resources_dir();
|
||||
wxString font_path = wxString::FromUTF8(resource_path + "/fonts/HarmonyOS_Sans_SC_Bold.ttf");
|
||||
#ifdef __linux__
|
||||
const std::string& resource_path = Slic3r::resources_dir();
|
||||
wxString font_path = wxString::FromUTF8(resource_path+"/fonts/HarmonyOS_Sans_SC_Bold.ttf");
|
||||
bool result = wxFont::AddPrivateFont(font_path);
|
||||
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Bold returns %1%")%result;
|
||||
//BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Bold returns %1%")%result;
|
||||
printf("add font of HarmonyOS_Sans_SC_Bold returns %d\n", result);
|
||||
font_path = wxString::FromUTF8(resource_path + "/fonts/HarmonyOS_Sans_SC_Regular.ttf");
|
||||
font_path = wxString::FromUTF8(resource_path+"/fonts/HarmonyOS_Sans_SC_Regular.ttf");
|
||||
result = wxFont::AddPrivateFont(font_path);
|
||||
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Regular returns %1%")%result;
|
||||
//BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Regular returns %1%")%result;
|
||||
printf("add font of HarmonyOS_Sans_SC_Regular returns %d\n", result);
|
||||
// Adding Noto Sans KR Regular and Bold
|
||||
font_path = wxString::FromUTF8(resource_path + "/fonts/NotoSansKR-Regular.otf");
|
||||
result = wxFont::AddPrivateFont(font_path);
|
||||
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NotoSansKR-Regular returns %1%")%result;
|
||||
printf("add font of NotoSansKR-Regular returns %d\n", result);
|
||||
font_path = wxString::FromUTF8(resource_path + "/fonts/NotoSansKR-Bold.otf");
|
||||
result = wxFont::AddPrivateFont(font_path);
|
||||
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NotoSansKR-Bold returns %1%")%result;
|
||||
printf("add font of NotoSansKR-Bold returns %d\n", result);
|
||||
#endif
|
||||
Head_48 = Label::sysFont(48, true);
|
||||
Head_32 = Label::sysFont(32, true);
|
||||
|
@ -127,6 +108,11 @@ public:
|
|||
for (bool newLine = false; !line.empty(); newLine = true) {
|
||||
if (newLine) OnNewLine();
|
||||
|
||||
if (1 == line.length()) {
|
||||
DoOutputLine(line);
|
||||
break;
|
||||
}
|
||||
|
||||
wxArrayInt widths;
|
||||
dc.GetPartialTextExtents(line, widths);
|
||||
|
||||
|
@ -155,6 +141,10 @@ public:
|
|||
// No spaces, so can't wrap.
|
||||
lastSpace = posEnd;
|
||||
}
|
||||
if (lastSpace == 0) {
|
||||
// Break at least one char
|
||||
lastSpace = 1;
|
||||
}
|
||||
|
||||
// Output the part that fits.
|
||||
DoOutputLine(line.substr(0, lastSpace));
|
||||
|
@ -203,13 +193,14 @@ private:
|
|||
class wxLabelWrapper2 : public wxTextWrapper2
|
||||
{
|
||||
public:
|
||||
void WrapLabel(wxWindow *text, int widthMax)
|
||||
void WrapLabel(wxWindow *text, wxString const & label, int widthMax)
|
||||
{
|
||||
m_text.clear();
|
||||
Wrap(text, text->GetLabel(), widthMax);
|
||||
text->SetLabel(m_text);
|
||||
Wrap(text, label, widthMax);
|
||||
}
|
||||
|
||||
wxString GetText() const { return m_text; }
|
||||
|
||||
protected:
|
||||
virtual void OnOutputLine(const wxString &line) wxOVERRIDE { m_text += line; }
|
||||
|
||||
|
@ -251,23 +242,32 @@ Label::Label(wxWindow *parent, wxString const &text, long style) : Label(parent,
|
|||
Label::Label(wxWindow *parent, wxFont const &font, wxString const &text, long style)
|
||||
: wxStaticText(parent, wxID_ANY, text, wxDefaultPosition, wxDefaultSize, style)
|
||||
{
|
||||
this->font = font;
|
||||
this->m_font = font;
|
||||
this->m_text = text;
|
||||
SetFont(font);
|
||||
SetForegroundColour(wxColour("#262E30"));
|
||||
SetForegroundColour(*wxBLACK);
|
||||
SetBackgroundColour(StaticBox::GetParentBackgroundColor(parent));
|
||||
SetForegroundColour("#262E30");
|
||||
if (style & LB_PROPAGATE_MOUSE_EVENT) {
|
||||
for (auto evt : {
|
||||
wxEVT_LEFT_UP, wxEVT_LEFT_DOWN})
|
||||
for (auto evt : { wxEVT_LEFT_UP, wxEVT_LEFT_DOWN })
|
||||
Bind(evt, [this] (auto & e) { GetParent()->GetEventHandler()->ProcessEventLocally(e); });
|
||||
};
|
||||
};
|
||||
if (style & LB_AUTO_WRAP) {
|
||||
Bind(wxEVT_SIZE, &Label::OnSize, this);
|
||||
Wrap(GetSize().x);
|
||||
}
|
||||
}
|
||||
|
||||
void Label::SetLabel(const wxString& label)
|
||||
{
|
||||
if (GetLabel() == label)
|
||||
if (m_text == label)
|
||||
return;
|
||||
wxStaticText::SetLabel(label);
|
||||
m_text = label;
|
||||
if ((GetWindowStyle() & LB_AUTO_WRAP)) {
|
||||
Wrap(GetSize().x);
|
||||
} else {
|
||||
wxStaticText::SetLabel(label);
|
||||
}
|
||||
#ifdef __WXOSX__
|
||||
if ((GetWindowStyle() & LB_HYPERLINK)) {
|
||||
SetLabelMarkup(label);
|
||||
|
@ -282,22 +282,21 @@ void Label::SetWindowStyleFlag(long style)
|
|||
return;
|
||||
wxStaticText::SetWindowStyleFlag(style);
|
||||
if (style & LB_HYPERLINK) {
|
||||
this->color = GetForegroundColour();
|
||||
static wxColor clr_url("#009688");
|
||||
SetFont(this->font.Underlined());
|
||||
this->m_color = GetForegroundColour();
|
||||
static wxColor clr_url("#00AE42");
|
||||
SetFont(this->m_font.Underlined());
|
||||
SetForegroundColour(clr_url);
|
||||
SetCursor(wxCURSOR_HAND);
|
||||
#ifdef __WXOSX__
|
||||
SetLabelMarkup(GetLabel());
|
||||
SetLabelMarkup(m_text);
|
||||
#endif
|
||||
} else {
|
||||
SetForegroundColour(this->color);
|
||||
SetFont(this->font);
|
||||
SetForegroundColour(this->m_color);
|
||||
SetFont(this->m_font);
|
||||
SetCursor(wxCURSOR_ARROW);
|
||||
#ifdef __WXOSX__
|
||||
auto label = GetLabel();
|
||||
wxStaticText::SetLabel({});
|
||||
wxStaticText::SetLabel(label);
|
||||
SetLabel(m_text);
|
||||
#endif
|
||||
}
|
||||
Refresh();
|
||||
|
@ -306,5 +305,15 @@ void Label::SetWindowStyleFlag(long style)
|
|||
void Label::Wrap(int width)
|
||||
{
|
||||
wxLabelWrapper2 wrapper;
|
||||
wrapper.WrapLabel(this, width);
|
||||
wrapper.Wrap(this, m_text, width);
|
||||
m_skip_size_evt = true;
|
||||
wxStaticText::SetLabel(wrapper.GetText());
|
||||
m_skip_size_evt = false;
|
||||
}
|
||||
|
||||
void Label::OnSize(wxSizeEvent &evt)
|
||||
{
|
||||
evt.Skip();
|
||||
if (m_skip_size_evt) return;
|
||||
Wrap(evt.GetSize().x);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#define LB_HYPERLINK 0x0020
|
||||
#define LB_PROPAGATE_MOUSE_EVENT 0x0040
|
||||
#define LB_AUTO_WRAP 0x0080
|
||||
|
||||
|
||||
class Label : public wxStaticText
|
||||
|
@ -21,12 +22,17 @@ public:
|
|||
void Wrap(int width);
|
||||
|
||||
private:
|
||||
wxFont font;
|
||||
wxColour color;
|
||||
void OnSize(wxSizeEvent & evt);
|
||||
|
||||
private:
|
||||
wxFont m_font;
|
||||
wxColour m_color;
|
||||
wxString m_text;
|
||||
bool m_skip_size_evt = false;
|
||||
|
||||
public:
|
||||
static wxFont Head_48;
|
||||
static wxFont Head_32;
|
||||
static wxFont Head_48;
|
||||
static wxFont Head_32;
|
||||
static wxFont Head_24;
|
||||
static wxFont Head_20;
|
||||
static wxFont Head_18;
|
||||
|
|
|
@ -223,9 +223,11 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
|
|||
maximum /= m_factor;
|
||||
#endif
|
||||
|
||||
m_gauge = new wxGauge(this, wxID_ANY, maximum, wxDefaultPosition, PROGRESSDIALOG_GAUGE_SIZE, gauge_style);
|
||||
m_gauge->SetValue(0);
|
||||
m_sizer_main->Add(m_gauge, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(28));
|
||||
if (!HasPDFlag(wxPD_NO_PROGRESS)) {
|
||||
m_gauge = new wxGauge(this, wxID_ANY, maximum, wxDefaultPosition, PROGRESSDIALOG_GAUGE_SIZE, gauge_style);
|
||||
m_gauge->SetValue(0);
|
||||
m_sizer_main->Add(m_gauge, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(28));
|
||||
}
|
||||
|
||||
#ifdef __WXMSW__
|
||||
//m_block_left = new wxWindow(m_gauge, wxID_ANY, wxPoint(0, 0), wxSize(FromDIP(2), PROGRESSDIALOG_GAUGE_SIZE.y * 2));
|
||||
|
@ -250,6 +252,7 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
|
|||
DisableAbort();
|
||||
m_button_cancel->Enable(false);
|
||||
DisableSkip();
|
||||
OnCancel();
|
||||
m_timeStop = wxGetCurrentTime();
|
||||
}
|
||||
});
|
||||
|
@ -509,14 +512,15 @@ bool ProgressDialog::Update(int value, const wxString &newmsg, bool *skip)
|
|||
{
|
||||
if (!DoBeforeUpdate(skip)) return false;
|
||||
|
||||
wxCHECK_MSG(m_gauge, false, "dialog should be fully created");
|
||||
wxCHECK_MSG(m_msg || m_gauge, false, "dialog should be fully created");
|
||||
|
||||
#ifdef __WXMSW__
|
||||
value /= m_factor;
|
||||
#endif // __WXMSW__
|
||||
|
||||
wxASSERT_MSG(value <= m_maximum, wxT("invalid progress value"));
|
||||
m_gauge->SetValue(value);
|
||||
if (m_gauge)
|
||||
m_gauge->SetValue(value);
|
||||
|
||||
UpdateMessage(newmsg);
|
||||
|
||||
|
@ -588,10 +592,10 @@ bool ProgressDialog::Pulse(const wxString &newmsg, bool *skip)
|
|||
{
|
||||
if (!DoBeforeUpdate(skip)) return false;
|
||||
|
||||
wxCHECK_MSG(m_gauge, false, "dialog should be fully created");
|
||||
wxCHECK_MSG(m_msg || m_gauge, false, "dialog should be fully created");
|
||||
|
||||
// show a bit of progress
|
||||
m_gauge->Pulse();
|
||||
if (m_gauge) m_gauge->Pulse();
|
||||
|
||||
UpdateMessage(newmsg);
|
||||
|
||||
|
@ -732,6 +736,8 @@ void ProgressDialog::OnCancel(wxCommandEvent &event)
|
|||
DisableAbort();
|
||||
DisableSkip();
|
||||
|
||||
OnCancel();
|
||||
|
||||
// save the time when the dialog was stopped
|
||||
m_timeStop = wxGetCurrentTime();
|
||||
}
|
||||
|
@ -756,6 +762,7 @@ void ProgressDialog::OnClose(wxCloseEvent &event)
|
|||
m_state = Canceled;
|
||||
DisableAbort();
|
||||
DisableSkip();
|
||||
OnCancel();
|
||||
|
||||
m_timeStop = wxGetCurrentTime();
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ class WXDLLIMPEXP_FWD_CORE wxWindowDisabler;
|
|||
#define PROGRESSDIALOG_DEF_BK wxColour(255,255,255)
|
||||
#define PROGRESSDIALOG_GREY_700 wxColour(107,107,107)
|
||||
|
||||
#define wxPD_NO_PROGRESS 0x0100
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
|
@ -51,6 +52,8 @@ public:
|
|||
virtual bool WasCancelled() const;
|
||||
virtual bool WasSkipped() const;
|
||||
|
||||
virtual void OnCancel() {};
|
||||
|
||||
// Must provide overload to avoid hiding it (and warnings about it)
|
||||
virtual void Update() wxOVERRIDE { wxDialog::Update(); }
|
||||
|
||||
|
|
|
@ -28,9 +28,10 @@ SideButton::SideButton(wxWindow* parent, wxString text, wxString icon, long stly
|
|||
|
||||
|
||||
border_color.append(0x6B6B6B, StateColor::Disabled);
|
||||
border_color.append(wxColour(0, 137, 123), StateColor::Pressed);
|
||||
border_color.append(wxColour(38, 166, 154), StateColor::Hovered);
|
||||
border_color.append(0x009688, StateColor::Normal);
|
||||
border_color.append(wxColour(23, 129, 63), StateColor::Pressed);
|
||||
border_color.append(wxColour(48,221,112), StateColor::Hovered);
|
||||
border_color.append(0x00AE42, StateColor::Normal);
|
||||
border_color.setTakeFocusedAsHovered(false);
|
||||
|
||||
text_color.append(0xACACAC, StateColor::Disabled);
|
||||
text_color.append(0xFEFEFE, StateColor::Pressed);
|
||||
|
@ -38,9 +39,10 @@ SideButton::SideButton(wxWindow* parent, wxString text, wxString icon, long stly
|
|||
text_color.append(0xFEFEFE, StateColor::Normal);
|
||||
|
||||
background_color.append(0x6B6B6B, StateColor::Disabled);
|
||||
background_color.append(wxColour(0, 137, 123), StateColor::Pressed);
|
||||
background_color.append(wxColour(38, 166, 154), StateColor::Hovered);
|
||||
background_color.append(0x009688, StateColor::Normal);
|
||||
background_color.append(wxColour(23, 129, 63), StateColor::Pressed);
|
||||
background_color.append(wxColour(48, 221, 112), StateColor::Hovered);
|
||||
background_color.append(0x00AE42, StateColor::Normal);
|
||||
background_color.setTakeFocusedAsHovered(false);
|
||||
|
||||
SetBottomColour(wxColour("#3B4446"));
|
||||
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
#include "SideTools.hpp"
|
||||
#include "bambu_networking.hpp"
|
||||
#include <wx/dcmemory.h>
|
||||
#include <wx/dcgraph.h>
|
||||
#include "Label.hpp"
|
||||
#include "StateColor.hpp"
|
||||
#include "../GUI_App.hpp"
|
||||
#include "../wxExtensions.hpp"
|
||||
#include "../I18N.hpp"
|
||||
#include "../GUI.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
SideTools::SideTools(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
|
||||
SideToolsPanel::SideToolsPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
|
||||
{
|
||||
wxPanel::Create(parent, id, pos, wxSize(0, FromDIP(50)));
|
||||
Bind(wxEVT_PAINT, &SideTools::OnPaint, this);
|
||||
wxPanel::Create(parent, id, pos, size);
|
||||
|
||||
SetMinSize(wxSize(-1, FromDIP(50)));
|
||||
SetMaxSize(wxSize(-1, FromDIP(50)));
|
||||
|
||||
Bind(wxEVT_PAINT, &SideToolsPanel::OnPaint, this);
|
||||
SetBackgroundColour(wxColour("#FEFFFF"));
|
||||
|
||||
m_printing_img = ScalableBitmap(this, "printer", 16);
|
||||
|
@ -30,33 +35,33 @@ namespace Slic3r { namespace GUI {
|
|||
m_intetval_timer = new wxTimer();
|
||||
m_intetval_timer->SetOwner(this);
|
||||
|
||||
this->Bind(wxEVT_TIMER, &SideTools::stop_interval, this);
|
||||
this->Bind(wxEVT_ENTER_WINDOW, &SideTools::on_mouse_enter, this);
|
||||
this->Bind(wxEVT_LEAVE_WINDOW, &SideTools::on_mouse_leave, this);
|
||||
this->Bind(wxEVT_LEFT_DOWN, &SideTools::on_mouse_left_down, this);
|
||||
this->Bind(wxEVT_LEFT_UP, &SideTools::on_mouse_left_up, this);
|
||||
this->Bind(wxEVT_TIMER, &SideToolsPanel::stop_interval, this);
|
||||
this->Bind(wxEVT_ENTER_WINDOW, &SideToolsPanel::on_mouse_enter, this);
|
||||
this->Bind(wxEVT_LEAVE_WINDOW, &SideToolsPanel::on_mouse_leave, this);
|
||||
this->Bind(wxEVT_LEFT_DOWN, &SideToolsPanel::on_mouse_left_down, this);
|
||||
this->Bind(wxEVT_LEFT_UP, &SideToolsPanel::on_mouse_left_up, this);
|
||||
}
|
||||
|
||||
SideTools::~SideTools() { delete m_intetval_timer; }
|
||||
SideToolsPanel::~SideToolsPanel() { delete m_intetval_timer; }
|
||||
|
||||
void SideTools::set_none_printer_mode()
|
||||
void SideToolsPanel::set_none_printer_mode()
|
||||
{
|
||||
m_none_printer = true;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SideTools::on_timer(wxTimerEvent &event)
|
||||
void SideToolsPanel::on_timer(wxTimerEvent &event)
|
||||
{
|
||||
}
|
||||
|
||||
void SideTools::set_current_printer_name(std::string dev_name)
|
||||
void SideToolsPanel::set_current_printer_name(std::string dev_name)
|
||||
{
|
||||
m_none_printer = false;
|
||||
m_dev_name = from_u8(dev_name);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SideTools::set_current_printer_signal(WifiSignal sign)
|
||||
void SideToolsPanel::set_current_printer_signal(WifiSignal sign)
|
||||
{
|
||||
if (last_printer_signal == sign) return;
|
||||
|
||||
|
@ -66,36 +71,36 @@ void SideTools::set_current_printer_signal(WifiSignal sign)
|
|||
Refresh();
|
||||
}
|
||||
|
||||
void SideTools::start_interval()
|
||||
void SideToolsPanel::start_interval()
|
||||
{
|
||||
m_intetval_timer->Start(SIDE_TOOL_CLICK_INTERVAL);
|
||||
m_is_in_interval = true;
|
||||
}
|
||||
|
||||
void SideTools::stop_interval(wxTimerEvent& event)
|
||||
void SideToolsPanel::stop_interval(wxTimerEvent& event)
|
||||
{
|
||||
m_is_in_interval = false;
|
||||
m_intetval_timer->Stop();
|
||||
}
|
||||
|
||||
|
||||
bool SideTools::is_in_interval()
|
||||
bool SideToolsPanel::is_in_interval()
|
||||
{
|
||||
return m_is_in_interval;
|
||||
}
|
||||
|
||||
void SideTools::msw_rescale()
|
||||
void SideToolsPanel::msw_rescale()
|
||||
{
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SideTools::OnPaint(wxPaintEvent &event)
|
||||
void SideToolsPanel::OnPaint(wxPaintEvent &event)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
doRender(dc);
|
||||
}
|
||||
|
||||
void SideTools::render(wxDC &dc)
|
||||
void SideToolsPanel::render(wxDC &dc)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
wxSize size = GetSize();
|
||||
|
@ -116,7 +121,7 @@ void SideTools::render(wxDC &dc)
|
|||
#endif
|
||||
}
|
||||
|
||||
void SideTools::doRender(wxDC &dc)
|
||||
void SideToolsPanel::doRender(wxDC &dc)
|
||||
{
|
||||
auto left = FromDIP(15);
|
||||
wxSize size = GetSize();
|
||||
|
@ -208,27 +213,330 @@ void SideTools::doRender(wxDC &dc)
|
|||
}
|
||||
}
|
||||
|
||||
void SideTools::on_mouse_left_down(wxMouseEvent &evt)
|
||||
void SideToolsPanel::on_mouse_left_down(wxMouseEvent &evt)
|
||||
{
|
||||
m_click = true;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SideTools::on_mouse_left_up(wxMouseEvent &evt)
|
||||
void SideToolsPanel::on_mouse_left_up(wxMouseEvent &evt)
|
||||
{
|
||||
m_click = false;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SideTools::on_mouse_enter(wxMouseEvent &evt)
|
||||
void SideToolsPanel::on_mouse_enter(wxMouseEvent &evt)
|
||||
{
|
||||
m_hover = true;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void SideTools::on_mouse_leave(wxMouseEvent &evt)
|
||||
void SideToolsPanel::on_mouse_leave(wxMouseEvent &evt)
|
||||
{
|
||||
m_hover = false;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
SideTools::SideTools(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
|
||||
{
|
||||
wxPanel::Create(parent, id, pos, size);
|
||||
SetBackgroundColour(wxColour("#FEFFFF"));
|
||||
|
||||
m_side_tools = new SideToolsPanel(this, wxID_ANY);
|
||||
|
||||
m_connection_info = new Button(this, wxEmptyString);
|
||||
m_connection_info->SetBackgroundColor(wxColour(255, 111, 0));
|
||||
m_connection_info->SetBorderColor(wxColour(255, 111, 0));
|
||||
m_connection_info->SetTextColor(*wxWHITE);
|
||||
m_connection_info->SetFont(::Label::Body_13);
|
||||
m_connection_info->SetCornerRadius(0);
|
||||
m_connection_info->SetSize(wxSize(FromDIP(-1), FromDIP(25)));
|
||||
m_connection_info->SetMinSize(wxSize(FromDIP(-1), FromDIP(25)));
|
||||
m_connection_info->SetMaxSize(wxSize(FromDIP(-1), FromDIP(25)));
|
||||
|
||||
|
||||
wxBoxSizer* connection_sizer_V = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* connection_sizer_H = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_hyperlink = new wxHyperlinkCtrl(m_connection_info, wxID_ANY, _L("Failed to connect to the server"), wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-connect-printer"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE);
|
||||
m_hyperlink->SetBackgroundColour(wxColour(255, 111, 0));
|
||||
|
||||
m_more_err_open = ScalableBitmap(this, "monitir_err_open", 16);
|
||||
m_more_err_close = ScalableBitmap(this, "monitir_err_close", 16);
|
||||
m_more_button = new ScalableButton(m_connection_info, wxID_ANY, "monitir_err_open");
|
||||
m_more_button->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
|
||||
m_more_button->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
|
||||
m_more_button->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
|
||||
if (!m_more_err_state) {
|
||||
m_more_button->SetBitmap(m_more_err_close.bmp());
|
||||
Freeze();
|
||||
m_side_error_panel->Show();
|
||||
m_more_err_state = true;
|
||||
m_tabpanel->Refresh();
|
||||
m_tabpanel->Layout();
|
||||
Thaw();
|
||||
}
|
||||
else {
|
||||
m_more_button->SetBitmap(m_more_err_open.bmp());
|
||||
Freeze();
|
||||
m_side_error_panel->Hide();
|
||||
m_more_err_state = false;
|
||||
m_tabpanel->Refresh();
|
||||
m_tabpanel->Layout();
|
||||
Thaw();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
connection_sizer_H->Add(m_hyperlink, 0, wxALIGN_CENTER | wxALL, 5);
|
||||
connection_sizer_H->Add(m_more_button, 0, wxALIGN_CENTER | wxALL, 3);
|
||||
connection_sizer_V->Add(connection_sizer_H, 0, wxALIGN_CENTER, 0);
|
||||
|
||||
m_connection_info->SetSizer(connection_sizer_V);
|
||||
m_connection_info->Layout();
|
||||
connection_sizer_V->Fit(m_connection_info);
|
||||
|
||||
m_side_error_panel = new wxWindow(this, wxID_ANY);
|
||||
m_side_error_panel->SetBackgroundColour(wxColour(255, 232, 214));
|
||||
m_side_error_panel->SetMinSize(wxSize(-1, -1));
|
||||
m_side_error_panel->SetMaxSize(wxSize(-1, -1));
|
||||
|
||||
m_side_error_panel->Hide();
|
||||
m_more_button->Hide();
|
||||
m_connection_info->Hide();
|
||||
|
||||
wxBoxSizer* sizer_print_failed_info = new wxBoxSizer(wxVERTICAL);
|
||||
m_side_error_panel->SetSizer(sizer_print_failed_info);
|
||||
|
||||
wxBoxSizer* sizer_error_code = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* sizer_error_desc = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* sizer_extra_info = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_link_network_state = new Label(m_side_error_panel, _L("Check cloud service status"), wxALIGN_CENTER_HORIZONTAL | wxST_ELLIPSIZE_END);
|
||||
m_link_network_state->SetMinSize(wxSize(FromDIP(220), -1));
|
||||
m_link_network_state->SetMaxSize(wxSize(FromDIP(220), -1));
|
||||
m_link_network_state->SetForegroundColour(0x00AE42);
|
||||
m_link_network_state->SetFont(::Label::Body_12);
|
||||
m_link_network_state->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {wxGetApp().link_to_network_check(); });
|
||||
m_link_network_state->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {m_link_network_state->SetCursor(wxCURSOR_HAND); });
|
||||
m_link_network_state->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {m_link_network_state->SetCursor(wxCURSOR_ARROW); });
|
||||
|
||||
auto st_title_error_code = new wxStaticText(m_side_error_panel, wxID_ANY, _L("code"), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
|
||||
auto st_title_error_code_doc = new wxStaticText(m_side_error_panel, wxID_ANY, ": ");
|
||||
m_st_txt_error_code = new Label(m_side_error_panel, wxEmptyString, LB_AUTO_WRAP);
|
||||
st_title_error_code->SetForegroundColour(0x909090);
|
||||
st_title_error_code_doc->SetForegroundColour(0x909090);
|
||||
m_st_txt_error_code->SetForegroundColour(0x909090);
|
||||
st_title_error_code->SetFont(::Label::Body_12);
|
||||
st_title_error_code_doc->SetFont(::Label::Body_12);
|
||||
m_st_txt_error_code->SetFont(::Label::Body_12);
|
||||
st_title_error_code->SetMinSize(wxSize(FromDIP(32), -1));
|
||||
st_title_error_code->SetMaxSize(wxSize(FromDIP(32), -1));
|
||||
m_st_txt_error_code->SetMinSize(wxSize(FromDIP(175), -1));
|
||||
m_st_txt_error_code->SetMaxSize(wxSize(FromDIP(175), -1));
|
||||
sizer_error_code->Add(st_title_error_code, 0, wxALL, 0);
|
||||
sizer_error_code->Add(st_title_error_code_doc, 0, wxALL, 0);
|
||||
sizer_error_code->Add(m_st_txt_error_code, 0, wxALL, 0);
|
||||
|
||||
|
||||
auto st_title_error_desc = new wxStaticText(m_side_error_panel, wxID_ANY, wxT("desc"), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
|
||||
auto st_title_error_desc_doc = new wxStaticText(m_side_error_panel, wxID_ANY, ": ");
|
||||
m_st_txt_error_desc = new Label(m_side_error_panel, wxEmptyString, LB_AUTO_WRAP);
|
||||
st_title_error_desc->SetForegroundColour(0x909090);
|
||||
st_title_error_desc_doc->SetForegroundColour(0x909090);
|
||||
m_st_txt_error_desc->SetForegroundColour(0x909090);
|
||||
st_title_error_desc->SetFont(::Label::Body_12);
|
||||
st_title_error_desc_doc->SetFont(::Label::Body_12);
|
||||
m_st_txt_error_desc->SetFont(::Label::Body_12);
|
||||
st_title_error_desc->SetMinSize(wxSize(FromDIP(32), -1));
|
||||
st_title_error_desc->SetMaxSize(wxSize(FromDIP(32), -1));
|
||||
m_st_txt_error_desc->SetMinSize(wxSize(FromDIP(175), -1));
|
||||
m_st_txt_error_desc->SetMaxSize(wxSize(FromDIP(175), -1));
|
||||
sizer_error_desc->Add(st_title_error_desc, 0, wxALL, 0);
|
||||
sizer_error_desc->Add(st_title_error_desc_doc, 0, wxALL, 0);
|
||||
sizer_error_desc->Add(m_st_txt_error_desc, 0, wxALL, 0);
|
||||
|
||||
auto st_title_extra_info = new wxStaticText(m_side_error_panel, wxID_ANY, wxT("info"), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
|
||||
auto st_title_extra_info_doc = new wxStaticText(m_side_error_panel, wxID_ANY, ": ");
|
||||
m_st_txt_extra_info = new Label(m_side_error_panel, wxEmptyString, LB_AUTO_WRAP);
|
||||
st_title_extra_info->SetForegroundColour(0x909090);
|
||||
st_title_extra_info_doc->SetForegroundColour(0x909090);
|
||||
m_st_txt_extra_info->SetForegroundColour(0x909090);
|
||||
st_title_extra_info->SetFont(::Label::Body_12);
|
||||
st_title_extra_info_doc->SetFont(::Label::Body_12);
|
||||
m_st_txt_extra_info->SetFont(::Label::Body_12);
|
||||
st_title_extra_info->SetMinSize(wxSize(FromDIP(32), -1));
|
||||
st_title_extra_info->SetMaxSize(wxSize(FromDIP(32), -1));
|
||||
m_st_txt_extra_info->SetMinSize(wxSize(FromDIP(175), -1));
|
||||
m_st_txt_extra_info->SetMaxSize(wxSize(FromDIP(175), -1));
|
||||
sizer_extra_info->Add(st_title_extra_info, 0, wxALL, 0);
|
||||
sizer_extra_info->Add(st_title_extra_info_doc, 0, wxALL, 0);
|
||||
sizer_extra_info->Add(m_st_txt_extra_info, 0, wxALL, 0);
|
||||
|
||||
sizer_print_failed_info->Add(m_link_network_state, 0, wxALIGN_CENTER, 3);
|
||||
sizer_print_failed_info->Add(sizer_error_code, 0, wxLEFT, 5);
|
||||
sizer_print_failed_info->Add(0, 0, 0, wxTOP, FromDIP(3));
|
||||
sizer_print_failed_info->Add(sizer_error_desc, 0, wxLEFT, 5);
|
||||
sizer_print_failed_info->Add(0, 0, 0, wxTOP, FromDIP(3));
|
||||
sizer_print_failed_info->Add(sizer_extra_info, 0, wxLEFT, 5);
|
||||
|
||||
m_st_txt_error_desc->SetLabel("");
|
||||
|
||||
wxBoxSizer* m_main_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_main_sizer->Add(m_connection_info, 0, wxEXPAND, 0);
|
||||
m_main_sizer->Add(m_side_error_panel, 0, wxEXPAND, 0);
|
||||
m_main_sizer->Add(m_side_tools, 1, wxEXPAND, 0);
|
||||
SetSizer(m_main_sizer);
|
||||
Layout();
|
||||
Fit();
|
||||
}
|
||||
|
||||
void SideTools::msw_rescale()
|
||||
{
|
||||
m_side_tools->msw_rescale();
|
||||
m_connection_info->SetCornerRadius(0);
|
||||
m_connection_info->SetSize(wxSize(FromDIP(220), FromDIP(25)));
|
||||
m_connection_info->SetMinSize(wxSize(FromDIP(220), FromDIP(25)));
|
||||
m_connection_info->SetMaxSize(wxSize(FromDIP(220), FromDIP(25)));
|
||||
}
|
||||
|
||||
bool SideTools::is_in_interval()
|
||||
{
|
||||
return m_side_tools->is_in_interval();
|
||||
}
|
||||
|
||||
void SideTools::set_current_printer_name(std::string dev_name)
|
||||
{
|
||||
m_side_tools->set_current_printer_name(dev_name);
|
||||
}
|
||||
|
||||
void SideTools::set_current_printer_signal(WifiSignal sign)
|
||||
{
|
||||
m_side_tools->set_current_printer_signal(sign);
|
||||
}
|
||||
|
||||
void SideTools::set_none_printer_mode()
|
||||
{
|
||||
m_side_tools->set_none_printer_mode();
|
||||
}
|
||||
|
||||
void SideTools::start_interval()
|
||||
{
|
||||
m_side_tools->start_interval();
|
||||
}
|
||||
|
||||
void SideTools::update_connect_err_info(int code, wxString desc, wxString info)
|
||||
{
|
||||
m_st_txt_error_code->SetLabelText(wxString::Format("%d", code));
|
||||
m_st_txt_error_desc->SetLabelText(desc);
|
||||
m_st_txt_extra_info->SetLabelText(info);
|
||||
|
||||
if (code == BAMBU_NETWORK_ERR_CONNECTION_TO_PRINTER_FAILED) {
|
||||
m_link_network_state->Hide();
|
||||
}
|
||||
else if (code == BAMBU_NETWORK_ERR_CONNECTION_TO_SERVER_FAILED) {
|
||||
m_link_network_state->Show();
|
||||
}
|
||||
}
|
||||
|
||||
void SideTools::update_status(MachineObject* obj)
|
||||
{
|
||||
if (!obj) return;
|
||||
|
||||
/* Update Device Info */
|
||||
m_side_tools->set_current_printer_name(obj->dev_name);
|
||||
|
||||
// update wifi signal image
|
||||
int wifi_signal_val = 0;
|
||||
if (!obj->is_connected() || obj->is_connecting()) {
|
||||
m_side_tools->set_current_printer_signal(WifiSignal::NONE);
|
||||
}
|
||||
else {
|
||||
if (!obj->wifi_signal.empty() && boost::ends_with(obj->wifi_signal, "dBm")) {
|
||||
try {
|
||||
wifi_signal_val = std::stoi(obj->wifi_signal.substr(0, obj->wifi_signal.size() - 3));
|
||||
}
|
||||
catch (...) {
|
||||
;
|
||||
}
|
||||
if (wifi_signal_val > -45) {
|
||||
m_side_tools->set_current_printer_signal(WifiSignal::STRONG);
|
||||
}
|
||||
else if (wifi_signal_val <= -45 && wifi_signal_val >= -60) {
|
||||
m_side_tools->set_current_printer_signal(WifiSignal::MIDDLE);
|
||||
}
|
||||
else {
|
||||
m_side_tools->set_current_printer_signal(WifiSignal::WEAK);
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_side_tools->set_current_printer_signal(WifiSignal::MIDDLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SideTools::show_status(int status)
|
||||
{
|
||||
if (((status & (int)MonitorStatus::MONITOR_DISCONNECTED) != 0) || ((status & (int)MonitorStatus::MONITOR_DISCONNECTED_SERVER) != 0)) {
|
||||
if ((status & (int)MonitorStatus::MONITOR_DISCONNECTED_SERVER)) {
|
||||
m_hyperlink->SetLabel(_L("Failed to connect to the server"));
|
||||
update_connect_err_info(BAMBU_NETWORK_ERR_CONNECTION_TO_SERVER_FAILED,
|
||||
_L("Failed to connect to cloud service"),
|
||||
_L("Please click on the hyperlink above to view the cloud service status"));
|
||||
}
|
||||
else {
|
||||
m_hyperlink->SetLabel(_L("Failed to connect to the printer"));
|
||||
update_connect_err_info(BAMBU_NETWORK_ERR_CONNECTION_TO_PRINTER_FAILED,
|
||||
_L("Connection to printer failed"),
|
||||
_L("Please check the network connection of the printer and Studio."));
|
||||
}
|
||||
|
||||
m_hyperlink->Show();
|
||||
m_connection_info->SetLabel(wxEmptyString);
|
||||
m_connection_info->SetBackgroundColor(0xFF6F00);
|
||||
m_connection_info->SetBorderColor(0xFF6F00);
|
||||
m_connection_info->Show();
|
||||
m_more_button->Show();
|
||||
|
||||
}
|
||||
else if ((status & (int)MonitorStatus::MONITOR_NORMAL) != 0) {
|
||||
m_connection_info->Hide();
|
||||
m_more_button->Hide();
|
||||
m_side_error_panel->Hide();
|
||||
}
|
||||
else if ((status & (int)MonitorStatus::MONITOR_CONNECTING) != 0) {
|
||||
m_hyperlink->Hide();
|
||||
m_connection_info->SetLabel(_L("Connecting..."));
|
||||
m_connection_info->SetBackgroundColor(0x00AE42);
|
||||
m_connection_info->SetBorderColor(0x00AE42);
|
||||
m_connection_info->Show();
|
||||
m_more_button->Hide();
|
||||
m_side_error_panel->Hide();
|
||||
}
|
||||
|
||||
if ((status & (int)MonitorStatus::MONITOR_NO_PRINTER) != 0) {
|
||||
m_side_tools->set_none_printer_mode();
|
||||
m_connection_info->Hide();
|
||||
m_side_error_panel->Hide();
|
||||
m_more_button->Hide();
|
||||
}
|
||||
else if (((status & (int)MonitorStatus::MONITOR_NORMAL) != 0)
|
||||
|| ((status & (int)MonitorStatus::MONITOR_DISCONNECTED) != 0)
|
||||
|| ((status & (int)MonitorStatus::MONITOR_DISCONNECTED_SERVER) != 0)
|
||||
|| ((status & (int)MonitorStatus::MONITOR_CONNECTING) != 0)
|
||||
) {
|
||||
if (((status & (int)MonitorStatus::MONITOR_DISCONNECTED) != 0)
|
||||
|| ((status & (int)MonitorStatus::MONITOR_DISCONNECTED_SERVER) != 0)
|
||||
|| ((status & (int)MonitorStatus::MONITOR_CONNECTING) != 0)) {
|
||||
m_side_tools->set_current_printer_signal(WifiSignal::NONE);
|
||||
}
|
||||
}
|
||||
Layout();
|
||||
Fit();
|
||||
}
|
||||
|
||||
SideTools::~SideTools()
|
||||
{
|
||||
}
|
||||
|
||||
}}
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
#include <wx/dcgraph.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/dcclient.h>
|
||||
#include <wx/hyperlink.h>
|
||||
#include "Button.hpp"
|
||||
#include "Label.hpp"
|
||||
#include "../GUI/Tabbook.hpp"
|
||||
#include "../DeviceManager.hpp"
|
||||
#include "../wxExtensions.hpp"
|
||||
|
||||
#define SIDE_TOOLS_GREY900 wxColour(38, 46, 48)
|
||||
|
@ -19,11 +24,20 @@ enum WifiSignal {
|
|||
STRONG,
|
||||
};
|
||||
|
||||
enum MonitorStatus {
|
||||
MONITOR_UNKNOWN = 0,
|
||||
MONITOR_NORMAL = 1 << 1,
|
||||
MONITOR_NO_PRINTER = 1 << 2,
|
||||
MONITOR_DISCONNECTED = 1 << 3,
|
||||
MONITOR_DISCONNECTED_SERVER = 1 << 4,
|
||||
MONITOR_CONNECTING = 1 << 5,
|
||||
};
|
||||
|
||||
#define SIDE_TOOL_CLICK_INTERVAL 20
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
class SideTools : public wxPanel
|
||||
class SideToolsPanel : public wxPanel
|
||||
{
|
||||
private:
|
||||
WifiSignal m_wifi_type{WifiSignal::NONE};
|
||||
|
@ -52,8 +66,8 @@ protected:
|
|||
bool m_is_in_interval {false};
|
||||
|
||||
public:
|
||||
SideTools(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
~SideTools();
|
||||
SideToolsPanel(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
||||
~SideToolsPanel();
|
||||
|
||||
void set_none_printer_mode();
|
||||
void on_timer(wxTimerEvent &event);
|
||||
|
@ -73,6 +87,43 @@ protected:
|
|||
void on_mouse_left_down(wxMouseEvent &evt);
|
||||
void on_mouse_left_up(wxMouseEvent &evt);
|
||||
};
|
||||
|
||||
class SideTools : public wxPanel
|
||||
{
|
||||
public:
|
||||
SideTools(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize);
|
||||
~SideTools();
|
||||
|
||||
private:
|
||||
SideToolsPanel* m_side_tools{ nullptr };
|
||||
Tabbook* m_tabpanel{ nullptr };
|
||||
Label* m_link_network_state{ nullptr };
|
||||
Label* m_st_txt_error_code{ nullptr };
|
||||
Label* m_st_txt_error_desc{ nullptr };
|
||||
Label* m_st_txt_extra_info{ nullptr };
|
||||
wxWindow* m_side_error_panel{ nullptr };
|
||||
Button* m_connection_info{ nullptr };
|
||||
wxHyperlinkCtrl* m_hyperlink{ nullptr };
|
||||
ScalableButton* m_more_button{ nullptr };
|
||||
ScalableBitmap m_more_err_open;
|
||||
ScalableBitmap m_more_err_close;
|
||||
bool m_more_err_state{ false };
|
||||
|
||||
public:
|
||||
void set_table_panel(Tabbook* tb) {m_tabpanel = tb;};
|
||||
void msw_rescale();
|
||||
bool is_in_interval();
|
||||
void set_current_printer_name(std::string dev_name);
|
||||
void set_current_printer_signal(WifiSignal sign);
|
||||
void set_none_printer_mode();
|
||||
void start_interval();
|
||||
void update_status(MachineObject* obj);
|
||||
void update_connect_err_info(int code, wxString desc, wxString info);
|
||||
void show_status(int status);
|
||||
|
||||
public:
|
||||
SideToolsPanel* get_panel() {return m_side_tools;};
|
||||
};
|
||||
}} // namespace Slic3r::GUI
|
||||
|
||||
#endif // !slic3r_GUI_SIDETOOLS_hpp_
|
||||
|
|
|
@ -96,6 +96,7 @@ void TextInput::SetLabel(const wxString& label)
|
|||
|
||||
void TextInput::SetIcon(const wxBitmap &icon)
|
||||
{
|
||||
this->icon = ScalableBitmap();
|
||||
this->icon.bmp() = icon;
|
||||
Rescale();
|
||||
}
|
||||
|
|
|
@ -44,6 +44,9 @@ class WebViewEdge : public wxWebViewEdge
|
|||
public:
|
||||
bool SetUserAgent(const wxString &userAgent)
|
||||
{
|
||||
bool dark = userAgent.Contains("dark");
|
||||
SetColorScheme(dark ? COREWEBVIEW2_PREFERRED_COLOR_SCHEME_DARK : COREWEBVIEW2_PREFERRED_COLOR_SCHEME_LIGHT);
|
||||
|
||||
ICoreWebView2 *webView2 = (ICoreWebView2 *) GetNativeBackend();
|
||||
if (webView2) {
|
||||
ICoreWebView2Settings *settings;
|
||||
|
@ -57,12 +60,35 @@ public:
|
|||
return true;
|
||||
}
|
||||
}
|
||||
settings->Release();
|
||||
return false;
|
||||
}
|
||||
pendingUserAgent = userAgent;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SetColorScheme(COREWEBVIEW2_PREFERRED_COLOR_SCHEME colorScheme)
|
||||
{
|
||||
ICoreWebView2 *webView2 = (ICoreWebView2 *) GetNativeBackend();
|
||||
if (webView2) {
|
||||
ICoreWebView2_13 * webView2_13;
|
||||
HRESULT hr = webView2->QueryInterface(&webView2_13);
|
||||
if (hr == S_OK) {
|
||||
ICoreWebView2Profile *profile;
|
||||
hr = webView2_13->get_Profile(&profile);
|
||||
if (hr == S_OK) {
|
||||
profile->put_PreferredColorScheme(colorScheme);
|
||||
profile->Release();
|
||||
return true;
|
||||
}
|
||||
webView2_13->Release();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
pendingColorScheme = colorScheme;
|
||||
return true;
|
||||
}
|
||||
|
||||
void DoGetClientSize(int *x, int *y) const override
|
||||
{
|
||||
if (!pendingUserAgent.empty()) {
|
||||
|
@ -71,10 +97,17 @@ public:
|
|||
thiz->pendingUserAgent.clear();
|
||||
thiz->SetUserAgent(userAgent);
|
||||
}
|
||||
if (pendingColorScheme) {
|
||||
auto thiz = const_cast<WebViewEdge *>(this);
|
||||
auto colorScheme = pendingColorScheme;
|
||||
thiz->pendingColorScheme = COREWEBVIEW2_PREFERRED_COLOR_SCHEME_AUTO;
|
||||
thiz->SetColorScheme(colorScheme);
|
||||
}
|
||||
wxWebViewEdge::DoGetClientSize(x, y);
|
||||
};
|
||||
private:
|
||||
wxString pendingUserAgent;
|
||||
COREWEBVIEW2_PREFERRED_COLOR_SCHEME pendingColorScheme = COREWEBVIEW2_PREFERRED_COLOR_SCHEME_AUTO;
|
||||
};
|
||||
|
||||
#elif defined __WXOSX__
|
||||
|
@ -241,7 +274,8 @@ void WebView::LoadUrl(wxWebView * webView, wxString const &url)
|
|||
|
||||
bool WebView::RunScript(wxWebView *webView, wxString const &javascript)
|
||||
{
|
||||
if (Slic3r::GUI::wxGetApp().get_mode() == Slic3r::comDevelop)
|
||||
if (Slic3r::GUI::wxGetApp().app_config->get("internal_developer_mode") == "true"
|
||||
&& javascript.find("studio_userlogin") == wxString::npos)
|
||||
wxLogMessage("Running JavaScript:\n%s\n", javascript);
|
||||
|
||||
try {
|
||||
|
@ -275,9 +309,10 @@ bool WebView::RunScript(wxWebView *webView, wxString const &javascript)
|
|||
|
||||
void WebView::RecreateAll()
|
||||
{
|
||||
auto dark = Slic3r::GUI::wxGetApp().dark_mode();
|
||||
for (auto webView : g_webviews) {
|
||||
webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s (%s) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)", SLIC3R_VERSION,
|
||||
Slic3r::GUI::wxGetApp().dark_mode() ? "dark" : "light"));
|
||||
dark ? "dark" : "light"));
|
||||
webView->Reload();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue