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

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

Inheritance diagram for Slic3r::GUI::MultiMachineItem:
Collaboration diagram for Slic3r::GUI::MultiMachineItem:

Public Member Functions

 MultiMachineItem (wxWindow *parent, MachineObject *obj)
 ~MultiMachineItem ()
void OnEnterWindow (wxMouseEvent &evt)
void OnLeaveWindow (wxMouseEvent &evt)
void OnLeftDown (wxMouseEvent &evt)
void OnMove (wxMouseEvent &evt)
void paintEvent (wxPaintEvent &evt)
void render (wxDC &dc)
void DrawTextWithEllipsis (wxDC &dc, const wxString &text, int maxWidth, int left, int top=0)
void doRender (wxDC &dc)
void post_event (wxCommandEvent &&event)
virtual void DoSetSize (int x, int y, int width, int height, int sizeFlags=wxSIZE_AUTO)
wxString get_left_time (int mc_left_time)
void on_refresh (wxCommandEvent &evt)
void sync_state ()
wxString get_state_printable ()
int get_state_printable () const
wxString get_state_device ()
int get_state_device () const
wxString get_local_state_task ()
wxString get_cloud_state_task ()
MachineObject * get_obj () const
int get_state_online () const
int get_state_selected () const
int get_state_enable_ams () const
int get_state_local_task () const
int get_state_cloud_task () const
std::string get_state_dev_name () const
void selected ()
void unselected ()
void update_item (const DeviceItem *item)

Public Attributes

bool m_hover { false }
ScalableBitmap m_bitmap_check_disable
ScalableBitmap m_bitmap_check_off
ScalableBitmap m_bitmap_check_on
MachineObject * obj_ {nullptr}
int state_online = { 0 }
std::string state_dev_name
int state_printable { 0 }
int state_selected { 0 }
int state_enable_ams { 0 }
int state_device { 0 }
int state_local_task { 0 }
int state_cloud_task { 0 }
int state_optional {0}
std::string m_send_time

Detailed Description

Constructor & Destructor Documentation

◆ MultiMachineItem()

Slic3r::GUI::MultiMachineItem::MultiMachineItem ( wxWindow * parent,
MachineObject * obj )
41 : DeviceItem(parent, obj)
42{
43 SetBackgroundColour(*wxWHITE);
44 SetMinSize(wxSize(FromDIP(DEVICE_ITEM_MAX_WIDTH), FromDIP(DEVICE_ITEM_MAX_HEIGHT)));
45 SetMaxSize(wxSize(FromDIP(DEVICE_ITEM_MAX_WIDTH), FromDIP(DEVICE_ITEM_MAX_HEIGHT)));
46
47 Bind(wxEVT_PAINT, &MultiMachineItem::paintEvent, this);
48 Bind(wxEVT_ENTER_WINDOW, &MultiMachineItem::OnEnterWindow, this);
49 Bind(wxEVT_LEAVE_WINDOW, &MultiMachineItem::OnLeaveWindow, this);
50 Bind(wxEVT_LEFT_DOWN, &MultiMachineItem::OnLeftDown, this);
51 Bind(wxEVT_MOTION, &MultiMachineItem::OnMove, this);
52 Bind(EVT_MULTI_DEVICE_VIEW, [obj](auto& e) {
53 wxGetApp().mainframe->jump_to_monitor(obj->get_dev_id());
54 MonitorPanel* monitor = MonitorPanel::if_built();
55 if (monitor && monitor->get_status_panel()->get_media_play_ctrl()) {
56 monitor->get_status_panel()->get_media_play_ctrl()->jump_to_play();
57 }
58 });
59 wxGetApp().UpdateDarkUIWin(this);
60}
#define DEVICE_ITEM_MAX_WIDTH
Definition MultiMachine.hpp:18
#define DEVICE_ITEM_MAX_HEIGHT
Definition MultiMachine.hpp:20
DeviceItem(wxWindow *parent, MachineObject *obj)
Definition MultiMachine.cpp:22
static MonitorPanel * if_built()
Definition Lazy.hpp:183
void OnLeftDown(wxMouseEvent &evt)
Definition MultiMachineManagerPage.cpp:74
void OnLeaveWindow(wxMouseEvent &evt)
Definition MultiMachineManagerPage.cpp:68
void OnEnterWindow(wxMouseEvent &evt)
Definition MultiMachineManagerPage.cpp:62
void paintEvent(wxPaintEvent &evt)
Definition MultiMachineManagerPage.cpp:112
void OnMove(wxMouseEvent &evt)
Definition MultiMachineManagerPage.cpp:91

