NEW:using new humidity display ui

jira:[STUDIO-5967]

Change-Id: I13be4212e6b97f646d21e0af64cbc5006753fdeb
This commit is contained in:
tao wang 2024-01-31 20:37:15 +08:00 committed by Lane.Wei
parent 64c7487abb
commit 27843c1601
16 changed files with 280 additions and 118 deletions

View File

@ -0,0 +1,5 @@
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.3138 49.5304C18.141 48.8671 14.2354 46.8575 11.5738 44.1788C13.8731 43.957 17.1373 43.7528 21.055 43.7528C25.2295 43.7528 27.2363 44.4204 29.1658 45.0624C30.9522 45.6567 32.6723 46.2289 35.985 46.2289C37.3004 46.2289 38.6419 46.1036 39.9535 45.8978C37.5851 47.6742 34.524 49.0115 30.7176 49.5304H23.3138Z" fill="#23A4DC"/>
<path d="M7.27356 34.0043C7.27356 26.2915 22.6691 1.65861 27.1318 1.65881C31.5946 1.65902 46.3211 27.3924 46.3211 34.0043C46.3211 40.6163 40.4668 49.7663 27.1318 49.7663C13.7969 49.7663 7.27356 41.7171 7.27356 34.0043Z" stroke="#E1E1E1" stroke-width="1.65888"/>
<path d="M19.2165 22.3651V18.2146L25.9051 14.4224H29.2793V36.3096H24.8899V19.1999L19.2165 22.3651Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 856 B

View File

@ -0,0 +1,5 @@
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.3138 49.5304C18.141 48.8671 14.2354 46.8575 11.5738 44.1788C13.8731 43.957 17.1373 43.7528 21.055 43.7528C25.2295 43.7528 27.2363 44.4204 29.1658 45.0624C30.9522 45.6567 32.6723 46.2289 35.985 46.2289C37.3004 46.2289 38.6419 46.1036 39.9535 45.8978C37.5851 47.6742 34.524 49.0115 30.7176 49.5304H23.3138Z" fill="#94DFFF"/>
<path d="M7.27356 34.0043C7.27356 26.2915 22.6691 1.65861 27.1318 1.65881C31.5946 1.65902 46.3211 27.3924 46.3211 34.0043C46.3211 40.6163 40.4668 49.7663 27.1318 49.7663C13.7969 49.7663 7.27356 41.7171 7.27356 34.0043Z" stroke="#858585" stroke-width="1.65888"/>
<path d="M19.2165 22.3651V18.2146L25.9051 14.4224H29.2793V36.3096H24.8899V19.1999L19.2165 22.3651Z" fill="#858585"/>
</svg>

After

Width:  |  Height:  |  Size: 858 B

View File

