From 17110a82e04849584763e9d570219be9325bc5ca Mon Sep 17 00:00:00 2001 From: Vladislav Ostapov Date: Tue, 1 Apr 2025 17:47:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B1=D0=B0=D0=B3=D1=84=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=D1=8B:=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B0=20=D0=B8=20?= =?UTF-8?q?=D1=87=D0=B8=D1=81=D0=BB=D0=BE=20=D1=81=20=D0=B7=D0=B0=D0=BF?= =?UTF-8?q?=D1=8F=D1=82=D1=8B=D0=BC=D0=B8=20=D0=BD=D0=B0=20=D0=BD=D0=B5?= =?UTF-8?q?=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D1=85=20=D0=BB=D0=BE=D0=BA?= =?UTF-8?q?=D0=B0=D0=BB=D1=8F=D1=85=20=D0=B2=20=D0=B2=D0=B5=D0=B1=D0=BA?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/common/setup-methods.js.j2 | 4 ++-- front-generator/template/main.html | 14 +++++++++++++- src/terminal_api_driver.cpp | 9 --------- static/main-scpc.html | 18 +++++++++++++++--- static/main-tdma.html | 14 +++++++++++++- 5 files changed, 43 insertions(+), 16 deletions(-) diff --git a/front-generator/template/common/setup-methods.js.j2 b/front-generator/template/common/setup-methods.js.j2 index bb6a660..c39017f 100644 --- a/front-generator/template/common/setup-methods.js.j2 +++ b/front-generator/template/common/setup-methods.js.j2 @@ -26,9 +26,9 @@ let snr; if (isNaN(calcSnr)) { snr = `ОСШ=?` } else { snr=`ОСШ=${calcSnr}` } if (result > 1024) { - return (result / 1024).toLocaleString() + ' Мбит/с; ' + snr + return toLocaleStringWithSpaces(result / 1024) + ' Мбит/с; ' + snr } else { - return result.toLocaleString() + ' кбит/с; ' + snr + return toLocaleStringWithSpaces(result) + ' кбит/с; ' + snr } }, {% endif %} diff --git a/front-generator/template/main.html b/front-generator/template/main.html index 8bfdfad..1d3c261 100644 --- a/front-generator/template/main.html +++ b/front-generator/template/main.html @@ -75,6 +75,18 @@ return availableTabs[0] } + function toLocaleStringWithSpaces(num) { + if (typeof num !== 'number') { + if (typeof num === 'string') { return num } + return String(num); + } + const numberString = num.toString() + const [integerPart, fractionalPart] = numberString.split('.') + const spacedIntegerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, " ") + if (fractionalPart) { return `${spacedIntegerPart}.${fractionalPart}` } + else { return spacedIntegerPart } + } + const app = Vue.createApp({ data() { return { @@ -161,7 +173,7 @@ result = Math.round(result / step) * step if ('min' in validation) { if (result <= validation['min']) { result = validation['min'] } } if ('max' in validation) { if (result >= validation['max']) { result = validation['max'] } } - return result.toLocaleString() + return toLocaleStringWithSpaces(result) }, // ========== include from 'common/all-params-methods.js.j2' diff --git a/src/terminal_api_driver.cpp b/src/terminal_api_driver.cpp index bf2cfa4..7bb6bb0 100644 --- a/src/terminal_api_driver.cpp +++ b/src/terminal_api_driver.cpp @@ -1073,11 +1073,6 @@ std::string api_driver::ApiDriver::loadSettings() const { result << ",\"dpdiDelay\":" << dpdiSettings.max_delay; #endif - -#ifdef MODEM_IS_TDMA - result << ",\n\"rxTxSatDelay\":" << static_cast(demodSettings.delay_ms); -#endif - result << ",\n\"rxAgcEn\":" << boolAsStr(demodSettings.is_aru_on); result << ",\"rxSpectrumInversion\":" << boolAsStr(demodSettings.is_rvt_iq); result << ",\"rxManualGain\":"; writeDouble(result, demodSettings.gain); @@ -1209,10 +1204,6 @@ void api_driver::ApiDriver::setRxTxSettings(boost::property_tree::ptree &pt) { demod.gold_seq_is_active = pt.get("rxGoldan"); #endif -#ifdef MODEM_IS_TDMA - demod.delay_ms = pt.get("rxTxSatDelay"); -#endif - #ifdef MODEM_IS_SCPC // ACM acm.period_pack_acm = pt.get("dvbServicePacketPeriod"); diff --git a/static/main-scpc.html b/static/main-scpc.html index d6ab325..60f6a4c 100644 --- a/static/main-scpc.html +++ b/static/main-scpc.html @@ -567,6 +567,18 @@ return availableTabs[0] } + function toLocaleStringWithSpaces(num) { + if (typeof num !== 'number') { + if (typeof num === 'string') { return num } + return String(num); + } + const numberString = num.toString() + const [integerPart, fractionalPart] = numberString.split('.') + const spacedIntegerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, " ") + if (fractionalPart) { return `${spacedIntegerPart}.${fractionalPart}` } + else { return spacedIntegerPart } + } + const app = Vue.createApp({ data() { return { @@ -768,7 +780,7 @@ result = Math.round(result / step) * step if ('min' in validation) { if (result <= validation['min']) { result = validation['min'] } } if ('max' in validation) { if (result >= validation['max']) { result = validation['max'] } } - return result.toLocaleString() + return toLocaleStringWithSpaces(result) }, // ========== include from 'common/all-params-methods.js.j2' @@ -1079,9 +1091,9 @@ let snr; if (isNaN(calcSnr)) { snr = `ОСШ=?` } else { snr=`ОСШ=${calcSnr}` } if (result > 1024) { - return (result / 1024).toLocaleString() + ' Мбит/с; ' + snr + return toLocaleStringWithSpaces(result / 1024) + ' Мбит/с; ' + snr } else { - return result.toLocaleString() + ' кбит/с; ' + snr + return toLocaleStringWithSpaces(result) + ' кбит/с; ' + snr } }, // ========== include end from 'common/setup-methods.js.j2' diff --git a/static/main-tdma.html b/static/main-tdma.html index e6953f3..5d03f54 100644 --- a/static/main-tdma.html +++ b/static/main-tdma.html @@ -290,6 +290,18 @@ return availableTabs[0] } + function toLocaleStringWithSpaces(num) { + if (typeof num !== 'number') { + if (typeof num === 'string') { return num } + return String(num); + } + const numberString = num.toString() + const [integerPart, fractionalPart] = numberString.split('.') + const spacedIntegerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, " ") + if (fractionalPart) { return `${spacedIntegerPart}.${fractionalPart}` } + else { return spacedIntegerPart } + } + const app = Vue.createApp({ data() { return { @@ -446,7 +458,7 @@ result = Math.round(result / step) * step if ('min' in validation) { if (result <= validation['min']) { result = validation['min'] } } if ('max' in validation) { if (result >= validation['max']) { result = validation['max'] } } - return result.toLocaleString() + return toLocaleStringWithSpaces(result) }, // ========== include from 'common/all-params-methods.js.j2'