OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::PrintingTaskPanel Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/StatusPanel.hpp>

Inheritance diagram for Slic3r::GUI::PrintingTaskPanel:
Collaboration diagram for Slic3r::GUI::PrintingTaskPanel:

Public Member Functions

 PrintingTaskPanel (wxWindow *parent, PrintingTaskType type)
 ~PrintingTaskPanel ()
void create_panel (wxWindow *parent)
void init_bitmaps ()
void init_scaled_buttons ()
void error_info_reset ()
void show_error_msg (wxString msg)
void reset_printing_value ()
void msw_rescale ()
void enable_partskip_button (MachineObject *obj, bool enable)
void enable_pause_resume_button (bool enable, std::string type)
void enable_abort_button (bool enable)
void update_subtask_name (wxString name)
void update_stage_value (wxString stage, int val)
void update_stage_value_with_machine (wxString stage, int val, MachineObject *obj=nullptr)
void on_stage_clicked (wxMouseEvent &event)
void update_thermal_remaining_time (MachineObject *obj)
void update_progress_percent (wxString percent, wxString icon)
void update_left_time (wxString time)
void update_left_time (int mc_left_time)
void show_layers_num (bool show)
void update_layers_num (bool show, wxString num=wxEmptyString)
void show_priting_use_info (bool show, wxString time=wxEmptyString, wxString weight=wxEmptyString)
void show_profile_info (bool show, wxString profile=wxEmptyString)
void set_thumbnail_img (const wxBitmap &bmp, const std::string &bmp_name)
void set_brightness_value (int value)
void set_plate_index (int plate_idx=-1)
void market_scoring_show ()
void market_scoring_hide ()
ScalableButton * get_abort_button ()
ScalableButton * get_pause_resume_button ()
Button * get_partskip_button ()
Button * get_market_scoring_button ()
Button * get_market_retry_buttom ()
Button * get_clean_button ()
wxStaticBitmap * get_bitmap_thumbnail ()
wxPanel * get_request_failed_panel ()
int get_star_count ()
void set_star_count (int star_count)
std::vector< ScalableButton * > & get_score_star ()
bool get_star_count_dirty ()
void set_star_count_dirty (bool dirty)
int get_part_skipped_count ()
void set_part_skipped_count (int count)
int get_part_skipped_dirty ()
void set_part_skipped_dirty (int dirty)
void set_has_reted_text (bool has_rated)
void paint (wxPaintEvent &)

Private Attributes

MachineObject * m_obj {nullptr}
ScalableBitmap m_thumbnail_placeholder
std::string m_thumbnail_bmp_display_name
wxBitmap m_thumbnail_bmp_display
ScalableBitmap m_bitmap_use_time
ScalableBitmap m_bitmap_use_weight
ScalableBitmap m_bitmap_background
wxPanel * m_panel_printing_title
wxPanel * m_staticline
wxPanel * m_panel_error_txt
wxBoxSizer * m_printing_sizer
wxStaticText * m_staticText_printing
wxStaticText * m_staticText_subtask_value
wxStaticText * m_staticText_consumption_of_time
wxStaticText * m_staticText_consumption_of_weight
wxStaticText * m_printing_stage_value
ScalableButton * m_question_button
wxStaticText * m_staticText_profile_value
wxStaticText * m_staticText_progress_percent
wxStaticText * m_staticText_progress_percent_icon
wxStaticText * m_staticText_progress_left
wxStaticText * m_staticText_progress_end
wxStaticText * m_staticText_layers
wxStaticText * m_has_rated_prompt
wxStaticText * m_request_failed_info
wxStaticBitmap * m_bitmap_thumbnail
int m_plate_index { -1 }
wxStaticBitmap * m_bitmap_static_use_time
wxStaticBitmap * m_bitmap_static_use_weight
ScalableButton * m_button_pause_resume
ScalableButton * m_button_abort
Button * m_button_partskip
Button * m_button_market_scoring
Button * m_button_clean
Button * m_button_market_retry
wxPanel * m_score_subtask_info
wxPanel * m_score_staticline
wxPanel * m_request_failed_panel
wxPanel * m_printing_stage_underline
wxPanel * m_printing_stage_panel
int m_star_count
std::vector< ScalableButton * > m_score_star
bool m_star_count_dirty = false
int m_part_skipped_count { 0 }
int m_part_skipped_dirty { 0 }
ProgressBar * m_gauge_progress
Label * m_error_text
PrintingTaskType m_type
int m_brightness_value { -1 }

Detailed Description

Constructor & Destructor Documentation

◆ PrintingTaskPanel()