References Slic3r::GUI::DeviceItem::DeviceItem(), DEVICE_ITEM_MAX_HEIGHT, DEVICE_ITEM_MAX_WIDTH, Slic3r::MachineObject::get_dev_id(), Slic3r::GUI::StatusBasePanel::get_media_play_ctrl(), Slic3r::GUI::MonitorPanel::get_status_panel(), Slic3r::GUI::LazyInstance< MonitorPanel >::if_built(), Slic3r::GUI::MediaPlayCtrl::jump_to_play(), OnEnterWindow(), OnLeaveWindow(), OnLeftDown(), OnMove(), and paintEvent().

Here is the call graph for this function:

◆ ~MultiMachineItem()

Slic3r::GUI::MultiMachineItem::~MultiMachineItem ( )
inline
32{};

Member Function Documentation

◆ doRender()

void Slic3r::GUI::MultiMachineItem::doRender ( wxDC & dc)
180{
181 wxSize size = GetSize();
182 dc.SetPen(wxPen(*wxBLACK));
183
184 int left = FromDIP(DEVICE_LEFT_PADDING_LEFT);
185
186 if (obj_) {
187 //dev name
188 wxString dev_name = wxString::FromUTF8(obj_->get_dev_name());
189 if (!obj_->is_online()) {
190 dev_name = dev_name + "(" + _L("Offline") + ")";
191 }
192 dc.SetFont(Label::Body_13);
193 DrawTextWithEllipsis(dc, dev_name, FromDIP(DEVICE_LEFT_DEV_NAME), left);
194 left += FromDIP(DEVICE_LEFT_DEV_NAME);
195
196 //project name
197 wxString project_name = _L("No task");
198 if (obj_->is_in_printing()) {
199 project_name = wxString::Format("%s", GUI::from_u8(obj_->subtask_name));
200 }
201 dc.SetFont(Label::Body_13);
202 DrawTextWithEllipsis(dc, project_name, FromDIP(DEVICE_LEFT_PRO_NAME), left);
203 left += FromDIP(DEVICE_LEFT_PRO_NAME);
204
205 //state
206 dc.SetFont(Label::Body_13);
207 if (state_device == 0) {
208 dc.SetTextForeground(*wxBLACK);
210 }
211 else if (state_device == 1) {
212 dc.SetTextForeground(wxColour(0,174,66));
214 }
215 else if (state_device == 2)
216 {
217 dc.SetTextForeground(wxColour(208,27,27));
219 }
220 else if (state_device > 2 && state_device < 7) {
221 dc.SetFont(Label::Body_12);
222 dc.SetTextForeground(wxColour(0, 150, 136));
223 if (obj_->get_curr_stage() == _L("Printing") && obj_->subtask_) {
224 //wxString layer_info = wxString::Format(_L("Layer: %d/%d"), obj_->curr_layer, obj_->total_layers);
225 wxString progress_info = wxString::Format("%d", obj_->subtask_->task_progress);
226 wxString left_time = wxString::Format("%s", get_left_time(obj_->mc_left_time));
227
228 DrawTextWithEllipsis(dc, progress_info + "% | " + left_time, FromDIP(DEVICE_LEFT_PRO_INFO), left, FromDIP(10));
229
230
231 dc.SetPen(wxPen(wxColour(233,233,233)));
232 dc.SetBrush(wxBrush(wxColour(233,233,233)));
233 dc.DrawRoundedRectangle(left, FromDIP(30), FromDIP(DEVICE_LEFT_PRO_INFO), FromDIP(10), 2);
234
235 dc.SetPen(wxPen(wxColour(0, 150, 136)));
236 dc.SetBrush(wxBrush(wxColour(0, 150, 136)));
237 dc.DrawRoundedRectangle(left, FromDIP(30), FromDIP(DEVICE_LEFT_PRO_INFO) * (static_cast<float>(obj_->subtask_->task_progress) / 100.0f), FromDIP(10), 2);
238 }
239 else {
240 DrawTextWithEllipsis(dc, obj_->get_curr_stage(), FromDIP(DEVICE_LEFT_PRO_INFO), left);
241 }
242
243 }
244 else {
245 dc.SetTextForeground(*wxBLACK);
247 }
248
249 left += FromDIP(DEVICE_LEFT_PRO_INFO);
250
251 //button
252 dc.SetPen(wxPen(wxColour(38, 46, 48)));
253 dc.SetBrush(wxBrush(wxColour(*wxWHITE)));
254 dc.DrawRoundedRectangle(left, (size.y - FromDIP(38)) / 2, FromDIP(90), FromDIP(38), 6);
255 dc.SetFont(Label::Body_14);
256 dc.SetTextForeground(*wxBLACK);
257 dc.DrawText(_L_CONTEXT("View", "Verb"),left + FromDIP(90) / 2 - dc.GetTextExtent(_L_CONTEXT("View", "Verb")).x / 2, (size.y -dc.GetTextExtent(_L_CONTEXT("View", "Verb")).y) / 2);
258
259 }
260
261 if (m_hover) {
262 dc.SetPen(wxPen(wxColour(0, 150, 136)));
263 dc.SetBrush(*wxTRANSPARENT_BRUSH);
264 dc.DrawRoundedRectangle(0, 0, size.x, size.y, 3);
265 }
266}
#define DEVICE_LEFT_DEV_NAME
Definition MultiMachineManagerPage.hpp:23
#define DEVICE_LEFT_PRO_NAME
Definition MultiMachineManagerPage.hpp:24
#define DEVICE_LEFT_PRO_INFO
Definition MultiMachineManagerPage.hpp:25
#define DEVICE_LEFT_PADDING_LEFT
Definition MultiMachineManagerPage.hpp:22
#define _L(s)
Definition OBJ.cpp:34
static wxFont Body_13
Definition Label.hpp:54
static wxFont Body_12
Definition Label.hpp:55
static wxFont Body_14
Definition Label.hpp:53
MachineObject * obj_
Definition MultiMachine.hpp:32
int state_device
Definition MultiMachine.hpp:38
wxString get_state_device()
Definition MultiMachine.cpp:138
wxString get_left_time(int mc_left_time)
Definition MultiMachineManagerPage.cpp:281
void DrawTextWithEllipsis(wxDC &dc, const wxString &text, int maxWidth, int left, int top=0)
Definition MultiMachineManagerPage.cpp:139
bool m_hover
Definition MultiMachineManagerPage.hpp:47
wxString from_u8(const std::string &str)
Definition GUI.cpp:544
@ left
Definition MarchingSquares.hpp:188
#define _L_CONTEXT(s, ctx)
Definition I18N.hpp:15

