Fix camera

This commit is contained in:
xiaoyeliu
2025-12-24 17:32:54 +08:00
parent 22c1753708
commit 6c549d996c
4 changed files with 8 additions and 5 deletions

View File

@@ -3201,8 +3201,10 @@ void SSWCP_MachineOption_Instance::sw_CameraStartMonitor() {
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());
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();
if (self) {
SSWCP_Instance::on_mqtt_msg_arrived(self, response);

View File

@@ -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();
BOOST_LOG_TRIVIAL(warning) << "[Moonraker_Mqtt] 开始启动摄像头监控,域名: " << domain;
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;
params["domain"] = domain;
params["interval"] = interval;
params["expect_pw"] = expect_pw;
if (!send_to_request(method, params, true, callback,
[callback, &wcp_loger]() {

View File

@@ -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_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)>) {}
@@ -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_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;

View File

@@ -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_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)>) {}