@ -0,0 +1,5 @@
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M45.7087 38.3055C43.8031 44.0795 37.9192 50.0033 27.2161 50.0033C16.4344 50.0033 10.1056 44.7155 8.07727 38.5938L8.50623 38.3615C8.86449 38.2887 9.28631 38.1478 9.80471 37.9747C11.502 37.4079 14.2347 36.4952 19.1613 36.4952C23.3358 36.4952 25.8759 37.5016 28.3182 38.4693C30.5793 39.3651 32.7565 40.2277 36.0692 40.2277C39.4226 40.2277 42.946 39.3069 45.7087 38.3055Z" fill="#23A4DC"/>
<path d="M7.35773 34.1636C7.35773 26.4128 22.7533 1.65861 27.216 1.65881C31.6787 1.65902 46.4052 27.5191 46.4052 34.1636C46.4052 40.8082 40.551 50.0033 27.216 50.0033C13.8811 50.0033 7.35773 41.9145 7.35773 34.1636Z" stroke="#E1E1E1" stroke-width="1.65888"/>
<path d="M26.1253 34.1844H34.8742V37.9766H19.795V35.1698L26.3941 27.7646C27.5287 26.4905 28.315 25.4952 28.753 24.7786C29.2108 24.042 29.4398 23.2856 29.4398 22.5092C29.4398 21.6532 29.2009 20.9665 28.7231 20.4489C28.2454 19.9313 27.5984 19.6725 26.7822 19.6725C25.9462 19.6725 25.2096 19.9811 24.5726 20.5982C23.9356 21.1954 23.4479 22.0514 23.1095 23.1661L19.7054 21.1954C20.223 19.4237 21.1586 18.0701 22.5123 17.1344C23.8659 16.1789 25.4286 15.7012 27.2003 15.7012C28.5937 15.7012 29.7981 15.9898 30.8133 16.5671C31.8484 17.1245 32.6348 17.9008 33.1722 18.8962C33.7296 19.8915 34.0083 21.0262 34.0083 22.3002C34.0083 23.5543 33.6998 24.7288 33.0827 25.8237C32.4855 26.8986 31.4105 28.302 29.8578 30.0339L26.1253 34.1844Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,5 @@
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M45.7887 38.3055C43.8831 44.0795 37.9992 50.0033 27.296 50.0033C16.5143 50.0033 10.1855 44.7155 8.15723 38.5938L8.58618 38.3615C8.94444 38.2887 9.36627 38.1478 9.88467 37.9747C11.582 37.4079 14.3146 36.4952 19.2413 36.4952C23.4157 36.4952 25.9558 37.5016 28.3981 38.4693C30.6592 39.3651 32.8365 40.2277 36.1491 40.2277C39.5025 40.2277 43.026 39.3069 45.7887 38.3055Z" fill="#94DFFF"/>
<path d="M7.43774 34.1636C7.43774 26.4128 22.8333 1.65861 27.296 1.65881C31.7587 1.65902 46.4852 27.5191 46.4852 34.1636C46.4852 40.8082 40.631 50.0033 27.296 50.0033C13.9611 50.0033 7.43774 41.9145 7.43774 34.1636Z" stroke="#858585" stroke-width="1.65888"/>
<path d="M26.2053 34.1844H34.9542V37.9766H19.875V35.1698L26.474 27.7646C27.6087 26.4905 28.395 25.4952 28.8329 24.7786C29.2908 24.042 29.5197 23.2856 29.5197 22.5092C29.5197 21.6532 29.2808 20.9665 28.8031 20.4489C28.3253 19.9313 27.6784 19.6725 26.8622 19.6725C26.0261 19.6725 25.2896 19.9811 24.6526 20.5982C24.0155 21.1954 23.5278 22.0514 23.1894 23.1661L19.7854 21.1954C20.303 19.4237 21.2386 18.0701 22.5922 17.1344C23.9459 16.1789 25.5085 15.7012 27.2802 15.7012C28.6737 15.7012 29.878 15.9898 30.8933 16.5671C31.9284 17.1245 32.7147 17.9008 33.2522 18.8962C33.8096 19.8915 34.0883 21.0262 34.0883 22.3002C34.0883 23.5543 33.7797 24.7288 33.1626 25.8237C32.5654 26.8986 31.4905 28.302 29.9377 30.0339L26.2053 34.1844Z" fill="#858585"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,5 @@
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.64204 26.4449C8.28847 29.5938 7.44196 32.3462 7.44196 34.1636C7.44196 41.1348 12.719 48.3795 23.4827 49.7664H30.8854C41.6905 48.2863 46.4895 40.1796 46.4895 34.1636C46.4895 32.6462 45.7214 30.1266 44.483 27.1418C41.9625 27.9536 38.9968 28.6157 36.1533 28.6157C32.8407 28.6157 30.6634 27.753 28.4023 26.8572C25.96 25.8896 23.4199 24.8832 19.2455 24.8832C14.3189 24.8832 11.5862 25.7958 9.88887 26.3626C9.80406 26.391 9.72183 26.4184 9.64204 26.4449Z" fill="#23A4DC"/>
<path d="M7.44189 34.1636C7.44189 26.4128 22.8374 1.65861 27.3002 1.65881C31.7629 1.65902 46.4894 27.5191 46.4894 34.1636C46.4894 40.8082 40.6351 50.0033 27.3002 50.0033C13.9652 50.0033 7.44189 41.9145 7.44189 34.1636Z" stroke="#E1E1E1" stroke-width="1.65888"/>
<path d="M31.0468 26.5702C32.2611 27.028 33.1867 27.7048 33.8237 28.6006C34.4608 29.4765 34.7793 30.5714 34.7793 31.8852C34.7793 33.2389 34.4309 34.4034 33.7342 35.3788C33.0573 36.3343 32.1317 37.0709 30.9572 37.5884C29.8026 38.0861 28.5186 38.3349 27.1053 38.3349C25.2938 38.3349 23.7112 37.9069 22.3576 37.051C21.0238 36.195 20.0783 34.9508 19.5209 33.3185L22.9548 31.3477C23.2733 32.3829 23.8008 33.1692 24.5373 33.7067C25.2739 34.2242 26.1 34.483 27.0157 34.483C27.9115 34.483 28.658 34.2242 29.2552 33.7067C29.8723 33.1891 30.1808 32.4725 30.1808 31.5568C30.1808 29.5462 28.648 28.5409 25.5824 28.5409H24.7762V24.9577H25.9407C27.0754 24.9577 27.9414 24.689 28.5385 24.1515C29.1557 23.5941 29.4642 22.9073 29.4642 22.0912C29.4642 21.3347 29.2154 20.7276 28.7177 20.2697C28.22 19.8119 27.5731 19.583 26.7768 19.583C25.9208 19.583 25.1743 19.8616 24.5373 20.419C23.9202 20.9565 23.4425 21.7329 23.1041 22.7481L19.8195 20.8669C20.337 19.1948 21.2428 17.9208 22.5367 17.0449C23.8306 16.1491 25.3635 15.7012 27.1351 15.7012C28.5087 15.7012 29.713 15.96 30.7482 16.4775C31.8032 16.9752 32.6194 17.6819 33.1967 18.5976C33.774 19.5133 34.0626 20.5683 34.0626 21.7627C34.0626 22.8775 33.8038 23.843 33.2863 24.6591C32.7886 25.4753 32.0421 26.1123 31.0468 26.5702Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,5 @@
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.80207 26.4449C8.4485 29.5938 7.60199 32.3462 7.60199 34.1636C7.60199 41.1348 12.879 48.3795 23.6428 49.7664H31.0454C41.8505 48.2863 46.6495 40.1796 46.6495 34.1636C46.6495 32.6462 45.8815 30.1266 44.643 27.1418C42.1225 27.9536 39.1568 28.6157 36.3134 28.6157C33.0007 28.6157 30.8235 27.753 28.5624 26.8572C26.1201 25.8896 23.58 24.8832 19.4055 24.8832C14.4789 24.8832 11.7462 25.7958 10.0489 26.3626C9.96409 26.391 9.88186 26.4184 9.80207 26.4449Z" fill="#94DFFF"/>
<path d="M7.60193 34.1636C7.60193 26.4128 22.9975 1.65861 27.4602 1.65881C31.9229 1.65902 46.6494 27.5191 46.6494 34.1636C46.6494 40.8082 40.7952 50.0033 27.4602 50.0033C14.1253 50.0033 7.60193 41.9145 7.60193 34.1636Z" stroke="#858585" stroke-width="1.65888"/>
<path d="M31.2068 26.5702C32.4211 27.028 33.3468 27.7048 33.9838 28.6006C34.6208 29.4765 34.9393 30.5714 34.9393 31.8852C34.9393 33.2389 34.5909 34.4034 33.8942 35.3788C33.2174 36.3343 32.2917 37.0709 31.1172 37.5884C29.9626 38.0861 28.6787 38.3349 27.2653 38.3349C25.4538 38.3349 23.8712 37.9069 22.5176 37.051C21.1839 36.195 20.2383 34.9508 19.6809 33.3185L23.1148 31.3477C23.4333 32.3829 23.9608 33.1692 24.6974 33.7067C25.4339 34.2242 26.26 34.483 27.1757 34.483C28.0715 34.483 28.818 34.2242 29.4152 33.7067C30.0323 33.1891 30.3409 32.4725 30.3409 31.5568C30.3409 29.5462 28.8081 28.5409 25.7425 28.5409H24.9362V24.9577H26.1008C27.2355 24.9577 28.1014 24.689 28.6986 24.1515C29.3157 23.5941 29.6242 22.9073 29.6242 22.0912C29.6242 21.3347 29.3754 20.7276 28.8777 20.2697C28.3801 19.8119 27.7331 19.583 26.9369 19.583C26.0809 19.583 25.3344 19.8616 24.6974 20.419C24.0803 20.9565 23.6025 21.7329 23.2641 22.7481L19.9795 20.8669C20.4971 19.1948 21.4028 17.9208 22.6968 17.0449C23.9907 16.1491 25.5235 15.7012 27.2952 15.7012C28.6687 15.7012 29.8731 15.96 30.9082 16.4775C31.9633 16.9752 32.7794 17.6819 33.3567 18.5976C33.934 19.5133 34.2227 20.5683 34.2227 21.7627C34.2227 22.8775 33.9639 23.843 33.4463 24.6591C32.9486 25.4753 32.2021 26.1123 31.2068 26.5702Z" fill="#858585"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,5 @@
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.8175 13.3563C11.9964 20.8736 7.52618 29.9871 7.52618 34.1636C7.52618 41.1346 12.8028 48.379 23.5658 49.7662H30.9707C41.775 48.2858 46.5737 40.1794 46.5737 34.1636C46.5737 31.0432 43.3257 23.6847 39.4182 16.757C38.3605 16.9125 37.2906 17.0034 36.2376 17.0034C32.9249 17.0034 30.7477 16.1407 28.4866 15.2449C26.0443 14.2773 23.5042 13.2709 19.3297 13.2709C18.4199 13.2709 17.585 13.302 16.8175 13.3563Z" fill="#23A4DC"/>
<path d="M7.52612 34.1636C7.52612 26.4128 22.9217 1.65861 27.3844 1.65881C31.8471 1.65902 46.5736 27.5191 46.5736 34.1636C46.5736 40.8082 40.7193 50.0033 27.3844 50.0033C14.0495 50.0033 7.52612 41.9145 7.52612 34.1636Z" stroke="#E1E1E1" stroke-width="1.65888"/>
<path d="M32.1614 24.7189V29.8249H35.1176V33.5275H32.1614V37.9766H27.9213V33.5275H18.5453V30.5714L26.07 16.0894H30.6087L23.4125 29.8249H27.9213V24.7189H32.1614Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1014 B