References _L, _L_CONTEXT, Label::Body_12, Label::Body_13, Label::Body_14, DEVICE_LEFT_DEV_NAME, DEVICE_LEFT_PADDING_LEFT, DEVICE_LEFT_PRO_INFO, DEVICE_LEFT_PRO_NAME, DrawTextWithEllipsis(), Slic3r::GUI::from_u8(), get_left_time(), Slic3r::GUI::DeviceItem::get_state_device(), m_hover, Slic3r::GUI::DeviceItem::obj_, and Slic3r::GUI::DeviceItem::state_device.

Referenced by render().

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

◆ DoSetSize()

void Slic3r::GUI::MultiMachineItem::DoSetSize ( int x,
int y,
int width,
int height,
int sizeFlags = wxSIZE_AUTO )
virtual
277{
278 wxWindow::DoSetSize(x, y, width, height, sizeFlags);
279}

◆ DrawTextWithEllipsis()

void Slic3r::GUI::MultiMachineItem::DrawTextWithEllipsis ( wxDC & dc,
const wxString & text,
int maxWidth,
int left,
int top = 0 )
139 {
140 wxSize size = GetSize();
141 wxFont font = dc.GetFont();
142
143 wxSize textSize = dc.GetTextExtent(text);
144 dc.SetTextForeground(StateColor::darkModeColorFor(wxColour(50, 58, 61)));
145 int textWidth = textSize.GetWidth();
146
147 if (textWidth > maxWidth) {
148 wxString truncatedText = text;
149 int ellipsisWidth = dc.GetTextExtent("...").GetWidth();
150 int numChars = text.length();
151
152 for (int i = numChars - 1; i >= 0; --i) {
153 truncatedText = text.substr(0, i) + "...";
154 int truncatedWidth = dc.GetTextExtent(truncatedText).GetWidth();
155
156 if (truncatedWidth <= maxWidth - ellipsisWidth) {
157 break;
158 }
159 }
160
161 if (top == 0) {
162 dc.DrawText(truncatedText, left, (size.y - textSize.y) / 2);
163 }
164 else {
165 dc.DrawText(truncatedText, left, (size.y - textSize.y) / 2 - top);
166 }
167
168 }
169 else {
170 if (top == 0) {
171 dc.DrawText(text, left, (size.y - textSize.y) / 2);
172 }
173 else {
174 dc.DrawText(text, left, (size.y - textSize.y) / 2 - top);
175 }
176 }
177}
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219

