NEW:support for displaying extra styles

Change-Id: I5c468218c865d93f5813cc3f53f3b9a74de44312
(cherry picked from commit 36e12f142c2bfc26dca89262f6367457a29a326c)
(cherry picked from commit 88b58898a749156e291dbe90d286115af6e69855)
This commit is contained in:
tao wang 2023-07-13 16:10:27 +08:00 committed by Lane.Wei
parent 32541741ed
commit ca17231c98
18 changed files with 1298 additions and 516 deletions

View file

@ -40,9 +40,7 @@
"FUNC_VIRTUAL_CAMERA": false,
"FUNC_PRINT_WITHOUT_SD": false,
"FUNC_ALTER_RESOLUTION": false,
"FUNC_PRINT_ALL": false,
"FUNC_VIRTUAL_TYAY": true,
"FUNC_EXTRUSION_CALI": true
"FUNC_PRINT_ALL": false
},
"camera_resolution": [ "720p" ],
"bed_temperature_limit": 100,
@ -53,7 +51,6 @@
"printer_thumbnail_image": "printer_thumbnail_p1p"
},
{
"display_name": "Bambu Lab X1",
"func": {
"FUNC_VIRTUAL_TYAY": true,

View file

@ -0,0 +1,3 @@
<svg width="20" height="140" viewBox="0 0 20 140" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20 9.5C20 4.25329 15.5228 0 10 0C4.47715 0 0 4.25329 0 9.5V130.5C0 135.747 4.47715 140 10 140C15.5228 140 20 135.747 20 130.5V9.5Z" fill="#CECECE"/>
</svg>

After

Width:  |  Height:  |  Size: 264 B

View file

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="16" height="16" fill="#FFFFFF" fill-opacity="0.01"/>
</svg>

After

Width:  |  Height:  |  Size: 169 B

View file

@ -0,0 +1,8 @@
<svg width="58" height="80" viewBox="0 0 58 80" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M58 45V35L51 35.7812V44.2187L58 45Z" fill="#ACACAC"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.9704 3.63623C43.208 3.63623 41.2116 6.70995 39.875 10.909L43.0738 10.9092C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H40.0518C41.4218 73.6574 43.1249 76.3635 44.9704 76.3635C49.4971 76.3635 53.1667 60.083 53.1667 39.9999C53.1667 19.9168 49.4971 3.63623 44.9704 3.63623Z" fill="#EEEEEE"/>
<path d="M15.7085 10.9092H43.0738C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H15.7085" stroke="#ACACAC"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.9265 10.9092C41.5573 9.00098 42.3148 7.39151 43.0881 6.26334C43.4956 5.6689 43.8846 5.24175 44.232 4.97214C44.5822 4.70037 44.8266 4.63623 44.9707 4.63623C45.2153 4.63623 45.5388 4.74176 45.9503 5.1154C46.3676 5.49423 46.8181 6.10021 47.2785 6.96415C48.1984 8.69037 49.0576 11.2541 49.7908 14.5068C51.2534 20.9959 52.167 30.0096 52.167 39.9999C52.167 49.9901 51.2534 59.0038 49.7908 65.4929C49.0576 68.7456 48.1984 71.3093 47.2785 73.0355C46.8181 73.8995 46.3676 74.5055 45.9503 74.8843C45.5388 75.2579 45.2153 75.3635 44.9707 75.3635C44.5504 75.3635 43.8868 75.0261 43.0699 73.7381C42.3835 72.656 41.715 71.0918 41.0974 69.091H39.0092C39.698 71.4483 40.49 73.4045 41.3809 74.8093C42.2805 76.2276 43.4651 77.3635 44.9707 77.3635C45.8577 77.3635 46.6391 76.9602 47.2947 76.3651C47.9445 75.7751 48.5233 74.9523 49.0435 73.9761C50.0848 72.0221 50.9917 69.2606 51.7418 65.9327C53.2457 59.2608 54.167 50.0927 54.167 39.9999C54.167 29.907 53.2457 20.7389 51.7418 14.067C50.9917 10.7391 50.0848 7.97755 49.0435 6.02357C48.5233 5.04741 47.9445 4.22458 47.2947 3.63461C46.6391 3.03946 45.8577 2.63623 44.9707 2.63623C44.2335 2.63623 43.5674 2.95631 43.0059 3.39208C42.4415 3.83001 41.9175 4.43373 41.4384 5.1326C40.4794 6.53179 39.6093 8.44755 38.9224 10.6056L39.8759 10.9092H40.9265Z" fill="#ACACAC"/>
<path d="M11.4792 76.3634C15.8169 76.3634 19.3333 60.0829 19.3333 39.9998C19.3333 19.9168 15.8169 3.63623 11.4792 3.63623C7.14143 3.63623 3.625 19.9168 3.625 39.9998C3.625 60.0829 7.14143 76.3634 11.4792 76.3634Z" fill="#EEEEEE" stroke="#ACACAC" stroke-width="2"/>
<path d="M10.8748 46.0605C11.5422 46.0605 12.0832 43.6184 12.0832 40.6059C12.0832 37.5935 11.5422 35.1514 10.8748 35.1514C10.2075 35.1514 9.6665 37.5935 9.6665 40.6059C9.6665 43.6184 10.2075 46.0605 10.8748 46.0605Z" fill="#ACACAC"/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -0,0 +1,8 @@
<svg width="58" height="80" viewBox="0 0 58 80" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M58 45V35L51 35.7812V44.2187L58 45Z" fill="#ACACAC"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.9704 3.63623C43.208 3.63623 41.2116 6.70995 39.875 10.909L43.0738 10.9092C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H40.0518C41.4218 73.6574 43.1249 76.3635 44.9704 76.3635C49.4971 76.3635 53.1667 60.083 53.1667 39.9999C53.1667 19.9168 49.4971 3.63623 44.9704 3.63623Z" fill="#EEEEEE"/>
<path d="M15.7085 10.9092H43.0738C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H15.7085" stroke="#6B6B6B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.9265 10.9092C41.5573 9.00098 42.3148 7.39151 43.0881 6.26334C43.4956 5.6689 43.8846 5.24175 44.232 4.97214C44.5822 4.70037 44.8266 4.63623 44.9707 4.63623C45.2153 4.63623 45.5388 4.74176 45.9503 5.1154C46.3676 5.49423 46.8181 6.10021 47.2785 6.96415C48.1984 8.69037 49.0576 11.2541 49.7908 14.5068C51.2534 20.9959 52.167 30.0096 52.167 39.9999C52.167 49.9901 51.2534 59.0038 49.7908 65.4929C49.0576 68.7456 48.1984 71.3093 47.2785 73.0355C46.8181 73.8995 46.3676 74.5055 45.9503 74.8843C45.5388 75.2579 45.2153 75.3635 44.9707 75.3635C44.5504 75.3635 43.8868 75.0261 43.0699 73.7381C42.3835 72.656 41.715 71.0918 41.0974 69.091H39.0092C39.698 71.4483 40.49 73.4045 41.3809 74.8093C42.2805 76.2276 43.4651 77.3635 44.9707 77.3635C45.8577 77.3635 46.6391 76.9602 47.2947 76.3651C47.9445 75.7751 48.5233 74.9523 49.0435 73.9761C50.0848 72.0221 50.9917 69.2606 51.7418 65.9327C53.2457 59.2608 54.167 50.0927 54.167 39.9999C54.167 29.907 53.2457 20.7389 51.7418 14.067C50.9917 10.7391 50.0848 7.97755 49.0435 6.02357C48.5233 5.04741 47.9445 4.22458 47.2947 3.63461C46.6391 3.03946 45.8577 2.63623 44.9707 2.63623C44.2335 2.63623 43.5674 2.95631 43.0059 3.39208C42.4415 3.83001 41.9175 4.43373 41.4384 5.1326C40.4794 6.53179 39.6093 8.44755 38.9224 10.6056L39.8759 10.9092H40.9265Z" fill="#6B6B6B"/>
<path d="M11.4792 76.3634C15.8169 76.3634 19.3333 60.0829 19.3333 39.9998C19.3333 19.9168 15.8169 3.63623 11.4792 3.63623C7.14143 3.63623 3.625 19.9168 3.625 39.9998C3.625 60.0829 7.14143 76.3634 11.4792 76.3634Z" fill="#EEEEEE" stroke="#6B6B6B" stroke-width="2"/>
<path d="M10.8748 46.0605C11.5422 46.0605 12.0832 43.6184 12.0832 40.6059C12.0832 37.5935 11.5422 35.1514 10.8748 35.1514C10.2075 35.1514 9.6665 37.5935 9.6665 40.6059C9.6665 43.6184 10.2075 46.0605 10.8748 46.0605Z" fill="#6B6B6B"/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -0,0 +1,8 @@
<svg width="58" height="80" viewBox="0 0 58 80" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M58 45V35L51 35.7812V44.2187L58 45Z" fill="#ACACAC"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.9704 3.63623C43.208 3.63623 41.2116 6.70995 39.875 10.909L43.0738 10.9092C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H40.0518C41.4218 73.6574 43.1249 76.3635 44.9704 76.3635C49.4971 76.3635 53.1667 60.083 53.1667 39.9999C53.1667 19.9168 49.4971 3.63623 44.9704 3.63623Z" fill="#EEEEEE"/>
<path d="M15.7085 10.9092H43.0738C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H15.7085" stroke="#262E30"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.9265 10.9092C41.5573 9.00098 42.3148 7.39151 43.0881 6.26334C43.4956 5.6689 43.8846 5.24175 44.232 4.97214C44.5822 4.70037 44.8266 4.63623 44.9707 4.63623C45.2153 4.63623 45.5388 4.74176 45.9503 5.1154C46.3676 5.49423 46.8181 6.10021 47.2785 6.96415C48.1984 8.69037 49.0576 11.2541 49.7908 14.5068C51.2534 20.9959 52.167 30.0096 52.167 39.9999C52.167 49.9901 51.2534 59.0038 49.7908 65.4929C49.0576 68.7456 48.1984 71.3093 47.2785 73.0355C46.8181 73.8995 46.3676 74.5055 45.9503 74.8843C45.5388 75.2579 45.2153 75.3635 44.9707 75.3635C44.5504 75.3635 43.8868 75.0261 43.0699 73.7381C42.3835 72.656 41.715 71.0918 41.0974 69.091H39.0092C39.698 71.4483 40.49 73.4045 41.3809 74.8093C42.2805 76.2276 43.4651 77.3635 44.9707 77.3635C45.8577 77.3635 46.6391 76.9602 47.2947 76.3651C47.9445 75.7751 48.5233 74.9523 49.0435 73.9761C50.0848 72.0221 50.9917 69.2606 51.7418 65.9327C53.2457 59.2608 54.167 50.0927 54.167 39.9999C54.167 29.907 53.2457 20.7389 51.7418 14.067C50.9917 10.7391 50.0848 7.97755 49.0435 6.02357C48.5233 5.04741 47.9445 4.22458 47.2947 3.63461C46.6391 3.03946 45.8577 2.63623 44.9707 2.63623C44.2335 2.63623 43.5674 2.95631 43.0059 3.39208C42.4415 3.83001 41.9175 4.43373 41.4384 5.1326C40.4794 6.53179 39.6093 8.44755 38.9224 10.6056L39.8759 10.9092H40.9265Z" fill="#262E30"/>
<path d="M11.4792 76.3634C15.8169 76.3634 19.3333 60.0829 19.3333 39.9998C19.3333 19.9168 15.8169 3.63623 11.4792 3.63623C7.14143 3.63623 3.625 19.9168 3.625 39.9998C3.625 60.0829 7.14143 76.3634 11.4792 76.3634Z" fill="#EEEEEE" stroke="#262E30" stroke-width="2"/>
<path d="M10.8748 46.0605C11.5422 46.0605 12.0832 43.6184 12.0832 40.6059C12.0832 37.5935 11.5422 35.1514 10.8748 35.1514C10.2075 35.1514 9.6665 37.5935 9.6665 40.6059C9.6665 43.6184 10.2075 46.0605 10.8748 46.0605Z" fill="#262E30"/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -0,0 +1,8 @@
<svg width="58" height="80" viewBox="0 0 58 80" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.9704 3.63623C43.208 3.63623 41.2116 6.70995 39.875 10.909L43.0738 10.9092C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H40.0518C41.4218 73.6574 43.1249 76.3635 44.9704 76.3635C49.4971 76.3635 53.1667 60.083 53.1667 39.9999C53.1667 19.9168 49.4971 3.63623 44.9704 3.63623Z" fill="#EEEEEE"/>
<path d="M15.7085 10.9092H43.0738C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H15.7085" stroke="#ACACAC"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.9265 10.9092C41.5573 9.00098 42.3148 7.39151 43.0881 6.26334C43.4956 5.6689 43.8846 5.24175 44.232 4.97214C44.5822 4.70037 44.8266 4.63623 44.9707 4.63623C45.2153 4.63623 45.5388 4.74176 45.9503 5.1154C46.3676 5.49423 46.8181 6.10021 47.2785 6.96415C48.1984 8.69037 49.0576 11.2541 49.7908 14.5068C51.2534 20.9959 52.167 30.0096 52.167 39.9999C52.167 49.9901 51.2534 59.0038 49.7908 65.4929C49.0576 68.7456 48.1984 71.3093 47.2785 73.0355C46.8181 73.8995 46.3676 74.5055 45.9503 74.8843C45.5388 75.2579 45.2153 75.3635 44.9707 75.3635C44.5504 75.3635 43.8868 75.0261 43.0699 73.7381C42.3835 72.656 41.715 71.0918 41.0974 69.091H39.0092C39.698 71.4483 40.49 73.4045 41.3809 74.8093C42.2805 76.2276 43.4651 77.3635 44.9707 77.3635C45.8577 77.3635 46.6391 76.9602 47.2947 76.3651C47.9445 75.7751 48.5233 74.9523 49.0435 73.9761C50.0848 72.0221 50.9917 69.2606 51.7418 65.9327C53.2457 59.2608 54.167 50.0927 54.167 39.9999C54.167 29.907 53.2457 20.7389 51.7418 14.067C50.9917 10.7391 50.0848 7.97755 49.0435 6.02357C48.5233 5.04741 47.9445 4.22458 47.2947 3.63461C46.6391 3.03946 45.8577 2.63623 44.9707 2.63623C44.2335 2.63623 43.5674 2.95631 43.0059 3.39208C42.4415 3.83001 41.9175 4.43373 41.4384 5.1326C40.4794 6.53179 39.6093 8.44755 38.9224 10.6056L39.8759 10.9092H40.9265Z" fill="#ACACAC"/>
<path d="M11.4792 76.3634C15.8169 76.3634 19.3333 60.0829 19.3333 39.9998C19.3333 19.9168 15.8169 3.63623 11.4792 3.63623C7.14143 3.63623 3.625 19.9168 3.625 39.9998C3.625 60.0829 7.14143 76.3634 11.4792 76.3634Z" fill="#EEEEEE" stroke="#ACACAC" stroke-width="2"/>
<path d="M10.8748 46.0605C11.5422 46.0605 12.0832 43.6184 12.0832 40.6059C12.0832 37.5935 11.5422 35.1514 10.8748 35.1514C10.2075 35.1514 9.6665 37.5935 9.6665 40.6059C9.6665 43.6184 10.2075 46.0605 10.8748 46.0605Z" fill="#ACACAC"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 44.4141V35.5859L10 36.5625V43.4375L0 44.4141Z" fill="#ACACAC"/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1,8 @@
<svg width="58" height="80" viewBox="0 0 58 80" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.9704 3.63623C43.208 3.63623 41.2116 6.70995 39.875 10.909L43.0738 10.9092C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H40.0518C41.4218 73.6574 43.1249 76.3635 44.9704 76.3635C49.4971 76.3635 53.1667 60.083 53.1667 39.9999C53.1667 19.9168 49.4971 3.63623 44.9704 3.63623Z" fill="#EEEEEE"/>
<path d="M15.7085 10.9092H43.0738C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H15.7085" stroke="#6B6B6B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.9265 10.9092C41.5573 9.00098 42.3148 7.39151 43.0881 6.26334C43.4956 5.6689 43.8846 5.24175 44.232 4.97214C44.5822 4.70037 44.8266 4.63623 44.9707 4.63623C45.2153 4.63623 45.5388 4.74176 45.9503 5.1154C46.3676 5.49423 46.8181 6.10021 47.2785 6.96415C48.1984 8.69037 49.0576 11.2541 49.7908 14.5068C51.2534 20.9959 52.167 30.0096 52.167 39.9999C52.167 49.9901 51.2534 59.0038 49.7908 65.4929C49.0576 68.7456 48.1984 71.3093 47.2785 73.0355C46.8181 73.8995 46.3676 74.5055 45.9503 74.8843C45.5388 75.2579 45.2153 75.3635 44.9707 75.3635C44.5504 75.3635 43.8868 75.0261 43.0699 73.7381C42.3835 72.656 41.715 71.0918 41.0974 69.091H39.0092C39.698 71.4483 40.49 73.4045 41.3809 74.8093C42.2805 76.2276 43.4651 77.3635 44.9707 77.3635C45.8577 77.3635 46.6391 76.9602 47.2947 76.3651C47.9445 75.7751 48.5233 74.9523 49.0435 73.9761C50.0848 72.0221 50.9917 69.2606 51.7418 65.9327C53.2457 59.2608 54.167 50.0927 54.167 39.9999C54.167 29.907 53.2457 20.7389 51.7418 14.067C50.9917 10.7391 50.0848 7.97755 49.0435 6.02357C48.5233 5.04741 47.9445 4.22458 47.2947 3.63461C46.6391 3.03946 45.8577 2.63623 44.9707 2.63623C44.2335 2.63623 43.5674 2.95631 43.0059 3.39208C42.4415 3.83001 41.9175 4.43373 41.4384 5.1326C40.4794 6.53179 39.6093 8.44755 38.9224 10.6056L39.8759 10.9092H40.9265Z" fill="#6B6B6B"/>
<path d="M11.4792 76.3634C15.8169 76.3634 19.3333 60.0829 19.3333 39.9998C19.3333 19.9168 15.8169 3.63623 11.4792 3.63623C7.14143 3.63623 3.625 19.9168 3.625 39.9998C3.625 60.0829 7.14143 76.3634 11.4792 76.3634Z" fill="#EEEEEE" stroke="#6B6B6B" stroke-width="2"/>
<path d="M10.8748 46.0605C11.5422 46.0605 12.0832 43.6184 12.0832 40.6059C12.0832 37.5935 11.5422 35.1514 10.8748 35.1514C10.2075 35.1514 9.6665 37.5935 9.6665 40.6059C9.6665 43.6184 10.2075 46.0605 10.8748 46.0605Z" fill="#ACACAC"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 44.4141V35.5859L10 36.5625V43.4375L0 44.4141Z" fill="#ACACAC"/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1,8 @@
<svg width="58" height="80" viewBox="0 0 58 80" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.9704 3.63623C43.208 3.63623 41.2116 6.70995 39.875 10.909L43.0738 10.9092C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H40.0518C41.4218 73.6574 43.1249 76.3635 44.9704 76.3635C49.4971 76.3635 53.1667 60.083 53.1667 39.9999C53.1667 19.9168 49.4971 3.63623 44.9704 3.63623Z" fill="#EEEEEE"/>
<path d="M15.7085 10.9092H43.0738C45 14 47 28.2357 47 40.5C47 52.0393 45.5 65 43.0738 69.091H15.7085" stroke="#262E30"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.9265 10.9092C41.5573 9.00098 42.3148 7.39151 43.0881 6.26334C43.4956 5.6689 43.8846 5.24175 44.232 4.97214C44.5822 4.70037 44.8266 4.63623 44.9707 4.63623C45.2153 4.63623 45.5388 4.74176 45.9503 5.1154C46.3676 5.49423 46.8181 6.10021 47.2785 6.96415C48.1984 8.69037 49.0576 11.2541 49.7908 14.5068C51.2534 20.9959 52.167 30.0096 52.167 39.9999C52.167 49.9901 51.2534 59.0038 49.7908 65.4929C49.0576 68.7456 48.1984 71.3093 47.2785 73.0355C46.8181 73.8995 46.3676 74.5055 45.9503 74.8843C45.5388 75.2579 45.2153 75.3635 44.9707 75.3635C44.5504 75.3635 43.8868 75.0261 43.0699 73.7381C42.3835 72.656 41.715 71.0918 41.0974 69.091H39.0092C39.698 71.4483 40.49 73.4045 41.3809 74.8093C42.2805 76.2276 43.4651 77.3635 44.9707 77.3635C45.8577 77.3635 46.6391 76.9602 47.2947 76.3651C47.9445 75.7751 48.5233 74.9523 49.0435 73.9761C50.0848 72.0221 50.9917 69.2606 51.7418 65.9327C53.2457 59.2608 54.167 50.0927 54.167 39.9999C54.167 29.907 53.2457 20.7389 51.7418 14.067C50.9917 10.7391 50.0848 7.97755 49.0435 6.02357C48.5233 5.04741 47.9445 4.22458 47.2947 3.63461C46.6391 3.03946 45.8577 2.63623 44.9707 2.63623C44.2335 2.63623 43.5674 2.95631 43.0059 3.39208C42.4415 3.83001 41.9175 4.43373 41.4384 5.1326C40.4794 6.53179 39.6093 8.44755 38.9224 10.6056L39.8759 10.9092H40.9265Z" fill="#262E30"/>
<path d="M11.4792 76.3634C15.8169 76.3634 19.3333 60.0829 19.3333 39.9998C19.3333 19.9168 15.8169 3.63623 11.4792 3.63623C7.14143 3.63623 3.625 19.9168 3.625 39.9998C3.625 60.0829 7.14143 76.3634 11.4792 76.3634Z" fill="#EEEEEE" stroke="#262E30" stroke-width="2"/>
<path d="M10.8748 46.0605C11.5422 46.0605 12.0832 43.6184 12.0832 40.6059C12.0832 37.5935 11.5422 35.1514 10.8748 35.1514C10.2075 35.1514 9.6665 37.5935 9.6665 40.6059C9.6665 43.6184 10.2075 46.0605 10.8748 46.0605Z" fill="#ACACAC"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 44.4141V35.5859L10 36.5625V43.4375L0 44.4141Z" fill="#ACACAC"/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -747,16 +747,6 @@ bool AMSMaterialsSetting::Show(bool show)
m_input_nozzle_min->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
//m_clr_picker->set_color(m_clr_picker->GetParent()->GetBackgroundColour());
/*if (obj && (obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI) || obj->is_high_printer_type())) {
m_ratio_text->Show();
m_k_param->Show();
m_input_k_val->Show();
}
else {
m_ratio_text->Hide();
m_k_param->Hide();
m_input_k_val->Hide();
}*/
m_ratio_text->Show();
m_k_param->Show();
m_input_k_val->Show();

View file

@ -725,6 +725,27 @@ bool MachineObject::is_support_ams_mapping()
}
}
bool MachineObject::is_support_command_ams_switch()
{
auto ota_ver_it = module_vers.find("ota");
if (ota_ver_it != module_vers.end()) {
if (printer_type == "BL-P001" || printer_type == "BL-P002") {
if (ota_ver_it->second.sw_ver.compare("01.05.06.01") < 0) {
return false;
}
}else if (printer_type == "C11" || printer_type == "C12") {
if (ota_ver_it->second.sw_ver.compare("01.02.99.10") < 0) {
return false;
}
}
}
return true;
}
bool MachineObject::is_support_ams_mapping_version(std::string module, std::string version)
{
bool result = true;
@ -1709,21 +1730,33 @@ int MachineObject::command_set_nozzle(int temp)
int MachineObject::command_ams_switch(int tray_index, int old_temp, int new_temp)
{
BOOST_LOG_TRIVIAL(trace) << "ams_switch to " << tray_index << " with temp: " << old_temp << ", " << new_temp;
if (old_temp < 0) old_temp = FILAMENT_DEF_TEMP;
if (new_temp < 0) new_temp = FILAMENT_DEF_TEMP;
int tray_id_int = tray_index;
int result = 0;
std::string gcode = "";
if (tray_index == 255) {
gcode = DeviceManager::load_gcode(printer_type, "ams_unload.gcode");
} else {
// include VIRTUAL_TRAY_ID
gcode = DeviceManager::load_gcode(printer_type, "ams_load.gcode");
boost::replace_all(gcode, "[next_extruder]", std::to_string(tray_index));
boost::replace_all(gcode, "[new_filament_temp]", std::to_string(new_temp));
//command
if (is_support_command_ams_switch()) {
command_ams_change_filament(tray_index, old_temp, new_temp);
}
//gcode
else {
std::string gcode = "";
if (tray_index == 255) {
gcode = DeviceManager::load_gcode(printer_type, "ams_unload.gcode");
}
else {
// include VIRTUAL_TRAY_ID
gcode = DeviceManager::load_gcode(printer_type, "ams_load.gcode");
boost::replace_all(gcode, "[next_extruder]", std::to_string(tray_index));
boost::replace_all(gcode, "[new_filament_temp]", std::to_string(new_temp));
}
result = this->publish_gcode(gcode);
}
return this->publish_gcode(gcode);
return result;
}
int MachineObject::command_ams_change_filament(int tray_id, int old_temp, int new_temp)

View file

@ -529,6 +529,7 @@ public:
bool can_unload_filament();
bool is_U0_firmware();
bool is_support_ams_mapping();
bool is_support_command_ams_switch();
static bool is_support_ams_mapping_version(std::string module, std::string version);
int ams_filament_mapping(std::vector<FilamentInfo> filaments, std::vector<FilamentInfo> &result, std::vector<int> exclude_id = std::vector<int>());

View file

@ -31,6 +31,7 @@ static const wxFont SWITCH_FONT = Label::Body_10;
/* const values */
static const int bed_temp_range[2] = {20, 120};
static const int nozzle_temp_range[2] = {20, 300};
static const int nozzle_chamber_range[2] = {20, 60};
/* colors */
static const wxColour STATUS_PANEL_BG = wxColour(238, 238, 238);
@ -144,7 +145,6 @@ PrintingTaskPanel::~PrintingTaskPanel()
{
}
void PrintingTaskPanel::create_panel(wxWindow* parent)
{
wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
@ -833,6 +833,17 @@ wxBoxSizer *StatusBasePanel::create_monitoring_page()
m_bmToggleBtn_timelapse->Hide();
bSizer_monitoring_title->Add(m_bmToggleBtn_timelapse, 0, wxALIGN_CENTER_VERTICAL | wxALL, FromDIP(5));
#if !BBL_RELEASE_TO_PUBLIC
m_staticText_timelapse->Show();
m_bmToggleBtn_timelapse->Show();
m_bmToggleBtn_timelapse->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent &e) {
if (e.IsChecked())
wxGetApp().getAgent()->start_subscribe("tunnel");
else
wxGetApp().getAgent()->stop_subscribe("tunnel");
});
#endif
//m_bitmap_camera_img = new wxStaticBitmap(m_panel_monitoring_title, wxID_ANY, m_bitmap_camera , wxDefaultPosition, wxSize(FromDIP(32), FromDIP(18)), 0);
//m_bitmap_camera_img->SetMinSize(wxSize(FromDIP(32), FromDIP(18)));
//bSizer_monitoring_title->Add(m_bitmap_camera_img, 0, wxALIGN_CENTER_VERTICAL | wxALL, FromDIP(5));
@ -1034,15 +1045,17 @@ wxBoxSizer *StatusBasePanel::create_temp_control(wxWindow *parent)
sizer->Add(line, 0, wxEXPAND | wxLEFT | wxRIGHT, 12);
wxWindowID frame_id = wxWindow::NewControlId();
m_tempCtrl_frame = new TempInput(parent, frame_id, TEMP_BLANK_STR, TEMP_BLANK_STR, wxString("monitor_frame_temp"), wxString("monitor_frame_temp"), wxDefaultPosition,
m_tempCtrl_chamber = new TempInput(parent, frame_id, TEMP_BLANK_STR, TEMP_BLANK_STR, wxString("monitor_frame_temp"), wxString("monitor_frame_temp"), wxDefaultPosition,
wxDefaultSize, wxALIGN_CENTER);
m_tempCtrl_frame->SetReadOnly(true);
m_tempCtrl_frame->SetMinSize(TEMP_CTRL_MIN_SIZE);
m_tempCtrl_frame->SetBorderWidth(FromDIP(2));
m_tempCtrl_frame->SetTextColor(tempinput_text_colour);
m_tempCtrl_frame->SetBorderColor(tempinput_border_colour);
m_tempCtrl_chamber->SetReadOnly(true);
m_tempCtrl_chamber->SetMinTemp(nozzle_chamber_range[0]);
m_tempCtrl_chamber->SetMaxTemp(nozzle_chamber_range[1]);
m_tempCtrl_chamber->SetMinSize(TEMP_CTRL_MIN_SIZE);
m_tempCtrl_chamber->SetBorderWidth(FromDIP(2));
m_tempCtrl_chamber->SetTextColor(tempinput_text_colour);
m_tempCtrl_chamber->SetBorderColor(tempinput_border_colour);
sizer->Add(m_tempCtrl_frame, 0, wxEXPAND | wxALL, 1);
sizer->Add(m_tempCtrl_chamber, 0, wxEXPAND | wxALL, 1);
line = new StaticLine(parent);
line->SetLineColour(STATIC_BOX_LINE_COL);
sizer->Add(line, 0, wxEXPAND | wxLEFT | wxRIGHT, 12);
@ -1181,12 +1194,12 @@ void StatusBasePanel::reset_temp_misc_control()
m_tempCtrl_nozzle->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
m_tempCtrl_bed->SetLabel(TEMP_BLANK_STR);
m_tempCtrl_bed->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
m_tempCtrl_frame->SetLabel(TEMP_BLANK_STR);
m_tempCtrl_frame->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
m_tempCtrl_chamber->SetLabel(TEMP_BLANK_STR);
m_tempCtrl_chamber->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
m_button_unload->Show();
m_tempCtrl_nozzle->Enable(true);
m_tempCtrl_frame->Enable(true);
m_tempCtrl_chamber->Enable(true);
m_tempCtrl_bed->Enable(true);
// reset misc control
@ -1401,11 +1414,11 @@ wxBoxSizer *StatusBasePanel::create_ams_group(wxWindow *parent)
return sizer;
}
void StatusBasePanel::show_ams_group(bool show, bool support_virtual_tray, bool support_extrustion_cali)
void StatusBasePanel::show_ams_group(bool show)
{
m_ams_control->Show(true);
m_ams_control_box->Show(true);
m_ams_control->show_noams_mode(show, support_virtual_tray, support_extrustion_cali);
m_ams_control->show_noams_mode();
if (m_show_ams_group != show) {
Fit();
}
@ -1530,6 +1543,8 @@ StatusPanel::StatusPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
on_set_bed_temp();
} else if (id == m_tempCtrl_nozzle->GetType()) {
on_set_nozzle_temp();
} else if (id == m_tempCtrl_chamber->GetType()) {
on_set_chamber_temp();
}
});
@ -1547,6 +1562,8 @@ StatusPanel::StatusPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
m_tempCtrl_bed->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_bed_temp_set_focus), NULL, this);
m_tempCtrl_nozzle->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_kill_focus), NULL, this);
m_tempCtrl_nozzle->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_nozzle_temp_set_focus), NULL, this);
m_tempCtrl_chamber->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(StatusPanel::on_cham_temp_kill_focus), NULL, this);
m_tempCtrl_chamber->Connect(wxEVT_SET_FOCUS, wxFocusEventHandler(StatusPanel::on_cham_temp_set_focus), NULL, this);
m_switch_lamp->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_lamp_switch), NULL, this);
m_switch_nozzle_fan->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_nozzle_fan_switch), NULL, this); // TODO
m_switch_printing_fan->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_nozzle_fan_switch), NULL, this);
@ -1787,6 +1804,14 @@ void StatusPanel::update(MachineObject *obj)
update_subtask(obj);
m_project_task_panel->Thaw();
#if !BBL_RELEASE_TO_PUBLIC
m_staticText_timelapse
->SetLabel(obj->is_lan_mode_printer() ? "Local Mqtt" : obj->is_tunnel_mqtt ? "Tunnel Mqtt" : "Cloud Mqtt");
m_bmToggleBtn_timelapse
->Enable(!obj->is_lan_mode_printer());
m_bmToggleBtn_timelapse
->SetValue(obj->is_tunnel_mqtt);
#endif
m_machine_ctrl_panel->Freeze();
@ -1803,11 +1828,9 @@ void StatusPanel::update(MachineObject *obj)
if (obj) {
// update extrusion calibration
if (obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)) {
if (m_extrusion_cali_dlg) {
m_extrusion_cali_dlg->update_machine_obj(obj);
m_extrusion_cali_dlg->update();
}
if (m_extrusion_cali_dlg) {
m_extrusion_cali_dlg->update_machine_obj(obj);
m_extrusion_cali_dlg->update();
}
// update calibration status
@ -1836,12 +1859,15 @@ void StatusPanel::update(MachineObject *obj)
m_options_btn->Hide();
}
//support edit chamber temp
if (obj->is_function_supported(PrinterFunction::FUNC_CHAMBER_TEMP)) {
m_tempCtrl_frame->Enable();
m_tempCtrl_chamber->SetReadOnly(false);
m_tempCtrl_chamber->Enable();
} else {
m_tempCtrl_frame->SetLabel(TEMP_BLANK_STR);
m_tempCtrl_frame->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
m_tempCtrl_frame->Disable();
m_tempCtrl_chamber->SetReadOnly(true);
m_tempCtrl_chamber->SetLabel(TEMP_BLANK_STR);
m_tempCtrl_chamber->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
m_tempCtrl_chamber->Disable();
}
if (!obj->dev_connection_type.empty()) {
@ -1921,14 +1947,12 @@ void StatusPanel::show_error_message(MachineObject* obj, wxString msg, std::stri
m_print_error_dlg->update_title_style(_L("Warning"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM, this);
}
m_print_error_dlg->update_text(msg);
m_print_error_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, obj](wxCommandEvent& e) {
if (obj) {
obj->command_clean_print_error(obj->subtask_id_, obj->print_error);
}
});
m_print_error_dlg->Bind(EVT_SECONDARY_CHECK_RETRY, [this, obj](wxCommandEvent& e) {
if (m_ams_control) {
m_ams_control->on_retry();
@ -2023,7 +2047,7 @@ void StatusPanel::show_printing_status(bool ctrl_area, bool temp_area)
if (!temp_area) {
m_tempCtrl_nozzle->Enable(false);
m_tempCtrl_bed->Enable(false);
m_tempCtrl_frame->Enable(false);
m_tempCtrl_chamber->Enable(false);
m_switch_speed->Enable(false);
m_switch_speed->SetValue(false);
m_switch_lamp->Enable(false);
@ -2033,7 +2057,7 @@ void StatusPanel::show_printing_status(bool ctrl_area, bool temp_area)
} else {
m_tempCtrl_nozzle->Enable();
m_tempCtrl_bed->Enable();
m_tempCtrl_frame->Enable();
m_tempCtrl_chamber->Enable();
m_switch_speed->Enable();
m_switch_speed->SetValue(true);
m_switch_lamp->Enable();
@ -2064,6 +2088,13 @@ void StatusPanel::update_temp_ctrl(MachineObject *obj)
}
m_tempCtrl_nozzle->SetCurrTemp((int) obj->nozzle_temp);
int nozzle_max_temp = 0;
if (DeviceManager::get_nozzle_max_temperature(obj->printer_type, nozzle_max_temp)) {
if (m_tempCtrl_nozzle) m_tempCtrl_nozzle->SetMaxTemp(nozzle_max_temp);
}
else {
if (m_tempCtrl_nozzle) m_tempCtrl_nozzle->SetMaxTemp(nozzle_temp_range[1]);
}
if (m_temp_nozzle_timeout > 0) {
m_temp_nozzle_timeout--;
@ -2077,8 +2108,21 @@ void StatusPanel::update_temp_ctrl(MachineObject *obj)
m_tempCtrl_nozzle->SetIconNormal();
}
m_tempCtrl_frame->SetCurrTemp(obj->chamber_temp);
m_tempCtrl_frame->SetTagTemp(obj->chamber_temp);
m_tempCtrl_chamber->SetCurrTemp(obj->chamber_temp);
// update temprature if not input temp target
if (m_temp_chamber_timeout > 0) {
m_temp_chamber_timeout--;
}
else {
if (!cham_temp_input) { m_tempCtrl_chamber->SetTagTemp(obj->chamber_temp_target); }
}
if ((obj->chamber_temp_target - obj->chamber_temp) >= TEMP_THRESHOLD_VAL) {
m_tempCtrl_chamber->SetIconActive();
}
else {
m_tempCtrl_chamber->SetIconNormal();
}
}
void StatusPanel::update_misc_ctrl(MachineObject *obj)
@ -2097,6 +2141,12 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
}
}
if (obj->is_core_xy()) {
m_staticText_z_tip->SetLabel(_L("Bed"));
} else {
m_staticText_z_tip->SetLabel("Z");
}
// update extruder icon
update_extruder_status(obj);
@ -2219,9 +2269,9 @@ void StatusPanel::update_ams(MachineObject *obj)
CalibUtils::emit_get_PA_calib_info(obj->nozzle_diameter, "");
}
bool is_support_extrusion_cali = obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI);
bool is_support_virtual_tray = obj->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY);
bool is_support_virtual_tray = obj->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY);
bool is_support_filament_backup = obj->is_function_supported(PrinterFunction::FUNC_FILAMENT_BACKUP);
AMSModel ams_mode = AMSModel::GENERIC_AMS;
if (!obj
|| !obj->is_connected()
@ -2237,11 +2287,18 @@ void StatusPanel::update_ams(MachineObject *obj)
BOOST_LOG_TRIVIAL(trace) << "machine object" << obj->dev_name << " was disconnected, set show_ams_group is false";
}
show_ams_group(false, obj->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY), is_support_extrusion_cali);
if (obj->printer_type == "N1" || obj->printer_type == "N2") { ams_mode = AMSModel::EXTRA_AMS; }
m_ams_control->SetAmsModel(AMSModel::NO_AMS, ams_mode);
show_ams_group(false);
m_ams_control->show_auto_refill(false);
}
else {
show_ams_group(true, obj->is_function_supported(PrinterFunction::FUNC_VIRTUAL_TYAY), is_support_extrusion_cali);
if (obj->printer_type == "N1" || obj->printer_type == "N2") { ams_mode = AMSModel::EXTRA_AMS; }
m_ams_control->SetAmsModel(ams_mode, ams_mode);
show_ams_group(true);
if (!obj->m_is_support_show_bak || !is_support_filament_backup || !obj->ams_support_auto_switch_filament_flag) {
m_ams_control->show_auto_refill(false);
@ -2275,7 +2332,7 @@ void StatusPanel::update_ams(MachineObject *obj)
//}
// must select a current can
m_ams_control->UpdateAms(ams_info, false, is_support_extrusion_cali);
m_ams_control->UpdateAms(ams_info, false);
last_tray_exist_bits = obj->tray_exist_bits;
last_ams_exist_bits = obj->ams_exist_bits;
@ -2309,13 +2366,15 @@ void StatusPanel::update_ams(MachineObject *obj)
// set segment 3
if (obj->m_tray_now == std::to_string(VIRTUAL_TRAY_ID)) {
m_ams_control->SetExtruder(obj->is_filament_at_extruder(), true, obj->vt_tray.get_color());
m_ams_control->SetExtruder(obj->is_filament_at_extruder(), true, obj->m_ams_id, obj->vt_tray.get_color());
} else {
m_ams_control->SetExtruder(obj->is_filament_at_extruder(), false, m_ams_control->GetCanColour(obj->m_ams_id, obj->m_tray_id));
m_ams_control->SetExtruder(obj->is_filament_at_extruder(), false, obj->m_ams_id, m_ams_control->GetCanColour(obj->m_ams_id, obj->m_tray_id));
}
if (obj->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE) {
update_filament_step();
if (obj->m_tray_tar == std::to_string(VIRTUAL_TRAY_ID) && (obj->m_tray_now != std::to_string(VIRTUAL_TRAY_ID) || obj->m_tray_now != "255")) {
// wait to heat hotend
if (obj->ams_status_sub == 0x02) {
@ -2386,6 +2445,14 @@ void StatusPanel::update_ams(MachineObject *obj)
else {
m_ams_control->SetFilamentStep(FilamentStep::STEP_PURGE_OLD_FILAMENT, FilamentStepType::STEP_TYPE_UNLOAD);
}
}
else if (obj->ams_status_sub == 0x08) {
if (!obj->is_ams_unload()) {
m_ams_control->SetFilamentStep(FilamentStep::STEP_CHECK_POSITION, FilamentStepType::STEP_TYPE_LOAD);
}
else {
m_ams_control->SetFilamentStep(FilamentStep::STEP_CHECK_POSITION, FilamentStepType::STEP_TYPE_UNLOAD);
}
} else {
m_ams_control->SetFilamentStep(FilamentStep::STEP_IDLE, FilamentStepType::STEP_TYPE_UNLOAD);
}
@ -2443,10 +2510,10 @@ void StatusPanel::update_ams(MachineObject *obj)
is_curr_tray_selected = true;
}
update_ams_control_state(is_support_extrusion_cali, is_curr_tray_selected);
update_ams_control_state(is_curr_tray_selected);
}
void StatusPanel::update_ams_control_state(bool is_support_virtual_tray, bool is_curr_tray_selected)
void StatusPanel::update_ams_control_state(bool is_curr_tray_selected)
{
// set default value to true
bool enable[ACTION_BTN_COUNT];
@ -2454,21 +2521,18 @@ void StatusPanel::update_ams_control_state(bool is_support_virtual_tray, bool is
enable[ACTION_BTN_LOAD] = true;
enable[ACTION_BTN_UNLOAD] = true;
if (!is_support_virtual_tray) {
enable[ACTION_BTN_CALI] = false;
}
else {
if (obj->is_in_printing()) {
if (obj->is_in_extrusion_cali()) {
enable[ACTION_BTN_LOAD] = false;
enable[ACTION_BTN_UNLOAD] = false;
enable[ACTION_BTN_CALI] = true;
} else {
enable[ACTION_BTN_CALI] = false;
}
} else {
if (obj->is_in_printing()) {
if (obj->is_in_extrusion_cali()) {
enable[ACTION_BTN_LOAD] = false;
enable[ACTION_BTN_UNLOAD] = false;
enable[ACTION_BTN_CALI] = true;
}
else {
enable[ACTION_BTN_CALI] = false;
}
}
else {
enable[ACTION_BTN_CALI] = true;
}
if (obj->is_in_printing() && !obj->can_resume()) {
@ -2943,53 +3007,64 @@ void StatusPanel::on_set_nozzle_temp()
}
}
void StatusPanel::on_set_chamber_temp()
{
wxString str = m_tempCtrl_chamber->GetTextCtrl()->GetValue();
try {
long chamber_temp;
if (str.ToLong(&chamber_temp) && obj) {
set_hold_count(m_temp_chamber_timeout);
obj->command_set_chamber(chamber_temp);
}
}
catch (...) {
;
}
}
void StatusPanel::on_ams_load(SimpleEvent &event)
{
BOOST_LOG_TRIVIAL(info) << "on_ams_load";
on_ams_load_curr();
}
void StatusPanel::update_filament_step()
{
m_ams_control->UpdateStepCtrl(obj->is_filament_at_extruder());
if (!obj->is_filament_at_extruder()) {
m_is_load_with_temp = true;
}
else {
m_is_load_with_temp = false;
}
}
void StatusPanel::on_ams_load_curr()
{
if (obj) {
std::string curr_ams_id = m_ams_control->GetCurentAms();
std::string curr_can_id = m_ams_control->GetCurrentCan(curr_ams_id);
m_ams_control->UpdateStepCtrl(obj->is_filament_at_extruder());
if(!obj->is_filament_at_extruder()){
m_is_load_with_temp = true;
}else{
m_is_load_with_temp = false;
}
update_filament_step();
//virtual tray
if (curr_ams_id.compare(std::to_string(VIRTUAL_TRAY_ID)) == 0) {
/*if (con_load_dlg == nullptr) {
con_load_dlg = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Confirm"));
con_load_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent& e) {*/
int old_temp = -1;
int new_temp = -1;
AmsTray* curr_tray = &obj->vt_tray;
int old_temp = -1;
int new_temp = -1;
AmsTray* curr_tray = &obj->vt_tray;
if (!curr_tray) return;
if (!curr_tray) return;
try {
if (!curr_tray->nozzle_temp_max.empty() && !curr_tray->nozzle_temp_min.empty())
old_temp = (atoi(curr_tray->nozzle_temp_min.c_str()) + atoi(curr_tray->nozzle_temp_max.c_str())) / 2;
if (!obj->vt_tray.nozzle_temp_max.empty() && !obj->vt_tray.nozzle_temp_min.empty())
new_temp = (atoi(obj->vt_tray.nozzle_temp_min.c_str()) + atoi(obj->vt_tray.nozzle_temp_max.c_str())) / 2;
}
catch (...) {
;
}
obj->command_ams_switch(VIRTUAL_TRAY_ID, old_temp, new_temp);
/*}
);
try {
if (!curr_tray->nozzle_temp_max.empty() && !curr_tray->nozzle_temp_min.empty())
old_temp = (atoi(curr_tray->nozzle_temp_min.c_str()) + atoi(curr_tray->nozzle_temp_max.c_str())) / 2;
if (!obj->vt_tray.nozzle_temp_max.empty() && !obj->vt_tray.nozzle_temp_min.empty())
new_temp = (atoi(obj->vt_tray.nozzle_temp_min.c_str()) + atoi(obj->vt_tray.nozzle_temp_max.c_str())) / 2;
}
con_load_dlg->update_text(_L("Please confirm the filament is ready?"));
con_load_dlg->on_show();*/
return;
catch (...) {
;
}
obj->command_ams_switch(VIRTUAL_TRAY_ID, old_temp, new_temp);
}
std::map<std::string, Ams*>::iterator it = obj->amsList.find(curr_ams_id);
@ -3303,7 +3378,6 @@ void StatusPanel::on_ams_selected(wxCommandEvent &event)
} catch (...) {
;
}
//update_ams_control_state(curr_ams_id, obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI));
}
}
}
@ -3355,6 +3429,18 @@ void StatusPanel::on_fan_changed(wxCommandEvent& event)
}
}
void StatusPanel::on_cham_temp_kill_focus(wxFocusEvent& event)
{
event.Skip();
cham_temp_input = false;
}
void StatusPanel::on_cham_temp_set_focus(wxFocusEvent& event)
{
event.Skip();
cham_temp_input = true;
}
void StatusPanel::on_bed_temp_kill_focus(wxFocusEvent &event)
{
event.Skip();
@ -3635,6 +3721,7 @@ void StatusPanel::set_default()
m_switch_lamp_timeout = 0;
m_temp_nozzle_timeout = 0;
m_temp_bed_timeout = 0;
m_temp_chamber_timeout = 0;
m_switch_nozzle_fan_timeout = 0;
m_switch_printing_fan_timeout = 0;
m_switch_cham_fan_timeout = 0;
@ -3645,7 +3732,7 @@ void StatusPanel::set_default()
m_bitmap_recording_img->Hide();
m_bitmap_vcamera_img->Hide();
m_setting_button->Show();
m_tempCtrl_frame->Show();
m_tempCtrl_chamber->Show();
m_options_btn->Show();
reset_temp_misc_control();
@ -3779,8 +3866,8 @@ void StatusPanel::msw_rescale()
m_line_nozzle->SetSize(wxSize(-1, FromDIP(1)));
m_tempCtrl_bed->SetMinSize(TEMP_CTRL_MIN_SIZE);
m_tempCtrl_bed->Rescale();
m_tempCtrl_frame->SetMinSize(TEMP_CTRL_MIN_SIZE);
m_tempCtrl_frame->Rescale();
m_tempCtrl_chamber->SetMinSize(TEMP_CTRL_MIN_SIZE);
m_tempCtrl_chamber->Rescale();
m_bitmap_speed.msw_rescale();
m_bitmap_speed_active.msw_rescale();

View file

@ -305,12 +305,13 @@ protected:
/* TempInput */
wxBoxSizer * m_misc_ctrl_sizer;
StaticBox* m_fan_panel;
TempInput * m_tempCtrl_nozzle;
int m_temp_nozzle_timeout {0};
StaticLine * m_line_nozzle;
TempInput* m_tempCtrl_nozzle;
int m_temp_nozzle_timeout{ 0 };
TempInput * m_tempCtrl_bed;
int m_temp_bed_timeout {0};
TempInput * m_tempCtrl_frame;
TempInput * m_tempCtrl_chamber;
int m_temp_chamber_timeout {0};
bool m_current_support_cham_fan{true};
FanSwitchButton *m_switch_nozzle_fan;
int m_switch_nozzle_fan_timeout{0};
@ -403,7 +404,7 @@ public:
wxBoxSizer *create_ams_group(wxWindow *parent);
wxBoxSizer *create_settings_group(wxWindow *parent);
void show_ams_group(bool show = true, bool support_virtual_tray = true, bool support_extrustion_cali = true);
void show_ams_group(bool show = true);
};
@ -446,6 +447,7 @@ protected:
wxWebRequest web_request;
bool bed_temp_input = false;
bool nozzle_temp_input = false;
bool cham_temp_input = false;
int speed_lvl = 1; // 0 - 3
int speed_lvl_timeout {0};
boost::posix_time::ptime speed_dismiss_time;
@ -489,9 +491,11 @@ protected:
void on_nozzle_temp_kill_focus(wxFocusEvent &event);
void on_nozzle_temp_set_focus(wxFocusEvent &event);
void on_set_nozzle_temp();
void on_set_chamber_temp();
/* extruder apis */
void on_ams_load(SimpleEvent &event);
void update_filament_step();
void on_ams_load_curr();
void on_ams_unload(SimpleEvent &event);
void on_ams_filament_backup(SimpleEvent& event);
@ -506,6 +510,8 @@ protected:
void on_print_error_func(wxCommandEvent& event);
void on_fan_changed(wxCommandEvent& event);
void on_cham_temp_kill_focus(wxFocusEvent& event);
void on_cham_temp_set_focus(wxFocusEvent& event);
void on_switch_speed(wxCommandEvent& event);
void on_lamp_switch(wxCommandEvent &event);
void on_printing_fan_switch(wxCommandEvent &event);
@ -539,7 +545,7 @@ protected:
void update_misc_ctrl(MachineObject *obj);
void update_ams(MachineObject* obj);
void update_extruder_status(MachineObject* obj);
void update_ams_control_state(bool is_support_virtual_tray, bool is_curr_tray_selected);
void update_ams_control_state(bool is_curr_tray_selected);
void update_cali(MachineObject* obj);
void reset_printing_values();

File diff suppressed because it is too large Load diff

View file

@ -13,6 +13,7 @@
#include <wx/animate.h>
#include <wx/dynarray.h>
#define AMS_CONTROL_BRAND_COLOUR wxColour(0, 174, 66)
#define AMS_CONTROL_GRAY700 wxColour(107, 107, 107)
#define AMS_CONTROL_GRAY800 wxColour(50, 58, 61)
@ -35,6 +36,12 @@
namespace Slic3r { namespace GUI {
enum AMSModel {
NO_AMS = 0,
GENERIC_AMS = 1,
EXTRA_AMS = 2
};
enum ActionButton {
ACTION_BTN_CALI = 0,
ACTION_BTN_LOAD = 1,
@ -105,6 +112,7 @@ enum FilamentStep {
STEP_PURGE_OLD_FILAMENT,
STEP_FEED_FILAMENT,
STEP_CONFIRM_EXTRUDED,
STEP_CHECK_POSITION,
STEP_COUNT,
};
@ -118,11 +126,11 @@ enum FilamentStepType {
#define AMS_ITEM_SIZE wxSize(FromDIP(82), FromDIP(27))
#define AMS_ITEM_HUMIDITY_SIZE wxSize(FromDIP(120), FromDIP(27))
#define AMS_CAN_LIB_SIZE wxSize(FromDIP(58), FromDIP(80))
#define AMS_CAN_ROAD_SIZE wxSize(FromDIP(66), FromDIP(60))
#define AMS_CAN_ROAD_SIZE wxSize(FromDIP(66), FromDIP(70))
#define AMS_CAN_ITEM_HEIGHT_SIZE FromDIP(27)
#define AMS_CANS_SIZE wxSize(FromDIP(284), FromDIP(186))
#define AMS_CANS_WINDOW_SIZE wxSize(FromDIP(264), FromDIP(186))
#define AMS_STEP_SIZE wxSize(FromDIP(172), FromDIP(186))
#define AMS_CANS_SIZE wxSize(FromDIP(284), FromDIP(196))
#define AMS_CANS_WINDOW_SIZE wxSize(FromDIP(264), FromDIP(196))
#define AMS_STEP_SIZE wxSize(FromDIP(172), FromDIP(196))
#define AMS_REFRESH_SIZE wxSize(FromDIP(30), FromDIP(30))
#define AMS_EXTRUDER_SIZE wxSize(FromDIP(86), FromDIP(72))
#define AMS_EXTRUDER_BITMAP_SIZE wxSize(FromDIP(36), FromDIP(55))
@ -161,8 +169,8 @@ class AMSrefresh : public wxWindow
{
public:
AMSrefresh();
AMSrefresh(wxWindow *parent, wxWindowID id, wxString number, Caninfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
AMSrefresh(wxWindow *parent, wxWindowID id, int number, Caninfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
AMSrefresh(wxWindow *parent, wxString number, Caninfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
AMSrefresh(wxWindow *parent, int number, Caninfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
~AMSrefresh();
void PlayLoading();
void StopLoading();
@ -243,7 +251,7 @@ public:
void has_ams(bool hams) {m_has_vams = hams; Refresh();};
void no_ams_mode(bool mode) {m_none_ams_mode = mode; Refresh();};
bool m_none_ams_mode{false};
bool m_none_ams_mode{true};
bool m_has_vams{false};
bool m_vams_loading{false};
bool m_ams_loading{false};
@ -284,13 +292,15 @@ Description:AMSLib
class AMSLib : public wxWindow
{
public:
AMSLib(wxWindow *parent, wxWindowID id, Caninfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
AMSLib(wxWindow *parent, Caninfo info);
void create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
public:
wxColour GetLibColour();
Caninfo m_info;
MachineObject* m_obj = {nullptr};
int m_can_index;
int m_can_index = 0;
AMSModel m_ams_model;
void Update(Caninfo info, bool refresh = true);
void UnableSelected() { m_unable_selected = true; };
void EableSelected() { m_unable_selected = false; };
@ -303,7 +313,7 @@ public:
virtual bool Enable(bool enable = true);
void set_disable_mode(bool disable) { m_disable_mode = disable; }
void msw_rescale();
void on_pass_road(bool pass);
protected:
wxStaticBitmap *m_edit_bitmp = {nullptr};
@ -314,6 +324,15 @@ protected:
ScalableBitmap m_bitmap_readonly_light;
ScalableBitmap m_bitmap_transparent;
ScalableBitmap m_bitmap_extra_tray_left;
ScalableBitmap m_bitmap_extra_tray_right;
ScalableBitmap m_bitmap_extra_tray_left_hover;
ScalableBitmap m_bitmap_extra_tray_right_hover;
ScalableBitmap m_bitmap_extra_tray_left_selected;
ScalableBitmap m_bitmap_extra_tray_right_selected;
bool m_unable_selected = {false};
bool m_enable = {false};
bool m_selected = {false};
@ -326,13 +345,18 @@ protected:
wxColour m_road_def_color;
wxColour m_lib_color;
bool m_disable_mode{ false };
bool m_pass_road{false};
void on_enter_window(wxMouseEvent &evt);
void on_leave_window(wxMouseEvent &evt);
void on_left_down(wxMouseEvent &evt);
void paintEvent(wxPaintEvent &evt);
void render(wxDC &dc);
void doRender(wxDC &dc);
void render_extra_text(wxDC& dc);
void render_generic_text(wxDC& dc);
void doRender(wxDC& dc);
void render_extra_lib(wxDC& dc);
void render_generic_lib(wxDC& dc);
};
/*************************************************
@ -364,9 +388,11 @@ public:
ScalableBitmap ams_humidity_3;
ScalableBitmap ams_humidity_4;
int m_humidity = { 0 };
bool m_show_humidity = { false };
bool m_vams_loading{false};
AMSModel m_ams_model;
void OnVamsLoading(bool load, wxColour col = AMS_CONTROL_GRAY500);
void SetPassRoadColour(wxColour col);
@ -399,9 +425,6 @@ public:
void OnLeaveWindow(wxMouseEvent &evt);
void OnSelected();
void UnSelected();
void ShowHumidity();
void HideHumidity();
void SetHumidity(int humidity);
virtual bool Enable(bool enable = true);
AMSinfo m_amsinfo;
@ -413,8 +436,6 @@ protected:
int m_space = {5};
bool m_hover = {false};
bool m_selected = {false};
bool m_show_humidity = {false};
int m_humidity = {0};
ScalableBitmap* m_ts_bitmap_cube;
void paintEvent(wxPaintEvent &evt);
@ -455,32 +476,45 @@ class AmsCans : public wxWindow
{
public:
AmsCans();
AmsCans(wxWindow *parent, wxWindowID id, AMSinfo info, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
AmsCans(wxWindow *parent, AMSinfo info, AMSModel model);
void Update(AMSinfo info);
void create(wxWindow *parent, wxWindowID id, AMSinfo info, const wxPoint &pos, const wxSize &size);
void AddCan(Caninfo caninfo, int canindex, int maxcan);
void create(wxWindow *parent);
void AddCan(Caninfo caninfo, int canindex, int maxcan, wxBoxSizer* sizer);
void SetDefSelectCan();
void SelectCan(std::string canid);
wxColour GetTagColr(wxString canid);
void SetAmsStep(wxString canid, AMSPassRoadType type, AMSPassRoadSTEP step);
//wxColour GetCanColour(wxString canid);
void PlayRridLoading(wxString canid);
void StopRridLoading(wxString canid);
void msw_rescale();
void show_sn_value(bool show);
void SetAmsStepExtra(wxString canid, AMSPassRoadType type, AMSPassRoadSTEP step);
void SetAmsStep(wxString canid, AMSPassRoadType type, AMSPassRoadSTEP step);
void SetAmsStep(std::string can_id);
void paintEvent(wxPaintEvent& evt);
void render(wxDC& dc);
void doRender(wxDC& dc);
wxColour GetTagColr(wxString canid);
std::string GetCurrentCan();
public:
ScalableBitmap m_bitmap_extra_framework;
int m_canlib_selection = { -1 };
int m_selection = { 0 };
int m_can_count = { 0 };
AMSModel m_ams_model;
std::string m_canlib_id;
int m_canlib_selection = {-1};
int m_selection = {0};
int m_can_count = {0};
std::string m_road_canid;
wxColour m_road_colour;
CanLibsHash m_can_lib_list;
CansRoadsHash m_can_road_list;
CanrefreshsHash m_can_refresh_list;
AMSinfo m_info;
wxBoxSizer * sizer_can = {nullptr};
wxBoxSizer * sizer_can_middle = {nullptr};
wxBoxSizer * sizer_can_left = {nullptr};
wxBoxSizer * sizer_can_right = {nullptr};
AMSPassRoadSTEP m_step = {AMSPassRoadSTEP ::AMS_ROAD_STEP_NONE};
};
@ -532,16 +566,16 @@ public:
void init_scaled_buttons();
protected:
int m_ams_count = {0};
std::map<std::string, int> m_ams_selection;
std::vector<AMSinfo> m_ams_info;
std::string m_current_ams;
std::string m_current_show_ams;
std::map<std::string, int> m_ams_selection;
AmsItemsHash m_ams_item_list;
std::vector<AMSinfo> m_ams_info;
AmsCansHash m_ams_cans_list;
AmsCansHash m_ams_generic_cans_list;
AmsCansHash m_ams_extra_cans_list;
AMSextruder *m_extruder = {nullptr};
@ -551,7 +585,10 @@ protected:
wxSimplebook *m_simplebook_calibration = {nullptr};
wxSimplebook *m_simplebook_amsitems = {nullptr};
wxSimplebook *m_simplebook_ams = {nullptr};
wxSimplebook *m_simplebook_cans = {nullptr};
wxSimplebook *m_simplebook_generic_cans= {nullptr};
wxSimplebook *m_simplebook_extra_cans = {nullptr};
wxSimplebook *m_simplebook_bottom = {nullptr};
wxStaticText *m_tip_right_top = {nullptr};
@ -564,6 +601,8 @@ protected:
wxBoxSizer* m_sizer_vams_tips = {nullptr};
Label* m_ams_backup_tip = {nullptr};
Label* m_ams_tip = {nullptr};
Caninfo m_vams_info;
StaticBox* m_panel_virtual = {nullptr};
AMSLib* m_vams_lib = {nullptr};
@ -584,6 +623,8 @@ protected:
Button *m_button_extruder_back = {nullptr};
wxStaticBitmap* m_button_ams_setting = {nullptr};
wxStaticBitmap* m_img_ams_backup = {nullptr};
wxStaticBitmap* m_img_amsmapping_tip = {nullptr};
wxStaticBitmap* m_img_vams_tip = {nullptr};
ScalableBitmap m_button_ams_setting_normal;
ScalableBitmap m_button_ams_setting_hover;
ScalableBitmap m_button_ams_setting_press;
@ -597,16 +638,23 @@ protected:
std::string m_last_ams_id;
std::string m_last_tray_id;
public:
std::string GetCurentAms();
std::string GetCurentShowAms();
std::string GetCurrentCan(std::string amsid);
wxColour GetCanColour(std::string amsid, std::string canid);
bool m_is_none_ams_mode{false};
AMSModel m_ams_model{AMSModel::NO_AMS};
AMSModel m_ext_model{AMSModel::NO_AMS};
AMSModel m_is_none_ams_mode{AMSModel::NO_AMS};
void SetAmsModel(AMSModel mode, AMSModel ext_mode) {m_ams_model = mode; m_ext_model = ext_mode;};
void SetActionState(bool button_status[]);
void EnterNoneAMSMode();
void ExitNoneAMSMode();
void EnterNoneAMSMode(bool support_vt_load = false);
void EnterGenericAMSMode();
void EnterExtraAMSMode();
void EnterCalibrationMode(bool read_to_calibration);
void ExitcClibrationMode();
@ -617,15 +665,16 @@ public:
void PlayRridLoading(wxString amsid, wxString canid);
void StopRridLoading(wxString amsid, wxString canid);
void SetFilamentStep(int item_idx, FilamentStepType f_type, bool is_extrusion_exist = false);
void SetFilamentStep(int item_idx, FilamentStepType f_type);
void ShowFilamentTip(bool hasams = true);
void SetHumidity(std::string amsid, int humidity);
void UpdateStepCtrl(bool is_extrusion_exist);
void CreateAms();
void UpdateAms(std::vector<AMSinfo> info, bool keep_selection = true, bool has_extrusion_cali = true, bool is_reset = false);
void AddAms(AMSinfo info, bool refresh = true);
void SetExtruder(bool on_off, bool is_vams, wxColour col);
void UpdateAms(std::vector<AMSinfo> info, bool keep_selection = true, bool is_reset = false);
void AddAms(AMSinfo info);
void AddAmsItems(AMSinfo info);
void AddExtraAms(AMSinfo info);
void SetExtruder(bool on_off, bool is_vams, std::string ams_now, wxColour col);
void SetAmsStep(std::string ams_id, std::string canid, AMSPassRoadType type, AMSPassRoadSTEP step);
void SwitchAms(std::string ams_id);
@ -639,7 +688,7 @@ public:
void on_clibration_cancel_click(wxMouseEvent &event);
void Reset();
void show_noams_mode(bool show, bool support_virtual_tray, bool support_extrustion_cali);
void show_noams_mode();
void show_auto_refill(bool show);
void show_vams(bool show);
void show_vams_kn_value(bool show);

View file

@ -87,6 +87,19 @@ wxString StepCtrlBase::GetItemText(unsigned int item) const
return item < steps.size() ? steps[item] : wxString{};
}
int StepCtrlBase::GetItemUseText(wxString txt) const
{
for(int i = 0; i < steps.size(); i++){
if (steps[i] == txt) {
return i;
}
else {
continue;
}
}
return 0;
}
void StepCtrlBase::SetItemText(unsigned int item, wxString const &value)
{
if (item >= steps.size()) return;

View file

@ -53,7 +53,8 @@ public:
void Idle();
wxString GetItemText(unsigned int item) const;
void SetItemText(unsigned int item, wxString const &value);
int GetItemUseText(wxString txt) const;
void SetItemText(unsigned int item, wxString const& value);
private:
// some useful events