Slic3r::GUI::PrintingTaskPanel::PrintingTaskPanel ( wxWindow * parent,
PrintingTaskType type )
570 : wxPanel(parent, wxID_ANY,wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
571{
572 m_type = type;
573 m_question_button = nullptr;
574 create_panel(this);
575 SetBackgroundColour(*wxWHITE);
576 m_bitmap_background = ScalableBitmap(this, "thumbnail_grid", m_bitmap_thumbnail->GetSize().y);
577
578 m_bitmap_thumbnail->Bind(wxEVT_PAINT, &PrintingTaskPanel::paint, this);
579}
void create_panel(wxWindow *parent)
Definition StatusPanel.cpp:589
ScalableBitmap m_bitmap_background
Definition StatusPanel.hpp:300
PrintingTaskType m_type
Definition StatusPanel.hpp:349
ScalableButton * m_question_button
Definition StatusPanel.hpp:312
wxStaticBitmap * m_bitmap_thumbnail
Definition StatusPanel.hpp:322
void paint(wxPaintEvent &)
Definition StatusPanel.cpp:1045

References create_panel(), m_bitmap_background, m_bitmap_thumbnail, m_question_button, m_type, and paint().

Here is the call graph for this function:

◆ ~PrintingTaskPanel()

Slic3r::GUI::PrintingTaskPanel::~PrintingTaskPanel ( )
582{
583 if (m_question_button) {
584 delete m_question_button;
585 m_question_button = nullptr;
586 }
587}

References m_question_button.

Member Function Documentation

◆ create_panel()

void Slic3r::GUI::PrintingTaskPanel::create_panel ( wxWindow * parent)
590{
591 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
592 wxBoxSizer *bSizer_printing_title = new wxBoxSizer(wxHORIZONTAL);
593
594 m_panel_printing_title = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(-1, PAGE_TITLE_HEIGHT), wxTAB_TRAVERSAL);
595 m_panel_printing_title->SetBackgroundColour(STATUS_TITLE_BG);
596
597 m_staticText_printing = new wxStaticText(m_panel_printing_title, wxID_ANY ,_L("Printing progress"));
598 m_staticText_printing->Wrap(-1);
599 //m_staticText_printing->SetFont(PAGE_TITLE_FONT);
600 m_staticText_printing->SetForegroundColour(PAGE_TITLE_FONT_COL);
601
602 bSizer_printing_title->Add(m_staticText_printing, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, PAGE_TITLE_LEFT_MARGIN);
603 bSizer_printing_title->Add(0, 0, 1, wxEXPAND, 0);
604
605 m_panel_printing_title->SetSizer(bSizer_printing_title);
606 m_panel_printing_title->Layout();
607 bSizer_printing_title->Fit(m_panel_printing_title);
608
609 m_bitmap_thumbnail = new wxStaticBitmap(parent, wxID_ANY, m_thumbnail_placeholder.bmp(), wxDefaultPosition, TASK_THUMBNAIL_SIZE, 0);
612
613 wxBoxSizer *bSizer_subtask_info = new wxBoxSizer(wxVERTICAL);
614 wxBoxSizer *bSizer_task_name = new wxBoxSizer(wxVERTICAL);
615 wxBoxSizer *bSizer_task_name_hor = new wxBoxSizer(wxHORIZONTAL);
616 wxPanel* task_name_panel = new wxPanel(parent);
617 task_name_panel->SetBackgroundColour(*wxWHITE);
618
619 m_staticText_subtask_value = new wxStaticText(task_name_panel, wxID_ANY, _L("N/A"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT | wxST_ELLIPSIZE_END);
620 m_staticText_subtask_value->SetMaxSize(wxSize(FromDIP(600), -1));
622 #ifdef __WXOSX_MAC__
624 #else
625 m_staticText_subtask_value->SetFont(wxFont(13, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
626 #endif
627 m_staticText_subtask_value->SetForegroundColour(wxColour(44, 44, 46));
628
629 m_bitmap_static_use_time = new wxStaticBitmap(task_name_panel, wxID_ANY, m_bitmap_use_time.bmp(), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)));
630
631 m_staticText_consumption_of_time = new wxStaticText(task_name_panel, wxID_ANY, "0m", wxDefaultPosition, wxDefaultSize, 0);
633 m_staticText_consumption_of_time->SetForegroundColour(wxColour(0x68, 0x68, 0x68));
635
636
637 m_bitmap_static_use_weight = new wxStaticBitmap(task_name_panel, wxID_ANY, m_bitmap_use_weight.bmp(), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)));
638
639
640 m_staticText_consumption_of_weight = new wxStaticText(task_name_panel, wxID_ANY, "0g", wxDefaultPosition, wxDefaultSize, 0);
642 m_staticText_consumption_of_weight->SetForegroundColour(wxColour(0x68, 0x68, 0x68));
644
645 bSizer_task_name_hor->Add(m_staticText_subtask_value, 1, wxALL | wxEXPAND, 0);
646 bSizer_task_name_hor->Add(m_bitmap_static_use_time, 0, wxALIGN_CENTER_VERTICAL, 0);
647 bSizer_task_name_hor->Add(m_staticText_consumption_of_time, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, FromDIP(3));
648 bSizer_task_name_hor->Add(0, 0, 0, wxLEFT, FromDIP(10));
649 bSizer_task_name_hor->Add(m_bitmap_static_use_weight, 0, wxALIGN_CENTER_VERTICAL, 0);
650 bSizer_task_name_hor->Add(m_staticText_consumption_of_weight, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(3));
651 bSizer_task_name_hor->Add(0, 0, 0, wxRIGHT, FromDIP(10));
652
653
654 task_name_panel->SetSizer(bSizer_task_name_hor);
655 task_name_panel->Layout();
656 task_name_panel->Fit();
657
658 bSizer_task_name->Add(task_name_panel, 0, wxEXPAND, FromDIP(5));
659
660
661 m_staticText_profile_value = new wxStaticText(parent, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT | wxST_ELLIPSIZE_END);
663#ifdef __WXOSX_MAC__
665#else
666 m_staticText_profile_value->SetFont(wxFont(11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
667#endif
668
669 m_staticText_profile_value->SetForegroundColour(0x6B6B6B);
670
671 auto progress_lr_panel = new wxPanel(parent, wxID_ANY);
672 progress_lr_panel->SetBackgroundColour(*wxWHITE);
673
674 m_gauge_progress = new ProgressBar(progress_lr_panel, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize);
675 m_gauge_progress->SetValue(0);
677
678 wxBoxSizer *bSizer_task_btn = new wxBoxSizer(wxHORIZONTAL);
679
680 bSizer_task_btn->Add(FromDIP(10), 0, 0);
681
682 StateColor white_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Pressed),
683 std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
684 std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
685
686 m_button_partskip = new Button(progress_lr_panel, wxEmptyString, "print_control_partskip_disable", 0, 16, wxID_ANY); // ORCA match icon size
687 m_button_partskip->Enable(false);
688 m_button_partskip->Hide();
689 m_button_partskip->SetBackgroundColor(white_bg);
690 m_button_partskip->SetIcon("print_control_partskip_disable");
691 m_button_partskip->SetBorderColor(*wxWHITE);
693 m_button_partskip->SetCornerRadius(0);
694 m_button_partskip->SetToolTip(_L("Parts Skip"));
695 m_button_partskip->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) { m_button_partskip->SetIcon("print_control_partskip_hover"); });
696 m_button_partskip->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { m_button_partskip->SetIcon("print_control_partskip"); });
697
698 m_button_pause_resume = new ScalableButton(progress_lr_panel, wxID_ANY, "print_control_pause", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER,true);
699
700 m_button_pause_resume->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {
701 if (m_button_pause_resume->GetToolTipText() == _L_CONTEXT("Pause", "Verb")) {
702 m_button_pause_resume->SetBitmap_("print_control_pause_hover");
703 }
704
705 if (m_button_pause_resume->GetToolTipText() == _L("Resume")) {
706 m_button_pause_resume->SetBitmap_("print_control_resume_hover");
707 }
708 });
709
710 m_button_pause_resume->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {
711 auto buf = m_button_pause_resume->GetClientData();
712 if (m_button_pause_resume->GetToolTipText() == _L_CONTEXT("Pause", "Verb")) {
713 m_button_pause_resume->SetBitmap_("print_control_pause");
714 }
715
716 if (m_button_pause_resume->GetToolTipText() == _L("Resume")) {
717 m_button_pause_resume->SetBitmap_("print_control_resume");
718 }
719 });
720
721 m_button_abort = new ScalableButton(progress_lr_panel, wxID_ANY, "print_control_stop", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
722 m_button_abort->SetToolTip(_L("Stop"));
723
724 m_button_abort->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {
725 m_button_abort->SetBitmap_("print_control_stop_hover");
726 });
727
728 m_button_abort->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {
729 m_button_abort->SetBitmap_("print_control_stop"); }
730 );
731
732 wxBoxSizer *bSizer_buttons = new wxBoxSizer(wxHORIZONTAL);
733 wxBoxSizer *bSizer_text = new wxBoxSizer(wxHORIZONTAL);
734 wxBoxSizer *bSizer_finish_time = new wxBoxSizer(wxHORIZONTAL);
735 wxPanel* penel_text = new wxPanel(progress_lr_panel);
736 wxPanel* penel_finish_time = new wxPanel(progress_lr_panel);
737
738 penel_text->SetBackgroundColour(*wxWHITE);
739 penel_finish_time->SetBackgroundColour(*wxWHITE);
740
741 wxBoxSizer *sizer_percent = new wxBoxSizer(wxVERTICAL);
742 sizer_percent->Add(0, 0, 1, wxEXPAND, 0);
743
744 wxBoxSizer *sizer_percent_icon = new wxBoxSizer(wxVERTICAL);
745 sizer_percent_icon->Add(0, 0, 1, wxEXPAND, 0);
746
747
748 m_staticText_progress_percent = new wxStaticText(penel_text, wxID_ANY, "0", wxDefaultPosition, wxDefaultSize, 0);
750 m_staticText_progress_percent->SetMaxSize(wxSize(-1, FromDIP(20)));
751 m_staticText_progress_percent->SetForegroundColour(wxColour(0, 150, 136));
752
753 m_staticText_progress_percent_icon = new wxStaticText(penel_text, wxID_ANY, "%", wxDefaultPosition, wxDefaultSize, 0);
755 m_staticText_progress_percent_icon->SetMaxSize(wxSize(-1, FromDIP(13)));
756 m_staticText_progress_percent_icon->SetForegroundColour(wxColour(0, 150, 136));
757
758 sizer_percent->Add(m_staticText_progress_percent, 0, 0, 0);
759
760 #ifdef __WXOSX_MAC__
761 sizer_percent_icon->Add(m_staticText_progress_percent_icon, 0, wxBOTTOM, FromDIP(2));
762 #else
763 sizer_percent_icon->Add(m_staticText_progress_percent_icon, 0, 0, 0);
764 #endif
765
766
767 m_staticText_progress_left = new wxStaticText(penel_text, wxID_ANY, _L("N/A"), wxDefaultPosition, wxDefaultSize, 0);
769 m_staticText_progress_left->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
770 m_staticText_progress_left->SetForegroundColour(wxColour(146, 146, 146));
771
772 m_staticText_layers = new wxStaticText(penel_text, wxID_ANY, _L("Layer: N/A"));
773 m_staticText_layers->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
774 m_staticText_layers->SetForegroundColour(wxColour(146, 146, 146));
775 m_staticText_layers->Hide();
776
777 bSizer_text->Add(sizer_percent, 0, wxEXPAND, 0);
778 bSizer_text->Add(sizer_percent_icon, 0, wxEXPAND, 0);
779 bSizer_text->Add(0, 0, 1, wxEXPAND, 0);
780 bSizer_text->Add(m_staticText_layers, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0);
781 bSizer_text->Add(0, 0, 0, wxLEFT, FromDIP(20));
782 bSizer_text->Add(m_staticText_progress_left, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0);
783
784 m_printing_stage_panel = new wxPanel(penel_finish_time);
785 m_printing_stage_panel->SetBackgroundColour(*wxWHITE);
786 wxBoxSizer *printingstage_vertical_sizer = new wxBoxSizer(wxVERTICAL);
787 wxBoxSizer *printingstage_horizontal_sizer = new wxBoxSizer(wxHORIZONTAL);
788
790 m_printing_stage_underline->SetMaxSize(wxSize(-1, FromDIP(1)));
791 m_printing_stage_underline->SetMinSize(wxSize(-1, FromDIP(1)));
792 m_printing_stage_underline->SetBackgroundColour(wxColour(146, 146, 146));
794
795 m_printing_stage_value = new wxStaticText(m_printing_stage_panel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT | wxST_ELLIPSIZE_END);
796 m_printing_stage_value->Wrap(-1);
797 m_printing_stage_value->SetMaxSize(wxSize(FromDIP(800), -1));
798#ifdef __WXOSX_MAC__
800#else
801 m_printing_stage_value->SetFont(wxFont(11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
802#endif
803 m_printing_stage_value->SetForegroundColour(STAGE_TEXT_COL);
804
806
807 m_printing_stage_value->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent &event) {
808 auto *dev_manager = wxGetApp().getDeviceManager();
809 MachineObject *obj = dev_manager ? dev_manager->get_selected_machine() : nullptr;
810 if (obj && obj->stage_curr == 58) {
811 m_printing_stage_value->SetCursor(wxCursor(wxCURSOR_HAND));
813 } else {
814 m_printing_stage_value->SetCursor(wxCursor(wxCURSOR_ARROW));
816 }
817 m_printing_stage_panel->Layout();
818 Layout();
819 event.Skip();
820 });
821 m_printing_stage_value->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent &event) {
822 auto *dev_manager = wxGetApp().getDeviceManager();
823 MachineObject *obj = dev_manager ? dev_manager->get_selected_machine() : nullptr;
824 if (obj && obj->stage_curr == 58) {
825 m_printing_stage_value->SetCursor(wxCURSOR_ARROW);
827 }
828 m_printing_stage_panel->Layout();
829 Layout();
830 event.Skip();
831 });
832
833 // penel_text->SetMaxSize(wxSize(FromDIP(600), -1));
834 penel_text->SetSizer(bSizer_text);
835 penel_text->Layout();
836
837
838 // Create question button
839 m_question_button = new ScalableButton(m_printing_stage_panel, wxID_ANY, "thermal_question", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
840 m_question_button->SetToolTip(_L("Click to view thermal preconditioning explanation"));
841 m_question_button->SetBackgroundColour(wxColour(255, 255, 255));
842 m_question_button->Hide(); // Hide by default
843 m_question_button->Bind(wxEVT_LEFT_UP, &PrintingTaskPanel::on_stage_clicked, this);
844 m_question_button->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent &event) {
845 auto *dev_manager = wxGetApp().getDeviceManager();
846 MachineObject *obj = dev_manager ? dev_manager->get_selected_machine() : nullptr;
847 if (obj && obj->stage_curr == 58) {
848 m_question_button->SetCursor(wxCursor(wxCURSOR_HAND));
850 }
851 event.Skip();
852 });
853 m_question_button->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent &event) {
854 auto *dev_manager = wxGetApp().getDeviceManager();
855 MachineObject *obj = dev_manager ? dev_manager->get_selected_machine() : nullptr;
856 if (obj && obj->stage_curr == 58) {
857 m_question_button->SetCursor(wxCURSOR_ARROW);
859 event.Skip();
860 }
861 });
862
863 printingstage_horizontal_sizer->Add(m_printing_stage_value, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, 0);
864 printingstage_horizontal_sizer->Add(m_question_button, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(5));
865 printingstage_vertical_sizer->Add(printingstage_horizontal_sizer, 0, wxALIGN_CENTER_VERTICAL, 0);
866 printingstage_vertical_sizer->Add(m_printing_stage_underline, 0, wxEXPAND, 0);
867 m_printing_stage_panel->SetSizer(printingstage_vertical_sizer);
868
869 // Orca: display the end time of the print
870 m_staticText_progress_end = new wxStaticText(penel_finish_time, wxID_ANY, _L("N/A"), wxDefaultPosition, wxDefaultSize, 0);
873 wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
874 m_staticText_progress_end->SetForegroundColour(wxColour(146, 146, 146));
875 bSizer_finish_time->Add(m_printing_stage_panel, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, 0);
876 bSizer_finish_time->Add(0, 0, 1, wxEXPAND, 0);
877 bSizer_finish_time->Add(m_staticText_progress_end, 0, wxLEFT | wxEXPAND, 0);
878 // penel_finish_time->SetMaxSize(wxSize(FromDIP(600), -1));
879 penel_finish_time->SetSizer(bSizer_finish_time);
880 penel_finish_time->Layout();
881
882 auto progress_lr_sizer = new wxBoxSizer(wxHORIZONTAL);
883 auto progress_left_sizer = new wxBoxSizer(wxVERTICAL);
884 auto progress_right_sizer = new wxBoxSizer(wxHORIZONTAL);
885
886 progress_left_sizer->Add(penel_text, 0, wxEXPAND | wxALL, 0);
887 progress_left_sizer->Add(m_gauge_progress, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(10));
888
889
890 progress_left_sizer->Add(penel_finish_time, 0, wxEXPAND |wxALL, 0);
891 // progress_left_sizer->SetMaxSize(wxSize(FromDIP(600), -1));
892
893 progress_right_sizer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(18));
894 progress_right_sizer->Add(m_button_partskip, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(0));//5
895 progress_right_sizer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(18));
896 progress_right_sizer->Add(m_button_pause_resume, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(0));
897 progress_right_sizer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(18));
898 progress_right_sizer->Add(m_button_abort, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(0));
899 progress_right_sizer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(18));
900
901 progress_lr_sizer->Add(progress_left_sizer, 1, wxEXPAND | wxALL, 0);
902 progress_lr_sizer->Add(progress_right_sizer, 0, wxEXPAND | wxALL , 0);
903
904 progress_lr_panel->SetSizer(progress_lr_sizer);
905 progress_lr_panel->SetMaxSize(wxSize(FromDIP(720), -1));
906
907 progress_lr_panel->Layout();
908 progress_lr_panel->Fit();
909
910 bSizer_subtask_info->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(14));
911 bSizer_subtask_info->Add(bSizer_task_name, 0, wxEXPAND|wxRIGHT, FromDIP(18));
912 bSizer_subtask_info->Add(m_staticText_profile_value, 0, wxEXPAND | wxTOP, FromDIP(5));
913 bSizer_subtask_info->Add(progress_lr_panel, 0, wxEXPAND | wxTOP, FromDIP(5));
914
915 m_printing_sizer = new wxBoxSizer(wxHORIZONTAL);
916 m_printing_sizer->SetMinSize(wxSize(PAGE_MIN_WIDTH, -1));
917 m_printing_sizer->Add(m_bitmap_thumbnail, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, FromDIP(12));
918 m_printing_sizer->Add(FromDIP(8), 0, 0, wxEXPAND, 0);
919 m_printing_sizer->Add(bSizer_subtask_info, 1, wxALL | wxEXPAND, 0);
920
921 m_staticline = new wxPanel( parent, wxID_ANY);
922 m_staticline->SetBackgroundColour(wxColour(238,238,238));
923 m_staticline->Layout();
924 m_staticline->Hide();
925
926 m_panel_error_txt = new wxPanel(parent, wxID_ANY);
927 m_panel_error_txt->SetBackgroundColour(*wxWHITE);
928
929 wxBoxSizer *static_text_sizer = new wxBoxSizer(wxHORIZONTAL);
930
932 m_error_text->SetForegroundColour(wxColour(255, 0, 0));
933 static_text_sizer->Add(m_error_text, 1, wxEXPAND | wxLEFT, FromDIP(17));
934
935 m_button_clean = new Button(m_panel_error_txt, _L("Clear"));
937
938 static_text_sizer->Add( FromDIP(10), 0, 0, 0, 0 );
939 static_text_sizer->Add(m_button_clean, 0, wxALIGN_CENTRE_VERTICAL|wxRIGHT, FromDIP(5));
940
941 m_panel_error_txt->SetSizer(static_text_sizer);
942 m_panel_error_txt->Hide();
943
944 sizer->Add(m_panel_printing_title, 0, wxEXPAND | wxALL, 0);
945 sizer->Add(0, FromDIP(12), 0);
946 sizer->Add(m_printing_sizer, 0, wxEXPAND | wxALL, 0);
947 sizer->Add(0, 0, 0, wxTOP, FromDIP(15));
948 sizer->Add(m_staticline, 0, wxEXPAND | wxALL, FromDIP(10));
949 sizer->Add(m_panel_error_txt, 0, wxEXPAND | wxALL, 0);
950 sizer->Add(0, FromDIP(12), 0);
951
952 m_score_staticline = new wxPanel(parent, wxID_ANY);
953 m_score_staticline->SetBackgroundColour(wxColour(238, 238, 238));
954 m_score_staticline->Layout();
955 m_score_staticline->Hide();
956 sizer->Add(0, 0, 0, wxTOP, FromDIP(15));
957 sizer->Add(m_score_staticline, 0, wxEXPAND | wxALL, FromDIP(10));
958 m_request_failed_panel = new wxPanel(parent, wxID_ANY);
959 m_request_failed_panel->SetBackgroundColour(*wxWHITE);
960 wxBoxSizer *static_request_failed_panel_sizer = new wxBoxSizer(wxHORIZONTAL);
961 m_request_failed_info = new wxStaticText(m_request_failed_panel, wxID_ANY, _L("You have completed printing the mall model, \nbut synchronizing rating information has failed."), wxDefaultPosition, wxDefaultSize, 0);
962 m_request_failed_info->Wrap(-1);
963 m_request_failed_info->SetForegroundColour(*wxRED);
965 static_request_failed_panel_sizer->Add(m_request_failed_info, 0, wxEXPAND | wxALL, FromDIP(10));
966
967 m_button_market_retry = new Button(m_request_failed_panel, _L("Retry"));
969
970 static_request_failed_panel_sizer->Add(0, 0, 1, wxEXPAND, 0);
971 static_request_failed_panel_sizer->Add(m_button_market_retry, 0, wxEXPAND | wxALL, FromDIP(10));
972 m_request_failed_panel->SetSizer(static_request_failed_panel_sizer);
974 sizer->Add(m_request_failed_panel, 0, wxEXPAND | wxALL, FromDIP(10));
975
976
977 m_score_subtask_info = new wxPanel(parent, wxID_ANY);
978 m_score_subtask_info->SetBackgroundColour(*wxWHITE);
979
980 wxBoxSizer * static_score_sizer = new wxBoxSizer(wxVERTICAL);
981 wxStaticText *static_score_text = new wxStaticText(m_score_subtask_info, wxID_ANY, _L("How do you like this printing file?"), wxDefaultPosition, wxDefaultSize, 0);
982 static_score_text->Wrap(-1);
983 static_score_sizer->Add(static_score_text, 1, wxEXPAND | wxALL, FromDIP(10));
984 m_has_rated_prompt = new wxStaticText(m_score_subtask_info, wxID_ANY, _L("(The model has already been rated. Your rating will overwrite the previous rating.)"), wxDefaultPosition, wxDefaultSize, 0);
985 m_has_rated_prompt->Wrap(-1);
986 m_has_rated_prompt->SetForegroundColour(*wxBLACK);
988 m_has_rated_prompt->Hide();
989
990 m_star_count = 0;
991 wxBoxSizer *static_score_star_sizer = new wxBoxSizer(wxHORIZONTAL);
992 m_score_star.resize(5);
993 for (int i = 0; i < m_score_star.size(); ++i) {
994 m_score_star[i] = new ScalableButton(m_score_subtask_info, wxID_ANY, "score_star_dark", wxEmptyString, wxSize(FromDIP(26), FromDIP(26)), wxDefaultPosition,
995 wxBU_EXACTFIT | wxNO_BORDER, true, 26);
996 m_score_star[i]->SetMinSize(wxSize(FromDIP(26), FromDIP(26)));
997 m_score_star[i]->SetMaxSize(wxSize(FromDIP(26), FromDIP(26)));
998 m_score_star[i]->Bind(wxEVT_LEFT_DOWN, [this, i](auto &e) {
999 for (int j = 0; j < m_score_star.size(); ++j) {
1000 ScalableBitmap light_star = ScalableBitmap(nullptr, "score_star_light", 26);
1001 m_score_star[j]->SetBitmap(light_star.bmp());
1002 if (m_score_star[j] == m_score_star[i]) {
1003 m_star_count = j + 1;
1004 break;
1005 }
1006 }
1007 for (int k = m_star_count; k < m_score_star.size(); ++k) {
1008 ScalableBitmap dark_star = ScalableBitmap(nullptr, "score_star_dark", 26);
1009 m_score_star[k]->SetBitmap(dark_star.bmp());
1010 }
1011 m_star_count_dirty = true;
1012 m_button_market_scoring->Enable(true);
1013 });
1014 static_score_star_sizer->Add(m_score_star[i], 1, wxEXPAND | wxLEFT, FromDIP(5));
1015 }
1016
1017 m_button_market_scoring = new Button(m_score_subtask_info, _L("Rate"));
1019 m_button_market_scoring->Enable(false);
1020
1021 static_score_star_sizer->Add(0, 0, 1, wxEXPAND, 0);
1022 static_score_star_sizer->Add(m_button_market_scoring, 0, wxEXPAND | wxRIGHT, FromDIP(10));
1023 static_score_sizer->Add(static_score_star_sizer, 0, wxEXPAND, FromDIP(10));
1024 static_score_sizer->Add(m_has_rated_prompt, 1, wxEXPAND | wxALL, FromDIP(10));
1025
1026 m_score_subtask_info->SetSizer(static_score_sizer);
1027 m_score_subtask_info->Layout();
1028 m_score_subtask_info->Hide();
1029
1030 sizer->Add(m_score_subtask_info, 0, wxEXPAND | wxALL, 0);
1031 sizer->Add(0, FromDIP(12), 0);
1032
1033 if (m_type == CALIBRATION) {
1034 m_panel_printing_title->Hide();
1035 m_bitmap_thumbnail->Hide();
1036 task_name_panel->Hide();
1038 }
1039
1040 parent->SetSizer(sizer);
1041 parent->Layout();
1042 parent->Fit();
1043}
@ Confirm
Definition Button.hpp:25
@ Regular
Definition Button.hpp:24
@ Window
Definition Button.hpp:32
#define LB_AUTO_WRAP
Definition Label.hpp:12
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
#define PROGRESSBAR_HEIGHT
Definition StatusPanel.cpp:178
#define TASK_THUMBNAIL_SIZE
Definition StatusPanel.cpp:181
#define PAGE_TITLE_HEIGHT
Definition StatusPanel.cpp:168
#define PAGE_TITLE_LEFT_MARGIN
Definition StatusPanel.cpp:170
#define PAGE_MIN_WIDTH
Definition StatusPanel.cpp:177
static wxFont Body_13
Definition Label.hpp:54
static wxFont Head_18
Definition Label.hpp:42
static wxFont Body_11
Definition Label.hpp:57
static wxFont Body_12
Definition Label.hpp:55
static wxFont Body_10
Definition Label.hpp:56
const wxBitmap & bmp() const
Definition wxExtensions.hpp:189
wxStaticText * m_staticText_subtask_value
Definition StatusPanel.hpp:308
ScalableButton * m_button_abort
Definition StatusPanel.hpp:327
ScalableBitmap m_bitmap_use_weight
Definition StatusPanel.hpp:299
wxPanel * m_staticline
Definition StatusPanel.hpp:303
std::vector< ScalableButton * > m_score_star
Definition StatusPanel.hpp:340
Button * m_button_market_retry
Definition StatusPanel.hpp:331
ScalableButton * m_button_pause_resume
Definition StatusPanel.hpp:326
wxPanel * m_panel_error_txt
Definition StatusPanel.hpp:304
Label * m_error_text
Definition StatusPanel.hpp:348
wxStaticText * m_has_rated_prompt
Definition StatusPanel.hpp:320
wxPanel * m_score_staticline
Definition StatusPanel.hpp:333
bool m_star_count_dirty
Definition StatusPanel.hpp:341
ProgressBar * m_gauge_progress
Definition StatusPanel.hpp:347
wxStaticText * m_staticText_profile_value
Definition StatusPanel.hpp:313
wxStaticText * m_staticText_progress_percent
Definition StatusPanel.hpp:314
ScalableBitmap m_bitmap_use_time
Definition StatusPanel.hpp:298
wxStaticText * m_staticText_printing
Definition StatusPanel.hpp:307
Button * m_button_market_scoring
Definition StatusPanel.hpp:329
wxPanel * m_score_subtask_info
Definition StatusPanel.hpp:332
ScalableBitmap m_thumbnail_placeholder
Definition StatusPanel.hpp:295
wxStaticBitmap * m_bitmap_static_use_time
Definition StatusPanel.hpp:324
wxStaticText * m_staticText_consumption_of_weight
Definition StatusPanel.hpp:310
wxPanel * m_printing_stage_underline
Definition StatusPanel.hpp:335
wxStaticText * m_staticText_layers
Definition StatusPanel.hpp:319
wxStaticText * m_staticText_progress_left
Definition StatusPanel.hpp:316
wxStaticText * m_staticText_consumption_of_time
Definition StatusPanel.hpp:309
wxPanel * m_printing_stage_panel
Definition StatusPanel.hpp:336
Button * m_button_partskip
Definition StatusPanel.hpp:328
wxPanel * m_panel_printing_title
Definition StatusPanel.hpp:302
wxStaticText * m_request_failed_info
Definition StatusPanel.hpp:321
wxBoxSizer * m_printing_sizer
Definition StatusPanel.hpp:306
wxPanel * m_request_failed_panel
Definition StatusPanel.hpp:334
wxStaticText * m_staticText_progress_end
Definition StatusPanel.hpp:318
wxStaticText * m_staticText_progress_percent_icon
Definition StatusPanel.hpp:315
Button * m_button_clean
Definition StatusPanel.hpp:330
wxStaticBitmap * m_bitmap_static_use_weight
Definition StatusPanel.hpp:325
int m_star_count
Definition StatusPanel.hpp:339
wxStaticText * m_printing_stage_value
Definition StatusPanel.hpp:311
void on_stage_clicked(wxMouseEvent &event)
Definition StatusPanel.cpp:1213
@ Hovered
Definition StateColor.hpp:20
@ Normal
Definition StateColor.hpp:16
@ Disabled
Definition StateColor.hpp:22
@ Pressed
Definition StateColor.hpp:21
@ Enabled
Definition StateColor.hpp:17
wxMouseEvent
Definition CameraPopup.cpp:47
static const wxColour STATUS_TITLE_BG
Definition StatusPanel.cpp:140
static wxColour PAGE_TITLE_FONT_COL
Definition StatusPanel.cpp:160
@ ProgressBar
Definition NotificationManager.hpp:112
@ CALIBRATION
Definition StatusPanel.hpp:100
static const wxColour STAGE_TEXT_COL
Definition StatusPanel.cpp:152
#define _L_CONTEXT(s, ctx)
Definition I18N.hpp:15

