добавил изменение параметров dpdi (CinC)
This commit is contained in:
@@ -208,10 +208,24 @@ public:
|
||||
json = this->qosClassesJson;
|
||||
}
|
||||
|
||||
void setStrringsRxTx(bool readback = true) {}
|
||||
void setStrringsCinc(bool readback = true) {}
|
||||
void setSettingsRxTx(bool readback = true) {}
|
||||
|
||||
void setStrringsBucLnb(const buc_lnb_settings& bucLnb, bool readback = true) {
|
||||
void setSettingsCinc(const DPDI_parmeters& s, bool readback = true) {
|
||||
DPDI_parmeters tmp = s;
|
||||
std::lock_guard lock(this->cpApiMutex);
|
||||
CP_SetDmaDebug(sid, "begin_save_config", "");
|
||||
CP_SetDpdiParams(sid, tmp);
|
||||
if (readback) {
|
||||
CP_GetDpdiParams(this->sid, &tmp);
|
||||
{
|
||||
std::lock_guard lock2{this->settingsMutex};
|
||||
this->dpdiSettings = tmp;
|
||||
}
|
||||
}
|
||||
CP_SetDmaDebug(sid, "save_config", "");
|
||||
}
|
||||
|
||||
void setSettingsBucLnb(const buc_lnb_settings& bucLnb, bool readback = true) {
|
||||
buc_lnb_settings tmp = bucLnb;
|
||||
std::lock_guard lock(this->cpApiMutex);
|
||||
CP_SetDmaDebug(sid, "begin_save_config", "");
|
||||
@@ -505,6 +519,32 @@ void api_driver::ApiDriver::setRxTxSettings(boost::property_tree::ptree &pt) {
|
||||
}
|
||||
|
||||
void api_driver::ApiDriver::setCincSettings(boost::property_tree::ptree &pt) {
|
||||
DPDI_parmeters s{};
|
||||
|
||||
//result << ",\n\"cinc.mode\":" << (dpdiSettings.is_delay_window ? "\"delay\"" : "\"positional\"");
|
||||
auto tmp = pt.get<std::string>(json_path("cinc.mode", '/'));
|
||||
if (tmp == "delay") { s.is_delay_window = true; }
|
||||
else if (tmp == "positional") { s.is_delay_window = false; }
|
||||
else {
|
||||
throw std::runtime_error("Wrong CinC mode: " + tmp);
|
||||
}
|
||||
|
||||
auto ctmp = translateCoordinates(pt.get<double>(json_path("cinc.position.station.latitude", '/')));
|
||||
s.latitude_station_grad = std::get<0>(ctmp);
|
||||
s.latitude_station_minute = std::get<1>(ctmp);
|
||||
|
||||
ctmp = translateCoordinates(pt.get<double>(json_path("cinc.position.station.longitude", '/')));
|
||||
s.longitude_station_grad = std::get<0>(ctmp);
|
||||
s.longitude_station_minute = std::get<1>(ctmp);
|
||||
|
||||
ctmp = translateCoordinates(pt.get<double>(json_path("cinc.position.satelliteLongitude", '/')));
|
||||
s.longitude_sattelite_grad = std::get<0>(ctmp);
|
||||
s.longitude_sattelite_minute = std::get<1>(ctmp);
|
||||
|
||||
s.max_delay = pt.get<int>(json_path("cinc.delayMax", '/'));
|
||||
s.min_delay = pt.get<int>(json_path("cinc.delayMin", '/'));
|
||||
|
||||
this->daemon->setSettingsCinc(s);
|
||||
}
|
||||
|
||||
void api_driver::ApiDriver::setBucLnbSettings(boost::property_tree::ptree &pt) {
|
||||
@@ -536,7 +576,7 @@ void api_driver::ApiDriver::setBucLnbSettings(boost::property_tree::ptree &pt) {
|
||||
s.is_ref_10MHz_output = pt.get<bool>(json_path("serviceSettings.refClk10M", '/'));
|
||||
s.is_save_current_state = pt.get<bool>(json_path("serviceSettings.autoStart", '/'));
|
||||
|
||||
this->daemon->setStrringsBucLnb(s);
|
||||
this->daemon->setSettingsBucLnb(s);
|
||||
}
|
||||
|
||||
void api_driver::ApiDriver::setQosSettings(boost::property_tree::ptree &pt) {
|
||||
|
Reference in New Issue
Block a user