NEW:update the new print progress layout

Change-Id: I4390c9ef5de3d050178bebe5d1dc60213a400280
This commit is contained in:
tao wang 2022-08-23 18:47:41 +08:00 committed by Lane.Wei
parent 007659aeec
commit ffb1f706d8
15 changed files with 279 additions and 90 deletions

View File

@ -0,0 +1,4 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3.5" y="3.5" width="3" height="11" fill="#FF6F00"/>
<rect x="11.5" y="3.5" width="3" height="11" fill="#FF6F00"/>
</svg>

After

Width:  |  Height:  |  Size: 226 B

View File

@ -0,0 +1,4 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3.5" y="3.5" width="3" height="11" fill="#CECECE"/>
<rect x="11.5" y="3.5" width="3" height="11" fill="#CECECE"/>
</svg>

After

Width:  |  Height:  |  Size: 226 B

View File

@ -0,0 +1,4 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.5" y="2.5" width="3.54545" height="13" fill="#FF6F00"/>
<rect x="11.9531" y="2.5" width="3.54545" height="13" fill="#FF6F00"/>
</svg>

After

Width:  |  Height:  |  Size: 241 B

View File

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.25 8.56699C15.5833 8.75944 15.5833 9.24056 15.25 9.43301L4.75 15.4952C4.41667 15.6876 4 15.4471 4 15.0622L4 2.93782C4 2.55292 4.41667 2.31236 4.75 2.50481L15.25 8.56699Z" fill="#00AE42"/>
</svg>

After

Width:  |  Height:  |  Size: 304 B

View File

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.25 8.56699C15.5833 8.75944 15.5833 9.24056 15.25 9.43301L4.75 15.4952C4.41667 15.6876 4 15.4471 4 15.0622L4 2.93782C4 2.55292 4.41667 2.31236 4.75 2.50481L15.25 8.56699Z" fill="#CECECE"/>
</svg>

After

Width:  |  Height:  |  Size: 304 B

View File

@ -0,0 +1,10 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_7481_29762)">
<path d="M15.9687 8.56699C16.3021 8.75944 16.3021 9.24056 15.9687 9.43301L3.96875 16.3612C3.63542 16.5537 3.21875 16.3131 3.21875 15.9282L3.21875 2.07179C3.21875 1.68689 3.63542 1.44633 3.96875 1.63878L15.9687 8.56699Z" fill="#00AE42"/>
</g>
<defs>
<clipPath id="clip0_7481_29762">
<rect width="18" height="18" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 488 B

View File

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3.19531" y="3.19531" width="11.6099" height="11.6099" fill="#D01B1B"/>
</svg>

After

Width:  |  Height:  |  Size: 183 B

View File

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3.19531" y="3.19531" width="11.6099" height="11.6099" fill="#CECECE"/>
</svg>

After

Width:  |  Height:  |  Size: 183 B

View File

@ -0,0 +1,3 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.5" y="2.5" width="13" height="13" fill="#D01B1B"/>
</svg>

After

Width:  |  Height:  |  Size: 165 B

View File

@ -0,0 +1,4 @@
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.812 11.9007C9.86999 12.628 8.68945 13.061 7.40744 13.061C4.32841 13.061 1.83203 10.5646 1.83203 7.48556C1.83203 4.40653 4.32841 1.91016 7.40744 1.91016C10.4865 1.91016 12.9828 4.40653 12.9828 7.48556C12.9828 8.37266 12.7757 9.2107 12.407 9.95572" stroke="#C4C4C4" stroke-miterlimit="10" stroke-linecap="round"/>
<path d="M6.97266 4.10938V7.60701C6.97266 7.76345 7.0995 7.8903 7.25595 7.8903H10.3654" stroke="#C4C4C4" stroke-miterlimit="10" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 581 B

View File