References _L, _L_CONTEXT, ScalableBitmap::bmp(), Label::Body_10, Label::Body_11, Label::Body_12, Label::Body_13, Slic3r::GUI::CALIBRATION, Confirm, StateColor::Disabled, StateColor::Enabled, Label::Head_18, StateColor::Hovered, LB_AUTO_WRAP, m_bitmap_static_use_time, m_bitmap_static_use_weight, m_bitmap_thumbnail, m_bitmap_use_time, m_bitmap_use_weight, m_button_abort, m_button_clean, m_button_market_retry, m_button_market_scoring, m_button_partskip, m_button_pause_resume, m_error_text, m_gauge_progress, m_has_rated_prompt, m_panel_error_txt, m_panel_printing_title, m_printing_sizer, m_printing_stage_panel, m_printing_stage_underline, m_printing_stage_value, m_question_button, m_request_failed_info, m_request_failed_panel, m_score_star, m_score_staticline, m_score_subtask_info, m_star_count, m_star_count_dirty, m_staticline, m_staticText_consumption_of_time, m_staticText_consumption_of_weight, m_staticText_layers, m_staticText_printing, m_staticText_profile_value, m_staticText_progress_end, m_staticText_progress_left, m_staticText_progress_percent, m_staticText_progress_percent_icon, m_staticText_subtask_value, m_thumbnail_placeholder, m_type, StateColor::Normal, on_stage_clicked(), PAGE_MIN_WIDTH, Slic3r::GUI::PAGE_TITLE_FONT_COL, PAGE_TITLE_HEIGHT, PAGE_TITLE_LEFT_MARGIN, StateColor::Pressed, Slic3r::GUI::ProgressBar, PROGRESSBAR_HEIGHT, Regular, Slic3r::MachineObject::stage_curr, Slic3r::GUI::STAGE_TEXT_COL, Slic3r::GUI::STATUS_TITLE_BG, TASK_THUMBNAIL_SIZE, Window, Slic3r::GUI::wxMouseEvent, and wxStaticText.

