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}` }