From 028bbac4dbe4ffa25a1df9eb134c2c6528cc526c Mon Sep 17 00:00:00 2001 From: Ramesh Kumar <ramesh.p@matriotsolutions.com> Date: Wed, 8 Sep 2021 18:51:42 +0530 Subject: [PATCH] TMSS-843: Units added and round off done. --- .../tmss_webapp/src/components/JSONEditor/JEditor.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js b/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js index 4ef889e0477..0c940d03465 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js @@ -457,14 +457,14 @@ function Jeditor(props) { } } else if (propertyKey.toLowerCase() === 'channels_per_subband' && propertyValue instanceof Object) { // Add custom fields to the properties where property 'channels_per_subband' is one of the property. - let freqResolution = { title: 'Frequency Resolution', + let freqResolution = { title: 'Frequency Resolution (kHz)', type: 'string', default: '', format: "grid", // propertyOrder: 1002 }; properties['frequency_resolution'] = freqResolution; - let timeResolution = { title: 'Time Resolution', + let timeResolution = { title: `Time Resolution (${props.observationType==='beamforming observation'?'ms':'sec'})`, type: 'string', default: '', format: "grid", @@ -678,9 +678,9 @@ function Jeditor(props) { function getFrequencyResolution(channelsPerSubband) { if (props.observationType) { if (props.observationType.toLowerCase() === 'beamforming observation') { - return clockValue / 1024 * channelsPerSubband * 1/1000; + return (clockValue / 1024 * channelsPerSubband * 1/1000).toFixed(2); } else if (props.observationType.toLowerCase() === 'target observation') { - return clockValue / 1024 / channelsPerSubband * 1/1000; + return (clockValue / 1024 / channelsPerSubband * 1/1000).toFixed(2); } } else { return null; @@ -694,7 +694,7 @@ function Jeditor(props) { * @returns Number calculated value */ function getTimeResolution(channelsPerSubband, timeIntegrationSteps) { - return 1 / clockValue * 1024 * channelsPerSubband * timeIntegrationSteps; + return 1 / clockValue * 1024 * channelsPerSubband * timeIntegrationSteps * (props.observationType==='beamforming observation'?1000:1); } /** -- GitLab