View File

@ -0,0 +1,5 @@
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.0576 13.3563C12.2364 20.8736 7.76624 29.9871 7.76624 34.1636C7.76624 41.1346 13.0429 48.379 23.8059 49.7662H31.2107C42.0151 48.2858 46.8137 40.1794 46.8137 34.1636C46.8137 31.0432 43.5658 23.6847 39.6583 16.757C38.6005 16.9125 37.5307 17.0034 36.4776 17.0034C33.165 17.0034 30.9877 16.1407 28.7266 15.2449C26.2843 14.2773 23.7442 13.2709 19.5698 13.2709C18.66 13.2709 17.825 13.302 17.0576 13.3563Z" fill="#94DFFF"/>
<path d="M7.76617 34.1636C7.76617 26.4128 23.1617 1.65861 27.6245 1.65881C32.0872 1.65902 46.8137 27.5191 46.8137 34.1636C46.8137 40.8082 40.9594 50.0033 27.6245 50.0033C14.2895 50.0033 7.76617 41.9145 7.76617 34.1636Z" stroke="#858585" stroke-width="1.65888"/>
<path d="M32.4015 24.7189V29.8249H35.3576V33.5275H32.4015V37.9766H28.1614V33.5275H18.7854V30.5714L26.3101 16.0894H30.8488L23.6526 29.8249H28.1614V24.7189H32.4015Z" fill="#858585"/>
</svg>

