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

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

Inheritance diagram for Slic3r::GUI::ExtruderImage:
Collaboration diagram for Slic3r::GUI::ExtruderImage:

Public Member Functions

void update (int nozzle_num, int nozzle_id)
void update (ExtruderState single_state)
void update (ExtruderState right_state, ExtruderState left_state)
void msw_rescale ()
void setExtruderCount (int nozzle_num)
void setExtruderUsed (std::string loc)
void paintEvent (wxPaintEvent &evt)
void render (wxDC &dc)
void doRender (wxDC &dc)
 ExtruderImage (wxWindow *parent, wxWindowID id, int nozzle_num, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 ~ExtruderImage ()

Public Attributes

bool m_show_state = {false}
int m_nozzle_num = 1
int current_nozzle_idx = 0
std::string current_nozzle_loc = ""
wxColour m_colour
std::string m_file_name
bool m_ams_loading {false}

Private Attributes

ScalableBitmap * m_pipe_filled_load
ScalableBitmap * m_pipe_filled_unload
ScalableBitmap * m_pipe_empty_load
ScalableBitmap * m_pipe_empty_unload
ScalableBitmap * m_pipe_filled_load_unselected
ScalableBitmap * m_pipe_filled_unload_unselected
ScalableBitmap * m_pipe_empty_load_unselected
ScalableBitmap * m_pipe_empty_unload_unselected
ScalableBitmap * m_left_extruder_active_filled
ScalableBitmap * m_left_extruder_active_empty
ScalableBitmap * m_left_extruder_unactive_filled
ScalableBitmap * m_left_extruder_unactive_empty
ScalableBitmap * m_right_extruder_active_filled
ScalableBitmap * m_right_extruder_active_empty
ScalableBitmap * m_right_extruder_unactive_filled
ScalableBitmap * m_right_extruder_unactive_empty
ScalableBitmap * m_extruder_single_nozzle_empty_load
ScalableBitmap * m_extruder_single_nozzle_empty_unload
ScalableBitmap * m_extruder_single_nozzle_filled_load
ScalableBitmap * m_extruder_single_nozzle_filled_unload
ExtruderState m_left_ext_state = {ExtruderState::EMPTY_LOAD}
ExtruderState m_right_ext_state = {ExtruderState::EMPTY_LOAD}
ExtruderState m_single_ext_state = {ExtruderState::EMPTY_LOAD}

Detailed Description

Constructor & Destructor Documentation

◆ ExtruderImage()

Slic3r::GUI::ExtruderImage::ExtruderImage ( wxWindow * parent,
wxWindowID id,
int nozzle_num,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize )
221{
222 wxWindow::Create(parent, id, pos, wxSize(FromDIP(45), FromDIP(112)));
223 SetBackgroundColour(*wxWHITE);
224 m_nozzle_num = nozzle_num;
225 SetSize(wxSize(FromDIP(45), FromDIP(112)));
226 SetMinSize(wxSize(FromDIP(45), FromDIP(112)));
227 SetMaxSize(wxSize(FromDIP(45), FromDIP(112)));
228
229 m_pipe_filled_load = new ScalableBitmap(this, "pipe_of_loading_selected", 50);
230 m_pipe_filled_unload = new ScalableBitmap(this, "pipe_of_unloading_selected", 50);
231 m_pipe_empty_load = new ScalableBitmap(this, "pipe_of_empty", 50);
232 m_pipe_empty_unload = new ScalableBitmap(this, "pipe_of_empty", 50);
233 m_pipe_filled_load_unselected = new ScalableBitmap(this, "pipe_of_loading_unselected", 50);
234 m_pipe_filled_unload_unselected = new ScalableBitmap(this, "pipe_of_unloading_unselected", 50);
235 m_pipe_empty_load_unselected = new ScalableBitmap(this, "pipe_of_empty", 50);
236 m_pipe_empty_unload_unselected = new ScalableBitmap(this, "pipe_of_empty", 50);
237
238 m_left_extruder_active_filled = new ScalableBitmap(this, "left_extruder_active_filled", 62);
239 m_left_extruder_active_empty = new ScalableBitmap(this, "left_extruder_active_empty", 62);
240 m_left_extruder_unactive_filled = new ScalableBitmap(this, "left_extruder_unactive_filled", 62);
241 m_left_extruder_unactive_empty = new ScalableBitmap(this, "left_extruder_unactive_empty", 62);
242 m_right_extruder_active_filled = new ScalableBitmap(this, "right_extruder_active_filled", 62);
243 m_right_extruder_active_empty = new ScalableBitmap(this, "right_extruder_active_empty", 62);
244 m_right_extruder_unactive_filled = new ScalableBitmap(this, "right_extruder_unactive_filled", 62);
245 m_right_extruder_unactive_empty = new ScalableBitmap(this, "right_extruder_unactive_empty", 62);
246
247 m_extruder_single_nozzle_empty_load = new ScalableBitmap(this, "monitor_extruder_empty_load", 106);
248 m_extruder_single_nozzle_empty_unload = new ScalableBitmap(this, "monitor_extruder_empty_unload", 106);
249 m_extruder_single_nozzle_filled_load = new ScalableBitmap(this, "monitor_extruder_filled_load", 106);
250 m_extruder_single_nozzle_filled_unload = new ScalableBitmap(this, "monitor_extruder_filled_unload", 106);
251
252 Bind(wxEVT_PAINT, &ExtruderImage::paintEvent, this);
253}
ScalableBitmap * m_right_extruder_unactive_empty
Definition StatusPanel.hpp:146
ScalableBitmap * m_right_extruder_unactive_filled
Definition StatusPanel.hpp:145
ScalableBitmap * m_pipe_empty_unload_unselected
Definition StatusPanel.hpp:137
ScalableBitmap * m_extruder_single_nozzle_filled_unload
Definition StatusPanel.hpp:151
ScalableBitmap * m_extruder_single_nozzle_empty_load
Definition StatusPanel.hpp:148
ScalableBitmap * m_extruder_single_nozzle_filled_load
Definition StatusPanel.hpp:150
ScalableBitmap * m_pipe_empty_unload
Definition StatusPanel.hpp:132
void paintEvent(wxPaintEvent &evt)
Definition StatusPanel.cpp:316
ScalableBitmap * m_right_extruder_active_filled
Definition StatusPanel.hpp:143
ScalableBitmap * m_left_extruder_active_filled
Definition StatusPanel.hpp:139
ScalableBitmap * m_left_extruder_unactive_filled
Definition StatusPanel.hpp:141
ScalableBitmap * m_pipe_empty_load_unselected
Definition StatusPanel.hpp:136
ScalableBitmap * m_pipe_filled_load_unselected
Definition StatusPanel.hpp:134
ScalableBitmap * m_pipe_filled_load
Definition StatusPanel.hpp:129
ScalableBitmap * m_pipe_filled_unload_unselected
Definition StatusPanel.hpp:135
ScalableBitmap * m_left_extruder_unactive_empty
Definition StatusPanel.hpp:142
ScalableBitmap * m_left_extruder_active_empty
Definition StatusPanel.hpp:140
ScalableBitmap * m_extruder_single_nozzle_empty_unload
Definition StatusPanel.hpp:149
ScalableBitmap * m_pipe_filled_unload
Definition StatusPanel.hpp:130
int m_nozzle_num
Definition StatusPanel.hpp:169
ScalableBitmap * m_right_extruder_active_empty
Definition StatusPanel.hpp:144
ScalableBitmap * m_pipe_empty_load
Definition StatusPanel.hpp:131

References m_extruder_single_nozzle_empty_load, m_extruder_single_nozzle_empty_unload, m_extruder_single_nozzle_filled_load, m_extruder_single_nozzle_filled_unload, m_left_extruder_active_empty, m_left_extruder_active_filled, m_left_extruder_unactive_empty, m_left_extruder_unactive_filled, m_nozzle_num, m_pipe_empty_load, m_pipe_empty_load_unselected, m_pipe_empty_unload, m_pipe_empty_unload_unselected, m_pipe_filled_load, m_pipe_filled_load_unselected, m_pipe_filled_unload, m_pipe_filled_unload_unselected, m_right_extruder_active_empty, m_right_extruder_active_filled, m_right_extruder_unactive_empty, m_right_extruder_unactive_filled, and paintEvent().

Here is the call graph for this function:

◆ ~ExtruderImage()

Slic3r::GUI::ExtruderImage::~ExtruderImage ( )
255{}

Member Function Documentation

◆ doRender()

void Slic3r::GUI::ExtruderImage::doRender ( wxDC & dc)
344{
345 auto size = GetSize();
346 //dc.DrawRectangle(0, FromDIP(5), size.x, size.y - FromDIP(5) - FromDIP(2));
347
348 auto pot = wxPoint(size.x / 2, (size.y - m_pipe_filled_load->GetBmpSize().y - m_left_extruder_active_filled->GetBmpSize().y) / 2);
349
350 if (m_nozzle_num >= 2){
351 ScalableBitmap* left_nozzle_bmp;
352 ScalableBitmap* right_nozzle_bmp;
353 ScalableBitmap* left_pipe_bmp;
354 ScalableBitmap* right_pipe_bmp;
355
356 switch (m_right_ext_state)
357 {
361 break;
365 break;
369 break;
373 break;
374 default:
375 break;
376 }
377
378 switch (m_left_ext_state)
379 {
383 break;
387 break;
391 break;
395 break;
396 default:
397 break;
398 }
399
400 left_pipe_bmp = m_pipe_filled_load;
401 right_pipe_bmp = m_pipe_filled_load;
402
403 dc.DrawBitmap(left_pipe_bmp->bmp(), pot.x - left_nozzle_bmp->GetBmpWidth() / 2 - left_pipe_bmp->GetBmpWidth() / 2 + left_pipe_bmp->GetBmpWidth() / 5, pot.y);
404 dc.DrawBitmap(left_nozzle_bmp->bmp(), pot.x - left_nozzle_bmp->GetBmpWidth(), pot.y + left_pipe_bmp->GetBmpSize().y);
405 dc.DrawBitmap(right_pipe_bmp->bmp(), pot.x + right_nozzle_bmp->GetBmpWidth() / 2 - right_pipe_bmp->GetBmpWidth() / 2 - right_pipe_bmp->GetBmpWidth() / 5, pot.y);
406 dc.DrawBitmap(right_nozzle_bmp->bmp(), pot.x, pot.y + right_pipe_bmp->GetBmpSize().y);
407 }
408 else{
409
410 ScalableBitmap* nozzle_bmp = nullptr;
411 switch (m_single_ext_state)
412 {
417 default: break;
418 }
419
420 if (nozzle_bmp)
421 {
422 dc.DrawBitmap(nozzle_bmp->bmp(), pot.x - nozzle_bmp->GetBmpWidth() / 2, (size.y - nozzle_bmp->GetBmpHeight()) / 2);
423 }
424 }
425}
wxSize GetBmpSize() const
Definition wxExtensions.cpp:959
int GetBmpWidth() const
Definition wxExtensions.cpp:977
const wxBitmap & bmp() const
Definition wxExtensions.hpp:189
int GetBmpHeight() const
Definition wxExtensions.cpp:988
std::string current_nozzle_loc
Definition StatusPanel.hpp:171
ExtruderState m_left_ext_state
Definition StatusPanel.hpp:153
ExtruderState m_right_ext_state
Definition StatusPanel.hpp:154
ExtruderState m_single_ext_state
Definition StatusPanel.hpp:155
@ FILLED_UNLOAD
Definition StatusPanel.hpp:106
@ EMPTY_LOAD
Definition StatusPanel.hpp:107
@ EMPTY_UNLOAD
Definition StatusPanel.hpp:108
@ FILLED_LOAD
Definition StatusPanel.hpp:105

References ScalableBitmap::bmp(), current_nozzle_loc, Slic3r::GUI::EMPTY_LOAD, Slic3r::GUI::EMPTY_UNLOAD, Slic3r::GUI::FILLED_LOAD, Slic3r::GUI::FILLED_UNLOAD, ScalableBitmap::GetBmpHeight(), ScalableBitmap::GetBmpSize(), ScalableBitmap::GetBmpWidth(), m_extruder_single_nozzle_empty_load, m_extruder_single_nozzle_empty_unload, m_extruder_single_nozzle_filled_load, m_extruder_single_nozzle_filled_unload, m_left_ext_state, m_left_extruder_active_empty, m_left_extruder_active_filled, m_left_extruder_unactive_empty, m_left_extruder_unactive_filled, m_nozzle_num, m_pipe_empty_load, m_pipe_empty_load_unselected, m_pipe_empty_unload, m_pipe_empty_unload_unselected, m_pipe_filled_load, m_pipe_filled_load_unselected, m_pipe_filled_unload, m_pipe_filled_unload_unselected, m_right_ext_state, m_right_extruder_active_empty, m_right_extruder_active_filled, m_right_extruder_unactive_empty, m_right_extruder_unactive_filled, and m_single_ext_state.

Referenced by render().

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

◆ msw_rescale()

void Slic3r::GUI::ExtruderImage::msw_rescale ( )
258{
259 //m_ams_extruder.SetSize(AMS_EXTRUDER_BITMAP_SIZE);
260 //auto image = m_ams_extruder.ConvertToImage();
261 //m_extruder_pipe = ScalableBitmap(this, "pipe_of_extruder_control", 50);
262
263 m_pipe_filled_load->msw_rescale();
264 m_pipe_filled_unload->msw_rescale();
265 m_pipe_empty_load->msw_rescale();
266 m_pipe_empty_unload->msw_rescale();
267 m_pipe_filled_load_unselected->msw_rescale();
268 m_pipe_filled_unload_unselected->msw_rescale();
269 m_pipe_empty_load_unselected->msw_rescale();
270 m_pipe_empty_unload_unselected->msw_rescale();
271
272 m_left_extruder_active_filled->msw_rescale();
273 m_left_extruder_active_empty->msw_rescale();
274 m_left_extruder_unactive_filled->msw_rescale();
275 m_left_extruder_unactive_empty->msw_rescale();
276 m_right_extruder_active_filled->msw_rescale();
277 m_right_extruder_active_empty->msw_rescale();
279 m_right_extruder_unactive_empty->msw_rescale();
280
285 Layout();
286 Refresh();
287}

References m_extruder_single_nozzle_empty_load, m_extruder_single_nozzle_empty_unload, m_extruder_single_nozzle_filled_load, m_extruder_single_nozzle_filled_unload, m_left_extruder_active_empty, m_left_extruder_active_filled, m_left_extruder_unactive_empty, m_left_extruder_unactive_filled, m_pipe_empty_load, m_pipe_empty_load_unselected, m_pipe_empty_unload, m_pipe_empty_unload_unselected, m_pipe_filled_load, m_pipe_filled_load_unselected, m_pipe_filled_unload, m_pipe_filled_unload_unselected, m_right_extruder_active_empty, m_right_extruder_active_filled, m_right_extruder_unactive_empty, and m_right_extruder_unactive_filled.

Referenced by Slic3r::GUI::StatusPanel::msw_rescale().

Here is the caller graph for this function:

◆ paintEvent()

void Slic3r::GUI::ExtruderImage::paintEvent ( wxPaintEvent & evt)
317{
318 wxPaintDC dc(this);
319 render(dc);
320}
void render(wxDC &dc)
Definition StatusPanel.cpp:322

References render().

Referenced by ExtruderImage().

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

◆ render()

void Slic3r::GUI::ExtruderImage::render ( wxDC & dc)
323{
324#ifdef __WXMSW__
325 wxSize size = GetSize();
326 wxMemoryDC memdc;
327 wxBitmap bmp(size.x, size.y);
328 memdc.SelectObject(bmp);
329 memdc.Blit({ 0, 0 }, size, &dc, { 0, 0 });
330
331 {
332 wxGCDC dc2(memdc);
333 doRender(dc2);
334 }
335
336 memdc.SelectObject(wxNullBitmap);
337 dc.DrawBitmap(bmp, 0, 0);
338#else
339 doRender(dc);
340#endif
341}
void doRender(wxDC &dc)
Definition StatusPanel.cpp:343

References doRender().

Referenced by paintEvent().

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

◆ setExtruderCount()

void Slic3r::GUI::ExtruderImage::setExtruderCount ( int nozzle_num)
290{
291 m_nozzle_num = nozzle_num;
292}

References m_nozzle_num.

◆ setExtruderUsed()

void Slic3r::GUI::ExtruderImage::setExtruderUsed ( std::string loc)
295{
296 //current_nozzle_idx = nozzle_id;
297 if (current_nozzle_loc == loc)
298 {
299 return;
300 }
301
302 current_nozzle_loc = loc;
303 Refresh();
304}

References current_nozzle_loc.

◆ update() [1/3]

void Slic3r::GUI::ExtruderImage::update ( ExtruderState right_state,
ExtruderState left_state )
311 {
312 m_left_ext_state = left_state;
313 m_right_ext_state = right_state;
314}

References m_left_ext_state, and m_right_ext_state.

◆ update() [2/3]

void Slic3r::GUI::ExtruderImage::update ( ExtruderState single_state)
307{
308 m_single_ext_state = single_state;
309}

References m_single_ext_state.

◆ update() [3/3]

void Slic3r::GUI::ExtruderImage::update ( int nozzle_num,
int nozzle_id )

Member Data Documentation

◆ current_nozzle_idx

int Slic3r::GUI::ExtruderImage::current_nozzle_idx = 0

◆ current_nozzle_loc

std::string Slic3r::GUI::ExtruderImage::current_nozzle_loc = ""

Referenced by doRender(), and setExtruderUsed().

◆ m_ams_loading

bool Slic3r::GUI::ExtruderImage::m_ams_loading {false}
175{false};

◆ m_colour

wxColour Slic3r::GUI::ExtruderImage::m_colour

◆ m_extruder_single_nozzle_empty_load

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_extruder_single_nozzle_empty_load
private

◆ m_extruder_single_nozzle_empty_unload

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_extruder_single_nozzle_empty_unload
private

◆ m_extruder_single_nozzle_filled_load

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_extruder_single_nozzle_filled_load
private

◆ m_extruder_single_nozzle_filled_unload

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_extruder_single_nozzle_filled_unload
private

◆ m_file_name

std::string Slic3r::GUI::ExtruderImage::m_file_name

◆ m_left_ext_state

ExtruderState Slic3r::GUI::ExtruderImage::m_left_ext_state = {ExtruderState::EMPTY_LOAD}
private

Referenced by doRender(), and update().

◆ m_left_extruder_active_empty

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_left_extruder_active_empty
private

◆ m_left_extruder_active_filled

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_left_extruder_active_filled
private

◆ m_left_extruder_unactive_empty

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_left_extruder_unactive_empty
private

◆ m_left_extruder_unactive_filled

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_left_extruder_unactive_filled
private

◆ m_nozzle_num

int Slic3r::GUI::ExtruderImage::m_nozzle_num = 1

◆ m_pipe_empty_load

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_pipe_empty_load
private

◆ m_pipe_empty_load_unselected

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_pipe_empty_load_unselected
private

◆ m_pipe_empty_unload

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_pipe_empty_unload
private

◆ m_pipe_empty_unload_unselected

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_pipe_empty_unload_unselected
private

◆ m_pipe_filled_load

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_pipe_filled_load
private

◆ m_pipe_filled_load_unselected

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_pipe_filled_load_unselected
private

◆ m_pipe_filled_unload

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_pipe_filled_unload
private

◆ m_pipe_filled_unload_unselected

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_pipe_filled_unload_unselected
private

◆ m_right_ext_state

ExtruderState Slic3r::GUI::ExtruderImage::m_right_ext_state = {ExtruderState::EMPTY_LOAD}
private

Referenced by doRender(), and update().

◆ m_right_extruder_active_empty

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_right_extruder_active_empty
private

◆ m_right_extruder_active_filled

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_right_extruder_active_filled
private

◆ m_right_extruder_unactive_empty

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_right_extruder_unactive_empty
private

◆ m_right_extruder_unactive_filled

ScalableBitmap* Slic3r::GUI::ExtruderImage::m_right_extruder_unactive_filled
private

◆ m_show_state

bool Slic3r::GUI::ExtruderImage::m_show_state = {false}
168{false};

◆ m_single_ext_state

ExtruderState Slic3r::GUI::ExtruderImage::m_single_ext_state = {ExtruderState::EMPTY_LOAD}
private

Referenced by doRender(), and update().


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