修复 bug

master
lzq 2025-09-29 15:15:37 +08:00
parent 5534eb5e87
commit 36a25b8205
2 changed files with 11 additions and 3 deletions

View File

@ -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<GenericVidicon>(config));
vidicons.emplace(config.sn, std::make_shared<BarrierVidicon>(config));
if (config.type == 0)
{
vidicons.emplace(config.sn, std::make_shared<GenericVidicon>(config));
}
else
{
vidicons.emplace(config.sn, std::make_shared<BarrierVidicon>(config));
}
}
}

View File

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