References StateColor::darkModeColorFor().

Referenced by doRender().

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

◆ get_cloud_state_task()

wxString Slic3r::GUI::DeviceItem::get_cloud_state_task ( )
inherited
172{
173 //0-printing 1-printing finish 2-printing failed
174 std::vector<wxString> str_state_task;
175 str_state_task.push_back(_L("Printing"));
176 str_state_task.push_back(_L("Printing Finish"));
177 str_state_task.push_back(_L("Printing Failed"));
178
179 return str_state_task[state_cloud_task];
180}
int state_cloud_task
Definition MultiMachine.hpp:40

References _L, and state_cloud_task.

Referenced by Slic3r::GUI::MultiTaskItem::doRender().

Here is the caller graph for this function:

◆ get_left_time()

wxString Slic3r::GUI::MultiMachineItem::get_left_time ( int mc_left_time)
282{
283 // update gcode progress
284 std::string left_time;
285 wxString left_time_text = _L("N/A");
286
287 try {
288 left_time = get_bbl_monitor_time_dhm(mc_left_time);
289 }
290 catch (...) {
291 ;
292 }
293
294 if (!left_time.empty()) left_time_text = wxString::Format("-%s", left_time);
295 return left_time_text;
296}
std::string get_bbl_monitor_time_dhm(float time_in_secs)
Definition Utils.hpp:707

References _L, and Slic3r::get_bbl_monitor_time_dhm().

Referenced by doRender().

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

◆ get_local_state_task()

wxString Slic3r::GUI::DeviceItem::get_local_state_task ( )
inherited
155{
156 //0-padding 1-sending 2-sending finish 3-sending cancel 4-sending failed 5-Removed
157 std::vector<wxString> str_state_task;
158 str_state_task.push_back(_L("Pending"));
159 str_state_task.push_back(_L("Sending"));
160 str_state_task.push_back(_L("Sending Finish"));
161 str_state_task.push_back(_L("Sending Cancel"));
162 str_state_task.push_back(_L("Sending Failed"));
163 str_state_task.push_back(_L("Printing"));
164 str_state_task.push_back(_L("Print Success"));
165 str_state_task.push_back(_L("Print Failed"));
166 str_state_task.push_back(_L("Removed"));
167 str_state_task.push_back(_L("Idle"));
168 return str_state_task[state_local_task];
169}
int state_local_task
Definition MultiMachine.hpp:39

References _L, and state_local_task.

Referenced by Slic3r::GUI::MultiTaskItem::doRender().

Here is the caller graph for this function:

◆ get_obj()

MachineObject * Slic3r::GUI::DeviceItem::get_obj ( ) const
inlineinherited

◆ get_state_cloud_task()

int Slic3r::GUI::DeviceItem::get_state_cloud_task ( ) const
inlineinherited
63{ return state_cloud_task; }

References state_cloud_task.

◆ get_state_dev_name()

std::string Slic3r::GUI::DeviceItem::get_state_dev_name ( ) const
inlineinherited
64{ return state_dev_name; }
std::string state_dev_name
Definition MultiMachine.hpp:34

References state_dev_name.

◆ get_state_device() [1/2]

