44 GraphSpectrumPlot ,
55 SPECTRUM_TYPE ,
66 SPECTRUM_OVERDRAW_TYPE ,
7+ MIN_DBM_VALUE ,
8+ MAX_DBM_VALUE ,
79} from "./graph_spectrum_plot" ;
810import { PrefStorage } from "./pref_storage" ;
911import { SpectrumExporter } from "./spectrum-exporter" ;
@@ -35,8 +37,11 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
3537 GraphSpectrumPlot . setLogRateWarningInfo ( logRateInfo ) ;
3638 const analyserZoomXElem = $ ( "#analyserZoomX" ) ;
3739 const analyserZoomYElem = $ ( "#analyserZoomY" ) ;
38- const analyserShiftPSDElem = $ ( "#analyserShiftPSD" ) ;
39- const analyserLowLevelPSDElem = $ ( "#analyserLowLevelPSD" ) ;
40+ const analyserShiftPSDSlider = $ ( "#analyserShiftPSD" ) ;
41+ const analyserLowLevelPSDSlider = $ ( "#analyserLowLevelPSD" ) ;
42+ const analyserMinPSDText = $ ( "#analyserMinPSD" ) ;
43+ const analyserMaxPSDText = $ ( "#analyserMaxPSD" ) ;
44+ const analyserLowPSDText = $ ( "#analyserLowPSD" ) ;
4045
4146 const spectrumToolbarElem = $ ( "#spectrumToolbar" ) ;
4247 const spectrumTypeElem = $ ( "#spectrumTypeSelect" ) ;
@@ -106,6 +111,15 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
106111 $ ( "#analyserResize" , parentElem ) . css ( {
107112 left : `${ newSize . width - 20 } px` ,
108113 } ) ;
114+ $ ( "#analyserMaxPSD" , parentElem ) . css ( {
115+ left : `${ newSize . width - 50 } px` ,
116+ } ) ;
117+ $ ( "#analyserMinPSD" , parentElem ) . css ( {
118+ left : `${ newSize . width - 50 } px` ,
119+ } ) ;
120+ $ ( "#analyserLowPSD" , parentElem ) . css ( {
121+ left : `${ newSize . width - 120 } px` ,
122+ } ) ;
109123 } ;
110124
111125 let dataLoad = function ( ) {
@@ -218,13 +232,15 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
218232 } )
219233 . val ( DEFAULT_ZOOM ) ;
220234
221- analyserShiftPSDElem
235+ analyserShiftPSDSlider
222236 . on (
223237 "input" ,
224238 debounce ( 100 , function ( ) {
225- const shift = - parseInt ( analyserShiftPSDElem . val ( ) ) ;
239+ const shift = - parseInt ( analyserShiftPSDSlider . val ( ) ) ;
226240 GraphSpectrumPlot . setShiftPSD ( shift ) ;
227- analyserLowLevelPSDElem . val ( 0 ) . trigger ( "input" ) ;
241+ analyserLowLevelPSDSlider . val ( 0 ) . trigger ( "input" ) ;
242+ analyserMinPSDText . val ( - 40 + shift ) ;
243+ analyserMaxPSDText . val ( 10 + shift ) ;
228244 that . refresh ( ) ;
229245 } )
230246 )
@@ -233,12 +249,17 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
233249 } )
234250 . val ( 0 ) ;
235251
236- analyserLowLevelPSDElem
252+ analyserLowLevelPSDSlider
237253 . on (
238254 "input" ,
239255 debounce ( 100 , function ( ) {
240- const lowLevel = analyserLowLevelPSDElem . val ( ) / 100 ;
241- GraphSpectrumPlot . setLowLevelPSD ( lowLevel ) ;
256+ const lowLevelPercent = analyserLowLevelPSDSlider . val ( ) ;
257+ GraphSpectrumPlot . setLowLevelPSD ( lowLevelPercent ) ;
258+ const shift = - parseInt ( analyserShiftPSDSlider . val ( ) ) ;
259+ const dBmValueMin = MIN_DBM_VALUE + shift ,
260+ dBmValueMax = MAX_DBM_VALUE + shift ,
261+ lowLevel = dBmValueMin + ( dBmValueMax - dBmValueMin ) * lowLevelPercent / 100 ;
262+ analyserLowPSDText . val ( lowLevel ) ;
242263 that . refresh ( ) ;
243264 } )
244265 )
@@ -287,11 +308,23 @@ export function FlightLogAnalyser(flightLog, canvas, analyserCanvas) {
287308 "onlyFullScreenException" ,
288309 pidErrorVsSetpointSelected || psdHeatMapSelected
289310 ) ;
290- analyserShiftPSDElem . toggleClass (
311+ analyserShiftPSDSlider . toggleClass (
312+ "onlyFullScreenException" ,
313+ ! psdHeatMapSelected
314+ ) ;
315+ analyserLowLevelPSDSlider . toggleClass (
316+ "onlyFullScreenException" ,
317+ ! psdHeatMapSelected
318+ ) ;
319+ analyserMinPSDText . toggleClass (
320+ "onlyFullScreenException" ,
321+ ! psdHeatMapSelected
322+ ) ;
323+ analyserMaxPSDText . toggleClass (
291324 "onlyFullScreenException" ,
292325 ! psdHeatMapSelected
293326 ) ;
294- analyserLowLevelPSDElem . toggleClass (
327+ analyserLowPSDText . toggleClass (
295328 "onlyFullScreenException" ,
296329 ! psdHeatMapSelected
297330 ) ;
0 commit comments