Referenced by PrintingTaskPanel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable_abort_button()

void Slic3r::GUI::PrintingTaskPanel::enable_abort_button ( bool enable)
1172{
1173 if (!enable) {
1174 m_button_abort->Enable(false);
1175 m_button_abort->SetBitmap_("print_control_stop_disable");
1176 }
1177 else {
1178 m_button_abort->Enable(true);
1179 m_button_abort->SetBitmap_("print_control_stop");
1180 }
1181}

References m_button_abort.

◆ enable_partskip_button()

void Slic3r::GUI::PrintingTaskPanel::enable_partskip_button ( MachineObject * obj,
bool enable )
1129{
1130 int stage = 0;
1131 bool in_calibration_mode = false;
1132 if( obj && (obj->print_type == "system" || CalibUtils::get_calib_mode_by_name(obj->subtask_name, stage) != CalibMode::Calib_None)){
1133 in_calibration_mode = true;
1134 }
1135
1136 if (!enable || in_calibration_mode) {
1137 m_button_partskip->Enable(false);
1138 m_button_partskip->SetLabel("");
1139 m_button_partskip->SetIcon("print_control_partskip_disable");
1140 }else if(obj && obj->is_support_brtc){
1141 m_button_partskip->Enable(true);
1142 m_button_partskip->SetIcon("print_control_partskip");
1143 }
1144}
static CalibMode get_calib_mode_by_name(const std::string name, int &cali_stage)
Definition CalibUtils.cpp:395
@ Calib_None
Definition calib.hpp:24

