diff --git a/builddate.js b/builddate.js index 7a9232e..6fdb8ca 100644 --- a/builddate.js +++ b/builddate.js @@ -1 +1 @@ -var CONF_builddate="20240115-215745" +var CONF_builddate="20240129-213201" diff --git a/eendraadschema.js b/eendraadschema.js index 2807eab..d938863 100644 --- a/eendraadschema.js +++ b/eendraadschema.js @@ -313,7 +313,7 @@ var Electro_Item = /** @class */ (function (_super) { }; // -- Lijst met toegestande kinderen van het Electro_item -- Electro_Item.prototype.allowedChilds = function () { - return ["", "Aansluiting", "Domotica", "Domotica gestuurde verbruiker", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Aansluiting", "Domotica", "Domotica gestuurde verbruiker", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Media", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; }; // -- Aantal actieve kinderen van het Electro_item -- Electro_Item.prototype.getNumChildsWithKnownType = function () { @@ -465,16 +465,18 @@ var Electro_Item = /** @class */ (function (_super) { return Electro_Item; }(List_Item)); var Schakelaar = /** @class */ (function () { - function Schakelaar(type, halfwaterdicht, verklikkerlamp, signalisatielamp, trekschakelaar) { + function Schakelaar(type, halfwaterdicht, verklikkerlamp, signalisatielamp, trekschakelaar, aantal) { if (halfwaterdicht === void 0) { halfwaterdicht = false; } if (verklikkerlamp === void 0) { verklikkerlamp = false; } if (signalisatielamp === void 0) { signalisatielamp = false; } if (trekschakelaar === void 0) { trekschakelaar = false; } + if (aantal === void 0) { aantal = 1; } this.type = type; this.halfwaterdicht = halfwaterdicht; this.verklikkerlamp = verklikkerlamp; this.signalisatielamp = signalisatielamp; this.trekschakelaar = trekschakelaar; + this.aantal = aantal; } Schakelaar.prototype.schakelaarAttributentoSVGString = function (endx, isdubbel) { if (isdubbel === void 0) { isdubbel = false; } @@ -590,6 +592,17 @@ var Schakelaar = /** @class */ (function () { outputstr += 'h'; return ({ endx: endx, str: outputstr, lowerbound: null }); }; + Schakelaar.prototype.magneetcontacttoDrawReturnObj = function (startx) { + var outputstr = ""; + var endx = startx + 20; + // Alles naar beneden schuiven als we het aantal laders boven het symbool willen plaatsen + if (this.aantal > 1) { + outputstr += 'x' + htmlspecialchars(this.aantal) + ''; + } + outputstr += '' + + ''; + return ({ endx: endx, str: outputstr, lowerbound: null }); + }; Schakelaar.prototype.defaulttoDrawReturnObj = function (startx, symbol) { var outputstr = ""; var endx = startx + 20; @@ -608,7 +621,7 @@ var Schakelaar = /** @class */ (function () { return 0; }; Schakelaar.prototype.toSVGString = function (startx, last) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u; + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v; var outputstr = ""; var endx; var lowerbound = 20; @@ -663,41 +676,46 @@ var Schakelaar = /** @class */ (function () { endx += 8; lowerbound = Math.max(lowerbound, 25); break; + case "magneetcontact": + (_m = (this.magneetcontacttoDrawReturnObj(startx)), endx = _m.endx, outputstr = _m.str); + endx += 20; + lowerbound = Math.max(lowerbound, 25); + break; case "schakelaar": - (_m = (this.defaulttoDrawReturnObj(startx, '#schakelaar')), endx = _m.endx, outputstr = _m.str); + (_o = (this.defaulttoDrawReturnObj(startx, '#schakelaar')), endx = _o.endx, outputstr = _o.str); endx += 40; break; case "schemerschakelaar": - (_o = (this.defaulttoDrawReturnObj(startx, '#schemerschakelaar')), endx = _o.endx, outputstr = _o.str); + (_p = (this.defaulttoDrawReturnObj(startx, '#schemerschakelaar')), endx = _p.endx, outputstr = _p.str); endx += 40; break; case "teleruptor": - (_p = (this.defaulttoDrawReturnObj(startx, '#teleruptor')), endx = _p.endx, outputstr = _p.str); + (_q = (this.defaulttoDrawReturnObj(startx, '#teleruptor')), endx = _q.endx, outputstr = _q.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; case "dimmer": - (_q = (this.defaulttoDrawReturnObj(startx, '#dimmer')), endx = _q.endx, outputstr = _q.str); + (_r = (this.defaulttoDrawReturnObj(startx, '#dimmer')), endx = _r.endx, outputstr = _r.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; case "relais": - (_r = (this.defaulttoDrawReturnObj(startx, '#relais')), endx = _r.endx, outputstr = _r.str); + (_s = (this.defaulttoDrawReturnObj(startx, '#relais')), endx = _s.endx, outputstr = _s.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; case "minuterie": - (_s = (this.defaulttoDrawReturnObj(startx, '#minuterie')), endx = _s.endx, outputstr = _s.str); + (_t = (this.defaulttoDrawReturnObj(startx, '#minuterie')), endx = _t.endx, outputstr = _t.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; case "thermostaat": - (_t = (this.defaulttoDrawReturnObj(startx, '#thermostaat')), endx = _t.endx, outputstr = _t.str); + (_u = (this.defaulttoDrawReturnObj(startx, '#thermostaat')), endx = _u.endx, outputstr = _u.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; case "tijdschakelaar": - (_u = (this.defaulttoDrawReturnObj(startx, '#tijdschakelaar')), endx = _u.endx, outputstr = _u.str); + (_v = (this.defaulttoDrawReturnObj(startx, '#tijdschakelaar')), endx = _v.endx, outputstr = _v.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; @@ -760,6 +778,9 @@ var Schakelaars = /** @class */ (function (_super) { case "dubbelpolig": this.props.aantal_schakelaars = String(Math.min(Number(this.props.aantal_schakelaars), 2)); break; + case "magneetcontact": + this.props.aantal_schakelaars = String(Math.min(Number(this.props.aantal_schakelaars), 20)); + break; default: this.props.aantal_schakelaars = "1"; break; @@ -777,7 +798,7 @@ var Schakelaars = /** @class */ (function (_super) { this.overrideKeys(); var output = this.toHTMLHeader(mode); output += " Nr: " + this.stringPropToHTML('nr', 5); - output += ", " + this.selectPropToHTML('type_schakelaar', ["enkelpolig", "dubbelpolig", "driepolig", "dubbelaansteking", "wissel_enkel", "wissel_dubbel", "kruis_enkel", "---", "schakelaar", "dimschakelaar", "dimschakelaar wissel", "bewegingsschakelaar", "schemerschakelaar", "---", "teleruptor", "relais", "dimmer", "tijdschakelaar", "minuterie", "thermostaat", "rolluikschakelaar"]); + output += ", " + this.selectPropToHTML('type_schakelaar', ["enkelpolig", "dubbelpolig", "driepolig", "dubbelaansteking", "wissel_enkel", "wissel_dubbel", "kruis_enkel", "---", "schakelaar", "dimschakelaar", "dimschakelaar wissel", "bewegingsschakelaar", "schemerschakelaar", "---", "teleruptor", "relais", "dimmer", "tijdschakelaar", "minuterie", "thermostaat", "rolluikschakelaar", "---", "magneetcontact"]); if (this.kanHalfwaterdichtZijn()) output += ", Halfwaterdicht: " + this.checkboxPropToHTML('is_halfwaterdicht'); if (this.kanVerklikkerlampjeHebben()) @@ -793,6 +814,9 @@ var Schakelaars = /** @class */ (function (_super) { case "dubbelpolig": output += ", Aantal schakelaars: " + this.selectPropToHTML('aantal_schakelaars', ["1", "2"]); break; + case "magneetcontact": + output += ", Aantal schakelaars: " + this.selectPropToHTML('aantal_schakelaars', ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]); + break; } output += ", Adres/tekst: " + this.stringPropToHTML('adres', 5); return (output); @@ -835,6 +859,9 @@ var Schakelaars = /** @class */ (function (_super) { case "tijdschakelaar": tekenKeten.push(new Schakelaar("tijdschakelaar")); break; + case "magneetcontact": + tekenKeten.push(new Schakelaar("magneetcontact", false, false, false, false, this.props.aantal_schakelaars)); + break; case "rolluikschakelaar": tekenKeten.push(new Schakelaar("rolluikschakelaar", this.props.is_halfwaterdicht)); break; @@ -1748,7 +1775,7 @@ var Domotica_gestuurde_verbruiker = /** @class */ (function (_super) { this.props.heeft_externe_sturing = false; }; Domotica_gestuurde_verbruiker.prototype.allowedChilds = function () { - return ["", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Media", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; }; Domotica_gestuurde_verbruiker.prototype.getMaxNumChilds = function () { return 1; @@ -2423,7 +2450,7 @@ var Kring = /** @class */ (function (_super) { } }; Kring.prototype.allowedChilds = function () { - return ["", "Aansluiting", "Bord", "Domotica", "Domotica gestuurde verbruiker", "Kring", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Aansluiting", "Bord", "Domotica", "Domotica gestuurde verbruiker", "Kring", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Media", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; }; Kring.prototype.getMaxNumChilds = function () { return 256; @@ -2954,6 +2981,71 @@ var Lichtpunt = /** @class */ (function (_super) { }; return Lichtpunt; }(Electro_Item)); +var Media = /** @class */ (function (_super) { + __extends(Media, _super); + function Media() { + return _super !== null && _super.apply(this, arguments) || this; + } + Media.prototype.convertLegacyKeys = function (mykeys) { + //Nothing to do since Media did not exist when Legacy Keys where still a thing + }; + Media.prototype.resetProps = function () { + this.clearProps(); + this.props.type = "Media"; + this.props.adres = ""; + this.props.aantal = 1; + this.props.symbool = ""; + }; + Media.prototype.overrideKeys = function () { + if (this.props.symbool == 'luidspreker') { + if (this.props.aantal < 1) + this.props.aantal = 1; + if (this.props.aantal > 20) + this.props.aantal = 20; + } + else { + this.props.aantal = 1; + } + }; + Media.prototype.toHTML = function (mode) { + this.overrideKeys(); + var output = this.toHTMLHeader(mode); + output += " Nr: " + this.stringPropToHTML('nr', 5) + + ", Symbool: " + this.selectPropToHTML('symbool', ["", "luidspreker"]); + if (this.props.symbool == 'luidspreker') { + output += ", Aantal: " + this.selectPropToHTML('aantal', ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]); + } + output += ", Adres/tekst: " + this.stringPropToHTML('adres', 5); + return (output); + }; + Media.prototype.toSVG = function () { + var mySVG = new SVGelement(); + // Alles naar beneden schuiven als we het aantal laders boven het symbool willen plaatsen + var shifty = 0; + if (this.props.aantal > 1) { + shifty = 15; + mySVG.data += 'x' + htmlspecialchars(this.props.aantal) + ''; + } + mySVG.xleft = 1; // foresee at least some space for the conductor + mySVG.xright = 59; + mySVG.yup = 25 + shifty; + mySVG.ydown = 25; + switch (this.props.symbool) { + case "luidspreker": + mySVG.data += '' + + ''; + mySVG.xright = 36; + mySVG.data += this.addAddressToSVG(mySVG, 60 + shifty, 15, 0); + break; + default: + mySVG.data += ''; + mySVG.xright = 19; + break; + } + return (mySVG); + }; + return Media; +}(Electro_Item)); var Meerdere_verbruikers = /** @class */ (function (_super) { __extends(Meerdere_verbruikers, _super); function Meerdere_verbruikers() { @@ -2970,7 +3062,7 @@ var Meerdere_verbruikers = /** @class */ (function (_super) { this.props.adres = ""; // Set Adres/tekst to "" when the item is cleared }; Meerdere_verbruikers.prototype.allowedChilds = function () { - return ["", "Domotica", "Domotica gestuurde verbruiker", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Omvormer", "Overspanningsbeveiliging", "Microgolfoven", "Motor", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Domotica", "Domotica gestuurde verbruiker", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Omvormer", "Overspanningsbeveiliging", "Media", "Microgolfoven", "Motor", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; }; Meerdere_verbruikers.prototype.getMaxNumChilds = function () { return 256; @@ -3988,7 +4080,7 @@ var SVGSymbols = /** @class */ (function () { function SVGSymbols() { } SVGSymbols.outputSVGSymbols = function () { - var output = "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n V\n E\n E\n V\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n S\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n PIR\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n M\n \n \n \n \n kWh\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"\n \n \n \n \n \n \n \n \n \n \"\n \"\n \"\n \n \n \n \n \n \n \n \n \n \n AC/DC\n USB\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n -> shift x -7.5 y -15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n "; + var output = "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n V\n E\n E\n V\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n S\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n PIR\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n M\n \n \n \n \n kWh\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"\n \n \n \n \n \n \n \n \n \n \"\n \"\n \"\n \n \n \n \n \n \n \n \n \n \n AC/DC\n USB\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n -> shift x -7.5 y -15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n "; return (output); }; return SVGSymbols; @@ -4204,6 +4296,9 @@ var Hierarchical_List = /** @class */ (function () { case 'Meerdere verbruikers': tempval = new Meerdere_verbruikers(structure); break; + case 'Media': + tempval = new Media(structure); + break; case 'Microgolfoven': tempval = new Microgolfoven(structure); break; diff --git a/src/Hierarchical_List.ts b/src/Hierarchical_List.ts index d60ea7e..05a8c2a 100644 --- a/src/Hierarchical_List.ts +++ b/src/Hierarchical_List.ts @@ -188,6 +188,7 @@ class Hierarchical_List { case 'Lichtcircuit': tempval = new Lichtcircuit(structure); break; case 'Lichtpunt': tempval = new Lichtpunt(structure); break; case 'Meerdere verbruikers': tempval = new Meerdere_verbruikers(structure); break; + case 'Media': tempval = new Media(structure); break; case 'Microgolfoven': tempval = new Microgolfoven(structure); break; case 'Motor': tempval = new Motor(structure); break; case 'Omvormer': tempval = new Omvormer(structure); break; diff --git a/src/List_Item/Domotica_gestuurde_verbruiker.ts b/src/List_Item/Domotica_gestuurde_verbruiker.ts index 000bb3a..78140ec 100644 --- a/src/List_Item/Domotica_gestuurde_verbruiker.ts +++ b/src/List_Item/Domotica_gestuurde_verbruiker.ts @@ -25,7 +25,7 @@ class Domotica_gestuurde_verbruiker extends Electro_Item { } allowedChilds() : Array { // returns an array with the type-names of allowed childs - return ["", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Media", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; } getMaxNumChilds(): number { diff --git a/src/List_Item/Electro_Item.ts b/src/List_Item/Electro_Item.ts index 006a2fc..3cbc838 100644 --- a/src/List_Item/Electro_Item.ts +++ b/src/List_Item/Electro_Item.ts @@ -32,7 +32,7 @@ class Electro_Item extends List_Item { // -- Lijst met toegestande kinderen van het Electro_item -- allowedChilds() : Array { - return ["", "Aansluiting", "Domotica", "Domotica gestuurde verbruiker", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Aansluiting", "Domotica", "Domotica gestuurde verbruiker", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Media", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; } // -- Aantal actieve kinderen van het Electro_item -- diff --git a/src/List_Item/Kring.ts b/src/List_Item/Kring.ts index 48e9e9e..569bbef 100644 --- a/src/List_Item/Kring.ts +++ b/src/List_Item/Kring.ts @@ -80,7 +80,7 @@ class Kring extends Electro_Item { } allowedChilds() : Array { // returns an array with the type-names of allowed childs - return ["", "Aansluiting", "Bord", "Domotica", "Domotica gestuurde verbruiker", "Kring", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Aansluiting", "Bord", "Domotica", "Domotica gestuurde verbruiker", "Kring", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Media", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; } getMaxNumChilds(): number { diff --git a/src/List_Item/Media.ts b/src/List_Item/Media.ts new file mode 100644 index 0000000..8f2d41c --- /dev/null +++ b/src/List_Item/Media.ts @@ -0,0 +1,71 @@ +class Media extends Electro_Item { + + convertLegacyKeys(mykeys: Array<[string,string,any]>) { + //Nothing to do since Media did not exist when Legacy Keys where still a thing + } + + resetProps() { + this.clearProps(); + this.props.type = "Media"; + this.props.adres = ""; + this.props.aantal = 1; + this.props.symbool = ""; + } + + overrideKeys() { + if (this.props.symbool == 'luidspreker') { + if (this.props.aantal < 1) this.props.aantal = 1; + if (this.props.aantal > 20) this.props.aantal = 20; + } else { + this.props.aantal = 1; + } + } + + toHTML(mode: string) { + this.overrideKeys(); + let output = this.toHTMLHeader(mode); + + output += " Nr: " + this.stringPropToHTML('nr',5) + + ", Symbool: " + this.selectPropToHTML('symbool',["","luidspreker"]); + + if (this.props.symbool == 'luidspreker') { + output += ", Aantal: " + this.selectPropToHTML('aantal',["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"]); + } + + output += ", Adres/tekst: " + this.stringPropToHTML('adres',5); + + return(output); + } + + toSVG() { + let mySVG:SVGelement = new SVGelement(); + + // Alles naar beneden schuiven als we het aantal laders boven het symbool willen plaatsen + var shifty = 0; + if (this.props.aantal>1) { + shifty = 15; + mySVG.data += 'x' + htmlspecialchars(this.props.aantal) + '' + } + + mySVG.xleft = 1; // foresee at least some space for the conductor + mySVG.xright = 59; + mySVG.yup = 25 + shifty; + mySVG.ydown = 25; + + switch (this.props.symbool) { + case "luidspreker": + mySVG.data += '' + + ''; + mySVG.xright = 36; + mySVG.data += this.addAddressToSVG(mySVG,60 + shifty,15,0); + break; + default: + mySVG.data += ''; + mySVG.xright = 19; + break; + } + + return(mySVG); + } + +} \ No newline at end of file diff --git a/src/List_Item/Meerdere_verbruikers.ts b/src/List_Item/Meerdere_verbruikers.ts index 9d4f0b6..00c72ed 100644 --- a/src/List_Item/Meerdere_verbruikers.ts +++ b/src/List_Item/Meerdere_verbruikers.ts @@ -13,7 +13,7 @@ class Meerdere_verbruikers extends Electro_Item { } allowedChilds() : Array { // returns an array with the type-names of allowed childs - return ["", "Domotica", "Domotica gestuurde verbruiker", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Omvormer", "Overspanningsbeveiliging", "Microgolfoven", "Motor", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Domotica", "Domotica gestuurde verbruiker", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Omvormer", "Overspanningsbeveiliging", "Media", "Microgolfoven", "Motor", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; } getMaxNumChilds(): number { diff --git a/src/List_Item/Schakelaars/Schakelaar.ts b/src/List_Item/Schakelaars/Schakelaar.ts index 3e9d895..a9507a4 100644 --- a/src/List_Item/Schakelaars/Schakelaar.ts +++ b/src/List_Item/Schakelaars/Schakelaar.ts @@ -11,13 +11,15 @@ class Schakelaar { verklikkerlamp: boolean; signalisatielamp: boolean; trekschakelaar: boolean; + aantal: number; - constructor(type: String, halfwaterdicht: boolean=false, verklikkerlamp: boolean=false, signalisatielamp: boolean=false, trekschakelaar: boolean=false) { + constructor(type: String, halfwaterdicht: boolean=false, verklikkerlamp: boolean=false, signalisatielamp: boolean=false, trekschakelaar: boolean=false, aantal: number=1) { this.type = type; this.halfwaterdicht = halfwaterdicht; this.verklikkerlamp = verklikkerlamp; this.signalisatielamp = signalisatielamp; this.trekschakelaar = trekschakelaar; + this.aantal = aantal; } schakelaarAttributentoSVGString(endx: number, isdubbel: boolean = false) { @@ -160,6 +162,21 @@ class Schakelaar { return({endx: endx, str: outputstr, lowerbound: null}); } + magneetcontacttoDrawReturnObj(startx: number): drawReturnObj { + let outputstr:string = ""; + let endx = startx + 20; + + // Alles naar beneden schuiven als we het aantal laders boven het symbool willen plaatsen + if (this.aantal>1) { + outputstr += 'x' + htmlspecialchars(this.aantal) + '' + } + + outputstr += '' + + ''; + + return({endx: endx, str: outputstr, lowerbound: null}); + } + defaulttoDrawReturnObj(startx: number, symbol: string): drawReturnObj { let outputstr:string = ""; let endx = startx + 20; @@ -233,6 +250,11 @@ class Schakelaar { endx += 8; lowerbound = Math.max(lowerbound,25); break; + case "magneetcontact": + ( {endx: endx, str: outputstr} = (this.magneetcontacttoDrawReturnObj(startx,)) ); + endx += 20; + lowerbound = Math.max(lowerbound,25); + break; case "schakelaar": ( {endx: endx, str: outputstr} = (this.defaulttoDrawReturnObj(startx,'#schakelaar')) ); endx += 40; @@ -270,7 +292,7 @@ class Schakelaar { ( {endx: endx, str: outputstr} = (this.defaulttoDrawReturnObj(startx,'#tijdschakelaar')) ); endx += 40; lowerbound = Math.max(lowerbound,30); - break; + break; default: endx = 30; //Indien type niet herkend wordt minstens deze variabele definieren } diff --git a/src/List_Item/Schakelaars/Schakelaars.ts b/src/List_Item/Schakelaars/Schakelaars.ts index 2ba496b..1401d9f 100644 --- a/src/List_Item/Schakelaars/Schakelaars.ts +++ b/src/List_Item/Schakelaars/Schakelaars.ts @@ -51,9 +51,10 @@ class Schakelaars extends Electro_Item { overrideKeys() { switch (this.props.type_schakelaar) { - case "enkelpolig": this.props.aantal_schakelaars = String(Math.min(Number(this.props.aantal_schakelaars),5)); break; - case "dubbelpolig": this.props.aantal_schakelaars = String(Math.min(Number(this.props.aantal_schakelaars),2)); break; - default: this.props.aantal_schakelaars = "1"; break; + case "enkelpolig": this.props.aantal_schakelaars = String(Math.min(Number(this.props.aantal_schakelaars),5)); break; + case "dubbelpolig": this.props.aantal_schakelaars = String(Math.min(Number(this.props.aantal_schakelaars),2)); break; + case "magneetcontact": this.props.aantal_schakelaars = String(Math.min(Number(this.props.aantal_schakelaars),20)); break; + default: this.props.aantal_schakelaars = "1"; break; } if (!this.kanHalfwaterdichtZijn) this.props.is_halfwaterdicht = false; if (!this.kanVerklikkerlampjeHebben) this.props.heeft_verklikkerlampje = false; @@ -66,7 +67,7 @@ class Schakelaars extends Electro_Item { let output = this.toHTMLHeader(mode); output += " Nr: " + this.stringPropToHTML('nr',5); - output += ", " + this.selectPropToHTML('type_schakelaar',["enkelpolig", "dubbelpolig", "driepolig", "dubbelaansteking", "wissel_enkel", "wissel_dubbel", "kruis_enkel", "---", "schakelaar", "dimschakelaar", "dimschakelaar wissel", "bewegingsschakelaar", "schemerschakelaar", "---", "teleruptor", "relais", "dimmer", "tijdschakelaar", "minuterie", "thermostaat", "rolluikschakelaar"]); + output += ", " + this.selectPropToHTML('type_schakelaar',["enkelpolig", "dubbelpolig", "driepolig", "dubbelaansteking", "wissel_enkel", "wissel_dubbel", "kruis_enkel", "---", "schakelaar", "dimschakelaar", "dimschakelaar wissel", "bewegingsschakelaar", "schemerschakelaar", "---", "teleruptor", "relais", "dimmer", "tijdschakelaar", "minuterie", "thermostaat", "rolluikschakelaar", "---", "magneetcontact"]); if (this.kanHalfwaterdichtZijn()) output += ", Halfwaterdicht: " + this.checkboxPropToHTML('is_halfwaterdicht'); if (this.kanVerklikkerlampjeHebben()) output += ", Verklikkerlampje: " + this.checkboxPropToHTML('heeft_verklikkerlampje'); @@ -74,8 +75,9 @@ class Schakelaars extends Electro_Item { if (this.kanTrekschakelaarHebben()) output += ", Trekschakelaar: " + this.checkboxPropToHTML('is_trekschakelaar'); switch (this.props.type_schakelaar) { - case "enkelpolig": output += ", Aantal schakelaars: " + this.selectPropToHTML('aantal_schakelaars',["1","2","3","4","5"]); break; - case "dubbelpolig": output += ", Aantal schakelaars: " + this.selectPropToHTML('aantal_schakelaars',["1","2"]); break; + case "enkelpolig": output += ", Aantal schakelaars: " + this.selectPropToHTML('aantal_schakelaars',["1","2","3","4","5"]); break; + case "dubbelpolig": output += ", Aantal schakelaars: " + this.selectPropToHTML('aantal_schakelaars',["1","2"]); break; + case "magneetcontact": output += ", Aantal schakelaars: " + this.selectPropToHTML('aantal_schakelaars',["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"]); break; } output += ", Adres/tekst: " + this.stringPropToHTML('adres',5); @@ -96,6 +98,7 @@ class Schakelaars extends Electro_Item { case "minuterie": tekenKeten.push(new Schakelaar("minuterie")); break; case "thermostaat": tekenKeten.push(new Schakelaar("thermostaat")); break; case "tijdschakelaar": tekenKeten.push(new Schakelaar("tijdschakelaar")); break; + case "magneetcontact": tekenKeten.push(new Schakelaar("magneetcontact",false,false,false,false,this.props.aantal_schakelaars)); break; case "rolluikschakelaar": tekenKeten.push(new Schakelaar("rolluikschakelaar",this.props.is_halfwaterdicht)); break; case "dubbelaansteking": tekenKeten.push(new Schakelaar("dubbelaansteking",this.props.is_halfwaterdicht,this.props.heeft_verklikkerlampje,this.props.heeft_signalisatielampje,this.props.is_trekschakelaar)); break; case "dimschakelaar": tekenKeten.push(new Schakelaar("dimschakelaar",this.props.is_halfwaterdicht,this.props.heeft_verklikkerlampje,this.props.heeft_signalisatielampje,false)); break; diff --git a/src/SVGSymbols.ts b/src/SVGSymbols.ts index 79c82a7..11fa917 100644 --- a/src/SVGSymbols.ts +++ b/src/SVGSymbols.ts @@ -61,6 +61,13 @@ static outputSVGSymbols() { + + + + + + + diff --git a/src/eendraadschema.js b/src/eendraadschema.js index 2807eab..d938863 100644 --- a/src/eendraadschema.js +++ b/src/eendraadschema.js @@ -313,7 +313,7 @@ var Electro_Item = /** @class */ (function (_super) { }; // -- Lijst met toegestande kinderen van het Electro_item -- Electro_Item.prototype.allowedChilds = function () { - return ["", "Aansluiting", "Domotica", "Domotica gestuurde verbruiker", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Aansluiting", "Domotica", "Domotica gestuurde verbruiker", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Media", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; }; // -- Aantal actieve kinderen van het Electro_item -- Electro_Item.prototype.getNumChildsWithKnownType = function () { @@ -465,16 +465,18 @@ var Electro_Item = /** @class */ (function (_super) { return Electro_Item; }(List_Item)); var Schakelaar = /** @class */ (function () { - function Schakelaar(type, halfwaterdicht, verklikkerlamp, signalisatielamp, trekschakelaar) { + function Schakelaar(type, halfwaterdicht, verklikkerlamp, signalisatielamp, trekschakelaar, aantal) { if (halfwaterdicht === void 0) { halfwaterdicht = false; } if (verklikkerlamp === void 0) { verklikkerlamp = false; } if (signalisatielamp === void 0) { signalisatielamp = false; } if (trekschakelaar === void 0) { trekschakelaar = false; } + if (aantal === void 0) { aantal = 1; } this.type = type; this.halfwaterdicht = halfwaterdicht; this.verklikkerlamp = verklikkerlamp; this.signalisatielamp = signalisatielamp; this.trekschakelaar = trekschakelaar; + this.aantal = aantal; } Schakelaar.prototype.schakelaarAttributentoSVGString = function (endx, isdubbel) { if (isdubbel === void 0) { isdubbel = false; } @@ -590,6 +592,17 @@ var Schakelaar = /** @class */ (function () { outputstr += 'h'; return ({ endx: endx, str: outputstr, lowerbound: null }); }; + Schakelaar.prototype.magneetcontacttoDrawReturnObj = function (startx) { + var outputstr = ""; + var endx = startx + 20; + // Alles naar beneden schuiven als we het aantal laders boven het symbool willen plaatsen + if (this.aantal > 1) { + outputstr += 'x' + htmlspecialchars(this.aantal) + ''; + } + outputstr += '' + + ''; + return ({ endx: endx, str: outputstr, lowerbound: null }); + }; Schakelaar.prototype.defaulttoDrawReturnObj = function (startx, symbol) { var outputstr = ""; var endx = startx + 20; @@ -608,7 +621,7 @@ var Schakelaar = /** @class */ (function () { return 0; }; Schakelaar.prototype.toSVGString = function (startx, last) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u; + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v; var outputstr = ""; var endx; var lowerbound = 20; @@ -663,41 +676,46 @@ var Schakelaar = /** @class */ (function () { endx += 8; lowerbound = Math.max(lowerbound, 25); break; + case "magneetcontact": + (_m = (this.magneetcontacttoDrawReturnObj(startx)), endx = _m.endx, outputstr = _m.str); + endx += 20; + lowerbound = Math.max(lowerbound, 25); + break; case "schakelaar": - (_m = (this.defaulttoDrawReturnObj(startx, '#schakelaar')), endx = _m.endx, outputstr = _m.str); + (_o = (this.defaulttoDrawReturnObj(startx, '#schakelaar')), endx = _o.endx, outputstr = _o.str); endx += 40; break; case "schemerschakelaar": - (_o = (this.defaulttoDrawReturnObj(startx, '#schemerschakelaar')), endx = _o.endx, outputstr = _o.str); + (_p = (this.defaulttoDrawReturnObj(startx, '#schemerschakelaar')), endx = _p.endx, outputstr = _p.str); endx += 40; break; case "teleruptor": - (_p = (this.defaulttoDrawReturnObj(startx, '#teleruptor')), endx = _p.endx, outputstr = _p.str); + (_q = (this.defaulttoDrawReturnObj(startx, '#teleruptor')), endx = _q.endx, outputstr = _q.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; case "dimmer": - (_q = (this.defaulttoDrawReturnObj(startx, '#dimmer')), endx = _q.endx, outputstr = _q.str); + (_r = (this.defaulttoDrawReturnObj(startx, '#dimmer')), endx = _r.endx, outputstr = _r.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; case "relais": - (_r = (this.defaulttoDrawReturnObj(startx, '#relais')), endx = _r.endx, outputstr = _r.str); + (_s = (this.defaulttoDrawReturnObj(startx, '#relais')), endx = _s.endx, outputstr = _s.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; case "minuterie": - (_s = (this.defaulttoDrawReturnObj(startx, '#minuterie')), endx = _s.endx, outputstr = _s.str); + (_t = (this.defaulttoDrawReturnObj(startx, '#minuterie')), endx = _t.endx, outputstr = _t.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; case "thermostaat": - (_t = (this.defaulttoDrawReturnObj(startx, '#thermostaat')), endx = _t.endx, outputstr = _t.str); + (_u = (this.defaulttoDrawReturnObj(startx, '#thermostaat')), endx = _u.endx, outputstr = _u.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; case "tijdschakelaar": - (_u = (this.defaulttoDrawReturnObj(startx, '#tijdschakelaar')), endx = _u.endx, outputstr = _u.str); + (_v = (this.defaulttoDrawReturnObj(startx, '#tijdschakelaar')), endx = _v.endx, outputstr = _v.str); endx += 40; lowerbound = Math.max(lowerbound, 30); break; @@ -760,6 +778,9 @@ var Schakelaars = /** @class */ (function (_super) { case "dubbelpolig": this.props.aantal_schakelaars = String(Math.min(Number(this.props.aantal_schakelaars), 2)); break; + case "magneetcontact": + this.props.aantal_schakelaars = String(Math.min(Number(this.props.aantal_schakelaars), 20)); + break; default: this.props.aantal_schakelaars = "1"; break; @@ -777,7 +798,7 @@ var Schakelaars = /** @class */ (function (_super) { this.overrideKeys(); var output = this.toHTMLHeader(mode); output += " Nr: " + this.stringPropToHTML('nr', 5); - output += ", " + this.selectPropToHTML('type_schakelaar', ["enkelpolig", "dubbelpolig", "driepolig", "dubbelaansteking", "wissel_enkel", "wissel_dubbel", "kruis_enkel", "---", "schakelaar", "dimschakelaar", "dimschakelaar wissel", "bewegingsschakelaar", "schemerschakelaar", "---", "teleruptor", "relais", "dimmer", "tijdschakelaar", "minuterie", "thermostaat", "rolluikschakelaar"]); + output += ", " + this.selectPropToHTML('type_schakelaar', ["enkelpolig", "dubbelpolig", "driepolig", "dubbelaansteking", "wissel_enkel", "wissel_dubbel", "kruis_enkel", "---", "schakelaar", "dimschakelaar", "dimschakelaar wissel", "bewegingsschakelaar", "schemerschakelaar", "---", "teleruptor", "relais", "dimmer", "tijdschakelaar", "minuterie", "thermostaat", "rolluikschakelaar", "---", "magneetcontact"]); if (this.kanHalfwaterdichtZijn()) output += ", Halfwaterdicht: " + this.checkboxPropToHTML('is_halfwaterdicht'); if (this.kanVerklikkerlampjeHebben()) @@ -793,6 +814,9 @@ var Schakelaars = /** @class */ (function (_super) { case "dubbelpolig": output += ", Aantal schakelaars: " + this.selectPropToHTML('aantal_schakelaars', ["1", "2"]); break; + case "magneetcontact": + output += ", Aantal schakelaars: " + this.selectPropToHTML('aantal_schakelaars', ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]); + break; } output += ", Adres/tekst: " + this.stringPropToHTML('adres', 5); return (output); @@ -835,6 +859,9 @@ var Schakelaars = /** @class */ (function (_super) { case "tijdschakelaar": tekenKeten.push(new Schakelaar("tijdschakelaar")); break; + case "magneetcontact": + tekenKeten.push(new Schakelaar("magneetcontact", false, false, false, false, this.props.aantal_schakelaars)); + break; case "rolluikschakelaar": tekenKeten.push(new Schakelaar("rolluikschakelaar", this.props.is_halfwaterdicht)); break; @@ -1748,7 +1775,7 @@ var Domotica_gestuurde_verbruiker = /** @class */ (function (_super) { this.props.heeft_externe_sturing = false; }; Domotica_gestuurde_verbruiker.prototype.allowedChilds = function () { - return ["", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Media", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; }; Domotica_gestuurde_verbruiker.prototype.getMaxNumChilds = function () { return 1; @@ -2423,7 +2450,7 @@ var Kring = /** @class */ (function (_super) { } }; Kring.prototype.allowedChilds = function () { - return ["", "Aansluiting", "Bord", "Domotica", "Domotica gestuurde verbruiker", "Kring", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Aansluiting", "Bord", "Domotica", "Domotica gestuurde verbruiker", "Kring", "Meerdere verbruikers", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Media", "Microgolfoven", "Motor", "Omvormer", "Overspanningsbeveiliging", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; }; Kring.prototype.getMaxNumChilds = function () { return 256; @@ -2954,6 +2981,71 @@ var Lichtpunt = /** @class */ (function (_super) { }; return Lichtpunt; }(Electro_Item)); +var Media = /** @class */ (function (_super) { + __extends(Media, _super); + function Media() { + return _super !== null && _super.apply(this, arguments) || this; + } + Media.prototype.convertLegacyKeys = function (mykeys) { + //Nothing to do since Media did not exist when Legacy Keys where still a thing + }; + Media.prototype.resetProps = function () { + this.clearProps(); + this.props.type = "Media"; + this.props.adres = ""; + this.props.aantal = 1; + this.props.symbool = ""; + }; + Media.prototype.overrideKeys = function () { + if (this.props.symbool == 'luidspreker') { + if (this.props.aantal < 1) + this.props.aantal = 1; + if (this.props.aantal > 20) + this.props.aantal = 20; + } + else { + this.props.aantal = 1; + } + }; + Media.prototype.toHTML = function (mode) { + this.overrideKeys(); + var output = this.toHTMLHeader(mode); + output += " Nr: " + this.stringPropToHTML('nr', 5) + + ", Symbool: " + this.selectPropToHTML('symbool', ["", "luidspreker"]); + if (this.props.symbool == 'luidspreker') { + output += ", Aantal: " + this.selectPropToHTML('aantal', ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]); + } + output += ", Adres/tekst: " + this.stringPropToHTML('adres', 5); + return (output); + }; + Media.prototype.toSVG = function () { + var mySVG = new SVGelement(); + // Alles naar beneden schuiven als we het aantal laders boven het symbool willen plaatsen + var shifty = 0; + if (this.props.aantal > 1) { + shifty = 15; + mySVG.data += 'x' + htmlspecialchars(this.props.aantal) + ''; + } + mySVG.xleft = 1; // foresee at least some space for the conductor + mySVG.xright = 59; + mySVG.yup = 25 + shifty; + mySVG.ydown = 25; + switch (this.props.symbool) { + case "luidspreker": + mySVG.data += '' + + ''; + mySVG.xright = 36; + mySVG.data += this.addAddressToSVG(mySVG, 60 + shifty, 15, 0); + break; + default: + mySVG.data += ''; + mySVG.xright = 19; + break; + } + return (mySVG); + }; + return Media; +}(Electro_Item)); var Meerdere_verbruikers = /** @class */ (function (_super) { __extends(Meerdere_verbruikers, _super); function Meerdere_verbruikers() { @@ -2970,7 +3062,7 @@ var Meerdere_verbruikers = /** @class */ (function (_super) { this.props.adres = ""; // Set Adres/tekst to "" when the item is cleared }; Meerdere_verbruikers.prototype.allowedChilds = function () { - return ["", "Domotica", "Domotica gestuurde verbruiker", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Omvormer", "Overspanningsbeveiliging", "Microgolfoven", "Motor", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; + return ["", "Domotica", "Domotica gestuurde verbruiker", "Splitsing", "---", "Batterij", "Bel", "Boiler", "Contactdoos", "Diepvriezer", "Droogkast", "Drukknop", "Elektriciteitsmeter", "Elektrische oven", "EV lader", "Ketel", "Koelkast", "Kookfornuis", "Lichtcircuit", "Lichtpunt", "Omvormer", "Overspanningsbeveiliging", "Media", "Microgolfoven", "Motor", "Schakelaars", "Stoomoven", "Transformator", "USB lader", "Vaatwasmachine", "Ventilator", "Verlenging", "Verwarmingstoestel", "Verbruiker", "Vrije tekst", "Warmtepomp/airco", "Wasmachine", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"]; }; Meerdere_verbruikers.prototype.getMaxNumChilds = function () { return 256; @@ -3988,7 +4080,7 @@ var SVGSymbols = /** @class */ (function () { function SVGSymbols() { } SVGSymbols.outputSVGSymbols = function () { - var output = "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n V\n E\n E\n V\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n S\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n PIR\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n M\n \n \n \n \n kWh\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"\n \n \n \n \n \n \n \n \n \n \"\n \"\n \"\n \n \n \n \n \n \n \n \n \n \n AC/DC\n USB\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n -> shift x -7.5 y -15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n "; + var output = "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n V\n E\n E\n V\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n S\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n PIR\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n M\n \n \n \n \n kWh\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \"\n \n \n \n \n \n \n \n \n \n \"\n \"\n \"\n \n \n \n \n \n \n \n \n \n \n AC/DC\n USB\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n -> shift x -7.5 y -15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n "; return (output); }; return SVGSymbols; @@ -4204,6 +4296,9 @@ var Hierarchical_List = /** @class */ (function () { case 'Meerdere verbruikers': tempval = new Meerdere_verbruikers(structure); break; + case 'Media': + tempval = new Media(structure); + break; case 'Microgolfoven': tempval = new Microgolfoven(structure); break;