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

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

Inheritance diagram for Slic3r::GUI::DeviceItem:
Collaboration diagram for Slic3r::GUI::DeviceItem:

Public Member Functions

 DeviceItem (wxWindow *parent, MachineObject *obj)
 ~DeviceItem ()
void on_refresh (wxCommandEvent &evt)
void sync_state ()
wxString get_state_printable ()
wxString get_state_device ()
wxString get_local_state_task ()
wxString get_cloud_state_task ()
MachineObject * get_obj () const
int get_state_online () const
int get_state_printable () const
int get_state_selected () const
int get_state_enable_ams () const
int get_state_device () 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

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

◆ DeviceItem()

Slic3r::GUI::DeviceItem::DeviceItem ( wxWindow * parent,
MachineObject * obj )
23 : wxWindow(parent, wxID_ANY)
24 , obj_(obj)
25{
26 sync_state();
27 Bind(EVT_MULTI_REFRESH, &DeviceItem::on_refresh, this);
28}
void sync_state()
Definition MultiMachine.cpp:35
MachineObject * obj_
Definition MultiMachine.hpp:32
void on_refresh(wxCommandEvent &evt)
Definition MultiMachine.cpp:30

References obj_, on_refresh(), and sync_state().

Referenced by Slic3r::GUI::DevicePickItem::DevicePickItem(), Slic3r::GUI::MultiMachineItem::MultiMachineItem(), Slic3r::GUI::MultiTaskItem::MultiTaskItem(), Slic3r::GUI::SendDeviceItem::SendDeviceItem(), and update_item().

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

◆ ~DeviceItem()

Slic3r::GUI::DeviceItem::~DeviceItem ( )
inline
47{};

Member Function Documentation

◆ get_cloud_state_task()

wxString Slic3r::GUI::DeviceItem::get_cloud_state_task ( )
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}
#define _L(s)
Definition OBJ.cpp:34
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_local_state_task()

wxString Slic3r::GUI::DeviceItem::get_local_state_task ( )
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
inline

◆ get_state_cloud_task()

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

References state_cloud_task.

◆ get_state_dev_name()

std::string Slic3r::GUI::DeviceItem::get_state_dev_name ( ) const
inline
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 ( )
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}
int state_device
Definition MultiMachine.hpp:38
#define _L_CONTEXT(s, ctx)
Definition I18N.hpp:15

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
inline
61{ return state_device; }

References state_device.

◆ get_state_enable_ams()

int Slic3r::GUI::DeviceItem::get_state_enable_ams ( ) const
inline
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
inline
62{ return state_local_task; }

References state_local_task.

◆ get_state_online()

int Slic3r::GUI::DeviceItem::get_state_online ( ) const
inline
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 ( )
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
inline
58{ return state_printable; }

References state_printable.

◆ get_state_selected()

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

References state_selected.

◆ on_refresh()

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

Referenced by DeviceItem().

Here is the caller graph for this function:

◆ selected()

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

References state_selected.

◆ sync_state()

void Slic3r::GUI::DeviceItem::sync_state ( )
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 ( )
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)
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_send_time

◆ obj_

◆ state_cloud_task

◆ state_dev_name

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

◆ state_device

int Slic3r::GUI::DeviceItem::state_device { 0 }
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 }
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 }

◆ state_online

int Slic3r::GUI::DeviceItem::state_online = { 0 }
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}
41{0}; //0-Not optional 1-Optional

◆ state_printable

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

◆ state_selected


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