Skip to content

Commit 800da33

Browse files
demvladhaslinghuis
andauthored
The spectrum charts improvements. (#833)
* The FFT is used power 2 input length to get maximal fft performance * Added Power spectral density curves chart * The spectrum magnitude is computed by complex Re and Im value * Added functions to compute PSD by RPM and Throttle * Added drawing heat map for PSD values * Added switch to select PSD by throttle or RPM charts * Resolved issue of limit drawing psd value * Code style improvement * Code refactoring in src/graph_spectrum_calc.js * Resolved missing this. issue * Added PSD values label at mouse position cursor by Shift key * Added PSD values label on the mouse position cursor by Shift key at the power specral density chart * Code refactoring * The background heatmap PSD value is changed from -70 to -100dBm * Added PSD value to maximal noise PSD marker * Removed needless spaces Co-authored-by: Mark Haslinghuis <[email protected]> * The SPECTRUM_TYPE enum members are reordered * Code style improvement Co-authored-by: Mark Haslinghuis <[email protected]> * Code refactoring * Resolved issue of wrong simple frequency spectrum data * Code refactoring * Improved fill data into fft input array * Improved computing of PSD * Code refactoring * Resolved issue computing frequency with maximal noise at the simple spectrum chart * Improved computing of vsBinIndex values * Code refactoring: using of named constant * The top margin at heatmaps charts applies for RPM axis only * Resolved issue of filters drawing at the PSD charts * Improved computing of top margin value at vs RPM charts * Set properly value for overdrawSpectrumType select element position * The vertical slider shifts the PSD charts dBm range * Improved draw simple spectrum code * Limit fft input count for simple spectrum chart to get normal charts plot quality * Using power at 2 fft inputsize to compute PSD ws throttle and RPM * Resolved issues of using power at 2 values * Resolved issue wrong PSD values matrix size * Impoved PSD heat map charts vertical slider control: the avaiable dBm range shift value are -30, -20, -10, 0, 10, 20 dBm * Code style improvement * Code refactoring * Added separated own vertical slider for PSD ranges shift * Added vertical slider to control drawing PSD low level * Code refactoring * Added text label for the PSD vertical sliders * Code refactoring * replaced PSD dBm values labels * Replaced dBm range shift slider at PSD heat map charts * Code refactoring: use two different function to compute frequency by RPM and PSD by RPM * Resolved Missing trailing comma issue * Resolved missing trailing coma issue * Added full dBm range min and max values control by using spin number input fields * Resolved missing trailing coma issues * The number input fields spin buttons are visible now * Added Ctrl key for double mouse click to set PSD range values as default * Improved PSD range values validation logic * Code style improvement * Improved console errors output * Made closer PSD control placement * Code style improvement * Resolved undue rectangle issue at the spectrum chart * The PSD caption is changed Co-authored-by: Mark Haslinghuis <[email protected]> * The extra line is removed Co-authored-by: Mark Haslinghuis <[email protected]> * The extra line is removed in src/graph_spectrum_calc.js Co-authored-by: Mark Haslinghuis <[email protected]> --------- Co-authored-by: Mark Haslinghuis <[email protected]>
1 parent 318cc75 commit 800da33

File tree

5 files changed

+842
-138
lines changed

5 files changed

+842
-138
lines changed

index.html

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,11 @@ <h4>Workspace</h4>
457457
<select id="spectrumTypeSelect">
458458
<option value="0">Frequency</option>
459459
<option value="1">Freq. vs Throttle</option>
460-
<option value="3">Freq. vs RPM</option>
461-
<option value="2">Error vs Setpoint</option>
460+
<option value="2">Freq. vs RPM</option>
461+
<option value="3">Power Spectral Density</option>
462+
<option value="4">PSD vs Throttle</option>
463+
<option value="5">PSD vs RPM</option>
464+
<option value="6">Error vs Setpoint</option>
462465
</select>
463466
</div>
464467

@@ -490,6 +493,22 @@ <h4>Workspace</h4>
490493
/>
491494
<input id="analyserZoomY" class="onlyFullScreen" type="range" name="analyserZoomY" value="100" min="10" max="1000" step="10" list="analyserZoomYTicks"
492495
/>
496+
<input id="analyserLowLevelPSD" class="onlyFullScreen" type="number" name="analyserLowLevelPSD" value="-40" min="-40" max="10" step="5"
497+
/>
498+
<input id="analyserMaxPSD" class="onlyFullScreen" type="number" name="analyserMaxPSD" value="10" min="-35" max="100" step="5"
499+
/>
500+
<input id="analyserMinPSD" class="onlyFullScreen" type="number" name="analyserMinPSD" value="-40" min="-100" max="5" step="5"
501+
/>
502+
<label id="analyserMaxPSDLabel" name="analyserMaxPSDLabel" class="onlyFullScreen" >
503+
Max&nbsp;dBm
504+
</label>
505+
<label id="analyserMinPSDLabel" name="analyserMinPSDLabel" class="onlyFullScreen" >
506+
Min&nbsp;dBm
507+
</label>
508+
<label id="analyserLowLevelPSDLabel" name="analyserLowLevelPSDLabel" class="onlyFullScreen" >
509+
Limit&nbsp;dBm
510+
</label>
511+
493512
<datalist id="analyserZoomXTicks">
494513
<option>100</option>
495514
<option>200</option>

src/css/main.css

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,12 @@ html.has-analyser-fullscreen.has-analyser
543543
display: block;
544544
}
545545

