-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(spie-ui): finish plotter feature
- Loading branch information
Showing
13 changed files
with
630 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
apps/spie-ui/src/app/components/plotter-advanced-modal/plotter-advanced-modal.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<ion-modal #plotterAdvancedModal id="plotter-advanced-modal"> | ||
<ng-template> | ||
<ion-header> | ||
<ion-toolbar color="primary"> | ||
<ion-title>Advanced Plotter Settings</ion-title> | ||
<ion-buttons slot="end"> | ||
<ion-button (click)="plotterAdvancedModal.dismiss()" | ||
>Close</ion-button | ||
> | ||
</ion-buttons> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content> | ||
<ion-list lines="full"> | ||
<ion-item> | ||
<ion-checkbox | ||
justify="space-between" | ||
checked="{{ plotterOptions().useSampleCount }}" | ||
(ionChange)="onChangeUseSampleCount($event)" | ||
>Use sample counter<ion-icon | ||
color="warning" | ||
class="tooltipIcon-top" | ||
name="help-circle-outline" | ||
matTooltip="The system may not be able to capture the time of the data event on fast data rates. Use this option to use the sample count instead of the timestamp for the xaxis. You will still be able to see the timestamp information when the chart is paused " | ||
></ion-icon | ||
></ion-checkbox> | ||
</ion-item> | ||
|
||
<ion-item> | ||
<ion-range | ||
labelPlacement="start" | ||
label="Scrollback size" | ||
[pin]="true" | ||
[snaps]="true" | ||
[min]="0" | ||
[max]="4" | ||
[step]="1" | ||
[pinFormatter]="pinFormatter" | ||
[value]=" | ||
NUMBER_OF_POINTS_VALUES.indexOf(plotterOptions().numberOfPoints) | ||
" | ||
(ionKnobMoveEnd)="onChangeNumberOfPoints($event)" | ||
> | ||
</ion-range> | ||
</ion-item> | ||
</ion-list> | ||
</ion-content> | ||
</ng-template> | ||
</ion-modal> |
Empty file.
76 changes: 76 additions & 0 deletions
76
apps/spie-ui/src/app/components/plotter-advanced-modal/plotter-advanced-modal.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { Component, model, output, viewChild } from '@angular/core'; | ||
import { MatTooltipModule } from '@angular/material/tooltip'; | ||
import { | ||
IonButton, | ||
IonButtons, | ||
IonCheckbox, | ||
IonContent, | ||
IonHeader, | ||
IonItem, | ||
IonList, | ||
IonModal, | ||
IonRange, | ||
IonTitle, | ||
IonToolbar, | ||
} from '@ionic/angular/standalone'; | ||
|
||
import { | ||
NUMBER_OF_POINTS_VALUES, | ||
type PlotterOptions, | ||
} from '../../interfaces/app.interface'; | ||
import { | ||
type CheckboxCustomEvent, | ||
type RangeCustomEvent, | ||
} from '../../interfaces/ionic.interface'; | ||
|
||
@Component({ | ||
selector: 'app-plotter-advanced-modal-component', | ||
templateUrl: 'plotter-advanced-modal.component.html', | ||
styleUrls: ['./plotter-advanced-modal.component.scss'], | ||
imports: [ | ||
IonButton, | ||
IonButtons, | ||
IonCheckbox, | ||
IonContent, | ||
IonHeader, | ||
IonItem, | ||
IonList, | ||
IonModal, | ||
IonRange, | ||
IonTitle, | ||
IonToolbar, | ||
MatTooltipModule, | ||
], | ||
}) | ||
export class PlotterAdvancedComponent { | ||
plotterOptions = model.required<PlotterOptions>(); | ||
clearChart = output<void>(); | ||
|
||
plotterAdvancedModal = viewChild.required<IonModal>('plotterAdvancedModal'); | ||
|
||
NUMBER_OF_POINTS_VALUES = NUMBER_OF_POINTS_VALUES; | ||
|
||
onChangeUseSampleCount(event: CheckboxCustomEvent<boolean>): void { | ||
const selectedOption = event.detail.checked; | ||
this.plotterOptions.update((plotterOptions) => ({ | ||
...plotterOptions, | ||
useSampleCount: selectedOption, | ||
})); | ||
|
||
this.clearChart.emit(); | ||
} | ||
|
||
onChangeNumberOfPoints(event: RangeCustomEvent): void { | ||
const index = event.detail.value as number; | ||
const selectedOption = NUMBER_OF_POINTS_VALUES[index]; | ||
this.plotterOptions.update((plotterOptions) => ({ | ||
...plotterOptions, | ||
numberOfPoints: selectedOption, | ||
})); | ||
} | ||
|
||
pinFormatter(index: number): string { | ||
const rangeValues = NUMBER_OF_POINTS_VALUES; | ||
return `${rangeValues[index]}`; | ||
} | ||
} |
Oops, something went wrong.