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

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

Inheritance diagram for Slic3r::GUI::CameraPopup:
Collaboration diagram for Slic3r::GUI::CameraPopup:

Public Types

enum  CameraResolution { RESOLUTION_720P = 0 , RESOLUTION_1080P = 1 , RESOLUTION_OPTIONS_NUM = 2 }

Public Member Functions

 CameraPopup (wxWindow *parent)
virtual ~CameraPopup ()
virtual void Popup (wxWindow *focus=NULL) wxOVERRIDE
virtual void OnDismiss () wxOVERRIDE
virtual bool ProcessLeftDown (wxMouseEvent &event) wxOVERRIDE
virtual bool Show (bool show=true) wxOVERRIDE
void sync_vcamera_state (bool show_vcamera)
void check_func_supported (MachineObject *obj)
void update (bool vcamera_streaming)
void rescale ()
bool Create (wxWindow *parent, int flags=wxBORDER_NONE)

Protected Member Functions

void on_switch_recording (wxCommandEvent &event)
void on_set_resolution ()
void sdcard_absent_hint ()
wxWindow * create_item_radiobox (wxString title, wxWindow *parent, wxString tooltip, int padding_left)
void select_curr_radiobox (int btn_idx)
void sync_resolution_setting (std::string resolution)
void reset_resolution_setting ()
wxString to_resolution_label_string (CameraResolution resolution)
std::string to_resolution_msg_string (CameraResolution resolution)
virtual bool ShouldDismissOnTopWindowDeactivate ()

Private Member Functions

void start_interval ()
void stop_interval (wxTimerEvent &event)
void OnMouse (wxMouseEvent &event)
void OnSize (wxSizeEvent &event)
void OnSetFocus (wxFocusEvent &event)
void OnKillFocus (wxFocusEvent &event)
void OnLeftUp (wxMouseEvent &event)
 wxDECLARE_ABSTRACT_CLASS (CameraPopup)
 wxDECLARE_EVENT_TABLE ()

Private Attributes

MachineObject * m_obj { nullptr }
wxTimer * m_interval_timer {nullptr}
bool m_is_in_interval { false }
wxStaticText * m_text_recording
SwitchButton * m_switch_recording
wxStaticText * m_text_vcamera
SwitchButton * m_switch_vcamera
wxStaticText * m_text_liveview_retry
SwitchButton * m_switch_liveview_retry
wxStaticText * m_text_resolution
wxWindow * m_resolution_options [RESOLUTION_OPTIONS_NUM]
wxScrolledWindow * m_panel
wxBoxSizer * main_sizer
std::vector< RadioBox * > resolution_rbtns
std::vector< wxStaticText * > resolution_texts
CameraResolution curr_sel_resolution = RESOLUTION_1080P
Label * vcamera_guide_link { nullptr }
wxPanel * link_underline { nullptr }
bool is_vcamera_show = false
bool allow_alter_resolution = false

Detailed Description

Member Enumeration Documentation

◆ CameraResolution

Enumerator
RESOLUTION_720P 
RESOLUTION_1080P 
RESOLUTION_OPTIONS_NUM 
51 {
55 };
@ RESOLUTION_1080P
Definition CameraPopup.hpp:53
@ RESOLUTION_720P
Definition CameraPopup.hpp:52
@ RESOLUTION_OPTIONS_NUM
Definition CameraPopup.hpp:54

Constructor & Destructor Documentation

◆ CameraPopup()