References Slic3r::Calib_None, Slic3r::GUI::CalibUtils::get_calib_mode_by_name(), Slic3r::MachineObject::is_support_brtc, m_button_partskip, Slic3r::MachineObject::print_type, and Slic3r::MachineObject::subtask_name.

Here is the call graph for this function:

◆ enable_pause_resume_button()

void Slic3r::GUI::PrintingTaskPanel::enable_pause_resume_button ( bool enable,
std::string type )
1147{
1148 if (!enable) {
1149 m_button_pause_resume->Enable(false);
1150
1151 if (type == "pause_disable") {
1152 m_button_pause_resume->SetBitmap_("print_control_pause_disable");
1153 }
1154 else if (type == "resume_disable") {
1155 m_button_pause_resume->SetBitmap_("print_control_resume_disable");
1156 }
1157 }
1158 else {
1159 m_button_pause_resume->Enable(true);
1160 if (type == "resume") {
1161 m_button_pause_resume->SetBitmap_("print_control_resume");
1162 if (m_button_pause_resume->GetToolTipText() != _L("Resume")) { m_button_pause_resume->SetToolTip(_L("Resume")); }
1163 }
1164 else if (type == "pause") {
1165 m_button_pause_resume->SetBitmap_("print_control_pause");
1166 if (m_button_pause_resume->GetToolTipText() != _L_CONTEXT("Pause", "Verb")) { m_button_pause_resume->SetToolTip(_L_CONTEXT("Pause", "Verb")); }
1167 }
1168 }
1169}