wxString Slic3r::GUI::DeviceItem::get_state_device ( )
inherited
139{
140 //0-idle 1-finish 2-running 3-pause 4-failed 5-prepare
141 std::vector<wxString> str_state_device;
142 str_state_device.push_back(_L("Idle"));
143 str_state_device.push_back(_L("Printing Finish"));
144 str_state_device.push_back(_L("Printing Failed"));
145 str_state_device.push_back(_L("Printing"));
146 str_state_device.push_back(_L("Printing Pause"));
147 str_state_device.push_back(_L_CONTEXT("Prepare", "Device status"));
148 str_state_device.push_back(_L("Slicing"));
149 str_state_device.push_back(_L("Syncing"));
150
151 return str_state_device[state_device];
152}

References _L, _L_CONTEXT, and state_device.

Referenced by Slic3r::GUI::MultiMachineItem::doRender(), and Slic3r::GUI::MultiTaskItem::doRender().

Here is the caller graph for this function:

◆ get_state_device() [2/2]

int Slic3r::GUI::DeviceItem::get_state_device ( ) const
inlineinherited
61{ return state_device; }

References state_device.

◆ get_state_enable_ams()

int Slic3r::GUI::DeviceItem::get_state_enable_ams ( ) const
inlineinherited
60{ return state_enable_ams; }
int state_enable_ams
Definition MultiMachine.hpp:37

References state_enable_ams.

◆ get_state_local_task()

int Slic3r::GUI::DeviceItem::get_state_local_task ( ) const
inlineinherited
62{ return state_local_task; }

References state_local_task.

◆ get_state_online()

int Slic3r::GUI::DeviceItem::get_state_online ( ) const
inlineinherited
57{ return state_online; }
int state_online
Definition MultiMachine.hpp:33

References state_online.

◆ get_state_printable() [1/2]

wxString Slic3r::GUI::DeviceItem::get_state_printable ( )
inherited
124{
125 //0-idle 1-finish 2-printing 3-upgrading 4-preset incompatible 5-unknown
126 std::vector<wxString> str_state_printable;
127 str_state_printable.push_back(_L("Idle"));
128 str_state_printable.push_back(_L("Idle"));
129 str_state_printable.push_back(_L("Idle"));
130 str_state_printable.push_back(_L("Printing"));
131 str_state_printable.push_back(_L("Upgrading"));
132 str_state_printable.push_back(_L("Incompatible"));
133 str_state_printable.push_back(_L("Syncing"));
134
135 return str_state_printable[state_printable];
136}
int state_printable
Definition MultiMachine.hpp:35

References _L, and state_printable.

Referenced by Slic3r::GUI::SendDeviceItem::doRender().

Here is the caller graph for this function:

◆ get_state_printable() [2/2]

int Slic3r::GUI::DeviceItem::get_state_printable ( ) const
inlineinherited
58{ return state_printable; }

References state_printable.

◆ get_state_selected()

int Slic3r::GUI::DeviceItem::get_state_selected ( ) const
inlineinherited
59{ return state_selected; }
int state_selected
Definition MultiMachine.hpp:36

References state_selected.

◆ on_refresh()

void Slic3r::GUI::DeviceItem::on_refresh ( wxCommandEvent & evt)
inherited
31{
32 Refresh();
33}

Referenced by DeviceItem().

Here is the caller graph for this function:

◆ OnEnterWindow()

void Slic3r::GUI::MultiMachineItem::OnEnterWindow ( wxMouseEvent & evt)
63{
64 m_hover = true;
65 Refresh();
66}

References m_hover, and Slic3r::GUI::wxMouseEvent.

Referenced by MultiMachineItem().

Here is the caller graph for this function:

◆ OnLeaveWindow()

void Slic3r::GUI::MultiMachineItem::OnLeaveWindow ( wxMouseEvent & evt)
69{
70 m_hover = false;
71 Refresh();
72}

References m_hover, and Slic3r::GUI::wxMouseEvent.

Referenced by MultiMachineItem().

Here is the caller graph for this function:

◆ OnLeftDown()