Slic3r::GUI::CameraPopup::CameraPopup ( wxWindow * parent)
55 : PopupWindow(parent, wxBORDER_NONE | wxPU_CONTAINS_CONTROLS)
56{
57#ifdef __WINDOWS__
58 SetDoubleBuffered(true);
59#endif
60 m_panel = new wxScrolledWindow(this, wxID_ANY);
61 m_panel->SetBackgroundColour(*wxWHITE);
62 m_panel->SetMinSize(wxSize(FromDIP(180),-1));
63 m_panel->Bind(wxEVT_MOTION, &CameraPopup::OnMouse, this);
64
65 main_sizer = new wxBoxSizer(wxVERTICAL);
66 wxFlexGridSizer* top_sizer = new wxFlexGridSizer(0, 2, 0, FromDIP(50));
67 top_sizer->AddGrowableCol(0);
68 top_sizer->SetFlexibleDirection(wxBOTH);
69 top_sizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
70
71 //recording
72 m_text_recording = new wxStaticText(m_panel, wxID_ANY, _L("Auto-record Monitoring"));
73 m_text_recording->Wrap(-1);
75 m_text_recording->SetForegroundColour(TEXT_COL);
76 m_switch_recording = new SwitchButton(m_panel);
77
78 //vcamera
79 m_text_vcamera = new wxStaticText(m_panel, wxID_ANY, _L("Go Live"));
80 m_text_vcamera->Wrap(-1);
82 m_text_vcamera->SetForegroundColour(TEXT_COL);
83 m_switch_vcamera = new SwitchButton(m_panel);
84
85 top_sizer->Add(m_text_recording, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, FromDIP(5));
86 top_sizer->Add(m_switch_recording, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, FromDIP(5));
87 top_sizer->Add(m_text_vcamera, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, FromDIP(5));
88 top_sizer->Add(m_switch_vcamera, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, FromDIP(5));
89
90#if !BBL_RELEASE_TO_PUBLIC
91 m_text_liveview_retry = new wxStaticText(m_panel, wxID_ANY, _L("Liveview Retry"));
92 m_text_liveview_retry->Wrap(-1);
94 m_text_liveview_retry->SetForegroundColour(TEXT_COL);
95 m_switch_liveview_retry = new SwitchButton(m_panel);
96 bool auto_retry = wxGetApp().app_config->get("liveview", "auto_retry") != "false";
97 m_switch_liveview_retry->SetValue(auto_retry);
98
99 top_sizer->Add(m_text_liveview_retry, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, FromDIP(5));
100 top_sizer->Add(m_switch_liveview_retry, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, FromDIP(5));
101
102 m_switch_liveview_retry->Bind(wxEVT_TOGGLEBUTTON, [](wxCommandEvent &e) {
103 wxGetApp().app_config->set("liveview", "auto_retry", e.IsChecked());
104 e.Skip();
105 });
106#endif
107
108 //resolution
109 m_text_resolution = new wxStaticText(m_panel, wxID_ANY, _L("Resolution"));
110 m_text_resolution->Wrap(-1);
112 m_text_resolution->SetForegroundColour(TEXT_COL);
113 top_sizer->Add(m_text_resolution, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, FromDIP(5));
114 top_sizer->Add(0, 0, wxALL, 0);
115 for (int i = 0; i < (int)RESOLUTION_OPTIONS_NUM; ++i)
116 {
118 top_sizer->Add(m_resolution_options[i], 0, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT | wxALL, FromDIP(5));
119 top_sizer->Add(0, 0, wxALL, 0);
120 }
121
122 main_sizer->Add(top_sizer, 0, wxALL, FromDIP(10));
123
124 auto url = wxString(L"https://www.orcaslicer.com/wiki/"); // Orca: neutral wiki link (vendor URL removed)
125 auto text = _L("Show \"Live Video\" guide page.");
126
127 wxBoxSizer* link_sizer = new wxBoxSizer(wxVERTICAL);
128 vcamera_guide_link = new Label(m_panel, text);
129 vcamera_guide_link->Wrap(-1);
130 vcamera_guide_link->SetForegroundColour(wxColour(0x1F, 0x8E, 0xEA));
131 auto text_size = vcamera_guide_link->GetTextExtent(text);
132 vcamera_guide_link->Bind(wxEVT_LEFT_DOWN, [url](wxMouseEvent& e) {wxLaunchDefaultBrowser(url); });
133
134 link_underline = new wxPanel(m_panel, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
135 link_underline->SetBackgroundColour(wxColour(0x1F, 0x8E, 0xEA));
136 link_underline->SetSize(wxSize(text_size.x, 1));
137 link_underline->SetMinSize(wxSize(text_size.x, 1));
138
139 vcamera_guide_link->Hide();
140 link_underline->Hide();
141 link_sizer->Add(vcamera_guide_link, 0, wxALL, 0);
142 link_sizer->Add(link_underline, 0, wxALL, 0);
143
144 main_sizer->Add(link_sizer, 0, wxALL, FromDIP(15));
145
146 m_panel->SetSizer(main_sizer);
147 m_panel->Layout();
148
149 main_sizer->Fit(m_panel);
150
151 SetClientSize(m_panel->GetSize());
152 m_switch_recording->Connect(wxEVT_LEFT_DOWN, wxCommandEventHandler(CameraPopup::on_switch_recording), NULL, this);
153 m_switch_vcamera->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
154 wxMouseEvent evt(EVT_VCAMERA_SWITCH);
155 evt.SetEventObject(this);
156 GetEventHandler()->ProcessEvent(evt);
157 });
158 #ifdef __APPLE__
159 m_panel->Bind(wxEVT_LEFT_UP, &CameraPopup::OnLeftUp, this);
160 #endif //APPLE
161
162 this->Bind(wxEVT_TIMER, &CameraPopup::stop_interval, this);
163 m_interval_timer = new wxTimer();
164 m_interval_timer->SetOwner(this);
165
166 wxGetApp().UpdateDarkUIWin(this);
167}
#define L(s)
Definition ExtrusionEntity.cpp:25
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
static wxFont Head_14
Definition Label.hpp:45
PopupWindow()
Definition PopupWindow.hpp:10
void stop_interval(wxTimerEvent &event)
Definition CameraPopup.cpp:452
wxTimer * m_interval_timer
Definition CameraPopup.hpp:73
wxStaticText * m_text_vcamera
Definition CameraPopup.hpp:77
Label * vcamera_guide_link
Definition CameraPopup.hpp:94
void on_switch_recording(wxCommandEvent &event)
Definition CameraPopup.cpp:176
wxString to_resolution_label_string(CameraResolution resolution)
Definition CameraPopup.cpp:368
CameraResolution
Definition CameraPopup.hpp:51
wxBoxSizer * main_sizer
Definition CameraPopup.hpp:90
SwitchButton * m_switch_vcamera
Definition CameraPopup.hpp:78
wxPanel * link_underline
Definition CameraPopup.hpp:95
wxWindow * m_resolution_options[RESOLUTION_OPTIONS_NUM]
Definition CameraPopup.hpp:88
wxWindow * create_item_radiobox(wxString title, wxWindow *parent, wxString tooltip, int padding_left)
Definition CameraPopup.cpp:206
SwitchButton * m_switch_recording
Definition CameraPopup.hpp:76
void OnLeftUp(wxMouseEvent &event)
Definition CameraPopup.cpp:400
wxScrolledWindow * m_panel
Definition CameraPopup.hpp:89
wxStaticText * m_text_recording
Definition CameraPopup.hpp:75
void OnMouse(wxMouseEvent &event)
Definition CameraPopup.cpp:488
SwitchButton * m_switch_liveview_retry
Definition CameraPopup.hpp:81
wxStaticText * m_text_resolution
Definition CameraPopup.hpp:87
wxStaticText * m_text_liveview_retry
Definition CameraPopup.hpp:80
wxMouseEvent
Definition CameraPopup.cpp:47
const wxColour TEXT_COL
Definition CameraPopup.cpp:52

