компилируемая версия для всех версий модемов, пока без CP Proxy
This commit is contained in:
@@ -11,10 +11,6 @@
|
||||
|
||||
typedef boost::property_tree::ptree::path_type json_path;
|
||||
|
||||
double translateCoordinates(uint8_t deg, uint8_t min) {
|
||||
return static_cast<double>(deg) + static_cast<double>(min) / 60;
|
||||
}
|
||||
|
||||
// static int calculateSubnetMask(const std::string& subnet_mask) {
|
||||
// int mask = 0;
|
||||
// std::istringstream iss(subnet_mask);
|
||||
@@ -108,10 +104,10 @@ std::string api_driver::obj::StatisticsLogger::getSettings() {
|
||||
return res.str();
|
||||
}
|
||||
|
||||
void api_driver::obj::StatisticsLogger::setSettings(boost::property_tree::ptree &pt) {
|
||||
const bool newEn = pt.get<bool>("en");
|
||||
const int newInterval = pt.get<int>("logPeriodMs");
|
||||
const int newMaxAgeMs = pt.get<int>("maxAgeMs");
|
||||
void api_driver::obj::StatisticsLogger::setSettings(const nlohmann::json& data) {
|
||||
const bool newEn = data.value("en", logEn);
|
||||
const int newInterval = data.value("logPeriodMs", logPeriodMs.load());
|
||||
const int newMaxAgeMs = data.value("maxAgeMs", maxAgeMs.load());
|
||||
|
||||
std::lock_guard _lock(this->mutex);
|
||||
this->logPeriodMs = newInterval;
|
||||
@@ -217,7 +213,7 @@ void api_driver::obj::TerminalNetworkSettings::updateCallback(proxy::CpProxy &cp
|
||||
}
|
||||
}
|
||||
|
||||
void api_driver::obj::TerminalNetworkSettings::updateFromPt(boost::property_tree::ptree &pt) {
|
||||
void api_driver::obj::TerminalNetworkSettings::updateFromJson(nlohmann::json &data) {
|
||||
}
|
||||
|
||||
void api_driver::obj::TerminalNetworkSettings::store(proxy::CpProxy& cp) {
|
||||
@@ -239,17 +235,22 @@ void api_driver::obj::TerminalNetworkSettings::store(proxy::CpProxy& cp) {
|
||||
}
|
||||
}
|
||||
|
||||
std::string api_driver::obj::TerminalNetworkSettings::asJson() {
|
||||
std::stringstream out;
|
||||
|
||||
return out.str();
|
||||
nlohmann::json api_driver::obj::TerminalNetworkSettings::asJson() {
|
||||
nlohmann::json res;
|
||||
res["isL2"] = isL2;
|
||||
res["managementIp"] = managementIp;
|
||||
res["managementGateway"] = managementGateway;
|
||||
res["dataIp"] = dataIp;
|
||||
res["dataMtu"] = dataMtu;
|
||||
res["serverName"] = serverName;
|
||||
return res;
|
||||
}
|
||||
|
||||
api_driver::obj::TerminalNetworkSettings::~TerminalNetworkSettings() = default;
|
||||
#endif
|
||||
|
||||
#ifdef API_OBJECT_QOS_SETTINGS_ENABLE
|
||||
api_driver::obj::TerminalQosSettings::TerminalQosSettings() = default;
|
||||
api_driver::obj::TerminalQosSettings::TerminalQosSettings(): qosSettingsJson(DEFAULT_QOS_CLASSES) {};
|
||||
api_driver::obj::TerminalQosSettings::TerminalQosSettings(const TerminalQosSettings &src) = default;
|
||||
api_driver::obj::TerminalQosSettings & api_driver::obj::TerminalQosSettings::operator=(const TerminalQosSettings &src) = default;
|
||||
|
||||
@@ -259,20 +260,60 @@ void api_driver::obj::TerminalQosSettings::loadDefaults() {
|
||||
}
|
||||
|
||||
void api_driver::obj::TerminalQosSettings::updateCallback(proxy::CpProxy &cp) {
|
||||
auto [profile, en] = cp.getQosSettings();
|
||||
qosEnabled = en;
|
||||
try {
|
||||
qosSettingsJson = nlohmann::json::parse(profile);
|
||||
} catch (std::exception& e) {
|
||||
BOOST_LOG_TRIVIAL(warning) << "api_driver::obj::TerminalQosSettings::updateCallback(): Failed to parse QoS settings json: " << e.what();
|
||||
qosSettingsJson = DEFAULT_QOS_CLASSES;
|
||||
}
|
||||
}
|
||||
|
||||
void api_driver::obj::TerminalQosSettings::updateFromPt(boost::property_tree::ptree &pt) {
|
||||
void api_driver::obj::TerminalQosSettings::updateFromJson(nlohmann::json &data) {
|
||||
qosEnabled = data.value("en", qosEnabled);
|
||||
qosSettingsJson = data.value("profile", qosSettingsJson);
|
||||
}
|
||||
|
||||
void api_driver::obj::TerminalQosSettings::store(proxy::CpProxy &cp) {
|
||||
cp.setQosSettings(qosSettingsJson.dump(), qosEnabled);
|
||||
}
|
||||
|
||||
std::string api_driver::obj::TerminalQosSettings::asJson() {
|
||||
nlohmann::json api_driver::obj::TerminalQosSettings::asJson() {
|
||||
nlohmann::json res;
|
||||
res["en"] = qosEnabled;
|
||||
res["profile"] = qosSettingsJson;
|
||||
return res;
|
||||
}
|
||||
|
||||
api_driver::obj::TerminalQosSettings::~TerminalQosSettings() = default;
|
||||
#endif
|
||||
|
||||
api_driver::obj::TerminalFirmwareVersion::TerminalFirmwareVersion() = default;
|
||||
api_driver::obj::TerminalFirmwareVersion::TerminalFirmwareVersion(const TerminalFirmwareVersion &src) = default;
|
||||
api_driver::obj::TerminalFirmwareVersion & api_driver::obj::TerminalFirmwareVersion::operator=(const TerminalFirmwareVersion &src) = default;
|
||||
|
||||
void api_driver::obj::TerminalFirmwareVersion::load(proxy::CpProxy &cp) {
|
||||
version = cp.getNetwork("version");
|
||||
modemId = cp.getNetwork("chip_id");
|
||||
rtrim(modemId);
|
||||
modemSn = cp.getNetwork("serial");
|
||||
macMang = cp.getNetwork("mac_eth0");
|
||||
macData = cp.getNetwork("mac_eth1");
|
||||
}
|
||||
|
||||
nlohmann::json api_driver::obj::TerminalFirmwareVersion::asJson() {
|
||||
nlohmann::json res;
|
||||
res["version"] = version;
|
||||
res["modemId"] = modemId;
|
||||
res["modemSn"] = modemSn;
|
||||
res["macMang"] = macMang;
|
||||
res["macData"] = macData;
|
||||
return res;
|
||||
}
|
||||
|
||||
api_driver::obj::TerminalFirmwareVersion::~TerminalFirmwareVersion() = default;
|
||||
|
||||
|
||||
api_driver::obj::TerminalState::TerminalState() = default;
|
||||
|
||||
@@ -487,6 +528,389 @@ nlohmann::json api_driver::obj::TerminalDeviceState::asJson() const {
|
||||
api_driver::obj::TerminalDeviceState::~TerminalDeviceState() = default;
|
||||
|
||||
|
||||
api_driver::obj::TerminalRxTxSettings::TerminalRxTxSettings() = default;
|
||||
api_driver::obj::TerminalRxTxSettings::TerminalRxTxSettings(const TerminalRxTxSettings &src) = default;
|
||||
api_driver::obj::TerminalRxTxSettings & api_driver::obj::TerminalRxTxSettings::operator=(const TerminalRxTxSettings &src) = default;
|
||||
|
||||
void api_driver::obj::TerminalRxTxSettings::updateCallback(proxy::CpProxy &cp) {
|
||||
cp.getModSettings(mod);
|
||||
cp.getDemodSettings(dem);
|
||||
#ifdef API_STRUCT_ACM_ENABLE
|
||||
cp.getAcmSettings(acm);
|
||||
#endif
|
||||
#ifdef API_OBJECT_DPDI_SETTINGS_ENABLE
|
||||
cp.getDpdiSettings(dpdi);
|
||||
#endif
|
||||
#ifdef API_OBJECT_BUCLNB_SETTINGS_ENABLE
|
||||
cp.getBuclnbSettings(buclnb);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
struct ModcodDef_t {const char* modulation; const char* speed;};
|
||||
const static ModcodDef_t ModcodDefs[] = {
|
||||
{.modulation = "dummy", .speed = "0"},
|
||||
{.modulation = "qpsk", .speed = "1/4"},
|
||||
{.modulation = "qpsk", .speed = "1/3"},
|
||||
{.modulation = "qpsk", .speed = "2/5"},
|
||||
{.modulation = "qpsk", .speed = "1/2"},
|
||||
{.modulation = "qpsk", .speed = "3/5"},
|
||||
{.modulation = "qpsk", .speed = "2/3"},
|
||||
{.modulation = "qpsk", .speed = "3/4"},
|
||||
{.modulation = "qpsk", .speed = "4/5"},
|
||||
{.modulation = "qpsk", .speed = "5/6"},
|
||||
{.modulation = "qpsk", .speed = "8/9"},
|
||||
{.modulation = "qpsk", .speed = "9/10"},
|
||||
{.modulation = "8psk", .speed = "3/5"},
|
||||
{.modulation = "8psk", .speed = "2/3"},
|
||||
{.modulation = "8psk", .speed = "3/4"},
|
||||
{.modulation = "8psk", .speed = "5/6"},
|
||||
{.modulation = "8psk", .speed = "8/9"},
|
||||
{.modulation = "8psk", .speed = "9/10"},
|
||||
{.modulation = "16apsk", .speed = "2/3"},
|
||||
{.modulation = "16apsk", .speed = "3/4"},
|
||||
{.modulation = "16apsk", .speed = "4/5"},
|
||||
{.modulation = "16apsk", .speed = "5/6"},
|
||||
{.modulation = "16apsk", .speed = "8/9"},
|
||||
{.modulation = "16apsk", .speed = "9/10"},
|
||||
{.modulation = "32apsk", .speed = "3/4"},
|
||||
{.modulation = "32apsk", .speed = "4/5"},
|
||||
{.modulation = "32apsk", .speed = "5/6"},
|
||||
{.modulation = "32apsk", .speed = "8/9"},
|
||||
{.modulation = "32apsk", .speed = "9/10"},
|
||||
};
|
||||
|
||||
static const char* extractModcodModulation(uint32_t modcod, bool defaultQpsk1_4 = true) {
|
||||
modcod >>= 2;
|
||||
const auto* d = defaultQpsk1_4 ? ModcodDefs : ModcodDefs + 1;
|
||||
if (modcod < (sizeof(ModcodDefs) / sizeof(ModcodDef_t))) {
|
||||
d = ModcodDefs + modcod;
|
||||
}
|
||||
return d->modulation;
|
||||
}
|
||||
static const char* extractModcodSpeed(uint32_t modcod, bool defaultQpsk1_4 = true) {
|
||||
modcod >>= 2;
|
||||
const auto* d = defaultQpsk1_4 ? ModcodDefs : ModcodDefs + 1;
|
||||
if (modcod < (sizeof(ModcodDefs) / sizeof(ModcodDef_t))) {
|
||||
d = ModcodDefs + modcod;
|
||||
}
|
||||
return d->speed;
|
||||
}
|
||||
static bool extractModcodFrameSizeNormal(uint32_t modcod) { return (modcod & 2) == 0; }
|
||||
static bool extractModcodIsPilots(uint32_t modcod) { return (modcod & 1) != 0; }
|
||||
static uint32_t buildModcodFromJson(const nlohmann::json& data, uint32_t modcod, const std::string& name, bool isNormalFrame, bool isPilots = false) {
|
||||
const std::string mod = data.value(name + "Modulation", extractModcodModulation(modcod));
|
||||
const std::string speed = data.value(name + "Speed", extractModcodSpeed(modcod));
|
||||
uint32_t _index = 0;
|
||||
for (const auto& m: ModcodDefs) {
|
||||
if (mod == m.modulation) {
|
||||
if (modcod == 0) modcod = _index;
|
||||
if (speed == m.speed) {
|
||||
modcod = _index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
_index++;
|
||||
}
|
||||
return (modcod << 2)| (isNormalFrame ? 0 : 2) | (isPilots ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
void api_driver::obj::TerminalRxTxSettings::updateMainSettings(const nlohmann::json &data) {
|
||||
// для модулятора
|
||||
#ifdef MODEM_IS_SCPC
|
||||
mod.is_cinc = data.value("isCinC", mod.is_cinc);
|
||||
#endif
|
||||
mod.tx_is_on = data.value("txEn", mod.tx_is_on);
|
||||
#ifdef MODEM_IS_SCPC
|
||||
mod.is_save_current_state = data.value("txAutoStart", mod.is_save_current_state);
|
||||
mod.is_test_data = data.value("txIsTestInput", mod.is_test_data);
|
||||
#endif
|
||||
mod.is_carrier = !data.value("txModulatorIsTest", !mod.is_carrier);
|
||||
mod.central_freq_in_kGz = data.value("txCentralFreq", mod.central_freq_in_kGz);
|
||||
#ifdef MODEM_IS_SCPC
|
||||
mod.baudrate = data.value("txBaudrate", mod.baudrate);
|
||||
mod.rollof = data.value("txRolloff", mod.rollof);
|
||||
mod.gold_seq_is_active = data.value("txGoldan", mod.gold_seq_is_active);
|
||||
#endif
|
||||
mod.attenuation = data.value("txAttenuation", mod.attenuation);
|
||||
|
||||
#if defined(MODEM_IS_SCPC) || defined(MODEM_IS_SHPS)
|
||||
bool acmIsFrameSizeNormal = extractModcodFrameSizeNormal(mod.modcod_tx);
|
||||
bool acmIsPilots = extractModcodIsPilots(mod.modcod_tx);
|
||||
|
||||
acmIsFrameSizeNormal = data.value("txFrameSizeNormal", acmIsFrameSizeNormal);
|
||||
acmIsPilots = data.value("txIsPilots", acmIsPilots);
|
||||
mod.modcod_tx = buildModcodFromJson(data, mod.modcod_tx, "dvbCcm", acmIsFrameSizeNormal, acmIsPilots);
|
||||
#endif
|
||||
|
||||
// демодулятор
|
||||
dem.is_aru_on = data.value("rxAgcEn", dem.is_aru_on);
|
||||
dem.gain = data.value("rxManualGain", dem.gain);
|
||||
dem.is_rvt_iq = data.value("rxSpectrumInversion", dem.is_rvt_iq);
|
||||
dem.central_freq_in_kGz = data.value("rxCentralFreq", dem.central_freq_in_kGz);
|
||||
dem.baudrate = data.value("rxBaudrate", dem.baudrate);
|
||||
dem.rollof = data.value("rxRolloff", dem.rollof);
|
||||
#ifdef MODEM_IS_SCPC
|
||||
dem.gold_seq_is_active = data.value("rxGoldan", dem.gold_seq_is_active);
|
||||
#endif
|
||||
|
||||
#ifdef API_STRUCT_ACM_ENABLE
|
||||
// ACM
|
||||
#ifndef MODEM_IS_SHPS
|
||||
// в ШПС этих настроек нет
|
||||
acm.period_pack_acm = data.value("dvbServicePacketPeriod", acm.period_pack_acm);
|
||||
acm.enable_acm = data.value("dvbIsAcm", acm.enable_acm);
|
||||
acm.min_modcod_acm = buildModcodFromJson(data, acm.min_modcod_acm, "dvbAcmMin", acmIsFrameSizeNormal, acmIsPilots);
|
||||
acm.min_modcod_acm = buildModcodFromJson(data, acm.max_modcod_acm, "dvbAcmMax", acmIsFrameSizeNormal, acmIsPilots);
|
||||
acm.snr_threashold_acm = data.value("dvbSnrReserve", acm.snr_threashold_acm); // запас ОСШ
|
||||
#endif
|
||||
|
||||
acm.enable_aupc = data.value("aupcEn", acm.enable_aupc);
|
||||
acm.min_attenuation_aupc = data.value("aupcMinAttenuation", acm.min_attenuation_aupc);
|
||||
acm.max_attenuation_aupc = data.value("aupcMaxAttenuation", acm.max_attenuation_aupc);
|
||||
acm.snr_threashold_aupc = data.value("aupcRequiredSnr", acm.snr_threashold_aupc);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef API_OBJECT_DPDI_SETTINGS_ENABLE
|
||||
double translateCoordinates(uint8_t deg, uint8_t min) {
|
||||
return static_cast<double>(deg) + static_cast<double>(min) / 60;
|
||||
}
|
||||
|
||||
std::tuple<uint8_t, uint8_t> translateCoordinates(double abs) {
|
||||
auto deg = static_cast<uint8_t>(abs);
|
||||
double min_double = (abs - deg) * 60;
|
||||
auto min = static_cast<uint8_t>(min_double);
|
||||
return std::make_tuple(deg, min);
|
||||
}
|
||||
|
||||
void api_driver::obj::TerminalRxTxSettings::updateDpdiSettings(const nlohmann::json &data) {
|
||||
dpdi.is_delay_window = !data.value("dpdiIsPositional", !dpdi.is_delay_window);
|
||||
#ifdef MODEM_IS_SCPC
|
||||
dpdi.freq_offset = data.value("dpdiSearchBandwidth", dpdi.freq_offset);
|
||||
#endif
|
||||
|
||||
if (data["dpdiPositionStationLatitude"]) {
|
||||
const double pos = data["dpdiPositionStationLatitude"];
|
||||
const auto [g, m] = translateCoordinates(pos);
|
||||
dpdi.latitude_station_grad = g;
|
||||
dpdi.latitude_station_minute = m;
|
||||
}
|
||||
|
||||
if (data["dpdiPositionStationLongitude"]) {
|
||||
const double pos = data["dpdiPositionStationLongitude"];
|
||||
const auto [g, m] = translateCoordinates(pos);
|
||||
dpdi.longitude_station_grad = g;
|
||||
dpdi.longitude_station_minute = m;
|
||||
}
|
||||
|
||||
if (data["dpdiPositionSatelliteLongitude"]) {
|
||||
const double pos = data["dpdiPositionSatelliteLongitude"];
|
||||
const auto [g, m] = translateCoordinates(pos);
|
||||
dpdi.longitude_sattelite_grad = g;
|
||||
dpdi.longitude_sattelite_minute = m;
|
||||
}
|
||||
|
||||
#ifdef MODEM_IS_SCPC
|
||||
dpdi.min_delay = data.value("dpdiDelayMin", dpdi.min_delay);
|
||||
dpdi.max_delay = data.value("dpdiDelayMax", dpdi.max_delay);
|
||||
#else
|
||||
s.min_delay = 0;
|
||||
s.max_delay = data.value("dpdiDelay", dpdi.max_delay);
|
||||
#endif
|
||||
}
|
||||
void api_driver::obj::TerminalRxTxSettings::storeDpdiSettings(proxy::CpProxy &cp) {
|
||||
cp.setDpdiSettings(dpdi);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef API_OBJECT_BUCLNB_SETTINGS_ENABLE
|
||||
void api_driver::obj::TerminalRxTxSettings::updateBuclnbSettings(const nlohmann::json &data) {
|
||||
{
|
||||
// напряжение buc
|
||||
int oldVoltage = 0;
|
||||
if (buclnb.buc == voltage_buc::_24V) { oldVoltage = 24; }
|
||||
#ifdef MODEM_IS_SCPC
|
||||
if (buclnb.buc == voltage_buc::_24V) { oldVoltage = 24; }
|
||||
#endif
|
||||
|
||||
auto result = data.value("bucPowering", oldVoltage);
|
||||
switch (result) {
|
||||
case 24: buclnb.buc = voltage_buc::_24V; break;
|
||||
#ifdef MODEM_IS_SCPC
|
||||
case 48: buclnb.buc = voltage_buc::_48V; break;
|
||||
#endif
|
||||
case 0:
|
||||
default:
|
||||
buclnb.buc = voltage_buc::DISABLE;
|
||||
}
|
||||
}
|
||||
buclnb.is_ref_10MHz_buc = data.value("bucRefClk10M", buclnb.is_ref_10MHz_buc);
|
||||
|
||||
{
|
||||
// напряжение lnb
|
||||
int oldVoltage;
|
||||
switch (buclnb.lnb) {
|
||||
case voltage_lnb::_13V: oldVoltage = 13; break;
|
||||
case voltage_lnb::_18V: oldVoltage = 18; break;
|
||||
case voltage_lnb::_24V: oldVoltage = 24; break;
|
||||
default: oldVoltage = 0;
|
||||
}
|
||||
|
||||
auto result = data.value("lnbPowering", oldVoltage);
|
||||
switch (result) {
|
||||
case 13: buclnb.lnb = voltage_lnb::_13V; break;
|
||||
case 18: buclnb.lnb = voltage_lnb::_18V; break;
|
||||
case 24: buclnb.lnb = voltage_lnb::_24V; break;
|
||||
default: buclnb.lnb = voltage_lnb::DISABLE;
|
||||
}
|
||||
}
|
||||
|
||||
buclnb.is_ref_10MHz_lnb = data.value("lnbRefClk10M", buclnb.is_ref_10MHz_lnb);
|
||||
|
||||
buclnb.is_ref_10MHz_output = data.value("srvRefClk10M", buclnb.is_ref_10MHz_output);
|
||||
buclnb.is_save_current_state = data.value("bucLnbAutoStart", buclnb.is_save_current_state);
|
||||
}
|
||||
void api_driver::obj::TerminalRxTxSettings::storeBuclnbSettings(proxy::CpProxy &cp) {
|
||||
cp.setBuclnbSettings(buclnb);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void api_driver::obj::TerminalRxTxSettings::storeAll(proxy::CpProxy &cp) {
|
||||
storeMainSettings(cp);
|
||||
#ifdef API_OBJECT_DPDI_SETTINGS_ENABLE
|
||||
storeDpdiSettings(cp);
|
||||
#endif
|
||||
#ifdef API_OBJECT_BUCLNB_SETTINGS_ENABLE
|
||||
storeBuclnbSettings(cp);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
nlohmann::json api_driver::obj::TerminalRxTxSettings::asJson() const {
|
||||
nlohmann::json res;
|
||||
|
||||
// RX TX
|
||||
{
|
||||
auto& rxtx = res["rxtx"];
|
||||
// для модулятора
|
||||
#ifdef MODEM_IS_SCPC
|
||||
rxtx["isCinC"] = mod.is_cinc;
|
||||
#endif
|
||||
rxtx["txEn"] = mod.tx_is_on;
|
||||
#ifdef MODEM_IS_SCPC
|
||||
rxtx["txAutoStart"] = mod.is_save_current_state;
|
||||
rxtx["txIsTestInput"] = mod.is_test_data;
|
||||
#endif
|
||||
rxtx["txModulatorIsTest"] = !mod.is_carrier;
|
||||
rxtx["txCentralFreq"] = mod.central_freq_in_kGz;
|
||||
#ifdef MODEM_IS_SCPC
|
||||
rxtx["txBaudrate"] = mod.baudrate;
|
||||
rxtx["txRolloff"] = mod.rollof;
|
||||
rxtx["txGoldan"] = mod.gold_seq_is_active;
|
||||
#endif
|
||||
rxtx["txAttenuation"] = mod.attenuation;
|
||||
|
||||
#if defined(MODEM_IS_SCPC) || defined(MODEM_IS_SHPS)
|
||||
const bool acmIsFrameSizeNormal = extractModcodFrameSizeNormal(mod.modcod_tx);
|
||||
const bool acmIsPilots = extractModcodIsPilots(mod.modcod_tx);
|
||||
|
||||
rxtx["txFrameSizeNormal"] = acmIsFrameSizeNormal;
|
||||
rxtx["txIsPilots"] = acmIsPilots;
|
||||
|
||||
rxtx["dvbCcmModulation"] = extractModcodModulation(mod.modcod_tx);
|
||||
rxtx["dvbCcmSpeed"] = extractModcodSpeed(mod.modcod_tx);
|
||||
#endif
|
||||
|
||||
// демодулятор
|
||||
rxtx["rxAgcEn"] = dem.is_aru_on;
|
||||
rxtx["rxManualGain"] = dem.gain;
|
||||
rxtx["rxSpectrumInversion"] = dem.is_rvt_iq;
|
||||
rxtx["rxCentralFreq"] = dem.central_freq_in_kGz;
|
||||
rxtx["rxBaudrate"] = dem.baudrate;
|
||||
rxtx["rxRolloff"] = dem.rollof;
|
||||
#ifdef MODEM_IS_SCPC
|
||||
rxtx["rxGoldan"] = dem.gold_seq_is_active;
|
||||
#endif
|
||||
|
||||
#ifdef API_STRUCT_ACM_ENABLE
|
||||
// ACM
|
||||
#ifndef MODEM_IS_SHPS
|
||||
// в ШПС этих настроек нет
|
||||
rxtx["dvbServicePacketPeriod"] = acm.period_pack_acm;
|
||||
rxtx["dvbIsAcm"] = acm.enable_acm;
|
||||
|
||||
rxtx["dvbAcmMinModulation"] = extractModcodModulation(acm.min_modcod_acm);
|
||||
rxtx["dvbAcmMinSpeed"] = extractModcodSpeed(acm.min_modcod_acm);
|
||||
|
||||
rxtx["dvbAcmMaxModulation"] = extractModcodModulation(acm.max_modcod_acm);
|
||||
rxtx["dvbAcmMaxSpeed"] = extractModcodSpeed(acm.max_modcod_acm);
|
||||
|
||||
rxtx["dvbSnrReserve"] = acm.snr_threashold_acm; // запас ОСШ
|
||||
#endif
|
||||
|
||||
rxtx["aupcEn"] = acm.enable_aupc;
|
||||
rxtx["aupcMinAttenuation"] = acm.min_attenuation_aupc;
|
||||
rxtx["aupcMaxAttenuation"] = acm.max_attenuation_aupc;
|
||||
rxtx["aupcRequiredSnr"] = acm.snr_threashold_aupc;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef API_OBJECT_DPDI_SETTINGS_ENABLE
|
||||
{
|
||||
auto& dp = res["dpdi"];
|
||||
|
||||
dp["dpdiIsPositional"] = !dpdi.is_delay_window;
|
||||
#ifdef MODEM_IS_SCPC
|
||||
dp["dpdiSearchBandwidth"] = dpdi.freq_offset;
|
||||
#endif
|
||||
|
||||
dp["dpdiPositionStationLatitude"] = translateCoordinates(dpdi.latitude_station_grad, dpdi.latitude_station_minute);
|
||||
dp["dpdiPositionStationLongitude"] = translateCoordinates(dpdi.longitude_station_grad, dpdi.longitude_station_minute);
|
||||
dp["dpdiPositionSatelliteLongitude"] = translateCoordinates(dpdi.longitude_sattelite_grad, dpdi.longitude_sattelite_minute);
|
||||
|
||||
#ifdef MODEM_IS_SCPC
|
||||
dp["dpdiDelayMin"] = dpdi.min_delay;
|
||||
dp["dpdiDelayMax"] = dpdi.max_delay;
|
||||
#else
|
||||
dp["dpdiDelay"] = dpdi.max_delay;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// BucLnb
|
||||
#ifdef API_OBJECT_BUCLNB_SETTINGS_ENABLE
|
||||
{
|
||||
auto& bl = res["buclnb"];
|
||||
switch (buclnb.buc) {
|
||||
case voltage_buc::_24V: bl["bucPowering"] = 24; break;
|
||||
#ifdef MODEM_IS_SCPC
|
||||
case voltage_buc::_48V: bl["bucPowering"] = 48; break;
|
||||
#endif
|
||||
default: bl["bucPowering"] = 0;
|
||||
}
|
||||
|
||||
bl["bucRefClk10M"] = buclnb.is_ref_10MHz_buc;
|
||||
switch (buclnb.lnb) {
|
||||
case voltage_lnb::_13V: bl["lnbPowering"] = 13; break;
|
||||
case voltage_lnb::_18V: bl["lnbPowering"] = 18; break;
|
||||
case voltage_lnb::_24V: bl["lnbPowering"] = 24; break;
|
||||
default: bl["lnbPowering"] = 0;
|
||||
}
|
||||
bl["lnbRefClk10M"] = buclnb.is_ref_10MHz_lnb;
|
||||
|
||||
bl["srvRefClk10M"] = buclnb.is_ref_10MHz_output;
|
||||
bl["bucLnbAutoStart"] = buclnb.is_save_current_state;
|
||||
}
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
api_driver::obj::TerminalRxTxSettings::~TerminalRxTxSettings() = default;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user