X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/c016156ebb870d9d81219b8c4165aa75703f1e85..f47613c7f556160a73003a09797750c58cc3fc74:/projects/stargazer/plugins/other/smux/tables.cpp diff --git a/projects/stargazer/plugins/other/smux/tables.cpp b/projects/stargazer/plugins/other/smux/tables.cpp index 023b90b2..962c91a8 100644 --- a/projects/stargazer/plugins/other/smux/tables.cpp +++ b/projects/stargazer/plugins/other/smux/tables.cpp @@ -1,16 +1,29 @@ +#include #include +#include +#include #include "stg/user_property.h" +#include "stg/tariffs.h" +#include "stg/users.h" #include "tables.h" +std::pair TD2Info(const TARIFF_DATA & td); + void TariffUsersTable::UpdateSensors(Sensors & sensors) const { std::map data; +std::list tdl; +tariffs.GetTariffsData(&tdl); +std::transform(tdl.begin(), + tdl.end(), + std::inserter(data, data.begin()), + TD2Info); + int handle = users.OpenSearch(); -if (!handle) - return; +assert(handle && "USERS::OpenSearch is always correct"); USER_PTR user; while (!users.SearchNext(handle, &user)) @@ -43,3 +56,8 @@ while (it != data.end()) ++it; } } + +std::pair TD2Info(const TARIFF_DATA & td) +{ +return std::make_pair(td.tariffConf.name, 0); +}