References PopupWindow::PopupWindow(), _L, create_item_radiobox(), Label::Head_14, L, link_underline, m_interval_timer, m_panel, m_resolution_options, m_switch_liveview_retry, m_switch_recording, m_switch_vcamera, m_text_liveview_retry, m_text_recording, m_text_resolution, m_text_vcamera, main_sizer, on_switch_recording(), OnLeftUp(), OnMouse(), RESOLUTION_OPTIONS_NUM, stop_interval(), Slic3r::GUI::TEXT_COL, to_resolution_label_string(), vcamera_guide_link, Slic3r::GUI::wxMouseEvent, and wxStaticText.

Referenced by wxDECLARE_ABSTRACT_CLASS().

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

◆ ~CameraPopup()

virtual Slic3r::GUI::CameraPopup::~CameraPopup ( )
inlinevirtual
38{}

Member Function Documentation

◆ check_func_supported()

void Slic3r::GUI::CameraPopup::check_func_supported ( MachineObject * obj)
299{
300 m_obj = obj2;
301 if (m_obj == nullptr)
302 return;
303 // function supported
304 if (m_obj->has_ipcam) {
305 m_text_recording->Show();
306 m_switch_recording->Show();
307 } else {
308 m_text_recording->Hide();
309 m_switch_recording->Hide();
310 }
311
312 if (m_obj->virtual_camera && m_obj->has_ipcam) {
313 m_text_vcamera->Show();
314 m_switch_vcamera->Show();
315 if (is_vcamera_show) {
316 vcamera_guide_link->Show();
317 link_underline->Show();
318 }
319 } else {
320 m_text_vcamera->Hide();
321 m_switch_vcamera->Hide();
322 vcamera_guide_link->Hide();
323 link_underline->Hide();
324 }
325
326 allow_alter_resolution = ( (m_obj->camera_resolution_supported.size() > 1?true:false) && m_obj->has_ipcam);
327
328 //check u2 version
329 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
330 if (!dev) return;
331 MachineObject* obj = dev->get_selected_machine();
332 if (!obj) return;
333
334 //resolution supported
335 std::vector<std::string> resolution_supported = m_obj->get_resolution_supported();
336 auto support_count = resolution_supported.size();
337 for (int i = 0; i < (int)RESOLUTION_OPTIONS_NUM; ++i){
338 auto curr_res = to_resolution_msg_string(CameraResolution(i));
339 std::vector <std::string> ::iterator it = std::find(resolution_supported.begin(), resolution_supported.end(), curr_res);
340 if ((it == resolution_supported.end())||(support_count <= 1) || !obj->is_support_1080dpi)
341 m_resolution_options[i]->Hide();
342 else {
343 m_resolution_options[i]->Show();
344 if (m_obj->camera_resolution == curr_res) {
345 resolution_rbtns[i]->SetValue(true);
346 }
347 }
348 }
349 //hide resolution if there is only one choice
350 if (support_count <= 1 || !obj->is_support_1080dpi) {
351 m_text_resolution->Hide();
352 }
353 else {
354 m_text_resolution->Show();
355 }
356}
bool is_vcamera_show
Definition CameraPopup.hpp:96
std::string to_resolution_msg_string(CameraResolution resolution)
Definition CameraPopup.cpp:380
bool allow_alter_resolution
Definition CameraPopup.hpp:97
MachineObject * m_obj
Definition CameraPopup.hpp:72
std::vector< RadioBox * > resolution_rbtns
Definition CameraPopup.hpp:91

