mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-27 21:02:23 +00:00
Fix camera
This commit is contained in:
@@ -3201,8 +3201,10 @@ void SSWCP_MachineOption_Instance::sw_CameraStartMonitor() {
|
|||||||
|
|
||||||
int interval = m_param_data.count("interval") ? m_param_data["interval"].get<int>() : 2;
|
int interval = m_param_data.count("interval") ? m_param_data["interval"].get<int>() : 2;
|
||||||
|
|
||||||
|
bool expect_pw = m_param_data.count("expect_pw") ? m_param_data["expect_pw"].get<bool>() : false;
|
||||||
|
|
||||||
auto weak_self = std::weak_ptr<SSWCP_Instance>(shared_from_this());
|
auto weak_self = std::weak_ptr<SSWCP_Instance>(shared_from_this());
|
||||||
host->async_camera_start(domain, interval, [weak_self](const json& response) {
|
host->async_camera_start(domain, interval, expect_pw, [weak_self](const json& response) {
|
||||||
auto self = weak_self.lock();
|
auto self = weak_self.lock();
|
||||||
if (self) {
|
if (self) {
|
||||||
SSWCP_Instance::on_mqtt_msg_arrived(self, response);
|
SSWCP_Instance::on_mqtt_msg_arrived(self, response);
|
||||||
|
|||||||
@@ -2267,7 +2267,7 @@ void Moonraker_Mqtt::async_machine_files_directory(const std::string& path, bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Moonraker_Mqtt::async_camera_start(const std::string& domain, int interval, std::function<void(const nlohmann::json& response)> callback) {
|
void Moonraker_Mqtt::async_camera_start(const std::string& domain, int interval, bool expect_pw, std::function<void(const nlohmann::json& response)> callback) {
|
||||||
auto& wcp_loger = GUI::WCP_Logger::getInstance();
|
auto& wcp_loger = GUI::WCP_Logger::getInstance();
|
||||||
BOOST_LOG_TRIVIAL(warning) << "[Moonraker_Mqtt] 开始启动摄像头监控,域名: " << domain;
|
BOOST_LOG_TRIVIAL(warning) << "[Moonraker_Mqtt] 开始启动摄像头监控,域名: " << domain;
|
||||||
wcp_loger.add_log("开始启动摄像头监控,域名: " + domain, false, "", "Moonraker_Mqtt", "info");
|
wcp_loger.add_log("开始启动摄像头监控,域名: " + domain, false, "", "Moonraker_Mqtt", "info");
|
||||||
@@ -2276,6 +2276,7 @@ void Moonraker_Mqtt::async_camera_start(const std::string& domain, int interval,
|
|||||||
json params;
|
json params;
|
||||||
params["domain"] = domain;
|
params["domain"] = domain;
|
||||||
params["interval"] = interval;
|
params["interval"] = interval;
|
||||||
|
params["expect_pw"] = expect_pw;
|
||||||
|
|
||||||
if (!send_to_request(method, params, true, callback,
|
if (!send_to_request(method, params, true, callback,
|
||||||
[callback, &wcp_loger]() {
|
[callback, &wcp_loger]() {
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public:
|
|||||||
virtual void async_server_client_manager_set_userinfo(const nlohmann::json& user, std::function<void(const nlohmann::json& response)>) {}
|
virtual void async_server_client_manager_set_userinfo(const nlohmann::json& user, std::function<void(const nlohmann::json& response)>) {}
|
||||||
virtual void async_machine_files_directory(const std::string& path, bool extend, std::function<void(const nlohmann::json& response)>) {}
|
virtual void async_machine_files_directory(const std::string& path, bool extend, std::function<void(const nlohmann::json& response)>) {}
|
||||||
|
|
||||||
virtual void async_camera_start(const std::string& domain, int interval, std::function<void(const nlohmann::json& response)>) {}
|
virtual void async_camera_start(const std::string& domain, int interval, bool expect_pw, std::function<void(const nlohmann::json& response)>) {}
|
||||||
|
|
||||||
virtual void async_canmera_stop(const std::string& domain, std::function<void(const nlohmann::json& response)>) {}
|
virtual void async_canmera_stop(const std::string& domain, std::function<void(const nlohmann::json& response)>) {}
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ public:
|
|||||||
|
|
||||||
virtual void async_machine_files_directory(const std::string& path, bool extend, std::function<void(const nlohmann::json& response)>) override;
|
virtual void async_machine_files_directory(const std::string& path, bool extend, std::function<void(const nlohmann::json& response)>) override;
|
||||||
|
|
||||||
virtual void async_camera_start(const std::string& domain, int interval, std::function<void(const nlohmann::json& response)>) override;
|
virtual void async_camera_start(const std::string& domain, int interval, bool expect_pw, std::function<void(const nlohmann::json& response)>) override;
|
||||||
|
|
||||||
virtual void async_canmera_stop(const std::string& domain, std::function<void(const nlohmann::json& response)>) override;
|
virtual void async_canmera_stop(const std::string& domain, std::function<void(const nlohmann::json& response)>) override;
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public:
|
|||||||
virtual void async_server_client_manager_set_userinfo(const nlohmann::json& user, std::function<void(const nlohmann::json& response)>) {}
|
virtual void async_server_client_manager_set_userinfo(const nlohmann::json& user, std::function<void(const nlohmann::json& response)>) {}
|
||||||
virtual void async_machine_files_directory(const std::string& path, bool extend, std::function<void(const nlohmann::json& response)>) {}
|
virtual void async_machine_files_directory(const std::string& path, bool extend, std::function<void(const nlohmann::json& response)>) {}
|
||||||
|
|
||||||
virtual void async_camera_start(const std::string& domain, int interval, std::function<void(const nlohmann::json& response)>) {}
|
virtual void async_camera_start(const std::string& domain, int interval, bool expect_pw, std::function<void(const nlohmann::json& response)>) {}
|
||||||
|
|
||||||
virtual void async_canmera_stop(const std::string& domain, std::function<void(const nlohmann::json& response)>) {}
|
virtual void async_canmera_stop(const std::string& domain, std::function<void(const nlohmann::json& response)>) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user