After

Width:  |  Height:  |  Size: 1016 B

View File

@ -0,0 +1,5 @@
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.27356 34.1636C7.27356 26.4128 22.6691 1.65861 27.1318 1.65881C31.5946 1.65902 46.3211 27.5191 46.3211 34.1636C46.3211 40.8082 40.4668 50.0033 27.1318 50.0033C13.7969 50.0033 7.27356 41.9145 7.27356 34.1636Z" fill="#23A4DC"/>
<path d="M7.27356 34.1636C7.27356 26.4128 22.6691 1.65861 27.1318 1.65881C31.5946 1.65902 46.3211 27.5191 46.3211 34.1636C46.3211 40.8082 40.4668 50.0033 27.1318 50.0033C13.7969 50.0033 7.27356 41.9145 7.27356 34.1636Z" stroke="#E1E1E1" stroke-width="1.65888"/>
<path d="M27.8328 23.7633C29.0869 23.7633 30.2315 24.0619 31.2667 24.6591C32.3018 25.2364 33.118 26.0725 33.7152 27.1674C34.3124 28.2423 34.611 29.4865 34.611 30.8998C34.611 32.4326 34.2725 33.7664 33.5957 34.9011C32.9388 36.0158 32.0331 36.8718 30.8785 37.469C29.7239 38.0463 28.4499 38.3349 27.0564 38.3349C25.4042 38.3349 23.9709 37.9567 22.7566 37.2003C21.5622 36.4438 20.7162 35.2992 20.2185 33.7664L23.7121 31.7658C23.9709 32.6616 24.3889 33.3384 24.9662 33.7962C25.5435 34.2541 26.2203 34.483 26.9967 34.483C27.9721 34.483 28.7186 34.1645 29.2362 33.5275C29.7737 32.8706 30.0424 32.0445 30.0424 31.0491C30.0424 30.0538 29.7637 29.2277 29.2063 28.5708C28.6688 27.8939 27.8925 27.5555 26.8773 27.5555C25.5634 27.5555 24.5183 28.2025 23.742 29.4964L20.6365 27.9736L22.1295 16.0894H33.5957V19.792H25.7724L25.1752 24.3008C26.0312 23.9425 26.9171 23.7633 27.8328 23.7633Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,5 @@
<svg width="54" height="54" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.61029 34.1636C7.61029 26.4128 23.0058 1.65861 27.4686 1.65881C31.9313 1.65902 46.6578 27.5191 46.6578 34.1636C46.6578 40.8082 40.8035 50.0033 27.4686 50.0033C14.1336 50.0033 7.61029 41.9145 7.61029 34.1636Z" fill="#94DFFF"/>
<path d="M7.61029 34.1636C7.61029 26.4128 23.0058 1.65861 27.4686 1.65881C31.9313 1.65902 46.6578 27.5191 46.6578 34.1636C46.6578 40.8082 40.8035 50.0033 27.4686 50.0033C14.1336 50.0033 7.61029 41.9145 7.61029 34.1636Z" stroke="#858585" stroke-width="1.65888"/>
<path d="M28.1695 23.7633C29.4236 23.7633 30.5682 24.0619 31.6034 24.6591C32.6385 25.2364 33.4547 26.0725 34.0519 27.1674C34.6491 28.2423 34.9477 29.4865 34.9477 30.8998C34.9477 32.4326 34.6093 33.7664 33.9324 34.9011C33.2755 36.0158 32.3698 36.8718 31.2152 37.469C30.0606 38.0463 28.7866 38.3349 27.3931 38.3349C25.7409 38.3349 24.3076 37.9567 23.0933 37.2003C21.8989 36.4438 21.0529 35.2992 20.5552 33.7664L24.0488 31.7658C24.3076 32.6616 24.7257 33.3384 25.303 33.7962C25.8802 34.2541 26.5571 34.483 27.3334 34.483C28.3088 34.483 29.0553 34.1645 29.5729 33.5275C30.1104 32.8706 30.3791 32.0445 30.3791 31.0491C30.3791 30.0538 30.1004 29.2277 29.5431 28.5708C29.0056 27.8939 28.2292 27.5555 27.214 27.5555C25.9002 27.5555 24.8551 28.2025 24.0787 29.4964L20.9733 27.9736L22.4663 16.0894H33.9324V19.792H26.1092L25.512 24.3008C26.368 23.9425 27.2538 23.7633 28.1695 23.7633Z" fill="#858585"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,4 @@
<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M23.3261 1.12596L0.961108 23.4909" stroke="#828280" stroke-linecap="round"/>
<line x1="0.707107" y1="1" x2="23.3264" y2="23.6193" stroke="#828280" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -803,98 +803,52 @@ AmsHumidityTipPopup::AmsHumidityTipPopup(wxWindow* parent)
{ {
SetBackgroundColour(*wxWHITE); SetBackgroundColour(*wxWHITE);
wxBoxSizer* main_sizer; wxBoxSizer* main_sizer = new wxBoxSizer(wxVERTICAL);
main_sizer = new wxBoxSizer(wxVERTICAL);
close_img = ScalableBitmap(this, "hum_popup_close", FromDIP(24));
main_sizer->Add(0, 0, 0, wxTOP, 28); m_staticText = new Label(this, _L("Current Cabin humidity"));
m_staticText->SetFont(::Label::Head_24);
wxBoxSizer* m_sizer_body; humidity_level_list = new AmsHumidityLevelList(this);
m_sizer_body = new wxBoxSizer(wxHORIZONTAL); curr_humidity_img = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("hum_level1_light", this, FromDIP(132)), wxDefaultPosition, wxSize(FromDIP(132), FromDIP(132)), 0);
m_img = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("ams_humidity_tips", this, 125), wxDefaultPosition, wxSize(FromDIP(125), FromDIP(145)), 0); m_staticText_note = new Label(this, _L("Please change the desiccant when it is too wet. The indicator may not represent accurately in following cases : when the lid is open or the desiccant pack is changed. it take hours to absorb the moisture, low temperatures also slow down the process."));
m_staticText_note->SetMinSize(wxSize(FromDIP(680), -1));
m_staticText_note->SetMaxSize(wxSize(FromDIP(680), -1));
m_staticText_note->Wrap(FromDIP(680));
m_sizer_body->Add(m_img, 0, wxEXPAND | wxALL, 2);
m_sizer_body->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(18));
wxBoxSizer* m_sizer_tips = new wxBoxSizer(wxVERTICAL);
m_staticText1 = new Label(this, _L("Cabin humidity"));
m_staticText1->SetFont(::Label::Head_13);
m_staticText2 = new Label(this, _L("Green means that AMS humidity is normal, orange represents humidity is high, red represents humidity is too high.(Hygrometer: lower the better.)"));
m_staticText2->SetFont(::Label::Body_13);
m_staticText2->SetSize(wxSize(FromDIP(357), -1));
m_staticText2->SetMinSize(wxSize(FromDIP(357), -1));
m_staticText2->SetMaxSize(wxSize(FromDIP(357), -1));
m_staticText2->Wrap(FromDIP(357));
m_staticText3 = new Label(this, _L("Desiccant status"));
m_staticText3->SetFont(::Label::Head_13);
m_staticText4 = new Label(this, _L("A desiccant status lower than two bars indicates that desiccant may be inactive. Please change the desiccant.(The bars: higher the better.)"));
m_staticText4->SetFont(::Label::Body_13);
m_staticText4->SetSize(wxSize(FromDIP(357), -1));
m_staticText4->SetMinSize(wxSize(FromDIP(357), -1));
m_staticText4->SetMaxSize(wxSize(FromDIP(357), -1));
m_staticText4->Wrap(FromDIP(357));
m_sizer_tips->Add(m_staticText1, 0, wxLEFT|wxRIGHT, 3);
m_sizer_tips->Add(0,0,0,wxTOP,2);
m_sizer_tips->Add(m_staticText2, 0, wxLEFT|wxRIGHT, 3);
m_sizer_tips->Add(0,0,0,wxTOP,8);
m_sizer_tips->Add(m_staticText3, 0, wxLEFT|wxRIGHT, 3);
m_sizer_tips->Add(0,0,0,wxTOP,2);
m_sizer_tips->Add(m_staticText4, 0, wxLEFT|wxRIGHT, 3);
m_sizer_body->Add(m_sizer_tips, 0, wxEXPAND, 0);
main_sizer->Add(m_sizer_body, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
m_staticText_note = new Label(this, _L("Note: When the lid is open or the desiccant pack is changed, it can take hours or a night to absorb the moisture. Low temperatures also slow down the process. During this time, the indicator may not represent the chamber accurately."));
m_staticText4->SetFont(::Label::Body_13);
m_staticText_note->SetMinSize(wxSize(FromDIP(523), -1));
m_staticText_note->SetMaxSize(wxSize(FromDIP(523), -1));
m_staticText_note->Wrap(FromDIP(523));
main_sizer->Add(m_staticText_note, 0, wxALL | wxLEFT | wxRIGHT, 22);
m_button_confirm = new Button(this, _L("OK"));
StateColor btn_bg_green(std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Pressed), std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
m_button_confirm->SetBackgroundColor(btn_bg_green);
m_button_confirm->SetBorderColor(wxColour(0, 174, 66));
m_button_confirm->SetTextColor(wxColour(0xFFFFFE));
m_button_confirm->SetSize(wxSize(FromDIP(72), FromDIP(24)));
m_button_confirm->SetMinSize(wxSize(FromDIP(72), FromDIP(24)));
m_button_confirm->SetCornerRadius(FromDIP(12));
m_button_confirm->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
Dismiss();
});
Bind(wxEVT_LEFT_UP, [this](auto& e) { Bind(wxEVT_LEFT_UP, [this](auto& e) {
auto rect = ClientToScreen(wxPoint(0, 0));
auto close_left = rect.x + GetSize().x - close_img.GetBmpWidth() - FromDIP(38);
auto close_right = close_left + close_img.GetBmpWidth();
auto close_top = rect.y + FromDIP(24);
auto close_bottom = close_top + close_img.GetBmpHeight();
auto mouse_pos = ClientToScreen(e.GetPosition()); auto mouse_pos = ClientToScreen(e.GetPosition());
auto rect = m_button_confirm->ClientToScreen(wxPoint(0, 0)); if (mouse_pos.x > close_left
if (mouse_pos.x > rect.x && mouse_pos.y > rect.y && mouse_pos.y > close_top
&& mouse_pos.x < (rect.x + m_button_confirm->GetSize().x) && mouse_pos.x < close_right
&& mouse_pos.y < (rect.y + m_button_confirm->GetSize().y)) && mouse_pos.y < close_bottom
)
{ {
Dismiss(); Dismiss();
} }
}); });
main_sizer->Add(m_button_confirm, 0, wxALIGN_CENTER | wxALL, 0);
main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, 18);
main_sizer->Add(0, 0, 0, wxTOP, FromDIP(24));
main_sizer->Add(m_staticText, 0, wxALIGN_CENTER, 0);
main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(28));
main_sizer->Add(curr_humidity_img, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, FromDIP(35));
main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(15));
main_sizer->Add(humidity_level_list, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, FromDIP(35));
main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(6));
main_sizer->Add(m_staticText_note, 0, wxALIGN_CENTER, 0);
main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(5));
main_sizer->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(25));
SetSizer(main_sizer); SetSizer(main_sizer);
Layout(); Layout();
Fit(); Fit();
@ -906,9 +860,7 @@ AmsHumidityTipPopup::AmsHumidityTipPopup(wxWindow* parent)
void AmsHumidityTipPopup::paintEvent(wxPaintEvent& evt) void AmsHumidityTipPopup::paintEvent(wxPaintEvent& evt)
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
dc.SetPen(wxColour(0xAC, 0xAC, 0xAC)); render(dc);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 0);
} }
void AmsHumidityTipPopup::OnDismiss() {} void AmsHumidityTipPopup::OnDismiss() {}
@ -917,6 +869,50 @@ bool AmsHumidityTipPopup::ProcessLeftDown(wxMouseEvent& event) {
return PopupWindow::ProcessLeftDown(event); return PopupWindow::ProcessLeftDown(event);
} }
void AmsHumidityTipPopup::set_humidity_level(int level)
{
current_humidity_level = level;
if (current_humidity_level<= 0) {return;}
std::string mode_string = wxGetApp().dark_mode()?"_dark":"_light";
curr_humidity_img->SetBitmap(create_scaled_bitmap("hum_level" + std::to_string(current_humidity_level) + mode_string, this, FromDIP(132)));
curr_humidity_img->Refresh();
curr_humidity_img->Update();
}
void AmsHumidityTipPopup::render(wxDC& dc)
{
#ifdef __WXMSW__
wxSize size = GetSize();
wxMemoryDC memdc;
wxBitmap bmp(size.x, size.y);
memdc.SelectObject(bmp);
memdc.Blit({ 0, 0 }, size, &dc, { 0, 0 });
{
wxGCDC dc2(memdc);
doRender(dc2);
}
memdc.SelectObject(wxNullBitmap);
dc.DrawBitmap(bmp, 0, 0);
#else
doRender(dc);
#endif
}
void AmsHumidityTipPopup::doRender(wxDC& dc)
{
//close
dc.DrawBitmap(close_img.bmp(), GetSize().x - close_img.GetBmpWidth() - FromDIP(38), FromDIP(24));
//background
dc.SetPen(wxColour(0xAC, 0xAC, 0xAC));
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 0);
}
AmsTutorialPopup::AmsTutorialPopup(wxWindow* parent) AmsTutorialPopup::AmsTutorialPopup(wxWindow* parent)
:PopupWindow(parent, wxBORDER_NONE) :PopupWindow(parent, wxBORDER_NONE)
{ {
@ -1590,4 +1586,93 @@ void AmsRMGroup::doRender(wxDC& dc)
dc.DrawText(m_group_index, (size.x - text_size.x) / 2, (size.y - text_size.y) / 2 + FromDIP(10)); dc.DrawText(m_group_index, (size.x - text_size.x) / 2, (size.y - text_size.y) / 2 + FromDIP(10));
} }
AmsHumidityLevelList::AmsHumidityLevelList(wxWindow* parent)
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
{
#ifdef __WINDOWS__
SetDoubleBuffered(true);
#endif //__WINDOWS__
SetSize(wxSize(FromDIP(680), FromDIP(104)));
SetMinSize(wxSize(FromDIP(680), FromDIP(104)));
SetMaxSize(wxSize(FromDIP(680), FromDIP(104)));
SetBackgroundColour(*wxWHITE);
background_img = ScalableBitmap(this, "humidity_list_background", FromDIP(104));
for (int i = 1; i <= 5; i++) {
hum_level_img_light.push_back(ScalableBitmap(this, ("hum_level" + std::to_string(i) + "_light"), FromDIP(54)));
}
for (int i = 1; i <= 5; i++) {
hum_level_img_dark.push_back(ScalableBitmap(this, ("hum_level" + std::to_string(i) + "_dark"), FromDIP(54)));
}
Bind(wxEVT_PAINT, &AmsHumidityLevelList::paintEvent, this);
wxGetApp().UpdateDarkUI(this);
}
void AmsHumidityLevelList::msw_rescale()
{
}
void AmsHumidityLevelList::paintEvent(wxPaintEvent& evt)
{
wxPaintDC dc(this);
render(dc);
}
void AmsHumidityLevelList::render(wxDC& dc)
{
#ifdef __WXMSW__
wxSize size = GetSize();
wxMemoryDC memdc;
wxBitmap bmp(size.x, size.y);
memdc.SelectObject(bmp);
memdc.Blit({ 0, 0 }, size, &dc, { 0, 0 });
{
wxGCDC dc2(memdc);
doRender(dc2);
}
memdc.SelectObject(wxNullBitmap);
dc.DrawBitmap(bmp, 0, 0);
#else
doRender(dc);
#endif
}
void AmsHumidityLevelList::doRender(wxDC& dc)
{
dc.DrawBitmap(background_img.bmp(), 0,0);
auto width_center = GetSize().x / 2;
auto left = width_center - FromDIP(27) - FromDIP(46) * 2 - FromDIP(54) * 2;
//dry / wet
dc.SetTextForeground(wxColour(0x989898));
dc.SetFont(::Label::Head_20);
auto font_top = GetSize().y - dc.GetTextExtent(_L("DRY")).GetHeight();
dc.DrawText(_L("DRY"), wxPoint(FromDIP(38), font_top / 2));
dc.DrawText(_L("WET"), wxPoint(( GetSize().x - FromDIP(38) - dc.GetTextExtent(_L("DRY")).GetWidth()), font_top / 2));
//level list
for (int i = 0; i < hum_level_img_light.size(); i++) {
if (wxGetApp().dark_mode()) {
dc.DrawBitmap(hum_level_img_dark[i].bmp(), left, (GetSize().y - FromDIP(54)) / 2);
}
else {
dc.DrawBitmap(hum_level_img_light[i].bmp(), left, (GetSize().y - FromDIP(54)) / 2);
}
left += FromDIP(46) + FromDIP(54);
}
}
}} // namespace Slic3r::GUI }} // namespace Slic3r::GUI