References allow_alter_resolution, Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::is_support_1080dpi, is_vcamera_show, link_underline, m_obj, m_resolution_options, m_switch_recording, m_switch_vcamera, m_text_recording, m_text_resolution, m_text_vcamera, RESOLUTION_OPTIONS_NUM, resolution_rbtns, to_resolution_msg_string(), and vcamera_guide_link.

Here is the call graph for this function:

◆ Create()

bool PopupWindow::Create ( wxWindow * parent,
int flags = wxBORDER_NONE )
inherited
22{
23 if (!wxPopupTransientWindow::Create(parent, style))
24 return false;
25#ifdef __WXGTK__
26 GetTopParent(parent)->Bind(wxEVT_ACTIVATE, &PopupWindow::topWindowActiavate, this);
27#endif
28#ifdef __WXOSX__
29 if (style & wxPU_CONTAINS_CONTROLS)
30 for (auto evt : {wxEVT_LEFT_DOWN, wxEVT_LEFT_UP, wxEVT_LEFT_DCLICK, wxEVT_MOTION, wxEVT_MOUSEWHEEL})
31 Bind(evt, &PopupWindow::OnMouseEvent2, this);
32#endif
33 return true;
34}
static wxWindow * GetTopParent(wxWindow *pWindow)
Definition PopupWindow.cpp:10
#define style
Definition WipeTowerDialog.cpp:101

References GetTopParent(), and style.

Referenced by PopupWindow(), and DropDown::Create().

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

◆ create_item_radiobox()

wxWindow * Slic3r::GUI::CameraPopup::create_item_radiobox ( wxString title,
wxWindow * parent,
wxString tooltip,
int padding_left )
protected
207{
208 wxWindow *item = new wxWindow(parent, wxID_ANY, wxDefaultPosition, wxSize(-1, FromDIP(20)));
209 item->SetBackgroundColour(*wxWHITE);
210
211 RadioBox *radiobox = new RadioBox(item);
212 radiobox->SetPosition(wxPoint(padding_left, (item->GetSize().GetHeight() - radiobox->GetSize().GetHeight()) / 2));
213 resolution_rbtns.push_back(radiobox);
214 int btn_idx = resolution_rbtns.size() - 1;
215 radiobox->Bind(wxEVT_LEFT_DOWN, [this, btn_idx](wxMouseEvent &e) {
217 select_curr_radiobox(btn_idx);
219 }
220 });
221
222 wxStaticText *text = new wxStaticText(item, wxID_ANY, title, wxDefaultPosition, wxDefaultSize);
223 text->SetForegroundColour(*wxBLACK);
224 resolution_texts.push_back(text);
225 text->SetPosition(wxPoint(padding_left + radiobox->GetSize().GetWidth() + 10, (item->GetSize().GetHeight() - text->GetSize().GetHeight()) / 2));
226 text->SetFont(Label::Body_13);
227 text->SetForegroundColour(0x6B6B6B);
228 text->Bind(wxEVT_LEFT_DOWN, [this, btn_idx](wxMouseEvent &e) {
230 select_curr_radiobox(btn_idx);
232 }
233 });
234
235 radiobox->SetToolTip(tooltip);
236 text->SetToolTip(tooltip);
237 return item;
238}
static wxFont Body_13
Definition Label.hpp:54
void on_set_resolution()
Definition CameraPopup.cpp:188
std::vector< wxStaticText * > resolution_texts
Definition CameraPopup.hpp:92
void select_curr_radiobox(int btn_idx)
Definition CameraPopup.cpp:240