@ -0,0 +1,13 @@
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_6827_29158)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.56061 5.08115C7.34409 5.86542 7.20599 6.97253 7.20599 8.2117C7.20599 9.45087 7.34409 10.558 7.56061 11.3422C7.66968 11.7373 7.79223 12.0266 7.91086 12.2073C7.98094 12.3141 8.03033 12.3557 8.05458 12.3714C8.05874 12.3687 8.06354 12.3652 8.069 12.361C8.10773 12.3308 8.16032 12.2743 8.21247 12.1852C8.32892 11.9862 8.58463 11.9193 8.7836 12.0358C8.98258 12.1522 9.04947 12.408 8.93302 12.6069C8.83851 12.7684 8.72002 12.9123 8.58155 13.02C8.44599 13.1254 8.26643 13.2144 8.05948 13.2144C7.6655 13.2144 7.38831 12.9327 7.21288 12.6655C7.02677 12.3819 6.87588 11.9993 6.75582 11.5644C6.51406 10.6887 6.37109 9.5032 6.37109 8.2117C6.37109 6.9202 6.51406 5.73467 6.75582 4.85898C6.87588 4.42408 7.02677 4.04151 7.21288 3.75795C7.38831 3.49066 7.6655 3.20898 8.05948 3.20898C8.44304 3.20898 8.72381 3.48138 8.89826 3.74964C9.02395 3.94291 8.96915 4.20149 8.77588 4.32717C8.5826 4.45286 8.32403 4.39807 8.19834 4.20479C8.14468 4.12228 8.09859 4.07728 8.06882 4.0558C8.06511 4.05312 8.06185 4.05094 8.05904 4.04918C8.03674 4.06248 7.98555 4.10227 7.91086 4.21606C7.79223 4.39681 7.66968 4.68607 7.56061 5.08115Z" fill="#C4C4C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.15045 4.96201C4.93393 5.74628 4.79583 6.85339 4.79583 8.09256C4.79583 9.33173 4.93393 10.4388 5.15045 11.2231C5.25952 11.6182 5.38207 11.9074 5.50071 12.0882C5.57079 12.195 5.62018 12.2366 5.64443 12.2523C5.64858 12.2495 5.65339 12.2461 5.65885 12.2418C5.69757 12.2117 5.75017 12.1552 5.80231 12.0661C5.91876 11.8671 6.17447 11.8002 6.37345 11.9167C6.57242 12.0331 6.63932 12.2888 6.52286 12.4878C6.42836 12.6493 6.30987 12.7932 6.17139 12.9009C6.03583 13.0063 5.85627 13.0953 5.64932 13.0953C5.25534 13.0953 4.97816 12.8136 4.80272 12.5463C4.61661 12.2627 4.46573 11.8802 4.34566 11.4453C4.10391 10.5696 3.96094 9.38406 3.96094 8.09256C3.96094 6.80106 4.10391 5.61553 4.34566 4.73983C4.46573 4.30494 4.61661 3.92237 4.80272 3.63881C4.97816 3.37151 5.25534 3.08984 5.64932 3.08984C6.03289 3.08984 6.31365 3.36224 6.4881 3.6305C6.61379 3.82377 6.559 4.08234 6.36572 4.20803C6.17245 4.33372 5.91388 4.27893 5.78819 4.08565C5.73453 4.00314 5.68844 3.95814 5.65867 3.93666C5.65495 3.93398 5.65169 3.9318 5.64888 3.93004C5.62658 3.94334 5.57539 3.98313 5.50071 4.09692C5.38207 4.27767 5.25952 4.56693 5.15045 4.96201Z" fill="#C4C4C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1473 4.47582C9.88993 5.41453 9.72552 6.73495 9.72552 8.21009C9.72552 9.68524 9.88993 11.0057 10.1473 11.9444C10.2768 12.4167 10.4236 12.7687 10.5689 12.9929C10.6412 13.1043 10.7032 13.1687 10.7482 13.2023C10.7696 13.2182 10.7842 13.225 10.7915 13.2277C10.7952 13.2291 10.7973 13.2296 10.7981 13.2297L10.7989 13.2298L10.799 13.2298L10.799 13.2298L10.799 13.2298L10.7991 13.2298L10.7998 13.2297C10.8006 13.2296 10.8028 13.2291 10.8064 13.2277C10.8138 13.225 10.8284 13.2182 10.8498 13.2023C10.8948 13.1687 10.9568 13.1043 11.029 12.9929C11.1744 12.7687 11.3211 12.4167 11.4506 11.9444C11.708 11.0057 11.8724 9.68524 11.8724 8.21009C11.8724 6.73495 11.708 5.41453 11.4506 4.47582C11.3211 4.00349 11.1744 3.65146 11.029 3.42728C10.9568 3.31586 10.8948 3.25152 10.8498 3.21794C10.8284 3.20195 10.8138 3.19517 10.8064 3.19245C10.8028 3.1911 10.8006 3.19063 10.7998 3.19048L10.7991 3.19037L10.799 3.19036L10.799 3.19036L10.799 3.19036L10.7989 3.19037L10.7981 3.19048C10.7973 3.19063 10.7952 3.1911 10.7915 3.19245C10.7842 3.19517 10.7696 3.20195 10.7482 3.21794C10.7032 3.25152 10.6412 3.31586 10.5689 3.42728C10.4236 3.65146 10.2768 4.00349 10.1473 4.47582ZM9.86837 2.97311C10.068 2.6652 10.3731 2.35547 10.799 2.35547C11.2248 2.35547 11.53 2.6652 11.7296 2.97311C11.941 3.2992 12.1155 3.74343 12.2558 4.25504C12.538 5.2842 12.7073 6.68237 12.7073 8.21009C12.7073 9.73782 12.538 11.136 12.2558 12.1651C12.1155 12.6768 11.941 13.121 11.7296 13.4471C11.53 13.755 11.2248 14.0647 10.799 14.0647C10.3731 14.0647 10.068 13.755 9.86837 13.4471C9.65697 13.121 9.48245 12.6768 9.34216 12.1651C9.05996 11.136 8.89062 9.73782 8.89062 8.21009C8.89062 6.68237 9.05996 5.2842 9.34216 4.25504C9.48245 3.74343 9.65697 3.2992 9.86837 2.97311Z" fill="#C4C4C4"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.28487 4.46452C2.02292 5.39548 1.85442 6.70867 1.85442 8.18504C1.85442 9.66257 2.01703 10.983 2.27348 11.9211C2.40252 12.3931 2.54895 12.7444 2.69431 12.9679C2.76651 13.0789 2.8286 13.143 2.87383 13.1766C2.89538 13.1925 2.91023 13.1994 2.91808 13.2023C2.92197 13.2037 2.92445 13.2043 2.92567 13.2045C2.92686 13.2047 2.9275 13.2048 2.92789 13.2048H2.928C2.93169 13.2048 2.98466 13.2052 3.08662 13.0854C3.19036 12.9635 3.30448 12.7614 3.41887 12.4682C3.50268 12.2535 3.74473 12.1473 3.9595 12.2311C4.17428 12.3149 4.28046 12.5569 4.19666 12.7717C4.06664 13.1049 3.91191 13.4039 3.72235 13.6266C3.53224 13.8499 3.26753 14.0397 2.92789 14.0397C2.50156 14.0397 2.19539 13.7321 1.9944 13.4231C1.7823 13.0969 1.60795 12.6527 1.46814 12.1412C1.18688 11.1124 1.01953 9.71423 1.01953 8.18504C1.01953 6.65467 1.19321 5.2618 1.48119 4.23838C1.62436 3.72956 1.80226 3.28838 2.01726 2.96474C2.22142 2.65742 2.52913 2.35547 2.95233 2.35547C3.3092 2.35547 3.58171 2.5771 3.76924 2.81549C3.96179 3.06025 4.12086 3.38996 4.25086 3.76311C4.3267 3.98082 4.2117 4.2188 3.99398 4.29465C3.77627 4.3705 3.53829 4.25549 3.46244 4.03777C3.34803 3.70935 3.22602 3.4753 3.11305 3.33169C3.015 3.20704 2.95876 3.19196 2.951 3.19043C2.94932 3.19059 2.94603 3.19116 2.94054 3.19315C2.93201 3.19624 2.9166 3.20338 2.8946 3.21943C2.84853 3.25302 2.78571 3.31681 2.71269 3.42673C2.56565 3.64806 2.41666 3.99615 2.28487 4.46452Z" fill="#C4C4C4"/>
</g>
<defs>
<clipPath id="clip0_6827_29158">
<rect width="14" height="14" fill="white" transform="translate(0.0195312 0.355469)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -60,7 +60,7 @@ static wxColour TEXT_LIGHT_FONT_COL = wxColour(107, 107, 107);
#define NORMAL_SPACING FromDIP(5)
#define PAGE_SPACING FromDIP(10)
#define PAGE_MIN_WIDTH FromDIP(574)
#define PROGRESSBAR_HEIGHT FromDIP(14)
#define PROGRESSBAR_HEIGHT FromDIP(8)
#define SWITCH_BUTTON_SIZE (wxSize(FromDIP(40), -1))
#define TASK_THUMBNAIL_SIZE (wxSize(FromDIP(120), FromDIP(120)))
@ -170,6 +170,8 @@ void StatusBasePanel::init_bitmaps()
m_bitmap_fan_off = ScalableBitmap(this, "monitor_fan_off", 24);
m_bitmap_speed = ScalableBitmap(this, "monitor_speed", 24);
m_bitmap_speed_active = ScalableBitmap(this, "monitor_speed_active", 24);
m_bitmap_use_time = ScalableBitmap(this, "print_info_time", 16);
m_bitmap_use_weight = ScalableBitmap(this, "print_info_weight", 16);
m_thumbnail_placeholder = ScalableBitmap(this, "monitor_placeholder", 120);
m_thumbnail_sdcard = ScalableBitmap(this, "monitor_sdcard_thumbnail", 120);
//m_bitmap_camera = create_scaled_bitmap("monitor_camera", nullptr, 18);
@ -272,6 +274,8 @@ wxBoxSizer *StatusBasePanel::create_project_task_page(wxWindow *parent)
m_staticText_printing->SetForegroundColour(PAGE_TITLE_FONT_COL);
bSizer_printing_title->Add(m_staticText_printing, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, PAGE_TITLE_LEFT_MARGIN);
bSizer_printing_title->Add(0, 0, 1, wxEXPAND, 0);
m_panel_printing_title->SetSizer(bSizer_printing_title);
m_panel_printing_title->Layout();
bSizer_printing_title->Fit(m_panel_printing_title);
@ -292,52 +296,84 @@ wxBoxSizer *StatusBasePanel::create_project_task_page(wxWindow *parent)
wxBoxSizer *bSizer_task_name = new wxBoxSizer(wxVERTICAL);
bSizer_task_name->Add(0, 0, 1, wxEXPAND, FromDIP(5));
wxBoxSizer *bSizer_task_name_hor = new wxBoxSizer(wxHORIZONTAL);
wxPanel* task_name_panel = new wxPanel(parent);
m_staticText_subtask_value = new wxStaticText(parent, wxID_ANY, _L("N/A"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT | wxST_ELLIPSIZE_END);
m_staticText_subtask_value = new wxStaticText(task_name_panel, wxID_ANY, _L("N/A"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT | wxST_ELLIPSIZE_END);
m_staticText_subtask_value->Wrap(-1);
m_staticText_subtask_value->SetFont(wxFont(13, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("HarmonyOS Sans SC")));
#ifdef __WXOSX_MAC__
m_staticText_subtask_value->SetFont(::Label::Body_13);
#else
m_staticText_subtask_value->SetFont(wxFont(13, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
#endif
m_staticText_subtask_value->SetForegroundColour(wxColour(44, 44, 46));
m_printing_stage_value = new wxStaticText(parent, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT | wxST_ELLIPSIZE_END);
m_printing_stage_value->Wrap(-1);
m_printing_stage_value->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
m_printing_stage_value->SetForegroundColour(STAGE_TEXT_COL);
m_bitmap_static_use_time = new wxStaticBitmap(task_name_panel, wxID_ANY, m_bitmap_use_time.bmp(), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)));
m_staticText_consumption_of_time = new wxStaticText(task_name_panel, wxID_ANY, "0m", wxDefaultPosition, wxDefaultSize, 0);
m_staticText_consumption_of_time->SetFont(::Label::Body_12);
m_staticText_consumption_of_time->SetForegroundColour(wxColour(0x68, 0x68, 0x68));
m_staticText_consumption_of_time->Wrap(-1);
m_bitmap_static_use_weight = new wxStaticBitmap(task_name_panel, wxID_ANY, m_bitmap_use_weight.bmp(), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)));
m_staticText_consumption_of_weight = new wxStaticText(task_name_panel, wxID_ANY, "0g", wxDefaultPosition, wxDefaultSize, 0);
m_staticText_consumption_of_weight->SetFont(::Label::Body_12);
m_staticText_consumption_of_weight->SetForegroundColour(wxColour(0x68, 0x68, 0x68));
m_staticText_consumption_of_weight->Wrap(-1);
bSizer_task_name_hor->Add(m_staticText_subtask_value, 1, wxALL | wxEXPAND, 0);
bSizer_task_name_hor->Add(0, 0, 1, wxEXPAND, 0);
bSizer_task_name_hor->Add(m_bitmap_static_use_time, 0, wxALIGN_CENTER_VERTICAL, 0);
bSizer_task_name_hor->Add(m_staticText_consumption_of_time, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, FromDIP(3));
bSizer_task_name_hor->Add(0, 0, 0, wxLEFT, FromDIP(20));
bSizer_task_name_hor->Add(m_bitmap_static_use_weight, 0, wxALIGN_CENTER_VERTICAL, 0);
bSizer_task_name_hor->Add(m_staticText_consumption_of_weight, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(3));
bSizer_task_name_hor->Add(0, 0, 0, wxRIGHT, FromDIP(10));
task_name_panel->SetSizer(bSizer_task_name_hor);
task_name_panel->Layout();
task_name_panel->Fit();
bSizer_task_name->Add(task_name_panel, 0, wxEXPAND, FromDIP(5));
bSizer_task_name->Add(m_staticText_subtask_value, 1, wxALL | wxEXPAND, 0);
bSizer_task_name->Add(m_printing_stage_value, 1, wxALL | wxEXPAND, 0);
bSizer_subtask_info->Add(bSizer_task_name, 1, wxEXPAND, FromDIP(5));
/* wxFlexGridSizer *fgSizer_task = new wxFlexGridSizer(2, 2, 0, 0);
fgSizer_task->AddGrowableCol(0);
fgSizer_task->SetFlexibleDirection(wxVERTICAL);
fgSizer_task->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);*/
m_printing_stage_value = new wxStaticText(parent, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT | wxST_ELLIPSIZE_END);
m_printing_stage_value->Wrap(-1);
#ifdef __WXOSX_MAC__
m_printing_stage_value->SetFont(::Label::Body_11);
#else
m_printing_stage_value->SetFont(wxFont(11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
#endif
m_printing_stage_value->SetForegroundColour(STAGE_TEXT_COL);
auto m_panel_progress = new wxPanel(parent, wxID_ANY);
m_panel_progress->SetBackgroundColour(*wxWHITE);
auto m_sizer_progressbar = new wxBoxSizer(wxHORIZONTAL);
m_gauge_progress = new ProgressBar(m_panel_progress, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize);
m_gauge_progress->SetValue(0);
m_gauge_progress->SetHeight(PROGRESSBAR_HEIGHT);
//m_gauge_progress->SetMinSize(wxSize(FromDIP(238), 16));
m_gauge_progress->SetMaxSize(wxSize(FromDIP(600), 16));
//fgSizer_task->Add(m_gauge_progress, 0, wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND, 0);
m_gauge_progress->SetMaxSize(wxSize(FromDIP(600), -1));
m_panel_progress->SetSizer(m_sizer_progressbar);
m_panel_progress->Layout();
//m_panel_progress->SetMinSize(wxSize(FromDIP(574), -1));
//m_panel_progress->SetMaxSize(wxSize(FromDIP(600), -1));
m_sizer_progressbar->Add(m_gauge_progress, 1, wxALIGN_CENTER_VERTICAL, 0);
//fgSizer_task->Add(m_panel_progress, 0, wxALIGN_CENTER_VERTICAL | wxEXPAND, 0);
m_panel_progress->SetSize(wxSize(-1, FromDIP(24)));
m_panel_progress->SetMaxSize(wxSize(-1, FromDIP(24)));
wxBoxSizer *bSizer_task_btn = new wxBoxSizer(wxHORIZONTAL);
bSizer_task_btn->Add(FromDIP(10), 0, 0);
m_button_report = new Button(m_panel_progress, _L("Report"));
/* m_button_report = new Button(m_panel_progress, _L("Report"));
StateColor report_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
@ -349,36 +385,46 @@ wxBoxSizer *StatusBasePanel::create_project_task_page(wxWindow *parent)
m_button_report->SetTextColor(report_text);
m_button_report->SetFont(Label::Body_10);
m_button_report->Hide();
m_sizer_progressbar->Add(m_button_report, 0, wxALL, FromDIP(5));
m_sizer_progressbar->Add(m_button_report, 0, wxALL, FromDIP(5));*/
m_button_pause_resume = new Button(m_panel_progress, _L("Pause"));
m_button_pause_resume = new ScalableButton(m_panel_progress, wxID_ANY, "print_control_pause", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER,true);
StateColor pause_resume_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered), std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Normal));
m_button_pause_resume->SetBackgroundColor(pause_resume_bg);
StateColor pause_resume_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(0, 174, 66), StateColor::Enabled));
m_button_pause_resume->SetBorderColor(pause_resume_bd);
StateColor pause_resume_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled));
m_button_pause_resume->SetTextColor(pause_resume_text);
m_button_pause_resume->SetFont(Label::Body_10);
m_button_pause_resume->SetMinSize(TASK_BUTTON_SIZE2);
//bSizer_task_btn->Add(m_button_pause_resume, 0, wxALIGN_RIGHT | wxALL, FromDIP(5));
m_button_pause_resume->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {
if (m_button_pause_resume->GetToolTipText() == _L("Pause")) {
m_button_pause_resume->SetBitmap_("print_control_pause_hover");
}
if (m_button_pause_resume->GetToolTipText() == _L("Resume")) {
m_button_pause_resume->SetBitmap_("print_control_resume_hover");
}
});
m_button_pause_resume->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {
auto buf = m_button_pause_resume->GetClientData();
if (m_button_pause_resume->GetToolTipText() == _L("Pause")) {
m_button_pause_resume->SetBitmap_("print_control_pause");
}
if (m_button_pause_resume->GetToolTipText() == _L("Resume")) {
m_button_pause_resume->SetBitmap_("print_control_resume");
}
});
m_button_abort = new ScalableButton(m_panel_progress, wxID_ANY, "print_control_stop", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
m_button_abort->SetToolTip(_L("Abort"));
m_button_abort->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {
m_button_abort->SetBitmap_("print_control_stop_hover");
});
m_button_abort->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {
m_button_abort->SetBitmap_("print_control_stop"); }
);
m_sizer_progressbar->Add(m_gauge_progress, 1, wxALIGN_CENTER_VERTICAL, 0);
m_sizer_progressbar->Add(0, 0, 0, wxEXPAND|wxLEFT, FromDIP(18));
m_sizer_progressbar->Add(m_button_pause_resume, 0, wxALL, FromDIP(5));
m_button_abort = new Button(m_panel_progress, _L("Stop"));
StateColor abort_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
m_button_abort->SetBackgroundColor(abort_bg);
StateColor abort_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
m_button_abort->SetBorderColor(abort_bd);
StateColor abort_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
m_button_abort->SetTextColor(abort_text);
m_button_abort->SetFont(Label::Body_10);
m_button_abort->SetMinSize(TASK_BUTTON_SIZE2);
//bSizer_task_btn->Add(m_button_abort, 0, wxALIGN_RIGHT | wxALL, FromDIP(5));
m_sizer_progressbar->Add(0, 0, 0, wxEXPAND|wxLEFT, FromDIP(18));
m_sizer_progressbar->Add(m_button_abort, 0, wxALL, FromDIP(5));
//fgSizer_task->Add(bSizer_task_btn, 0, wxEXPAND, 0);
@ -391,14 +437,35 @@ wxBoxSizer *StatusBasePanel::create_project_task_page(wxWindow *parent)
penel_text->SetBackgroundColour(*wxWHITE);
penel_bottons->SetBackgroundColour(*wxWHITE);
m_staticText_progress_percent = new wxStaticText(penel_text, wxID_ANY, _L("0%"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText_progress_percent->Wrap(-1);
m_staticText_progress_percent->SetFont(::Label::Head_13);
wxBoxSizer *sizer_percent = new wxBoxSizer(wxVERTICAL);
sizer_percent->Add(0, 0, 1, wxEXPAND, 0);
wxBoxSizer *sizer_percent_icon = new wxBoxSizer(wxVERTICAL);
sizer_percent_icon->Add(0, 0, 1, wxEXPAND, 0);
m_staticText_progress_percent = new wxStaticText(penel_text, wxID_ANY, L("0"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText_progress_percent->SetFont(::Label::Head_18);
m_staticText_progress_percent->SetMaxSize(wxSize(-1, FromDIP(20)));
m_staticText_progress_percent->SetForegroundColour(wxColour(0, 174, 66));
m_staticText_progress_left = new wxStaticText(penel_text, wxID_ANY, _L("N/A"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText_progress_percent_icon = new wxStaticText(penel_text, wxID_ANY, L("%"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText_progress_percent_icon->SetFont(::Label::Body_11);
m_staticText_progress_percent_icon->SetMaxSize(wxSize(-1, FromDIP(13)));
m_staticText_progress_percent_icon->SetForegroundColour(wxColour(0, 174, 66));
sizer_percent->Add(m_staticText_progress_percent, 0, 0, 0);
#ifdef __WXOSX_MAC__
sizer_percent_icon->Add(m_staticText_progress_percent_icon, 0, wxBOTTOM, FromDIP(2));
#else
sizer_percent_icon->Add(m_staticText_progress_percent_icon, 0, 0, 0);
#endif
m_staticText_progress_left = new wxStaticText(penel_text, wxID_ANY, L("N/A"), wxDefaultPosition, wxDefaultSize, 0);
m_staticText_progress_left->Wrap(-1);
m_staticText_progress_left->SetFont(wxFont(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
m_staticText_progress_left->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
m_staticText_progress_left->SetForegroundColour(wxColour(146, 146, 146));
//fgSizer_task->Add(bSizer_buttons, 0, wxEXPAND, 0);
@ -410,7 +477,9 @@ wxBoxSizer *StatusBasePanel::create_project_task_page(wxWindow *parent)
panel_button_block->SetSize(wxSize(TASK_BUTTON_SIZE.x * 2 + FromDIP(5) * 2, -1));
panel_button_block->SetBackgroundColour(*wxWHITE);
bSizer_text->Add(m_staticText_progress_percent, 0, wxALIGN_CENTER | wxALL, 0);
//bSizer_text->Add(m_staticText_progress_percent, 0, wxALL, 0);
bSizer_text->Add(sizer_percent, 0, wxEXPAND, 0);
bSizer_text->Add(sizer_percent_icon, 0, wxEXPAND, 0);
bSizer_text->Add(0, 0, 1, wxEXPAND, 0);
bSizer_text->Add(m_staticText_progress_left, 0, wxALIGN_CENTER | wxALL, 0);
@ -424,8 +493,11 @@ wxBoxSizer *StatusBasePanel::create_project_task_page(wxWindow *parent)
penel_bottons->SetSizer(bSizer_buttons);
penel_bottons->Layout();
bSizer_subtask_info->Add(m_panel_progress, 0, wxEXPAND, FromDIP(5));
bSizer_subtask_info->Add(penel_bottons, 0, wxEXPAND, FromDIP(5));
bSizer_subtask_info->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(14));
bSizer_subtask_info->Add(bSizer_task_name, 0, wxEXPAND|wxRIGHT, FromDIP(18));
bSizer_subtask_info->Add(m_printing_stage_value, 0, wxEXPAND | wxTOP, FromDIP(5));
bSizer_subtask_info->Add(penel_bottons, 0, wxEXPAND | wxTOP, FromDIP(10));
bSizer_subtask_info->Add(m_panel_progress, 0, wxEXPAND|wxRIGHT, FromDIP(25));
m_printing_sizer->Add(bSizer_subtask_info, 1, wxALL | wxEXPAND, 0);
@ -448,10 +520,18 @@ wxBoxSizer *StatusBasePanel::create_project_task_page(wxWindow *parent)
m_error_text = new wxStaticText2(m_panel_error_txt);
m_error_text->SetForegroundColour(PAGE_TITLE_FONT_COL);
text_sizer->Add(m_error_text, 1, wxEXPAND|wxLEFT, FromDIP(17));
m_button_clean = new Button(m_panel_error_txt, _L("Clean"));
m_button_clean->SetBackgroundColor(abort_bg);
m_button_clean->SetBorderColor(abort_bd);
m_button_clean->SetTextColor(abort_text);
StateColor clean_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
StateColor clean_bd(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor clean_text(std::pair<wxColour, int>(wxColour(144, 144, 144), StateColor::Disabled), std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
m_button_clean->SetBackgroundColor(clean_bg);
m_button_clean->SetBorderColor(clean_bd);
m_button_clean->SetTextColor(clean_text);
m_button_clean->SetFont(Label::Body_10);
m_button_clean->SetMinSize(TASK_BUTTON_SIZE2);
@ -955,9 +1035,9 @@ StatusPanel::StatusPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
init_scaled_buttons();
m_buttons.push_back(m_button_report);
m_buttons.push_back(m_button_pause_resume);
m_buttons.push_back(m_button_abort);
//m_buttons.push_back(m_button_report);
//m_buttons.push_back(m_button_pause_resume);
//m_buttons.push_back(m_button_abort);
m_buttons.push_back(m_button_unload);
m_buttons.push_back(m_button_clean);
m_buttons.push_back(m_bpButton_z_10);
@ -975,7 +1055,10 @@ StatusPanel::StatusPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
/* set default enable state */
m_button_pause_resume->Enable(false);
m_button_pause_resume->SetBitmap_("print_control_resume_disable");
m_button_abort->Enable(false);
m_button_abort->SetBitmap_("print_control_stop_disable");
Bind(wxEVT_WEBREQUEST_STATE, &StatusPanel::on_webrequest_state, this);
@ -1056,12 +1139,12 @@ StatusPanel::~StatusPanel()
void StatusPanel::init_scaled_buttons()
{
m_button_report->SetMinSize(wxSize(FromDIP(48), FromDIP(24)));
m_button_report->SetCornerRadius(FromDIP(12));
m_button_pause_resume->SetMinSize(wxSize(FromDIP(48), FromDIP(24)));
m_button_pause_resume->SetCornerRadius(FromDIP(12));
m_button_abort->SetMinSize(wxSize(FromDIP(48), FromDIP(24)));
m_button_abort->SetCornerRadius(FromDIP(12));
// m_button_report->SetMinSize(wxSize(FromDIP(48), FromDIP(24)));
// m_button_report->SetCornerRadius(FromDIP(12));
//m_button_pause_resume->SetMinSize(wxSize(FromDIP(48), FromDIP(24)));
//m_button_pause_resume->SetCornerRadius(FromDIP(12));
//m_button_abort->SetMinSize(wxSize(FromDIP(48), FromDIP(24)));
//m_button_abort->SetCornerRadius(FromDIP(12));
m_button_clean->SetMinSize(wxSize(FromDIP(48), FromDIP(24)));
m_button_clean->SetCornerRadius(FromDIP(12));
m_button_unload->SetMinSize(wxSize(-1, FromDIP(24)));
@ -1639,6 +1722,27 @@ void StatusPanel::update_left_time(int mc_left_time)
m_staticText_progress_left->SetLabelText(left_time_text);
}
void StatusPanel::update_basic_print_data(bool def)
{
if (def) {
auto aprint_stats = wxGetApp().plater()->get_partplate_list().get_current_fff_print().print_statistics();
wxString time;
PartPlate *plate = wxGetApp().plater()->get_partplate_list().get_curr_plate();
if (plate) {
if (plate->get_slice_result()) { time = wxString::Format("%s", get_bbl_monitor_time_dhm(plate->get_slice_result()->print_statistics.modes[0].time)); }
}
char weight[64];
::sprintf(weight, " %.2f g", aprint_stats.total_weight);
m_staticText_consumption_of_time->SetLabelText(time);
m_staticText_consumption_of_weight->SetLabelText(weight);
} else {
m_staticText_consumption_of_time->SetLabelText("0m");
m_staticText_consumption_of_weight->SetLabelText("0g");
}
}
void StatusPanel::update_subtask(MachineObject *obj)
{
if (!obj) return;
@ -1648,28 +1752,41 @@ void StatusPanel::update_subtask(MachineObject *obj)
} else if (obj->is_in_printing() || obj->print_status == "FINISH") {
if (obj->is_in_prepare()) {
m_button_abort->Enable(false);
m_button_abort->SetBitmap_("print_control_stop_disable");
m_button_pause_resume->Enable(false);
m_button_pause_resume->SetLabel(_L("Pause"));
m_button_pause_resume->SetBitmap_("print_control_pause_disable");
wxString prepare_text = wxString::Format(_L("Downloading..."));
if (obj->gcode_file_prepare_percent >= 0 && obj->gcode_file_prepare_percent <= 100)
prepare_text += wxString::Format("(%d%%)", obj->gcode_file_prepare_percent);
m_printing_stage_value->SetLabelText(prepare_text);
m_gauge_progress->SetValue(0);
m_staticText_progress_percent->SetLabelText(NA_STR);
m_staticText_progress_percent_icon->SetLabelText(wxEmptyString);
m_staticText_progress_left->SetLabel(NA_STR);
m_staticText_progress_left->SetLabelText(NA_STR);
wxString subtask_text = wxString::Format("%s", GUI::from_u8(obj->subtask_name));
m_staticText_subtask_value->SetLabelText(subtask_text);
update_basic_print_data(true);
} else {
if (obj->can_resume())
m_button_pause_resume->SetLabel(_L("Resume"));
else
m_button_pause_resume->SetLabel(_L("Pause"));
if (obj->can_resume()) {
m_button_pause_resume->SetBitmap_("print_control_resume");
if (m_button_pause_resume->GetToolTipText() != _L("Resume")) { m_button_pause_resume->SetToolTip(_L("Resume")); }
} else {
m_button_pause_resume->SetBitmap_("print_control_pause");
if (m_button_pause_resume->GetToolTipText() != _L("Pause")) { m_button_pause_resume->SetToolTip(_L("Pause")); }
}
if (obj->print_status == "FINISH") {
m_button_abort->Enable(false);
m_button_abort->SetBitmap_("print_control_stop_disable");
m_button_pause_resume->Enable(false);
m_button_pause_resume->SetBitmap_("print_control_resume_disable");
} else {
m_button_abort->Enable(true);
m_button_abort->SetBitmap_("print_control_stop");
m_button_pause_resume->Enable(true);
}
// update printing stage
@ -1677,14 +1794,17 @@ void StatusPanel::update_subtask(MachineObject *obj)
update_left_time(obj->mc_left_time);
if (obj->subtask_) {
m_gauge_progress->SetValue(obj->subtask_->task_progress);
m_staticText_progress_percent->SetLabelText(wxString::Format("%d%%", obj->subtask_->task_progress));
m_staticText_progress_percent->SetLabelText(wxString::Format("%d", obj->subtask_->task_progress));
m_staticText_progress_percent_icon->SetLabelText("%");
} else {
m_gauge_progress->SetValue(0);
m_staticText_progress_percent->SetLabelText(NA_STR);
m_staticText_progress_percent_icon->SetLabelText(wxEmptyString);
}
}
wxString subtask_text = wxString::Format("%s", GUI::from_u8(obj->subtask_name));
m_staticText_subtask_value->SetLabelText(subtask_text);
update_basic_print_data(true);
//update thumbnail
if (obj->is_sdcard_printing()) {
update_sdcard_subtask(obj);
@ -1744,13 +1864,18 @@ void StatusPanel::update_sdcard_subtask(MachineObject *obj)
void StatusPanel::reset_printing_values()
{
m_button_pause_resume->Enable(false);
m_button_pause_resume->SetLabel(_L("Pause"));
m_button_pause_resume->SetBitmap_("print_control_pause_disable");
m_button_abort->Enable(false);
m_button_abort->SetBitmap_("print_control_stop_disable");
m_gauge_progress->SetValue(0);
m_staticText_subtask_value->SetLabelText(NA_STR);
update_basic_print_data(false);
m_printing_stage_value->SetLabelText("");
m_staticText_progress_left->SetLabelText(NA_STR);
m_staticText_progress_percent->SetLabelText(NA_STR);
m_staticText_progress_percent_icon->SetLabelText(wxEmptyString);
m_bitmap_thumbnail->SetBitmap(m_thumbnail_placeholder.bmp());
m_start_loading_thumbnail = false;
m_load_sdcard_thumbnail = false;

View File

@ -78,6 +78,8 @@ protected:
ScalableBitmap m_bitmap_lamp_off;
ScalableBitmap m_bitmap_fan_on;
ScalableBitmap m_bitmap_fan_off;
ScalableBitmap m_bitmap_use_time;
ScalableBitmap m_bitmap_use_weight;
wxBitmap m_bitmap_extruder;
CameraRecordingStatus m_state_recording{CameraRecordingStatus::RECORDING_NONE};
@ -97,6 +99,8 @@ protected:
wxPanel * m_panel_printing_title;
wxPanel * m_panel_control_title;
wxStaticText* m_staticText_consumption_of_time;
wxStaticText * m_staticText_consumption_of_weight;
wxStaticText * m_staticText_monitoring;
wxStaticText * m_staticText_timelapse;
SwitchButton * m_bmToggleBtn_timelapse;
@ -105,6 +109,8 @@ protected:
wxStaticBitmap *m_bitmap_recording_img;
wxStaticBitmap *m_bitmap_sdcard_on_img;
wxStaticBitmap *m_bitmap_sdcard_off_img;
wxStaticBitmap *m_bitmap_static_use_time;
wxStaticBitmap *m_bitmap_static_use_weight;
wxMediaCtrl2 * m_media_ctrl;
@ -116,10 +122,11 @@ protected:
wxStaticText * m_printing_stage_value;
ProgressBar* m_gauge_progress;
wxStaticText * m_staticText_progress_percent;
wxStaticText * m_staticText_progress_percent_icon;
wxStaticText * m_staticText_progress_left;
Button * m_button_report;
Button * m_button_pause_resume;
Button * m_button_abort;
ScalableButton *m_button_pause_resume;
ScalableButton *m_button_abort;
Button * m_button_clean;
wxStaticText * m_text_tasklist_caption;
@ -320,6 +327,7 @@ protected:
void update(MachineObject* obj);
void show_printing_status(bool ctrl_area = true, bool temp_area = true);
void update_left_time(int mc_left_time);
void update_basic_print_data(bool def = false);
void update_subtask(MachineObject *obj);
void update_cloud_subtask(MachineObject *obj);
void update_sdcard_subtask(MachineObject *obj);

View File

@ -34,6 +34,7 @@ wxFont Label::Body_15 = Label::sysFont(15, false);
wxFont Label::Body_14 = Label::sysFont(14, false);
wxFont Label::Body_13 = Label::sysFont(13, false);
wxFont Label::Body_12 = Label::sysFont(12, false);
wxFont Label::Body_11 = Label::sysFont(11, false);
wxFont Label::Body_10 = Label::sysFont(10, false);
wxFont Label::Body_9 = Label::sysFont(9, false);

View File

@ -27,6 +27,7 @@ public:
static wxFont Body_13;
static wxFont Body_12;
static wxFont Body_10;
static wxFont Body_11;
static wxFont Body_9;
static wxFont sysFont(int size, bool bold = false);