From 36a25b82058c365e82b9c52d6e83298e3c918058 Mon Sep 17 00:00:00 2001 From: lzq Date: Mon, 29 Sep 2025 15:15:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/device_holder.cpp | 12 +++++++++--- src/vidicon/vidicon_properties.h | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/device_holder.cpp b/src/device_holder.cpp index ad2e96d..1aff2ea 100644 --- a/src/device_holder.cpp +++ b/src/device_holder.cpp @@ -3,7 +3,7 @@ #include "barrier/generic_barrier.h" #include "platform_scale/generic_platform_scale.h" #include "sound_column/generic_sound_column.h" -// #include "vidicon/generic_vidicon.h" +#include "vidicon/generic_vidicon.h" #include "vidicon/barrier_vidicon.h" namespace zsy @@ -40,8 +40,14 @@ namespace zsy { for (auto &config: configs) { - // vidicons.emplace(config.sn, std::make_shared(config)); - vidicons.emplace(config.sn, std::make_shared(config)); + if (config.type == 0) + { + vidicons.emplace(config.sn, std::make_shared(config)); + } + else + { + vidicons.emplace(config.sn, std::make_shared(config)); + } } } diff --git a/src/vidicon/vidicon_properties.h b/src/vidicon/vidicon_properties.h index 0671687..9c27ce7 100644 --- a/src/vidicon/vidicon_properties.h +++ b/src/vidicon/vidicon_properties.h @@ -12,6 +12,7 @@ namespace zsy uint16_t port{8000}; std::string username; std::string passwd; + uint16_t type; }; inline void from_json(const nlohmann::json &j, VidiconProperties &o) @@ -22,6 +23,7 @@ namespace zsy PARSE_JSON(port, o.port); PARSE_JSON(username, o.username); PARSE_JSON(passwd, o.passwd); + PARSE_JSON(type, o.type); } }