References allow_alter_resolution, Label::Body_13, m_obj, on_set_resolution(), resolution_rbtns, resolution_texts, select_curr_radiobox(), Slic3r::GUI::wxMouseEvent, and wxStaticText.

Referenced by CameraPopup().

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

◆ on_set_resolution()

void Slic3r::GUI::CameraPopup::on_set_resolution ( )
protected
189{
190 if (!m_obj) return;
191
192 m_obj->command_ipcam_resolution_set(to_resolution_msg_string(curr_sel_resolution));
193}
CameraResolution curr_sel_resolution
Definition CameraPopup.hpp:93

References curr_sel_resolution, m_obj, and to_resolution_msg_string().

Referenced by create_item_radiobox().

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

◆ on_switch_recording()

void Slic3r::GUI::CameraPopup::on_switch_recording ( wxCommandEvent & event)
protected
177{
178 if (!m_obj) return;
179 if (m_obj->GetStorage()->get_sdcard_state() != DevStorage::SdcardState::HAS_SDCARD_NORMAL) {
181 return;
182 }
183 bool value = m_switch_recording->GetValue();
184 m_switch_recording->SetValue(!value);
185 m_obj->command_ipcam_record(!value);
186}
@ HAS_SDCARD_NORMAL
Definition DevStorage.h:19
void sdcard_absent_hint()
Definition CameraPopup.cpp:169

References Slic3r::DevStorage::HAS_SDCARD_NORMAL, m_obj, m_switch_recording, and sdcard_absent_hint().

Referenced by CameraPopup().

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

◆ OnDismiss()

void Slic3r::GUI::CameraPopup::OnDismiss ( )
virtual
458 {
459 PopupWindow::OnDismiss();
460 this->start_interval();
461}
void start_interval()
Definition CameraPopup.cpp:446

References start_interval().

Here is the call graph for this function:

◆ OnKillFocus()

void Slic3r::GUI::CameraPopup::OnKillFocus ( wxFocusEvent & event)
private
484{
485 event.Skip();
486}

Referenced by Slic3r::GUI::wxBEGIN_EVENT_TABLE().

Here is the caller graph for this function:

◆ OnLeftUp()

