procon aggregate

This commit is contained in:
marco committed 2026-10-22 07:57:46 +02:00
1 parent e284fae7b4
commit d0655f3638
32 files changed
+1520 -1058

No files matched your search

@@ -0,0 +1,7 @@
import type { ProConViewElement } from '../../_schemas/anlagen/procon-view-aggregate';
export class ProConViewAggregateUpdateDto {
anlageId!: string;
elemente!: ProConViewElement[];
}
+29
View File
@@ -0,0 +1,29 @@
export class VisuAggregateDto {
anlageId!: string;
antriebId!: number;
analogSensorId!: number | null;
mengeId!: null;
view!: string | null;
anzahlMotoren!: number;
antriebName!: string;
bmk!: string;
hmiText3!: string;
hmiText2!: string;
hmiText1!: string;
dauerlaeufer!: boolean;
stellantrieb!: boolean;
pulsantrieb!: boolean;
direktanlauf!: boolean;
wendeschuetz!: boolean;
sternDreieck!: boolean;
fu!: boolean;
sanftanlauf!: boolean;
dzImpulsgeber!: boolean;
dzDauersignal!: boolean;
schlupfueberwachung!: boolean;
endschalter1!: boolean;
endschalter2!: boolean;
endschalter3!: boolean;
endschalter4!: boolean;
}
+33
View File
@@ -0,0 +1,33 @@
import { BadRequestException } from '@nestjs/common';
import type { BandObenConfig, BandObenOptions } from '../graphics/elements/types';
export class BandObenRenderDto {
config!: BandObenConfig;
options?: Partial<BandObenOptions>;
}
export function parseBandObenRequest(input: unknown): BandObenRenderDto {
const object = (value: unknown): value is Record<string, unknown> =>
typeof value === 'object' && value !== null && !Array.isArray(value);
if (!object(input) || Object.keys(input).some(key => !['config', 'options'].includes(key)) || !object(input.config))
throw new BadRequestException('Erwartet werden config und optional options');
const config = input.config;
if (Object.keys(config).some(key => !['width', 'length'].includes(key)) ||
typeof config.width !== 'number' || !Number.isFinite(config.width) || config.width <= 10 ||
typeof config.length !== 'number' || !Number.isFinite(config.length) || config.length <= 0)
throw new BadRequestException('config.width muss größer als 10 und config.length positiv sein; beide Werte müssen endliche Zahlen sein');
const options = input.options === undefined ? {} : input.options;
if (!object(options) || Object.entries(options).some(([key, value]) =>
!['fromNorthToSouth', 'trichterStart', 'trichterEnd'].includes(key) || typeof value !== 'boolean'))
throw new BadRequestException('options erlaubt nur fromNorthToSouth, trichterStart und trichterEnd als Boolean');
if ((options.trichterStart || options.trichterEnd) && config.length < 20)
throw new BadRequestException('Mit Trichter muss die Bandlänge mindestens 20 sein');
return {
config: { width: config.width, length: config.length },
options: {
fromNorthToSouth: options.fromNorthToSouth ?? false,
trichterStart: options.trichterStart ?? false,
trichterEnd: options.trichterEnd ?? false,
} as BandObenOptions,
};
}
+26 -2
View File
@@ -1,9 +1,14 @@
import { Types } from "mongoose";
export class DrawData{
state!:"inactive" | "active" | "error";
svg!:string;
xaml!:string;
xamlBase64!:string;
}
export class DrawDto {
name!:string;
svg!:string;
raster!:number;
scale!:number;
height!: number;
@@ -12,10 +17,20 @@ export class DrawDto {
px_width!:number;
offset_x!:number;
offset_y!:number;
xaml?:string
svg!:string;
xaml?:string;
graphicsData?:DrawData[]
}
export class DrawDataDto {
name!:string;
height!: number;
width!:number;
svg!:{state:string,data:string}[]
xaml!:{state:"inactive" | "active" | "error",data:string,base64?:string}[]
}
export class DrawShapeOptionenDto{
scale?:number;
raster?:number;
@@ -31,3 +46,12 @@ export class DrawShapeOptionenDto{
colorError?:string;
}
export class DrawParameterDto{
height?:number;
width?:number;
colorInactive?:string;
colorActive?:string;
colorError?:string;
}