void Slic3r::GUI::MultiMachineItem::OnLeftDown ( wxMouseEvent & evt)
75{
76 int left = FromDIP(DEVICE_LEFT_PADDING_LEFT +
80 auto mouse_pos = ClientToScreen(evt.GetPosition());
81 auto item = this->ClientToScreen(wxPoint(0, 0));
82
83 if (mouse_pos.x > (item.x + left) &&
84 mouse_pos.x < (item.x + left + FromDIP(90)) &&
85 mouse_pos.y > item.y &&
86 mouse_pos.y < (item.y + DEVICE_ITEM_MAX_HEIGHT)) {
87 post_event(wxCommandEvent(EVT_MULTI_DEVICE_VIEW));
88 }
89}
void post_event(wxCommandEvent &&event)
Definition MultiMachineManagerPage.cpp:268

References DEVICE_ITEM_MAX_HEIGHT, DEVICE_LEFT_DEV_NAME, DEVICE_LEFT_PADDING_LEFT, DEVICE_LEFT_PRO_INFO, DEVICE_LEFT_PRO_NAME, post_event(), and Slic3r::GUI::wxMouseEvent.

Referenced by MultiMachineItem().

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

◆ OnMove()

void Slic3r::GUI::MultiMachineItem::OnMove ( wxMouseEvent & evt)
92{
93 int left = FromDIP(DEVICE_LEFT_PADDING_LEFT +
97
98 auto mouse_pos = ClientToScreen(evt.GetPosition());
99 auto item = this->ClientToScreen(wxPoint(0, 0));
100
101 if (mouse_pos.x > (item.x + left) &&
102 mouse_pos.x < (item.x + left + FromDIP(90)) &&
103 mouse_pos.y > item.y &&
104 mouse_pos.y < (item.y + DEVICE_ITEM_MAX_HEIGHT)) {
105 SetCursor(wxCURSOR_HAND);
106 }
107 else {
108 SetCursor(wxCURSOR_ARROW);
109 }
110}

References DEVICE_ITEM_MAX_HEIGHT, DEVICE_LEFT_DEV_NAME, DEVICE_LEFT_PADDING_LEFT, DEVICE_LEFT_PRO_INFO, DEVICE_LEFT_PRO_NAME, and Slic3r::GUI::wxMouseEvent.

Referenced by MultiMachineItem().

Here is the caller graph for this function:

◆ paintEvent()

void Slic3r::GUI::MultiMachineItem::paintEvent ( wxPaintEvent & evt)
113{
114 wxPaintDC dc(this);
115 render(dc);
116}
void render(wxDC &dc)
Definition MultiMachineManagerPage.cpp:118

References render().

Referenced by MultiMachineItem().

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

◆ post_event()

void Slic3r::GUI::MultiMachineItem::post_event ( wxCommandEvent && event)
269{
270 event.SetEventObject(this);
271 event.SetString(obj_->get_dev_id());
272 event.SetInt(state_selected);
273 wxPostEvent(this, event);
274}

References Slic3r::GUI::DeviceItem::obj_, and Slic3r::GUI::DeviceItem::state_selected.

Referenced by OnLeftDown().

Here is the caller graph for this function:

◆ render()

void Slic3r::GUI::MultiMachineItem::render ( wxDC & dc)
119{
120#ifdef __WXMSW__
121 wxSize size = GetSize();
122 wxMemoryDC memdc;
123 wxBitmap bmp(size.x, size.y);
124 memdc.SelectObject(bmp);
125 memdc.Blit({ 0, 0 }, size, &dc, { 0, 0 });
126
127 {
128 wxGCDC dc2(memdc);
129 doRender(dc2);
130 }
131
132 memdc.SelectObject(wxNullBitmap);
133 dc.DrawBitmap(bmp, 0, 0);
134#else
135 doRender(dc);
136#endif
137}
void doRender(wxDC &dc)
Definition MultiMachineManagerPage.cpp:179

References doRender().

Referenced by paintEvent().

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

◆ selected()

void Slic3r::GUI::DeviceItem::selected ( )
inherited
98{
99 if (state_selected != 2) {
100 state_selected = 1;
101 }
102}

References state_selected.

◆ sync_state()

void Slic3r::GUI::DeviceItem::sync_state ( )
inherited
36{
37 if (obj_) {
38 state_online = obj_->is_online();
39 state_dev_name = obj_->get_dev_name();
40
41 //printable
42 if (obj_->print_status == "IDLE") {
44 }
45 else if (obj_->print_status == "FINISH") {
47 }
48 else if (obj_->print_status == "FAILED") {
50 }
51 else if (obj_->is_in_printing()) {
53 }
54 else {
56 }
57
58 if (wxGetApp().is_blocking_printing(obj_)) {
60 }
61
62 if (obj_->is_in_upgrading()) {
64 }
65
66 state_enable_ams = obj_->ams_exist_bits;
67
68
69 //device
70 if (obj_->print_status == "IDLE") {
71 state_device = 0;
72 }
73 else if (obj_->print_status == "FINISH") {
74 state_device = 1;
75 }
76 else if (obj_->print_status == "FAILED") {
77 state_device = 2;
78 }
79 else if (obj_->print_status == "RUNNING") {
80 state_device = 3;
81 }
82 else if (obj_->print_status == "PAUSE") {
83 state_device = 4;
84 }
85 else if (obj_->print_status == "PREPARE") {
86 state_device = 5;
87 }
88 else if (obj_->print_status == "SLICING") {
89 state_device = 6;
90 }
91 else {
92 state_device = 7;
93 }
94 }
95}

References obj_, state_dev_name, state_device, state_enable_ams, state_online, and state_printable.

Referenced by DeviceItem().

Here is the caller graph for this function:

◆ unselected()

void Slic3r::GUI::DeviceItem::unselected ( )
inherited
105{
106 if (state_selected != 2) {
107 state_selected = 0;
108 }
109}

References state_selected.

Referenced by Slic3r::GUI::MultiMachinePickPage::refresh_user_device().

Here is the caller graph for this function:

◆ update_item()

void Slic3r::GUI::DeviceItem::update_item ( const DeviceItem * item)
inherited
112{
113 // Except for the selected status, everything else is updated
114 if (this == item)
115 return;
116 this->state_online = item->state_online;
117 this->state_printable = item->state_printable;
118 this->state_enable_ams = item->state_enable_ams;
119 this->state_device = item->state_device;
120 this->state_local_task = item->state_local_task;
121}

References DeviceItem(), state_device, state_enable_ams, state_local_task, state_online, and state_printable.

Here is the call graph for this function:

Member Data Documentation

◆ m_bitmap_check_disable

ScalableBitmap Slic3r::GUI::MultiMachineItem::m_bitmap_check_disable

◆ m_bitmap_check_off

ScalableBitmap Slic3r::GUI::MultiMachineItem::m_bitmap_check_off

◆ m_bitmap_check_on

ScalableBitmap Slic3r::GUI::MultiMachineItem::m_bitmap_check_on

◆ m_hover

bool Slic3r::GUI::MultiMachineItem::m_hover { false }
47{ false };

Referenced by doRender(), OnEnterWindow(), and OnLeaveWindow().

◆ m_send_time

◆ obj_

◆ state_cloud_task

◆ state_dev_name

std::string Slic3r::GUI::DeviceItem::state_dev_name
inherited

◆ state_device

int Slic3r::GUI::DeviceItem::state_device { 0 }
inherited
38{ 0 }; //0-idle 1-finish 2-failed 3-running 4-pause 5-prepare 6-slicing 7-removed

Referenced by Slic3r::GUI::SortItem::SortItem(), Slic3r::GUI::MultiMachineItem::doRender(), Slic3r::GUI::MultiTaskItem::doRender(), get_state_device(), get_state_device(), sync_state(), and update_item().

◆ state_enable_ams

int Slic3r::GUI::DeviceItem::state_enable_ams { 0 }
inherited
37{ 0 };//0-no ams 1-enabled ams 2-not enabled ams

Referenced by Slic3r::GUI::SortItem::SortItem(), get_state_enable_ams(), sync_state(), and update_item().

◆ state_local_task

int Slic3r::GUI::DeviceItem::state_local_task { 0 }
inherited

◆ state_online

int Slic3r::GUI::DeviceItem::state_online = { 0 }
inherited
33{ 0 }; //0-Offline 1-Online

Referenced by Slic3r::GUI::SortItem::SortItem(), get_state_online(), sync_state(), and update_item().

◆ state_optional

int Slic3r::GUI::DeviceItem::state_optional {0}
inherited
41{0}; //0-Not optional 1-Optional

◆ state_printable

int Slic3r::GUI::DeviceItem::state_printable { 0 }
inherited

◆ state_selected


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