mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-23 02:42:08 +00:00
ENH: support command error dialog; support clean print error; support stop ams drying
JIRA: [STUDIO-12441] [STUDIO-13123] [STUDIO-12372] Change-Id: I87170f1f51c1e24f6eee61deb07d06ff6b53a884 (cherry picked from commit 1ec5382f14ebf06d8f3ed128e377243665434ca6)
This commit is contained in:
88
src/slic3r/GUI/DeviceErrorDialog.hpp
Normal file
88
src/slic3r/GUI/DeviceErrorDialog.hpp
Normal file
@@ -0,0 +1,88 @@
|
||||
#pragma once
|
||||
|
||||
#include <unordered_set>
|
||||
#include <wx/webrequest.h>
|
||||
|
||||
#include "GUI_Utils.hpp"
|
||||
#include "Widgets/StateColor.hpp"
|
||||
|
||||
class Label;
|
||||
class Button;
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class MachineObject;//Previous definitions
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class DeviceErrorDialog : public DPIDialog
|
||||
{
|
||||
public:
|
||||
enum ActionButton : int {
|
||||
RESUME_PRINTING = 2,
|
||||
RESUME_PRINTING_DEFECTS = 3,
|
||||
RESUME_PRINTING_PROBELM_SOLVED = 4,
|
||||
STOP_PRINTING = 5,
|
||||
CHECK_ASSISTANT = 6,
|
||||
FILAMENT_EXTRUDED = 7,
|
||||
RETRY_FILAMENT_EXTRUDED = 8,
|
||||
CONTINUE = 9,
|
||||
LOAD_VIRTUAL_TRAY = 10,
|
||||
OK_BUTTON = 11,
|
||||
FILAMENT_LOAD_RESUME = 12,
|
||||
JUMP_TO_LIVEVIEW,
|
||||
|
||||
NO_REMINDER_NEXT_TIME = 23,
|
||||
IGNORE_NO_REMINDER_NEXT_TIME = 25,
|
||||
//LOAD_FILAMENT = 26*/
|
||||
IGNORE_RESUME = 27,
|
||||
PROBLEM_SOLVED_RESUME = 28,
|
||||
STOP_BUZZER = 29,
|
||||
|
||||
RETRY_PROBLEM_SOLVED = 34,
|
||||
STOP_DRYING = 35,
|
||||
|
||||
ERROR_BUTTON_COUNT
|
||||
};
|
||||
|
||||
public:
|
||||
DeviceErrorDialog(MachineObject* obj,
|
||||
wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& title = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCLOSE_BOX | wxCAPTION);
|
||||
~DeviceErrorDialog();
|
||||
|
||||
public:
|
||||
void show_error_code(int error_code);
|
||||
|
||||
protected:
|
||||
void init_button_list();
|
||||
void init_button(ActionButton style, wxString buton_text);
|
||||
|
||||
void update_contents(const wxString& text, const wxString& error_code,const wxString& image_url, const std::vector<int>& btns);
|
||||
|
||||
void on_button_click(ActionButton btn_id);
|
||||
void on_webrequest_state(wxWebRequestEvent& evt);
|
||||
void on_dpi_changed(const wxRect& suggested_rect);
|
||||
|
||||
private:
|
||||
MachineObject* m_obj;
|
||||
|
||||
int m_error_code;
|
||||
std::unordered_set<Button*> m_used_button;
|
||||
|
||||
wxWebRequest web_request;
|
||||
wxStaticBitmap* m_error_picture;
|
||||
Label* m_error_msg_label{ nullptr };
|
||||
Label* m_error_code_label{ nullptr };
|
||||
wxBoxSizer* m_sizer_main;
|
||||
wxBoxSizer* m_sizer_button;
|
||||
wxScrolledWindow* m_scroll_area{ nullptr };
|
||||
|
||||
std::map<int, Button*> m_button_list;
|
||||
StateColor btn_bg_white;
|
||||
};
|
||||
}} // namespace Slic3r::GUI
|
||||
Reference in New Issue
Block a user