View File

@ -185,6 +185,33 @@ public:
wxStaticText * m_tip_disable_ams; wxStaticText * m_tip_disable_ams;
}; };
class AmsHumidityLevelList : public wxPanel
{
public:
AmsHumidityLevelList(wxWindow* parent);
~AmsHumidityLevelList() {};
ScalableBitmap background_img;
ScalableBitmap hum_level1_img;
ScalableBitmap hum_level2_img;
ScalableBitmap hum_level3_img;
ScalableBitmap hum_level4_img;
std::vector<ScalableBitmap> hum_level_img_light;
std::vector<ScalableBitmap> hum_level_img_dark;
wxStaticBitmap* hum_level1_bitmap;
wxStaticBitmap* hum_level2_bitmap;
wxStaticBitmap* hum_level3_bitmap;
wxStaticBitmap* hum_level4_bitmap;
wxStaticBitmap* hum_level5_bitmap;
void msw_rescale();
void paintEvent(wxPaintEvent& evt);
void render(wxDC& dc);
void doRender(wxDC& dc);
};
class AmsHumidityTipPopup : public PopupWindow class AmsHumidityTipPopup : public PopupWindow
{ {
public: public:
@ -195,14 +222,19 @@ public:
virtual void OnDismiss() wxOVERRIDE; virtual void OnDismiss() wxOVERRIDE;
virtual bool ProcessLeftDown(wxMouseEvent& event) wxOVERRIDE; virtual bool ProcessLeftDown(wxMouseEvent& event) wxOVERRIDE;
void set_humidity_level(int level);
void render(wxDC& dc);
void doRender(wxDC& dc);
public: public:
int current_humidity_level;
ScalableBitmap close_img;
wxStaticBitmap* curr_humidity_img;
AmsHumidityLevelList* humidity_level_list{nullptr};
wxStaticBitmap* m_img; wxStaticBitmap* m_img;
Label* m_staticText1; Label* m_staticText;;
Label* m_staticText2;
Label* m_staticText3;
Label* m_staticText4;
Label* m_staticText_note; Label* m_staticText_note;
Button* m_button_confirm;
}; };
class AmsTutorialPopup : public PopupWindow class AmsTutorialPopup : public PopupWindow

