Lots of changes
- ✅ Feedback van dataSensor array - ✅ dataSliders min/max and unit - ✅ Camera before Unity - ✅ Restart knop buiten service mode - ✅ Operator phonenumber button - ✅ Gracefull shutdown - ✅ Out of service control
This commit is contained in:
@@ -26,24 +26,34 @@ export type StatusType = 'green' | 'yellow' | 'red' | 'gray';
|
||||
|
||||
export const setProgressState = (
|
||||
progressElement: HTMLDivElement,
|
||||
percentage: number
|
||||
value: number,
|
||||
min: number,
|
||||
max: number,
|
||||
unit: string
|
||||
) => {
|
||||
const value: HTMLDivElement = progressElement.querySelector(
|
||||
const percentage = (value - min) / (max - min);
|
||||
|
||||
const progressValue: HTMLDivElement = progressElement.querySelector(
|
||||
'.ntsh_progress-value'
|
||||
);
|
||||
value.style.width = `${percentage * 100}%`;
|
||||
progressValue.style.width = `${percentage * 100}%`;
|
||||
|
||||
const label: HTMLDivElement = progressElement.querySelector(
|
||||
'.ntsh_progress-label'
|
||||
);
|
||||
label.innerText = `${Math.round(percentage * 100)}%`;
|
||||
label.innerText = `${value}${unit}`;
|
||||
};
|
||||
|
||||
export const createProgress = (value: number) => {
|
||||
export const createProgress = (
|
||||
value: number,
|
||||
min: number,
|
||||
max: number,
|
||||
unit: string
|
||||
) => {
|
||||
const progress = ce('div', 'ntsh_progress');
|
||||
progress.appendChild(ce('div', 'ntsh_progress-value'));
|
||||
progress.appendChild(ce('div', 'ntsh_progress-label'));
|
||||
setProgressState(progress, value);
|
||||
setProgressState(progress, value, min, max, unit);
|
||||
return progress;
|
||||
};
|
||||
export function capitalizeFirstLetter(string: string) {
|
||||
|
||||
Reference in New Issue
Block a user