void Slic3r::GUI::CameraPopup::OnLeftUp ( wxMouseEvent & event)
private
401{
402 auto mouse_pos = ClientToScreen(event.GetPosition());
403 auto wxscroll_win_pos = m_panel->ClientToScreen(wxPoint(0, 0));
404
405 if (mouse_pos.x > wxscroll_win_pos.x && mouse_pos.y > wxscroll_win_pos.y && mouse_pos.x < (wxscroll_win_pos.x + m_panel->GetSize().x) && mouse_pos.y < (wxscroll_win_pos.y + m_panel->GetSize().y)) {
406 //recording
407 auto recording_rect = m_switch_recording->ClientToScreen(wxPoint(0, 0));
408 if (mouse_pos.x > recording_rect.x && mouse_pos.y > recording_rect.y && mouse_pos.x < (recording_rect.x + m_switch_recording->GetSize().x) && mouse_pos.y < (recording_rect.y + m_switch_recording->GetSize().y)) {
409 wxMouseEvent recording_evt(wxEVT_LEFT_DOWN);
410 m_switch_recording->GetEventHandler()->ProcessEvent(recording_evt);
411 return;
412 }
413 //vcamera
414 auto vcamera_rect = m_switch_vcamera->ClientToScreen(wxPoint(0, 0));
415 if (mouse_pos.x > vcamera_rect.x && mouse_pos.y > vcamera_rect.y && mouse_pos.x < (vcamera_rect.x + m_switch_vcamera->GetSize().x) && mouse_pos.y < (vcamera_rect.y + m_switch_vcamera->GetSize().y)) {
416 wxMouseEvent vcamera_evt(wxEVT_LEFT_DOWN);
417 m_switch_vcamera->GetEventHandler()->ProcessEvent(vcamera_evt);
418 return;
419 }
420 //resolution
421 for (int i = 0; i < (int)RESOLUTION_OPTIONS_NUM; ++i){
422 auto resolution_rbtn = resolution_rbtns[i];
423 auto rbtn_rect = resolution_rbtn->ClientToScreen(wxPoint(0, 0));
424 if (mouse_pos.x > rbtn_rect.x && mouse_pos.y > rbtn_rect.y && mouse_pos.x < (rbtn_rect.x + resolution_rbtn->GetSize().x) && mouse_pos.y < (rbtn_rect.y + resolution_rbtn->GetSize().y)) {
425 wxMouseEvent resolution_evt(wxEVT_LEFT_DOWN);
426 resolution_rbtn->GetEventHandler()->ProcessEvent(resolution_evt);
427 return;
428 }
429 auto resolution_txt = resolution_texts[i];
430 auto txt_rect = resolution_txt->ClientToScreen(wxPoint(0, 0));
431 if (mouse_pos.x > txt_rect.x && mouse_pos.y > txt_rect.y && mouse_pos.x < (txt_rect.x + resolution_txt->GetSize().x) && mouse_pos.y < (txt_rect.y + resolution_txt->GetSize().y)) {
432 wxMouseEvent resolution_evt(wxEVT_LEFT_DOWN);
433 resolution_txt->GetEventHandler()->ProcessEvent(resolution_evt);
434 return;
435 }
436 }
437 //hyper link
438 auto h_rect = vcamera_guide_link->ClientToScreen(wxPoint(0, 0));
439 if (mouse_pos.x > h_rect.x && mouse_pos.y > h_rect.y && mouse_pos.x < (h_rect.x + vcamera_guide_link->GetSize().x) && mouse_pos.y < (h_rect.y + vcamera_guide_link->GetSize().y)) {
440 auto url = wxString(L"https://www.orcaslicer.com/wiki/"); // Orca: neutral wiki link (vendor URL removed)
441 wxLaunchDefaultBrowser(url);
442 }
443 }
444}

References L, m_panel, m_switch_recording, m_switch_vcamera, RESOLUTION_OPTIONS_NUM, resolution_rbtns, resolution_texts, vcamera_guide_link, and Slic3r::GUI::wxMouseEvent.

Referenced by CameraPopup().

Here is the caller graph for this function:

◆ OnMouse()

void Slic3r::GUI::CameraPopup::OnMouse ( wxMouseEvent & event)
private
489{
490 event.Skip();
491}

References Slic3r::GUI::wxMouseEvent.

Referenced by CameraPopup(), and Slic3r::GUI::wxBEGIN_EVENT_TABLE().

Here is the caller graph for this function:

◆ OnSetFocus()

void Slic3r::GUI::CameraPopup::OnSetFocus ( wxFocusEvent & event)
private
479{
480 event.Skip();
481}

Referenced by Slic3r::GUI::wxBEGIN_EVENT_TABLE().

Here is the caller graph for this function:

◆ OnSize()

void Slic3r::GUI::CameraPopup::OnSize ( wxSizeEvent & event)
private
474{
475 event.Skip();
476}

Referenced by Slic3r::GUI::wxBEGIN_EVENT_TABLE().

Here is the caller graph for this function:

◆ Popup()

void Slic3r::GUI::CameraPopup::Popup ( wxWindow * focus = NULL)
virtual
196{
197 wxPoint curr_position = this->GetPosition();
198 wxSize win_size = this->GetSize();
199 curr_position.x -= win_size.x;
200 this->SetPosition(curr_position);
201
202 if (!m_is_in_interval)
203 PopupWindow::Popup();
204}
bool m_is_in_interval
Definition CameraPopup.hpp:74

References m_is_in_interval.

◆ ProcessLeftDown()

bool Slic3r::GUI::CameraPopup::ProcessLeftDown ( wxMouseEvent & event)
virtual
464{
465 return PopupWindow::ProcessLeftDown(event);
466}

◆ rescale()

void Slic3r::GUI::CameraPopup::rescale ( )
393{
394 m_panel->Layout();
395 main_sizer->Fit(m_panel);
396 SetClientSize(m_panel->GetSize());
397 PopupWindow::Update();
398}

References m_panel, and main_sizer.

Referenced by sync_vcamera_state(), and update().

Here is the caller graph for this function:

◆ reset_resolution_setting()

void Slic3r::GUI::CameraPopup::reset_resolution_setting ( )
protected
273{
274 int len = resolution_rbtns.size();
275 for (int i = 0; i < len; ++i) {
276 resolution_rbtns[i]->SetValue(false);
277 }
279}

