mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-07 12:21:50 +03:00
update slic3r
This commit is contained in:
@@ -93,7 +93,7 @@ MediaPlayCtrl::MediaPlayCtrl(wxWindow *parent, wxMediaCtrl3 *media_ctrl, const w
|
||||
m_button_play->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](auto &e) { TogglePlay(); });
|
||||
m_button_play->Bind(wxEVT_RIGHT_UP, [this](auto & e) { m_media_ctrl->Play(); });
|
||||
m_label_status->Bind(wxEVT_LEFT_UP, [this](auto &e) {
|
||||
auto url = wxString::Format(L"https://wiki.qidi3d.com/%s/software/qidi-studio/faq/live-view", L"en");
|
||||
auto url = wxString::Format(L"https://wiki.qidi3d.com/%s/software/qidi-studio/faq/live-view", wxGetApp().current_language_code_safe() == "zh_CN" ? "zh" : "en");
|
||||
wxLaunchDefaultBrowser(url);
|
||||
});
|
||||
|
||||
@@ -157,7 +157,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
|
||||
m_dev_ver = obj->get_ota_version();
|
||||
m_lan_mode = obj->is_lan_mode_printer();
|
||||
m_lan_proto = obj->liveview_local;
|
||||
m_remote_proto = obj->liveview_remote;
|
||||
m_remote_proto = obj->get_liveview_remote();
|
||||
m_lan_ip = obj->dev_ip;
|
||||
m_lan_passwd = obj->get_access_code();
|
||||
m_device_busy = obj->is_camera_busy_off();
|
||||
@@ -173,7 +173,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
|
||||
m_remote_proto = 0;
|
||||
m_device_busy = false;
|
||||
}
|
||||
Enable(obj && obj->is_connected() && obj->m_push_count > 0);
|
||||
Enable(obj && obj->is_info_ready() && obj->m_push_count > 0);
|
||||
if (machine == m_machine) {
|
||||
if (m_last_state == MEDIASTATE_IDLE && IsEnabled())
|
||||
Play();
|
||||
@@ -181,21 +181,23 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
|
||||
auto now = std::chrono::system_clock::now();
|
||||
if (m_play_timer <= now) {
|
||||
m_play_timer = now + 1min;
|
||||
#if QDT_RELEASE_TO_PUBLIC
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl playing..., idle: " << SecondsSinceLastInput() << "printIdle: " << m_print_idle;
|
||||
if (SecondsSinceLastInput() >= 900) { // 15 min
|
||||
auto close = wxGetApp().app_config->get("liveview", "auto_stop_liveview") == "true";
|
||||
if (close) {
|
||||
if (close || obj == nullptr || !obj->is_in_printing()) {
|
||||
m_next_retry = wxDateTime();
|
||||
Stop(_L("Temporarily closed because there is no operating for a long time."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
auto obj = wxGetApp().getDeviceManager()->get_selected_machine();
|
||||
if (obj && obj->is_in_printing()) {
|
||||
m_print_idle = 0;
|
||||
} else if (++m_print_idle >= 5) {
|
||||
m_next_retry = wxDateTime();
|
||||
Stop(_L("Temporarily closed because there is no printing for a while."));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -295,6 +297,7 @@ void MediaPlayCtrl::Play()
|
||||
}
|
||||
|
||||
m_play_timer = std::chrono::system_clock::now();
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl::Play: " << m_lan_proto << m_remote_proto << m_disable_lan;
|
||||
|
||||
NetworkAgent *agent = wxGetApp().getAgent();
|
||||
std::string agent_version = agent ? agent->get_version() : "";
|
||||
@@ -372,6 +375,11 @@ void MediaPlayCtrl::Play()
|
||||
if (m_last_state == MEDIASTATE_IDLE) {
|
||||
if (url.empty() || !boost::algorithm::starts_with(url, "qidi:///")) {
|
||||
m_failed_code = 3;
|
||||
if (boost::ends_with(url, "]")) {
|
||||
size_t n = url.find_last_of('[');
|
||||
if (n != std::string::npos)
|
||||
m_failed_code = std::atoi(url.substr(n + 1, url.length() - n - 2).c_str());
|
||||
}
|
||||
Stop(_L("Connection Failed. Please check the network and try again"), from_u8(url));
|
||||
} else {
|
||||
m_url = url;
|
||||
@@ -480,7 +488,7 @@ void MediaPlayCtrl::Stop(wxString const &msg, wxString const &msg2)
|
||||
tunnel == "rtsps";
|
||||
if (m_failed_code < 0 && last_state != wxMEDIASTATE_PLAYING && local && (m_failed_retry > 1 || m_user_triggered)) {
|
||||
m_next_retry = wxDateTime(); // stop retry
|
||||
if (wxGetApp().show_modal_ip_address_enter_dialog(_L("LAN Connection Failed (Failed to start liveview)"))) {
|
||||
if (wxGetApp().show_modal_ip_address_enter_dialog(false, _L("LAN Connection Failed (Failed to start liveview)"))) {
|
||||
m_failed_retry = 0;
|
||||
m_user_triggered = true;
|
||||
if (m_last_user_play + wxTimeSpan::Minutes(5) < wxDateTime::Now()) {
|
||||
@@ -591,7 +599,9 @@ void MediaPlayCtrl::ToggleStream()
|
||||
}
|
||||
NetworkAgent *agent = wxGetApp().getAgent();
|
||||
if (!agent) return;
|
||||
agent->get_camera_url(m_machine, [this, m = m_machine, v = agent->get_version(), dv = m_dev_ver](std::string url) {
|
||||
std::string protocols[] = {"", "\"tutk\"", "\"agora\"", "\"tutk\",\"agora\""};
|
||||
agent->get_camera_url(m_machine + "|" + m_dev_ver + "|" + protocols[m_remote_proto],
|
||||
[this, m = m_machine, v = agent->get_version(), dv = m_dev_ver](std::string url) {
|
||||
if (boost::algorithm::starts_with(url, "qidi:///")) {
|
||||
url += "&device=" + m;
|
||||
url += "&net_ver=" + v;
|
||||
@@ -771,10 +781,7 @@ void MediaPlayCtrl::media_proc()
|
||||
continue;
|
||||
}
|
||||
lock.unlock();
|
||||
if (url.IsEmpty()) {
|
||||
break;
|
||||
}
|
||||
else if (url == "<stop>") {
|
||||
if (url == "<stop>") {
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: start stop";
|
||||
m_media_ctrl->Stop();
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: end stop";
|
||||
|
||||
Reference in New Issue
Block a user