2026_08_31

This commit is contained in:
marco committed 2026-08-31 16:19:06 +02:00
commit 73015386e9
2320 files changed
+80291

No files matched your search

+260
View File
@@ -0,0 +1,260 @@
import { Injectable } from '@nestjs/common';
import { DrawShapeOptionenDto } from 'src/_dto/draw.dto';
import { DrawBand } from 'src/graphics/elements/drawBand';
import { DrawBehaelter } from 'src/graphics/elements/drawBehaelter';
import { DrawBrecher } from 'src/graphics/elements/drawBrecher';
import { DrawGurtfoerderer } from 'src/graphics/elements/drawGurtfoerderer';
import { DrawSetzmaschine } from 'src/graphics/elements/drawSetzmaschine';
import { Sieb } from 'src/graphics/elements/drawSieb';
import { createCsv } from './csv';
import { DrawSiebEntwaesserung } from 'src/graphics/elements/drawSiebEntwaesserung';
import { DrawWeiche } from 'src/graphics/elements/drawWeiche';
import { DrawZyklon } from 'src/graphics/elements/drawZyklon';
import { DrawTurbowascher } from 'src/graphics/elements/drawTurbowascher';
import { DrawHaspel } from 'src/graphics/elements/drawHaspel';
import { DrawSilo } from 'src/graphics/elements/drawSilo';
import { DrawFlex } from 'src/graphics/elements/drawFlex';
import { LineDto, VisuElementDto } from 'src/_dto/visuElement.dto';
import { DrawPfeil } from 'src/graphics/elements/drawPfeil';
import { DrawPumpe } from 'src/graphics/elements/drawPumpe';
import { DrawVentil } from 'src/graphics/elements/drawVentil';
import { DrawWasserZufuhr } from 'src/graphics/elements/drawWasserZufuhr';
import { DrawBehaelterMulti } from 'src/graphics/elements/drawBehaelterMulti';
import { DrawMotor } from 'src/graphics/elements/drawMotor';
@Injectable()
export class DrawService {
constructor(
private readonly buildSieb: Sieb,
private readonly buildGurtfoerderer: DrawGurtfoerderer,
private readonly buildSetzmaschine: DrawSetzmaschine,
private readonly buildBand: DrawBand,
private readonly buildBrecher: DrawBrecher,
private readonly buildBehaelter: DrawBehaelter,
private readonly buildSiebentwaesseung: DrawSiebEntwaesserung,
private readonly buildWeiche: DrawWeiche,
private readonly buildZyklon: DrawZyklon,
private readonly buildTurbowascher: DrawTurbowascher,
private readonly buildHaspel: DrawHaspel,
private readonly buildSilo: DrawSilo,
private readonly buildFlex: DrawFlex,
private readonly buildPfeil: DrawPfeil,
private readonly buildPumpe: DrawPumpe,
private readonly buildVentil: DrawVentil,
private readonly buildWasserZufuhr: DrawWasserZufuhr,
private readonly buildBehaelterMulti: DrawBehaelterMulti,
private readonly buildMotor: DrawMotor,
) { }
sieb(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildSieb.getSvg(options);
return this.buildSieb.getDrawObject(options);
}
gurtfoerderer(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildGurtfoerderer.getSvg(options);
return this.buildGurtfoerderer.getDrawObject(options);
}
setzmaschine(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildSetzmaschine.getSvg(options);
return this.buildSetzmaschine.getDrawObject(options);
}
band(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildBand.getSvg(options);
return this.buildBand.getDrawObject(options);
}
brecher(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildBrecher.getSvg(options);
return this.buildBrecher.getDrawObject(options);
}
behaelter(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildBehaelter.getSvg(options);
return this.buildBehaelter.getDrawObject(options);
}
siebentwaesserung(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildSiebentwaesseung.getSvg(options);
return this.buildSiebentwaesseung.getDrawObject(options);
}
weiche(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildWeiche.getSvg(options);
return this.buildWeiche.getDrawObject(options);
}
zyklon(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildZyklon.getSvg(options);
return this.buildZyklon.getDrawObject(options);
}
turbowascher(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildTurbowascher.getSvg(options);
return this.buildTurbowascher.getDrawObject(options);
}
haspel(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildHaspel.getSvg(options);
return this.buildHaspel.getDrawObject(options);
}
silo(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildSilo.getSvg(options);
return this.buildSilo.getDrawObject(options);
}
pumpe(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildPumpe.getSvg(options);
return this.buildPumpe.getDrawObject(options);
}
ventil(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildVentil.getSvg(options);
return this.buildVentil.getDrawObject(options);
}
wasserZufuhr(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildWasserZufuhr.getSvg(options);
return this.buildWasserZufuhr.getDrawObject(options);
}
behaelterMulti(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildBehaelterMulti.getSvg(options);
return this.buildBehaelterMulti.getDrawObject(options);
}
motor(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildMotor.getSvg(options);
return this.buildMotor.getDrawObject(options);
}
flex(options?: DrawShapeOptionenDto, rawSvg?: boolean) {
if (rawSvg) return this.buildFlex.getSvg(options);
return this.buildFlex.getDrawObject(options);
}
drawElement(name: string, options: DrawShapeOptionenDto) {
switch (name) {
case "gurtfoerderer":
return this.buildGurtfoerderer.getDrawObject(options);
case "sieb":
return this.buildSieb.getDrawObject(options);
case "band":
return this.buildBand.getDrawObject(options);
case "setzmaschine":
return this.buildSetzmaschine.getDrawObject(options);
case "brecher":
return this.buildBrecher.getDrawObject(options);
case "behaelter":
return this.buildBehaelter.getDrawObject(options);
case "siebentwaesserung":
return this.buildSiebentwaesseung.getDrawObject(options);
case "weiche":
return this.buildWeiche.getDrawObject(options);
case "zyklon":
return this.buildZyklon.getDrawObject(options);
case "turbowascher":
return this.buildTurbowascher.getDrawObject(options);
case "haspel":
return this.buildHaspel.getDrawObject(options);
case "silo":
return this.buildSilo.getDrawObject(options);
case "pumpe":
return this.buildPumpe.getDrawObject(options);
case "ventil":
return this.buildVentil.getDrawObject(options);
case "wasserZufuhr":
return this.buildWasserZufuhr.getDrawObject(options);
case "behaelterMulti":
return this.buildBehaelterMulti.getDrawObject(options);
case "motor":
return this.buildMotor.getDrawObject(options);
}
}
drawLine(element: VisuElementDto, line: LineDto, state: "inactive" | "active" | "error", xaml?: boolean,color?:string) {
//if (!element || !line) return new BadRequestException('Element has no lines')
let options: DrawShapeOptionenDto ={}
if(color && state==='inactive') options['colorInactive']=color;
if(color && state==='active') options['colorActive']=color;
if(color && state==='error') options['colorError']=color;
options['state']=state;
console.log("getDrawObject-->");
let params = this.buildPfeil.getDrawObject(line,options);
console.log("getSvg-->");
if (xaml) params.svg = this.buildPfeil.getSvg(line, options, xaml);
return params;
}
drawShape(name: string, options: DrawShapeOptionenDto) {
switch (name) {
case "gurtfoerderer":
return this.buildGurtfoerderer.getSvg(options);
case "sieb":
return this.buildSieb.getSvg(options);
case "band":
return this.buildBand.getSvg(options);
case "setzmaschine":
return this.buildSetzmaschine.getSvg(options);
case "brecher":
return this.buildBrecher.getSvg(options);
case "behaelter":
return this.buildBehaelter.getSvg(options);
case "siebentwaesserung":
return this.buildSiebentwaesseung.getSvg(options);
case "weiche":
return this.buildWeiche.getSvg(options);
case "zyklon":
return this.buildZyklon.getSvg(options);
case "turbowascher":
return this.buildTurbowascher.getSvg(options);
case "haspel":
return this.buildHaspel.getSvg(options);
case "pumpe":
return this.buildPumpe.getSvg(options);
case "ventil":
return this.buildVentil.getSvg(options);
case "wasserZufuhr":
return this.buildWasserZufuhr.getSvg(options);
case "behaelterMulti":
return this.buildBehaelterMulti.getSvg(options);
case "motor":
return this.buildMotor.getSvg(options);
case "silo":
let silo = this.buildSilo.getSvg(options);
const base64 = Buffer.from(silo, "utf-8").toString("base64");
//console.log(base64);
return silo;
case "flex":
console.log('----flex----')
return this.buildFlex.getSvg(options);
}
}
csv(text: string) {
createCsv(text);
}
}