mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
添加QT的webengineview开发者调试功能
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user