References _L, _L_CONTEXT, and m_button_pause_resume.

◆ error_info_reset()

void Slic3r::GUI::PrintingTaskPanel::error_info_reset ( )
1106{
1107 if (m_panel_error_txt->IsShown()) {
1108 m_staticline->Hide();
1109 m_panel_error_txt->Hide();
1110 m_panel_error_txt->GetParent()->Layout();
1111 m_error_text->SetLabel(wxEmptyString);
1112 }
1113}

References m_error_text, m_panel_error_txt, and m_staticline.

◆ get_abort_button()

ScalableButton * Slic3r::GUI::PrintingTaskPanel::get_abort_button ( )
inline
385{return m_button_abort;};

References m_button_abort.

◆ get_bitmap_thumbnail()

wxStaticBitmap * Slic3r::GUI::PrintingTaskPanel::get_bitmap_thumbnail ( )
inline
391{return m_bitmap_thumbnail;};

References m_bitmap_thumbnail.

◆ get_clean_button()

Button * Slic3r::GUI::PrintingTaskPanel::get_clean_button ( )
inline
390{return m_button_clean;};

References m_button_clean.

◆ get_market_retry_buttom()

Button * Slic3r::GUI::PrintingTaskPanel::get_market_retry_buttom ( )
inline
389{ return m_button_market_retry; };

References m_button_market_retry.

◆ get_market_scoring_button()

Button * Slic3r::GUI::PrintingTaskPanel::get_market_scoring_button ( )
inline

◆ get_part_skipped_count()

int Slic3r::GUI::PrintingTaskPanel::get_part_skipped_count ( )
inline
398{ return m_part_skipped_count; }
int m_part_skipped_count
Definition StatusPanel.hpp:344

References m_part_skipped_count.

◆ get_part_skipped_dirty()

int Slic3r::GUI::PrintingTaskPanel::get_part_skipped_dirty ( )
inline
400{ return m_part_skipped_dirty; }
int m_part_skipped_dirty
Definition StatusPanel.hpp:345

References m_part_skipped_dirty.

◆ get_partskip_button()

Button * Slic3r::GUI::PrintingTaskPanel::get_partskip_button ( )
inline
387{ return m_button_partskip; };

References m_button_partskip.

◆ get_pause_resume_button()

ScalableButton * Slic3r::GUI::PrintingTaskPanel::get_pause_resume_button ( )
inline
386{return m_button_pause_resume;};

References m_button_pause_resume.

◆ get_request_failed_panel()

wxPanel * Slic3r::GUI::PrintingTaskPanel::get_request_failed_panel ( )
inline
392{ return m_request_failed_panel; }

References m_request_failed_panel.

◆ get_score_star()

std::vector< ScalableButton * > & Slic3r::GUI::PrintingTaskPanel::get_score_star ( )
inline
395{ return m_score_star; }

References m_score_star.

◆ get_star_count()

int Slic3r::GUI::PrintingTaskPanel::get_star_count ( )
inline
393{ return m_star_count; }

References m_star_count.

◆ get_star_count_dirty()

bool Slic3r::GUI::PrintingTaskPanel::get_star_count_dirty ( )
inline
396{ return m_star_count_dirty; }

References m_star_count_dirty.

◆ init_bitmaps()

void Slic3r::GUI::PrintingTaskPanel::init_bitmaps ( )
1093{
1094 m_thumbnail_placeholder = ScalableBitmap(this, "monitor_placeholder", 120);
1095 m_bitmap_use_time = ScalableBitmap(this, "print_info_time", 16);
1096 m_bitmap_use_weight = ScalableBitmap(this, "print_info_weight", 16);
1097}

References m_bitmap_use_time, m_bitmap_use_weight, and m_thumbnail_placeholder.

◆ init_scaled_buttons()

void Slic3r::GUI::PrintingTaskPanel::init_scaled_buttons ( )
1100{
1101 m_button_clean->SetMinSize(wxSize(FromDIP(48), FromDIP(24)));
1102 m_button_clean->SetCornerRadius(FromDIP(12));
1103}

References m_button_clean.

◆ market_scoring_hide()

void Slic3r::GUI::PrintingTaskPanel::market_scoring_hide ( )
1357{
1358 m_score_staticline->Hide();
1359 m_score_subtask_info->Hide();
1360 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " hide market scoring page";
1361}

References m_score_staticline, and m_score_subtask_info.

◆ market_scoring_show()

void Slic3r::GUI::PrintingTaskPanel::market_scoring_show ( )
1350{
1351 m_score_staticline->Show();
1352 m_score_subtask_info->Show();
1353 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " show market scoring page";
1354}

References m_score_staticline, and m_score_subtask_info.

◆ msw_rescale()

void Slic3r::GUI::PrintingTaskPanel::msw_rescale ( )
1081{
1082 m_panel_printing_title->SetSize(wxSize(-1, FromDIP(PAGE_TITLE_HEIGHT)));
1083 m_printing_sizer->SetMinSize(wxSize(PAGE_MIN_WIDTH, -1));
1084 //m_staticText_printing->SetMinSize(wxSize(PAGE_TITLE_TEXT_WIDTH, PAGE_TITLE_HEIGHT));
1086 m_gauge_progress->Rescale();
1087 m_button_pause_resume->msw_rescale();
1088 m_button_abort->msw_rescale();
1090}

References m_bitmap_thumbnail, m_button_abort, m_button_pause_resume, m_gauge_progress, m_panel_printing_title, m_printing_sizer, PAGE_MIN_WIDTH, PAGE_TITLE_HEIGHT, PROGRESSBAR_HEIGHT, and TASK_THUMBNAIL_SIZE.

◆ on_stage_clicked()

void Slic3r::GUI::PrintingTaskPanel::on_stage_clicked ( wxMouseEvent & event)
1214{
1215 auto *dev_manager = wxGetApp().getDeviceManager();
1216 MachineObject *obj = dev_manager ? dev_manager->get_selected_machine() : nullptr;
1217
1218 if (obj && obj->stage_curr == 58) {
1219 wxWindow *top = wxGetTopLevelParent(this);
1220 ThermalPreconditioningDialog m_thermal_dialog(top ? top : this, obj->get_dev_id() , _L("Calculating..."));
1221 m_thermal_dialog.ShowModal();
1222 }
1223
1224 event.Skip();
1225}

References _L, Slic3r::MachineObject::get_dev_id(), Slic3r::MachineObject::stage_curr, and Slic3r::GUI::wxMouseEvent.

Referenced by create_panel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ paint()

void Slic3r::GUI::PrintingTaskPanel::paint ( wxPaintEvent & )
1046{
1047 wxPaintDC dc(m_bitmap_thumbnail);
1048 if (wxGetApp().dark_mode()) {
1050 dc.DrawBitmap(m_bitmap_background.bmp(), 0, 0);
1051 dc.SetTextForeground(*wxBLACK);
1052 }
1053 else
1054 dc.SetTextForeground(*wxWHITE);
1055 }
1056 else
1057 dc.SetTextForeground(*wxBLACK);
1058 if (m_thumbnail_bmp_display.IsOk()) {
1059 dc.DrawBitmap(m_thumbnail_bmp_display, wxPoint(0, 0));
1060 }
1061 dc.SetFont(Label::Body_12);
1062
1063 if (m_plate_index >= 0) {
1064 wxString plate_id_str = wxString::Format("%d", m_plate_index);
1065 dc.DrawText(plate_id_str, wxPoint(4, 4));
1066 }
1067}
#define SHOW_BACKGROUND_BITMAP_PIXEL_THRESHOLD
Definition GUI_App.hpp:56
int m_plate_index
Definition StatusPanel.hpp:323
int m_brightness_value
Definition StatusPanel.hpp:350
wxBitmap m_thumbnail_bmp_display
Definition StatusPanel.hpp:297

References Label::Body_12, m_bitmap_background, m_bitmap_thumbnail, m_brightness_value, m_plate_index, m_thumbnail_bmp_display, and SHOW_BACKGROUND_BITMAP_PIXEL_THRESHOLD.

Referenced by PrintingTaskPanel().

Here is the caller graph for this function:

◆ reset_printing_value()

