添加QT的webengineview开发者调试功能

This commit is contained in:
lixiaoyuan
2025-09-13 17:28:35 +08:00
parent 7f23138d9c
commit d1a8fb0665
18 changed files with 653 additions and 218 deletions

View File

@@ -33,13 +33,13 @@ std::string ElectPeriod::dump()
}
void AppData::initFromDB()
bool AppData::initFromDB()
{
auto dao = DaoEntity::create("");
if (!dao->isConnected())
{
spdlog::error("Init app data failed, database connected error.");
return;
return false;
}
std::string str;
@@ -235,26 +235,17 @@ void AppData::initFromDB()
}
}
}
return true;
}
void AppData::init()
bool AppData::init()
{
this->initFromDB();
bool ret = this->initFromDB();
if (!ret) { return false; }
auto& optionMqtt = Config::option.mqtt;
if (!optionMqtt.host.empty())
{
for (auto& item : mapStation)
{
auto& station = item.second;
if (station->status == 1)
{
// "tcp://localhost:1883"
station->mqttCli->init(optionMqtt.host, station->code, optionMqtt.username, optionMqtt.password);
}
}
}
this->launchDate = Config::option.lunchDate;
return true;
}
std::shared_ptr<Station> AppData::getStation(int stationId)