References curr_sel_resolution, RESOLUTION_OPTIONS_NUM, and resolution_rbtns.

Referenced by sync_resolution_setting().

Here is the caller graph for this function:

◆ sdcard_absent_hint()

void Slic3r::GUI::CameraPopup::sdcard_absent_hint ( )
protected
170{
171 wxCommandEvent evt(EVT_SDCARD_ABSENT_HINT);
172 evt.SetEventObject(this);
173 GetEventHandler()->ProcessEvent(evt);
174}

Referenced by on_switch_recording().

Here is the caller graph for this function:

◆ select_curr_radiobox()

void Slic3r::GUI::CameraPopup::select_curr_radiobox ( int btn_idx)
protected
241{
242 if (!m_obj) return;
243
244 int len = resolution_rbtns.size();
245 for (int i = 0; i < len; ++i) {
246 if (i == btn_idx) {
248 resolution_rbtns[i]->SetValue(true);
249 }
250 else {
251 resolution_rbtns[i]->SetValue(false);
252 }
253 }
254}

References curr_sel_resolution, m_obj, and resolution_rbtns.

Referenced by create_item_radiobox(), and sync_resolution_setting().

Here is the caller graph for this function:

◆ ShouldDismissOnTopWindowDeactivate()

virtual bool PopupWindow::ShouldDismissOnTopWindowDeactivate ( )
inlineprotectedvirtualinherited

Reimplemented in DropDown.

28{ return true; }

◆ Show()

bool Slic3r::GUI::CameraPopup::Show ( bool show = true)
virtual
469{
470 return PopupWindow::Show(show);
471}

◆ start_interval()

void Slic3r::GUI::CameraPopup::start_interval ( )
private
447{
449 m_is_in_interval = true;
450}
#define CAMERAPOPUP_CLICK_INTERVAL
Definition CameraPopup.cpp:50

References CAMERAPOPUP_CLICK_INTERVAL, m_interval_timer, and m_is_in_interval.

Referenced by OnDismiss().

Here is the caller graph for this function:

◆ stop_interval()

void Slic3r::GUI::CameraPopup::stop_interval ( wxTimerEvent & event)
private
453{
454 m_is_in_interval = false;
455 m_interval_timer->Stop();
456}

References m_interval_timer, and m_is_in_interval.

Referenced by CameraPopup().

Here is the caller graph for this function:

◆ sync_resolution_setting()