546+
html.has-analyser-fullscreen.has-analyser
547+
.analyser
548+
label:not(.onlyFullScreenException) {
549+
display: block;
550+
}
551+
546552
#analyser,
547553
#log-seek-bar {
548554
z-index: 10;
@@ -616,7 +622,7 @@ html.has-analyser-fullscreen.has-analyser
616622
height: 0;
617623
overflow: hidden;
618624
opacity: 0;
619-
left: 120px;
625+
left: 130px;
620626
float: left;
621627
z-index: 9;
622628
position: absolute;
@@ -670,6 +676,7 @@ html.has-analyser-fullscreen.has-analyser
670676
top: 10px;
671677
float: right;
672678
}
679+
673680
.analyser input#analyserZoomY {
674681
width: 10px;
675682
height: 100px;
@@ -678,6 +685,65 @@ html.has-analyser-fullscreen.has-analyser
678685
top: 30px;
679686
}
680687

688+
.analyser input#analyserMinPSD::-webkit-inner-spin-button,
689+
.analyser input#analyserMinPSD::-webkit-outer-spin-button,
690+
.analyser input#analyserMaxPSD::-webkit-inner-spin-button,
691+
.analyser input#analyserMaxPSD::-webkit-outer-spin-button,
692+
.analyser input#analyserLowLevelPSD::-webkit-inner-spin-button,
693+
.analyser input#analyserLowLevelPSD::-webkit-outer-spin-button {
694+
-webkit-appearance: auto !important;
695+
-moz-appearance: auto !important;
696+
appearance: auto !important;
697+
opacity: 1 !important;
698+
height: auto !important;
699+
width: auto !important;
700+
}
701+
702+
.analyser input#analyserMaxPSD {
703+
width: 50px;
704+
height: 20px;
705+
left: 0px;
706+
top: 30px;
707+
}
708+
709+
.analyser input#analyserMinPSD {
710+
width: 50px;
711+
height: 20px;
712+
left: 0px;
713+
top: 55px;
714+
}
715+
716+
.analyser input#analyserLowLevelPSD {
717+
width: 50px;
718+
height: 20px;
719+
left: 0px;
720+
top: 80px;
721+
}
722+
723+
.analyser label#analyserMaxPSDLabel {
724+
position:absolute;
725+
color:gray;
726+
left: 0px;
727+
top: 30px;
728+
font-size: 12px;
729+
}
730+
731+
.analyser label#analyserMinPSDLabel {
732+
position:absolute;
733+
color:gray;
734+
left: 0px;
735+
top: 55px;
736+
font-size: 12px;
737+
}
738+
739+
.analyser label#analyserLowLevelPSDLabel {
740+
position:absolute;
741+
color:gray;
742+
left: 0px;
743+
top: 80px;
744+
font-size: 12px;
745+
}
746+
681747
.analyser input.onlyFullScreen {
682748
display: none;
683749
padding: 3px;
@@ -686,6 +752,14 @@ html.has-analyser-fullscreen.has-analyser
686752
position: absolute;
687753
}
688754

755+
.analyser label.onlyFullScreen {
756+
display: none;
757+
padding: 3px;
758+
margin-right: 3px;
759+
z-index: 9;
760+
position: absolute;
761+
}
762+
689763
.analyser,
690764
.map-container,
691765
.log-seek-bar {

0 commit comments

Comments
 (0)