изменил политику кеширования, убрал строковые константы из статистик (пилоты, размер кадра)
This commit is contained in:
@@ -242,6 +242,12 @@ public:
|
||||
CP_SetDmaDebug(sid, "save_config", "");
|
||||
}
|
||||
|
||||
void resetPacketStatistics() {
|
||||
std::string tmp;
|
||||
std::lock_guard lock(this->cpApiMutex);
|
||||
CP_GetDmaDebug(sid, "reset_cnt_rx", &tmp);
|
||||
}
|
||||
|
||||
~TerminalApiDaemon() {
|
||||
try {
|
||||
daemon.interrupt();
|
||||
@@ -321,15 +327,15 @@ std::string api_driver::ApiDriver::loadTerminalState() const {
|
||||
result << ",\"tx.snr\":"; writeDouble(result, modulator.snr_remote);
|
||||
|
||||
if (modulator.is_short) {
|
||||
result << R"(,"tx.frameSize":"short")";
|
||||
result << R"(,"tx.frameSizeNormal":false)";
|
||||
} else {
|
||||
result << R"(,"tx.frameSize":"normal")";
|
||||
result << R"(,"tx.frameSizeNormal":true)";
|
||||
}
|
||||
|
||||
if (modulator.is_pilots) {
|
||||
result << R"(,"tx.pilots":"pilots")";
|
||||
result << R"(,"tx.isPilots":true)";
|
||||
} else {
|
||||
result << R"(,"tx.pilots":"no pilots")";
|
||||
result << R"(,"tx.isPilots":false)";
|
||||
}
|
||||
|
||||
result << ",\"tx.speedOnTxKbit\":"; writeDouble(result, static_cast<double>(modulator.speed_in_bytes_tx) / 128.0);
|
||||
@@ -347,15 +353,15 @@ std::string api_driver::ApiDriver::loadTerminalState() const {
|
||||
result << ",\"rx.modcod\":" << demodulator.modcod;
|
||||
|
||||
if (demodulator.is_short) {
|
||||
result << R"(,"rx.frameSize":"short")";
|
||||
result << R"(,"rx.frameSizeNormal":false)";
|
||||
} else {
|
||||
result << R"(,"rx.frameSize":"normal")";
|
||||
result << R"(,"rx.frameSizeNormal":true)";
|
||||
}
|
||||
|
||||
if (demodulator.is_pilots) {
|
||||
result << R"(,"rx.pilots":"pilots")";
|
||||
result << R"(,"rx.isPilots":true)";
|
||||
} else {
|
||||
result << R"(,"rx.pilots":"no pilots")";
|
||||
result << R"(,"rx.isPilots":false)";
|
||||
}
|
||||
|
||||
result << ",\n\"rx.symError\":"; writeDouble(result, demodulator.sym_err);
|
||||
@@ -405,8 +411,7 @@ std::string api_driver::ApiDriver::loadTerminalState() const {
|
||||
|
||||
|
||||
void api_driver::ApiDriver::resetPacketStatistics() const {
|
||||
std::string tmp;
|
||||
CP_GetDmaDebug(sid, "reset_cnt_rx", &tmp);
|
||||
this->daemon->resetPacketStatistics();
|
||||
}
|
||||
|
||||
std::string api_driver::ApiDriver::loadSettings() const {
|
||||
@@ -441,8 +446,8 @@ std::string api_driver::ApiDriver::loadSettings() const {
|
||||
result << ",\"tx.centerFreq\":"; writeDouble(result, modSettings.central_freq_in_kGz, 3);
|
||||
|
||||
result << ",\n\"dvbs2.isAcm\":" << boolAsStr(acmSettings.enable);
|
||||
result << ",\"dvbs2.frameSize\":" << ((modulatorModcod & 2) ? "\"short\"" : "\"normal\"");
|
||||
// result << ",\"dvbs2.pilots\":" << "null";
|
||||
result << ",\"dvbs2.frameSizeNormal\":" << boolAsStr(!(modulatorModcod & 2));
|
||||
// result << ",\"dvbs2.isPilots\":" << "null";
|
||||
result << ",\"dvbs2.ccm_modcod\":" << (modulatorModcod >> 4);
|
||||
result << ",\"dvbs2.acm_maxModcod\":" << (acmSettings.max_modcod >> 2);
|
||||
result << ",\"dvbs2.acm_minModcod\":" << (acmSettings.min_modcod >> 2);
|
||||
|
Reference in New Issue
Block a user