void Slic3r::GUI::CameraPopup::sync_resolution_setting ( std::string resolution)
protected
257{
258 if (resolution == "") {
260 return;
261 }
262 int res = 0;
265 res = int(i);
266 break;
267 }
268 }
270}
void reset_resolution_setting()
Definition CameraPopup.cpp:272
zaa_minimize_perimeter_height resolution((ConfigOptionFloats, retraction_minimum_travel))((ConfigOptionBools

References reset_resolution_setting(), Slic3r::resolution(), RESOLUTION_720P, RESOLUTION_OPTIONS_NUM, select_curr_radiobox(), and to_resolution_msg_string().

Referenced by update().

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

◆ sync_vcamera_state()

void Slic3r::GUI::CameraPopup::sync_vcamera_state ( bool show_vcamera)
282{
283 is_vcamera_show = show_vcamera;
284 if (is_vcamera_show) {
285 m_switch_vcamera->SetValue(true);
286 vcamera_guide_link->Show();
287 link_underline->Show();
288 }
289 else {
290 m_switch_vcamera->SetValue(false);
291 vcamera_guide_link->Hide();
292 link_underline->Hide();
293 }
294
295 rescale();
296}
void rescale()
Definition CameraPopup.cpp:392

References is_vcamera_show, link_underline, m_switch_vcamera, rescale(), and vcamera_guide_link.

Referenced by update().

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

◆ to_resolution_label_string()

wxString Slic3r::GUI::CameraPopup::to_resolution_label_string ( CameraResolution resolution)
protected
368 {
369 switch (resolution) {
370 case RESOLUTION_720P:
371 return "720p";
372 case RESOLUTION_1080P:
373 return "1080p";
374 default:
375 return "";
376 }
377 return "";
378}

References Slic3r::resolution(), RESOLUTION_1080P, and RESOLUTION_720P.

Referenced by CameraPopup().

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

◆ to_resolution_msg_string()

std::string Slic3r::GUI::CameraPopup::to_resolution_msg_string ( CameraResolution resolution)
protected
380 {
381 switch (resolution) {
382 case RESOLUTION_720P:
383 return std::string("720p");
384 case RESOLUTION_1080P:
385 return std::string("1080p");
386 default:
387 return "";
388 }
389 return "";
390}

References Slic3r::resolution(), RESOLUTION_1080P, and RESOLUTION_720P.

Referenced by check_func_supported(), on_set_resolution(), and sync_resolution_setting().

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

◆ update()

void Slic3r::GUI::CameraPopup::update ( bool vcamera_streaming)
359{
360 if (!m_obj) return;
361 m_switch_recording->SetValue(m_obj->camera_recording_when_printing);
362 sync_resolution_setting(m_obj->camera_resolution);
363 sync_vcamera_state(vcamera_streaming);
364
365 rescale();
366}
void sync_vcamera_state(bool show_vcamera)
Definition CameraPopup.cpp:281
void sync_resolution_setting(std::string resolution)
Definition CameraPopup.cpp:256

References m_obj, m_switch_recording, rescale(), sync_resolution_setting(), and sync_vcamera_state().

Here is the call graph for this function:

◆ wxDECLARE_ABSTRACT_CLASS()

Slic3r::GUI::CameraPopup::wxDECLARE_ABSTRACT_CLASS ( CameraPopup )
private

References CameraPopup().

Here is the call graph for this function:

◆ wxDECLARE_EVENT_TABLE()

Slic3r::GUI::CameraPopup::wxDECLARE_EVENT_TABLE ( )
private

Member Data Documentation

◆ allow_alter_resolution

bool Slic3r::GUI::CameraPopup::allow_alter_resolution = false
private

◆ curr_sel_resolution

CameraResolution Slic3r::GUI::CameraPopup::curr_sel_resolution = RESOLUTION_1080P
private

◆ is_vcamera_show

bool Slic3r::GUI::CameraPopup::is_vcamera_show = false
private

◆ link_underline

wxPanel* Slic3r::GUI::CameraPopup::link_underline { nullptr }
private
95{ nullptr };

Referenced by CameraPopup(), check_func_supported(), and sync_vcamera_state().

◆ m_interval_timer

wxTimer* Slic3r::GUI::CameraPopup::m_interval_timer {nullptr}
private
73{nullptr};

Referenced by CameraPopup(), start_interval(), and stop_interval().

◆ m_is_in_interval

bool Slic3r::GUI::CameraPopup::m_is_in_interval { false }
private
74{ false };

Referenced by Popup(), start_interval(), and stop_interval().

◆ m_obj

MachineObject* Slic3r::GUI::CameraPopup::m_obj { nullptr }
private

◆ m_panel

wxScrolledWindow* Slic3r::GUI::CameraPopup::m_panel
private

Referenced by CameraPopup(), OnLeftUp(), and rescale().

◆ m_resolution_options

wxWindow* Slic3r::GUI::CameraPopup::m_resolution_options[RESOLUTION_OPTIONS_NUM]
private

◆ m_switch_liveview_retry

SwitchButton* Slic3r::GUI::CameraPopup::m_switch_liveview_retry
private

Referenced by CameraPopup().

◆ m_switch_recording

SwitchButton* Slic3r::GUI::CameraPopup::m_switch_recording
private

◆ m_switch_vcamera

SwitchButton* Slic3r::GUI::CameraPopup::m_switch_vcamera
private

◆ m_text_liveview_retry

wxStaticText* Slic3r::GUI::CameraPopup::m_text_liveview_retry
private

Referenced by CameraPopup().

◆ m_text_recording

wxStaticText* Slic3r::GUI::CameraPopup::m_text_recording
private

◆ m_text_resolution

wxStaticText* Slic3r::GUI::CameraPopup::m_text_resolution
private

◆ m_text_vcamera

wxStaticText* Slic3r::GUI::CameraPopup::m_text_vcamera
private

◆ main_sizer

wxBoxSizer* Slic3r::GUI::CameraPopup::main_sizer
private

Referenced by CameraPopup(), and rescale().

◆ resolution_rbtns

std::vector<RadioBox*> Slic3r::GUI::CameraPopup::resolution_rbtns
private

◆ resolution_texts

std::vector<wxStaticText*> Slic3r::GUI::CameraPopup::resolution_texts
private

Referenced by create_item_radiobox(), and OnLeftUp().

◆ vcamera_guide_link

Label* Slic3r::GUI::CameraPopup::vcamera_guide_link { nullptr }
private

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