View File

@ -1388,11 +1388,13 @@ AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, in
m_rode_mode = AMSRoadMode::AMS_ROAD_MODE_NONE_ANY_ROAD; m_rode_mode = AMSRoadMode::AMS_ROAD_MODE_NONE_ANY_ROAD;
} }
ams_humidity_0 = ScalableBitmap(this, "ams_humidity_0", 20); for (int i = 1; i <= 5; i++) {
ams_humidity_1 = ScalableBitmap(this, "ams_humidity_1", 20); ams_humidity_img.push_back(ScalableBitmap(this, "hum_level" + std::to_string(i) + "_light", FromDIP(32)));
ams_humidity_2 = ScalableBitmap(this, "ams_humidity_2", 20); }
ams_humidity_3 = ScalableBitmap(this, "ams_humidity_3", 20);
ams_humidity_4 = ScalableBitmap(this, "ams_humidity_4", 20); for (int i = 1; i <= 5; i++) {
ams_humidity_img.push_back(ScalableBitmap(this, "hum_level" + std::to_string(i) + "_dark", FromDIP(32)));
}
create(parent, id, pos, size); create(parent, id, pos, size);
Bind(wxEVT_PAINT, &AMSRoad::paintEvent, this); Bind(wxEVT_PAINT, &AMSRoad::paintEvent, this);
@ -1403,8 +1405,8 @@ AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, in
auto mouse_pos = ClientToScreen(e.GetPosition()); auto mouse_pos = ClientToScreen(e.GetPosition());
auto rect = ClientToScreen(wxPoint(0, 0)); auto rect = ClientToScreen(wxPoint(0, 0));
if (mouse_pos.x > rect.x + GetSize().x - FromDIP(25) && if (mouse_pos.x > rect.x + GetSize().x - FromDIP(40) &&
mouse_pos.y > rect.y + GetSize().y - FromDIP(25)) { mouse_pos.y > rect.y + GetSize().y - FromDIP(40)) {
wxCommandEvent show_event(EVT_AMS_SHOW_HUMIDITY_TIPS); wxCommandEvent show_event(EVT_AMS_SHOW_HUMIDITY_TIPS);
wxPostEvent(GetParent()->GetParent(), show_event); wxPostEvent(GetParent()->GetParent(), show_event);
@ -1565,24 +1567,15 @@ void AMSRoad::doRender(wxDC &dc)
if (m_amsinfo.ams_humidity >= 1 && m_amsinfo.ams_humidity <= 5) {m_show_humidity = true;} if (m_amsinfo.ams_humidity >= 1 && m_amsinfo.ams_humidity <= 5) {m_show_humidity = true;}
else {m_show_humidity = false;} else {m_show_humidity = false;}
if (m_amsinfo.ams_humidity == 5) { if (m_amsinfo.ams_humidity >= 1 && m_amsinfo.ams_humidity <= 5) {
dc.DrawBitmap(ams_humidity_4.bmp(), wxPoint(size.x - ams_humidity_4.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_4.GetBmpSize().y - FromDIP(8)));
}
else if (m_amsinfo.ams_humidity == 4) {
dc.DrawBitmap(ams_humidity_3.bmp(), wxPoint(size.x - ams_humidity_3.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_3.GetBmpSize().y - FromDIP(8)));
}
else if (m_amsinfo.ams_humidity == 3) {
dc.DrawBitmap(ams_humidity_2.bmp(), wxPoint(size.x - ams_humidity_2.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_2.GetBmpSize().y - FromDIP(8))); int hum_index = m_amsinfo.ams_humidity - 1;
if (wxGetApp().dark_mode()) {
hum_index += 5;
} }
else if (m_amsinfo.ams_humidity == 2) { dc.DrawBitmap(ams_humidity_img[hum_index].bmp(), wxPoint(size.x - FromDIP(28), size.y - FromDIP(35)));
dc.DrawBitmap(ams_humidity_1.bmp(), wxPoint(size.x - ams_humidity_1.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_1.GetBmpSize().y - FromDIP(8)));
}
else if (m_amsinfo.ams_humidity == 1) {
dc.DrawBitmap(ams_humidity_0.bmp(), wxPoint(size.x - ams_humidity_0.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_0.GetBmpSize().y - FromDIP(8)));
} }
else { else {
/*dc.DrawBitmap(ams_humidity_4.bmp(), wxPoint(size.x - ams_humidity_4.GetBmpSize().x - FromDIP(4), size.y - ams_humidity_4.GetBmpSize().y - FromDIP(8)));*/
//to do ... //to do ...
} }
} }
@ -2904,8 +2897,11 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
Bind(EVT_AMS_SHOW_HUMIDITY_TIPS, [this](wxCommandEvent& evt) { Bind(EVT_AMS_SHOW_HUMIDITY_TIPS, [this](wxCommandEvent& evt) {
wxPoint img_pos = ClientToScreen(wxPoint(0, 0)); wxPoint img_pos = ClientToScreen(wxPoint(0, 0));
wxPoint popup_pos(img_pos.x - m_Humidity_tip_popup.GetSize().GetWidth() + FromDIP(150), img_pos.y); wxPoint popup_pos(img_pos.x - m_Humidity_tip_popup.GetSize().GetWidth() + FromDIP(150), img_pos.y - FromDIP(80));
m_Humidity_tip_popup.Position(popup_pos, wxSize(0, 0)); m_Humidity_tip_popup.Position(popup_pos, wxSize(0, 0));
if (m_ams_info.size() > 0) {
m_Humidity_tip_popup.set_humidity_level(m_ams_info[0].ams_humidity);
}
m_Humidity_tip_popup.Popup(); m_Humidity_tip_popup.Popup();
}); });
@ -3481,7 +3477,6 @@ void AMSControl::SwitchAms(std::string ams_id)
} else { } else {
item->amsItem->UnSelected(); item->amsItem->UnSelected();
//item->amsItem->HideHumidity();
} }
m_sizer_top->Layout(); m_sizer_top->Layout();
m_panel_top->Fit(); m_panel_top->Fit();

View File

@ -383,11 +383,7 @@ public:
wxColour m_road_color; wxColour m_road_color;
void Update(AMSinfo amsinfo, Caninfo info, int canindex, int maxcan); void Update(AMSinfo amsinfo, Caninfo info, int canindex, int maxcan);
ScalableBitmap ams_humidity_0; std::vector<ScalableBitmap> ams_humidity_img;
ScalableBitmap ams_humidity_1;
ScalableBitmap ams_humidity_2;
ScalableBitmap ams_humidity_3;
ScalableBitmap ams_humidity_4;
int m_humidity = { 0 }; int m_humidity = { 0 };