void Slic3r::GUI::PrintingTaskPanel::reset_printing_value ( )
1123{
1125 this->set_plate_index(-1);
1126}
void set_thumbnail_img(const wxBitmap &bmp, const std::string &bmp_name)
Definition StatusPanel.cpp:1333
void set_plate_index(int plate_idx=-1)
Definition StatusPanel.cpp:1344

References m_thumbnail_placeholder, set_plate_index(), and set_thumbnail_img().

Here is the call graph for this function:

◆ set_brightness_value()

void Slic3r::GUI::PrintingTaskPanel::set_brightness_value ( int value)
inline
379{ m_brightness_value = value; }

References m_brightness_value.

◆ set_has_reted_text()

void Slic3r::GUI::PrintingTaskPanel::set_has_reted_text ( bool has_rated)
1070{
1071 if (has_rated) {
1072 m_has_rated_prompt->Show();
1073 } else {
1074 m_has_rated_prompt->Hide();
1075 }
1076 Layout();
1077 Fit();
1078}

References m_has_rated_prompt.

◆ set_part_skipped_count()

void Slic3r::GUI::PrintingTaskPanel::set_part_skipped_count ( int count)
inline
static unsigned int count
Definition AuxiliaryDataViewModel.cpp:246

References count, and m_part_skipped_count.

◆ set_part_skipped_dirty()

void Slic3r::GUI::PrintingTaskPanel::set_part_skipped_dirty ( int dirty)
inline
401{ m_part_skipped_dirty = dirty; }

References m_part_skipped_dirty.

◆ set_plate_index()

void Slic3r::GUI::PrintingTaskPanel::set_plate_index ( int plate_idx = -1)
1345{
1346 m_plate_index = plate_idx;
1347}

References m_plate_index.

Referenced by reset_printing_value().

Here is the caller graph for this function:

◆ set_star_count()

void Slic3r::GUI::PrintingTaskPanel::set_star_count ( int star_count)
1364{
1365 m_star_count = star_count;
1366
1367 for (int i = 0; i < m_score_star.size(); ++i) {
1368 if (i < star_count) {
1369 ScalableBitmap light_star = ScalableBitmap(nullptr, "score_star_light", 26);
1370 m_score_star[i]->SetBitmap(light_star.bmp());
1371 } else {
1372 ScalableBitmap dark_star = ScalableBitmap(nullptr, "score_star_dark", 26);
1373 m_score_star[i]->SetBitmap(dark_star.bmp());
1374 }
1375 }
1376}

References ScalableBitmap::bmp(), m_score_star, and m_star_count.

Here is the call graph for this function:

◆ set_star_count_dirty()

void Slic3r::GUI::PrintingTaskPanel::set_star_count_dirty ( bool dirty)
inline
397{ m_star_count_dirty = dirty; }

References m_star_count_dirty.

◆ set_thumbnail_img()

void Slic3r::GUI::PrintingTaskPanel::set_thumbnail_img ( const wxBitmap & bmp,
const std::string & bmp_name )
1334{
1335 if (!bmp_name.empty() && m_thumbnail_bmp_display_name == bmp_name) {
1336 return;
1337 }
1338
1341 Refresh();
1342}
std::string m_thumbnail_bmp_display_name
Definition StatusPanel.hpp:296

References m_thumbnail_bmp_display, and m_thumbnail_bmp_display_name.

Referenced by reset_printing_value().

Here is the caller graph for this function:

◆ show_error_msg()

void Slic3r::GUI::PrintingTaskPanel::show_error_msg ( wxString msg)
1116{
1117 m_staticline->Show();
1118 m_panel_error_txt->Show();
1119 m_error_text->SetLabel(msg);
1120}

References m_error_text, m_panel_error_txt, and m_staticline.

◆ show_layers_num()

void Slic3r::GUI::PrintingTaskPanel::show_layers_num ( bool show)
inline
374{ m_staticText_layers->Show(show); }

References m_staticText_layers.

◆ show_priting_use_info()

void Slic3r::GUI::PrintingTaskPanel::show_priting_use_info ( bool show,
wxString time = wxEmptyString,
wxString weight = wxEmptyString )
1289{
1290 if (show) {
1291 if (!m_staticText_consumption_of_time->IsShown()) {
1294 }
1295
1296 if (!m_staticText_consumption_of_weight->IsShown()) {
1299 }
1300
1301 m_staticText_consumption_of_time->SetLabelText(time);
1302 m_staticText_consumption_of_weight->SetLabelText(weight);
1303 }
1304 else {
1305 m_staticText_consumption_of_time->SetLabelText("0m");
1306 m_staticText_consumption_of_weight->SetLabelText("0g");
1307 if (m_staticText_consumption_of_time->IsShown()) {
1310 }
1311
1312 if (m_staticText_consumption_of_weight->IsShown()) {
1315 } }
1316}

References m_bitmap_static_use_time, m_bitmap_static_use_weight, m_staticText_consumption_of_time, and m_staticText_consumption_of_weight.

◆ show_profile_info()

void Slic3r::GUI::PrintingTaskPanel::show_profile_info ( bool show,
wxString profile = wxEmptyString )
1320{
1321 if (show) {
1322 if (!m_staticText_profile_value->IsShown()) { m_staticText_profile_value->Show(); }
1323 m_staticText_profile_value->SetLabelText(profile);
1324 }
1325 else {
1326 m_staticText_profile_value->SetLabelText(wxEmptyString);
1328 }
1329}

References m_staticText_profile_value.

◆ update_layers_num()

void Slic3r::GUI::PrintingTaskPanel::update_layers_num ( bool show,
wxString num = wxEmptyString )
1272{
1273 if ((show == m_staticText_layers->IsShown()) && (num == m_staticText_layers->GetLabelText()))
1274 {
1275 return;
1276 }
1277
1278 if (show) {
1279 m_staticText_layers->Show(true);
1280 m_staticText_layers->SetLabelText(num);
1281 }
1282 else {
1283 m_staticText_layers->Show(false);
1284 m_staticText_layers->SetLabelText(num);
1285 }
1286}

References m_staticText_layers.

◆ update_left_time() [1/2]

void Slic3r::GUI::PrintingTaskPanel::update_left_time ( int mc_left_time)
1239{
1240 // update gcode progress
1241 std::string left_time;
1242 wxString left_time_text = NA_STR;
1243
1244 try {
1245 left_time = get_bbl_monitor_time_dhm(mc_left_time);
1246 }
1247 catch (...) {
1248 ;
1249 }
1250
1251 if (!left_time.empty()) left_time_text = wxString::Format("-%s", left_time);
1252 update_left_time(left_time_text);
1253
1254 //Update end time
1255 std::string end_time;
1256 wxString end_time_text = NA_STR;
1257 try {
1258 end_time = get_bbl_monitor_end_time_dhm(mc_left_time);
1259 } catch (...) {
1260 ;
1261 }
1262 if (!end_time.empty())
1263 end_time_text = wxString::Format("%s", end_time);
1264 else
1265 end_time_text = NA_STR;
1266
1267 m_staticText_progress_end->SetLabelText(end_time_text);
1268
1269}
void update_left_time(wxString time)
Definition StatusPanel.cpp:1233
static const wxString NA_STR
Definition CalibrationWizard.cpp:47
std::string get_bbl_monitor_time_dhm(float time_in_secs)
Definition Utils.hpp:707
std::string get_bbl_monitor_end_time_dhm(float time_in_secs)
Definition Utils.hpp:729

References Slic3r::get_bbl_monitor_end_time_dhm(), Slic3r::get_bbl_monitor_time_dhm(), m_staticText_progress_end, Slic3r::GUI::NA_STR, and update_left_time().

Here is the call graph for this function:

◆ update_left_time() [2/2]

void Slic3r::GUI::PrintingTaskPanel::update_left_time ( wxString time)
1234{
1235 m_staticText_progress_left->SetLabelText(time);
1236}

References m_staticText_progress_left.

Referenced by update_left_time().

Here is the caller graph for this function:

◆ update_progress_percent()

void Slic3r::GUI::PrintingTaskPanel::update_progress_percent ( wxString percent,
wxString icon )
1228{
1229 m_staticText_progress_percent->SetLabelText(percent);
1230 m_staticText_progress_percent_icon->SetLabelText(icon);
1231}

