Skip to content

Commit ae473e3

Browse files
RajeshwriKrajeshwari-kiwad
andauthored
Task/tsp 1343 timing requirements (#58)
Displaying values in engineering notations and displaying time per step above step plot --------- Co-authored-by: rajeshwari-kiwad <[email protected]>
1 parent 0b348f3 commit ae473e3

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

script-gen-manager/src/model/sweep_data/sweep_timing_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl PsuTiming {
148148
let mut psu_timing = PsuTiming {
149149
rate: ParameterString::new("rate"),
150150
rate_normal: 0.066667,
151-
rate_fast: 0.016667,
151+
rate_fast: 0.0016667,
152152
};
153153
psu_timing.set_defaults();
154154
psu_timing

script-gen-ui/src/app/components/main-sweep/plot-container/plot-bias/plot-bias.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ export class PlotBiasComponent
8383
type: 'linear',
8484
position: 20,
8585
linewidth: 1,
86-
range: [0,1],
86+
range: [0, 1],
87+
tickformat: '.3~s',
88+
exponentformat: 'SI'
8789
},
8890
xaxis2: {
8991
visible: true,

script-gen-ui/src/app/components/main-sweep/plot-container/plot-container.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
[plotDataX]="plotDataX"
2222
[plotConfig]="plotConfig"
2323
[tickDifference]="tickDifference"
24+
[totalTimePerStep]="totalTimePerStep"
2425
[isActive]="activeComponent === 'step' && activeIndex === i"
2526
[activeStyle]="getActiveStyle(stepChannel.start_stop_channel.common_chan_attributes.uuid, 'step', i)"
2627
[color]="getColor(stepChannel.start_stop_channel.common_chan_attributes.uuid)"

script-gen-ui/src/app/components/main-sweep/plot-container/plot-step/plot-step.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<p>{{ chanName }}</p>
1515
<span class="vertical-line"></span>
1616
<p>{{ deviceID }}</p>
17-
<!-- <span class="vertical-line"></span>
18-
<p> Model:<strong>{{ deviceID }}</strong></p> -->
17+
<span class="vertical-line"></span>
18+
<p> Time Per Step: {{ totalTimePerStepConverted }}</p>
1919
</div>
2020
<div id="divStep" class="plot-graph">
2121
</div>

script-gen-ui/src/app/components/main-sweep/plot-container/plot-step/plot-step.component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { FormsModule } from '@angular/forms';
2424
import { MatIconModule } from '@angular/material/icon';
2525
import { BrowserModule } from '@angular/platform-browser';
2626
import { PlotUtils } from '../plot-utils';
27+
import { parseScientificInput } from '../../../controls/input-parser.util';
2728

2829
@Component({
2930
selector: 'app-plot-step',
@@ -40,7 +41,9 @@ export class PlotStepComponent
4041
@Input() plotDataX: number[] = [];
4142
@Input() tickDifference: number | undefined;
4243
@Input() plotConfig: { staticPlot: boolean } | undefined;
43-
@Input() stepPointsList: ParameterFloat[][] = [];
44+
@Input() totalTimePerStep: number | undefined;
45+
totalTimePerStepConverted: string | undefined;
46+
4447

4548
private _isActive = false;
4649

@@ -112,6 +115,8 @@ export class PlotStepComponent
112115
type: 'linear',
113116
position: 20,
114117
linewidth: 1,
118+
tickformat: '.3~s',
119+
exponentformat: 'SI'
115120
},
116121
xaxis2: {
117122
visible: true,
@@ -218,7 +223,7 @@ export class PlotStepComponent
218223
}
219224

220225
ngOnInit() {
221-
if (this.stepChannel && this.stepGlobalParameters) {
226+
if (this.stepChannel && this.stepGlobalParameters && this.totalTimePerStep) {
222227
this.commonChanAttributes =
223228
this.stepChannel.start_stop_channel.common_chan_attributes;
224229

@@ -239,12 +244,14 @@ export class PlotStepComponent
239244

240245
this.stepPoints = this.stepGlobalParameters.step_points;
241246
this.stepToSweepDelay = this.stepGlobalParameters.step_to_sweep_delay;
247+
this.totalTimePerStepConverted = parseScientificInput(this.totalTimePerStep.toString(), 's');
242248
}
243249
this.plotData1.x = this.plotDataX;
244250
this.plotData1.line.color = this.color;
245251
this.updatePlotLayout();
246252
this.initializePlot();
247253
this.observeThemeChanges();
254+
248255
}
249256

250257
// the plots are rendered only after the DOM is created, so we need to render them after the DOM is loaded

script-gen-ui/src/app/components/main-sweep/plot-container/plot-sweep/plot-sweep.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ export class PlotSweepComponent
110110
type: 'linear',
111111
position: 20,
112112
linewidth: 1,
113+
tickformat: '.3~s',
114+
exponentformat: 'SI'
113115
},
114116
xaxis2: {
115117
visible: true,

0 commit comments

Comments
 (0)