From 73e1d281b2645a25ec5406c50fb87ffca4fa519f Mon Sep 17 00:00:00 2001 From: Vladislav Ostapov Date: Thu, 23 Jan 2025 15:25:46 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81:=20=D1=80=D0=B0=D1=81?= =?UTF-8?q?=D1=87=D0=B5=D1=82=D0=BD=D0=B0=D1=8F=20=D1=81=D0=BA=D0=BE=D1=80?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7=D1=8B?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=D0=B0=20"=D0=BD=D0=B5=20=D1=87=D0=B8=D1=81?= =?UTF-8?q?=D0=BB=D0=BE"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front-generator/template/common/setup-methods.js.j2 | 3 ++- static/main-scpc.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/front-generator/template/common/setup-methods.js.j2 b/front-generator/template/common/setup-methods.js.j2 index 1d63285..e1a0cf6 100644 --- a/front-generator/template/common/setup-methods.js.j2 +++ b/front-generator/template/common/setup-methods.js.j2 @@ -17,10 +17,11 @@ return '?' }, calcInterfaceSpeedKb(baud, modulation, speed, frameSizeNormal) { + const mBaud = parseInt(baud.replace(/[^0-9]/g, '')) const mMod = Math.max(2, ['', '', 'qpsk', '8psk', '16apsk', '32apsk'].indexOf(modulation)) const speedVals = {'1/4': 0.25, '1/3': 0.333, '2/5': 0.4, '1/2': 0.5, '3/5': 0.6, '2/3': 0.666, '3/4': 0.75, '4/5': 0.8, '5/6': 0.833, '8/9': 0.888, '9/10': 0.9} const mSpeed = speed in speedVals ? speedVals[speed] : 1 - const result = (baud * mMod * mSpeed) / 1024 + const result = (mBaud * mMod * mSpeed) / 1024 const calcSnr = this.calcRequiredSnr(frameSizeNormal, modulation, speed) let snr; if (isNaN(calcSnr)) { snr = `ОСШ=?` } else { snr=`ОСШ=${calcSnr}` } diff --git a/static/main-scpc.html b/static/main-scpc.html index 66873ff..0181650 100644 --- a/static/main-scpc.html +++ b/static/main-scpc.html @@ -1058,10 +1058,11 @@ return '?' }, calcInterfaceSpeedKb(baud, modulation, speed, frameSizeNormal) { + const mBaud = parseInt(baud.replace(/[^0-9]/g, '')) const mMod = Math.max(2, ['', '', 'qpsk', '8psk', '16apsk', '32apsk'].indexOf(modulation)) const speedVals = {'1/4': 0.25, '1/3': 0.333, '2/5': 0.4, '1/2': 0.5, '3/5': 0.6, '2/3': 0.666, '3/4': 0.75, '4/5': 0.8, '5/6': 0.833, '8/9': 0.888, '9/10': 0.9} const mSpeed = speed in speedVals ? speedVals[speed] : 1 - const result = (baud * mMod * mSpeed) / 1024 + const result = (mBaud * mMod * mSpeed) / 1024 const calcSnr = this.calcRequiredSnr(frameSizeNormal, modulation, speed) let snr; if (isNaN(calcSnr)) { snr = `ОСШ=?` } else { snr=`ОСШ=${calcSnr}` }