References m_staticText_progress_percent, and m_staticText_progress_percent_icon.

◆ update_stage_value()

void Slic3r::GUI::PrintingTaskPanel::update_stage_value ( wxString stage,
int val )
1193{
1194 m_printing_stage_value->SetLabelText(stage);
1195 m_gauge_progress->SetValue(val);
1196}

References m_gauge_progress, and m_printing_stage_value.

◆ update_stage_value_with_machine()

void Slic3r::GUI::PrintingTaskPanel::update_stage_value_with_machine ( wxString stage,
int val,
MachineObject * obj = nullptr )
1199{
1200 m_gauge_progress->SetValue(val);
1201 m_printing_stage_value->SetLabelText(stage);
1202
1203 if (obj && obj->stage_curr == 58) {
1204 m_question_button->Show(); // Show question button
1205 } else {
1206 m_question_button->Hide(); // Hide question button
1208 }
1209 m_printing_stage_panel->Layout();
1210 Layout();
1211}

References m_gauge_progress, m_printing_stage_panel, m_printing_stage_underline, m_printing_stage_value, m_question_button, and Slic3r::MachineObject::stage_curr.

◆ update_subtask_name()

void Slic3r::GUI::PrintingTaskPanel::update_subtask_name ( wxString name)
1184{
1185 if (m_staticText_subtask_value->GetLabelText() != name)
1186 {
1187 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": " << name;
1188 }
1189 m_staticText_subtask_value->SetLabelText(name);
1190}

References m_staticText_subtask_value.

◆ update_thermal_remaining_time()

void Slic3r::GUI::PrintingTaskPanel::update_thermal_remaining_time ( MachineObject * obj)

Member Data Documentation

◆ m_bitmap_background

ScalableBitmap Slic3r::GUI::PrintingTaskPanel::m_bitmap_background
private

Referenced by PrintingTaskPanel(), and paint().

◆ m_bitmap_static_use_time

wxStaticBitmap* Slic3r::GUI::PrintingTaskPanel::m_bitmap_static_use_time
private

◆ m_bitmap_static_use_weight

wxStaticBitmap* Slic3r::GUI::PrintingTaskPanel::m_bitmap_static_use_weight
private

◆ m_bitmap_thumbnail

wxStaticBitmap* Slic3r::GUI::PrintingTaskPanel::m_bitmap_thumbnail
private

◆ m_bitmap_use_time

ScalableBitmap Slic3r::GUI::PrintingTaskPanel::m_bitmap_use_time
private

Referenced by create_panel(), and init_bitmaps().

◆ m_bitmap_use_weight

ScalableBitmap Slic3r::GUI::PrintingTaskPanel::m_bitmap_use_weight
private

Referenced by create_panel(), and init_bitmaps().

◆ m_brightness_value

int Slic3r::GUI::PrintingTaskPanel::m_brightness_value { -1 }
private
350{ -1 };

Referenced by paint(), and set_brightness_value().

◆ m_button_abort

ScalableButton* Slic3r::GUI::PrintingTaskPanel::m_button_abort
private

◆ m_button_clean

Button* Slic3r::GUI::PrintingTaskPanel::m_button_clean
private

◆ m_button_market_retry

Button* Slic3r::GUI::PrintingTaskPanel::m_button_market_retry
private

◆ m_button_market_scoring

Button* Slic3r::GUI::PrintingTaskPanel::m_button_market_scoring
private

◆ m_button_partskip

Button* Slic3r::GUI::PrintingTaskPanel::m_button_partskip
private

◆ m_button_pause_resume

ScalableButton* Slic3r::GUI::PrintingTaskPanel::m_button_pause_resume
private

◆ m_error_text

Label* Slic3r::GUI::PrintingTaskPanel::m_error_text
private

◆ m_gauge_progress

ProgressBar* Slic3r::GUI::PrintingTaskPanel::m_gauge_progress
private

◆ m_has_rated_prompt

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_has_rated_prompt
private

Referenced by create_panel(), and set_has_reted_text().

◆ m_obj

MachineObject* Slic3r::GUI::PrintingTaskPanel::m_obj {nullptr}
private
294{nullptr};

◆ m_panel_error_txt

wxPanel* Slic3r::GUI::PrintingTaskPanel::m_panel_error_txt
private

◆ m_panel_printing_title

wxPanel* Slic3r::GUI::PrintingTaskPanel::m_panel_printing_title
private

Referenced by create_panel(), and msw_rescale().

◆ m_part_skipped_count

int Slic3r::GUI::PrintingTaskPanel::m_part_skipped_count { 0 }
private
344{ 0 };

Referenced by get_part_skipped_count(), and set_part_skipped_count().

◆ m_part_skipped_dirty

int Slic3r::GUI::PrintingTaskPanel::m_part_skipped_dirty { 0 }
private
345{ 0 };

Referenced by get_part_skipped_dirty(), and set_part_skipped_dirty().

◆ m_plate_index

int Slic3r::GUI::PrintingTaskPanel::m_plate_index { -1 }
private
323{ -1 };

Referenced by paint(), and set_plate_index().

◆ m_printing_sizer

wxBoxSizer* Slic3r::GUI::PrintingTaskPanel::m_printing_sizer
private

Referenced by create_panel(), and msw_rescale().

◆ m_printing_stage_panel

wxPanel* Slic3r::GUI::PrintingTaskPanel::m_printing_stage_panel
private

◆ m_printing_stage_underline

wxPanel* Slic3r::GUI::PrintingTaskPanel::m_printing_stage_underline
private

◆ m_printing_stage_value

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_printing_stage_value
private

◆ m_question_button

ScalableButton* Slic3r::GUI::PrintingTaskPanel::m_question_button
private

◆ m_request_failed_info

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_request_failed_info
private

Referenced by create_panel().

◆ m_request_failed_panel

wxPanel* Slic3r::GUI::PrintingTaskPanel::m_request_failed_panel
private

◆ m_score_star

std::vector<ScalableButton *> Slic3r::GUI::PrintingTaskPanel::m_score_star
private

◆ m_score_staticline

wxPanel* Slic3r::GUI::PrintingTaskPanel::m_score_staticline
private

◆ m_score_subtask_info

wxPanel* Slic3r::GUI::PrintingTaskPanel::m_score_subtask_info
private

◆ m_star_count

int Slic3r::GUI::PrintingTaskPanel::m_star_count
private

◆ m_star_count_dirty

bool Slic3r::GUI::PrintingTaskPanel::m_star_count_dirty = false
private

◆ m_staticline

wxPanel* Slic3r::GUI::PrintingTaskPanel::m_staticline
private

◆ m_staticText_consumption_of_time

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_staticText_consumption_of_time
private

◆ m_staticText_consumption_of_weight

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_staticText_consumption_of_weight
private

◆ m_staticText_layers

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_staticText_layers
private

◆ m_staticText_printing

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_staticText_printing
private

Referenced by create_panel().

◆ m_staticText_profile_value

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_staticText_profile_value
private

Referenced by create_panel(), and show_profile_info().

◆ m_staticText_progress_end

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_staticText_progress_end
private

Referenced by create_panel(), and update_left_time().

◆ m_staticText_progress_left

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_staticText_progress_left
private

Referenced by create_panel(), and update_left_time().

◆ m_staticText_progress_percent

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_staticText_progress_percent
private

◆ m_staticText_progress_percent_icon

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_staticText_progress_percent_icon
private

◆ m_staticText_subtask_value

wxStaticText* Slic3r::GUI::PrintingTaskPanel::m_staticText_subtask_value
private

◆ m_thumbnail_bmp_display

wxBitmap Slic3r::GUI::PrintingTaskPanel::m_thumbnail_bmp_display
private

Referenced by paint(), and set_thumbnail_img().

◆ m_thumbnail_bmp_display_name

std::string Slic3r::GUI::PrintingTaskPanel::m_thumbnail_bmp_display_name
private

Referenced by set_thumbnail_img().

◆ m_thumbnail_placeholder

ScalableBitmap Slic3r::GUI::PrintingTaskPanel::m_thumbnail_placeholder
private

◆ m_type

PrintingTaskType Slic3r::GUI::PrintingTaskPanel::m_type
private

Referenced by PrintingTaskPanel(), and create_panel().


The documentation for this class was generated from the following files: