mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-07 12:21:50 +03:00
update slic3r
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
#include "MsgDialog.hpp"
|
||||
#include "DownloadProgressDialog.hpp"
|
||||
|
||||
#include <boost/filesystem/string_file.hpp>
|
||||
#include "slic3r/Utils/QDTUtil.hpp"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <boost/nowide/cstdio.hpp>
|
||||
@@ -203,7 +204,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
|
||||
return;
|
||||
}
|
||||
m_machine = machine;
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl switch machine: " << m_machine;
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl switch machine: " << QDTCrossTalk::Crosstalk_DevId(m_machine);
|
||||
m_disable_lan = false;
|
||||
m_failed_retry = 0;
|
||||
m_last_failed_codes.clear();
|
||||
@@ -315,7 +316,11 @@ void MediaPlayCtrl::Play()
|
||||
url += "&dev_ver=" + m_dev_ver;
|
||||
url += "&cli_id=" + wxGetApp().app_config->get("slicer_uuid");
|
||||
url += "&cli_ver=" + std::string(SLIC3R_VERSION);
|
||||
|
||||
#if !QDT_RELEASE_TO_PUBLIC
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: " << hide_passwd(hide_id_middle_string(url, url.find(m_lan_ip), m_lan_ip.length()), {m_lan_passwd});
|
||||
#endif
|
||||
|
||||
m_url = url;
|
||||
load();
|
||||
m_button_play->SetIcon("media_stop");
|
||||
@@ -365,11 +370,14 @@ void MediaPlayCtrl::Play()
|
||||
url += "&cli_id=" + wxGetApp().app_config->get("slicer_uuid");
|
||||
url += "&cli_ver=" + std::string(SLIC3R_VERSION);
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: " << hide_passwd(url,
|
||||
{"?uid=", "authkey=", "passwd=", "license=", "token="});
|
||||
|
||||
#if !QDT_RELEASE_TO_PUBLIC
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl: " << hide_passwd(url, {"?uid=", "channel=", "authkey=", "passwd=", "license=", "token="});
|
||||
#endif
|
||||
|
||||
CallAfter([this, m, url] {
|
||||
if (m != m_machine) {
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl drop late ttcode for machine: " << m;
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl drop late ttcode for machine: " << QDTCrossTalk::Crosstalk_DevId(m);
|
||||
return;
|
||||
}
|
||||
if (m_last_state == MEDIASTATE_IDLE) {
|
||||
@@ -446,7 +454,7 @@ void MediaPlayCtrl::Stop(wxString const &msg, wxString const &msg2)
|
||||
json j;
|
||||
j["stage"] = last_state;
|
||||
j["dev_id"] = m_machine;
|
||||
j["dev_ip"] = m_lan_ip;
|
||||
j["dev_ip"] = "";
|
||||
j["result"] = "failed";
|
||||
j["user_triggered"] = m_user_triggered;
|
||||
j["failed_retry"] = m_failed_retry;
|
||||
@@ -469,7 +477,7 @@ void MediaPlayCtrl::Stop(wxString const &msg, wxString const &msg2)
|
||||
if (last_state == wxMEDIASTATE_PLAYING && m_stat.size() == 4) {
|
||||
json j;
|
||||
j["dev_id"] = m_machine;
|
||||
j["dev_ip"] = m_lan_ip;
|
||||
j["dev_ip"] = "";
|
||||
j["result"] = m_failed_code ? "failed" : "success";
|
||||
j["tunnel"] = tunnel;
|
||||
j["code"] = m_failed_code;
|
||||
@@ -588,7 +596,11 @@ void MediaPlayCtrl::ToggleStream()
|
||||
url = "qidi:///rtsp___" + m_lan_user + ":" + m_lan_passwd + "@" + m_lan_ip + "/streaming/live/1?proto=rtsp";
|
||||
url += "&device=" + into_u8(m_machine);
|
||||
url += "&dev_ver=" + m_dev_ver;
|
||||
|
||||
#if !QDT_RELEASE_TO_PUBLIC
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl::ToggleStream: " << hide_passwd(hide_id_middle_string(url, url.find(m_lan_ip), m_lan_ip.length()), {m_lan_passwd});
|
||||
#endif
|
||||
|
||||
std::string file_url = data_dir() + "/cameratools/url.txt";
|
||||
boost::nowide::ofstream file(file_url);
|
||||
auto url2 = encode_path(url.c_str());
|
||||
@@ -610,8 +622,11 @@ void MediaPlayCtrl::ToggleStream()
|
||||
url += "&cli_id=" + wxGetApp().app_config->get("slicer_uuid");
|
||||
url += "&cli_ver=" + std::string(SLIC3R_VERSION);
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl::ToggleStream: " << hide_passwd(url,
|
||||
{"?uid=", "authkey=", "passwd=", "license=", "token="});
|
||||
|
||||
#if !QDT_RELEASE_TO_PUBLIC
|
||||
BOOST_LOG_TRIVIAL(info) << "MediaPlayCtrl::ToggleStream: " << hide_passwd(url,{"?uid=", "authkey=", "passwd=", "license=", "token="});
|
||||
#endif
|
||||
|
||||
CallAfter([this, m, url] {
|
||||
if (m != m_machine) return;
|
||||
if (url.empty() || !boost::algorithm::starts_with(url, "qidi:///")) {
|
||||
@@ -678,7 +693,7 @@ void MediaPlayCtrl::onStateChanged(wxMediaEvent &event)
|
||||
json j;
|
||||
j["stage"] = std::to_string(m_last_state);
|
||||
j["dev_id"] = m_machine;
|
||||
j["dev_ip"] = m_lan_ip;
|
||||
j["dev_ip"] = "";
|
||||
j["result"] = "success";
|
||||
j["code"] = 0;
|
||||
auto tunnel = into_u8(wxURI(m_url).GetPath()).substr(1);
|
||||
@@ -775,7 +790,10 @@ void MediaPlayCtrl::media_proc()
|
||||
}
|
||||
wxString url = m_tasks.front();
|
||||
if (m_tasks.size() >= 2 && !url.IsEmpty() && url[0] != '<' && m_tasks[1] == "<stop>") {
|
||||
|
||||
#if !QDT_RELEASE_TO_PUBLIC
|
||||
BOOST_LOG_TRIVIAL(trace) << "MediaPlayCtrl: busy skip url: " << url;
|
||||
#endif
|
||||
m_tasks.pop_front();
|
||||
m_tasks.pop_front();
|
||||
continue;
|
||||
@@ -834,7 +852,7 @@ bool MediaPlayCtrl::start_stream_service(bool *need_install)
|
||||
file_url2 = wxURI(file_url2).BuildURI();
|
||||
try {
|
||||
std::string configs;
|
||||
boost::filesystem::load_string_file(file_ff_cfg, configs);
|
||||
load_string_file(file_ff_cfg, configs);
|
||||
std::vector<std::string> configss;
|
||||
boost::algorithm::split(configss, configs, boost::algorithm::is_any_of("\r\n"));
|
||||
configss.erase(std::remove(configss.begin(), configss.end(), std::string()), configss.end());
|
||||
|
||||
Reference in New Issue
Block a user