X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/27cbf9efdb75590ada1c734e68bd74a78730ad20..8582d7dfe21e7225d4a715501d70c2649268228f:/projects/stargazer/plugins/other/smux/tables.cpp?ds=sidebyside diff --git a/projects/stargazer/plugins/other/smux/tables.cpp b/projects/stargazer/plugins/other/smux/tables.cpp index ad08c40f..21173b70 100644 --- a/projects/stargazer/plugins/other/smux/tables.cpp +++ b/projects/stargazer/plugins/other/smux/tables.cpp @@ -5,17 +5,18 @@ #include "stg/user_property.h" #include "stg/tariffs.h" +#include "stg/tariff_conf.h" #include "stg/users.h" #include "tables.h" -std::pair TD2Info(const TARIFF_DATA & td); +std::pair TD2Info(const STG::TariffData & td); void TariffUsersTable::UpdateSensors(Sensors & sensors) const { std::map data; -std::list tdl; +std::vector tdl; tariffs.GetTariffsData(&tdl); std::transform(tdl.begin(), tdl.end(), @@ -25,14 +26,13 @@ std::transform(tdl.begin(), int handle = users.OpenSearch(); assert(handle && "USERS::OpenSearch is always correct"); -USER_PTR user; +STG::User* user; while (!users.SearchNext(handle, &user)) { if (user->GetDeleted()) continue; - std::string tariffName(user->GetProperty().tariffName.ConstData()); - std::map::iterator it; - it = data.lower_bound(tariffName); + std::string tariffName(user->GetProperties().tariffName.ConstData()); + std::map::iterator it(data.lower_bound(tariffName)); if (it == data.end() || it->first != tariffName) { @@ -52,14 +52,14 @@ OID prefixOid(prefix); std::map::const_iterator it(data.begin()); while (it != data.end()) { - sensors[prefixOid.copyWithSuffix(2, idx)] = new ConstSensor(it->first); - sensors[prefixOid.copyWithSuffix(3, idx)] = new ConstSensor(it->second); + sensors[prefixOid.copyWithSuffix(2, static_cast(idx))] = new ConstSensor(it->first); + sensors[prefixOid.copyWithSuffix(3, static_cast(idx))] = new ConstSensor(it->second); ++idx; ++it; } } -std::pair TD2Info(const TARIFF_DATA & td) +std::pair TD2Info(const STG::TariffData & td) { return std::make_pair(td.tariffConf.name, 0); }