Skip to content

Commit

Permalink
Nieuw symbool "Zekering/differentieel" voor horizontale zekeringen.
Browse files Browse the repository at this point in the history
  • Loading branch information
igoethal committed Aug 23, 2024
1 parent abd08d9 commit 28c2643
Show file tree
Hide file tree
Showing 13 changed files with 678 additions and 37 deletions.
2 changes: 1 addition & 1 deletion builddate.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var CONF_builddate="20240715-204933"
var CONF_builddate="20240823-133216"
226 changes: 214 additions & 12 deletions eendraadschema.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions prop/prop_scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ function exportjson() {
listitem.sourcelist = structure;
}

// Compress the output structure and offer as download to the user. We are at version 003
// Compress the output structure and offer as download to the user. We are at version 004
try {
let decoder = new TextDecoder("utf-8");
let encoder = new TextEncoder();
let pako_inflated = new Uint8Array(encoder.encode(text));
let pako_deflated = new Uint8Array(pako.deflate(pako_inflated));
text = "EDS0030000" + btoa(String.fromCharCode.apply(null, pako_deflated));
text = "EDS0040000" + btoa(String.fromCharCode.apply(null, pako_deflated));
} catch (error) {
text = "TXT0030000" + text;
text = "TXT0040000" + text;
} finally {
download_by_blob(text, filename, 'data:text/eds;charset=utf-8');
}
Expand Down
1 change: 1 addition & 0 deletions src/Hierarchical_List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class Hierarchical_List {
case 'Warmtepomp/airco': tempval = new Warmtepomp(structure); break;
case 'Wasmachine': tempval = new Wasmachine(structure); break;
case 'Zeldzame symbolen': tempval = new Zeldzame_symbolen(structure); break;
case 'Zekering/differentieel': tempval = new Zekering(structure); break;
case 'Zonnepaneel': tempval = new Zonnepaneel(structure); break;
default: tempval = new Electro_Item(structure);
}
Expand Down
15 changes: 11 additions & 4 deletions src/List_Item/Bord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,16 @@ class Bord extends Electro_Item {

// Schuif het geheel voldoende naar links om plaats te hebben voor label en eventuele aarding

let mintextsize = Math.max(30, svgTextWidth('&lt'+htmlspecialchars(this.props.naam)+'&gt',10,'font-weight="bold"') + 13);
let mintextsize = Math.max(30, svgTextWidth(htmlspecialchars(this.props.naam),10,'font-weight="bold"') + 13);
let minxleft = mintextsize + (this.props.is_geaard ? 70 : 0); //Indien geaard hebben we 70 meer nodig

if (this.isChildOf("Aansluiting")) {
let maxTotalSize = 145;
if (this.getParent().props.type_kabel_voor_teller != "") maxTotalSize = maxTotalSize + 50;
let lengthToAdd = Math.max(0,(maxTotalSize - minxleft));
mintextsize = mintextsize + lengthToAdd;
minxleft = minxleft + lengthToAdd;
}

if (mySVG.xleft <= minxleft) { // Minstens 100 pixels indien aarding
mySVG.xright = mySVG.xleft + mySVG.xright - minxleft;
mySVG.xleft = minxleft;
Expand All @@ -65,8 +72,8 @@ class Bord extends Electro_Item {
// Voeg naam van het bord toe
if (this.props.naam !== "")
mySVG.data += '<text x="' + (5) + '" y="' + (mySVG.yup + 13) + '" '
+ 'style="text-anchor:start" font-family="Arial, Helvetica, sans-serif" font-weight="bold" font-size="10">&lt;'
+ htmlspecialchars(this.props.naam)+'&gt;</text>';
+ 'style="text-anchor:start" font-family="Arial, Helvetica, sans-serif" font-weight="bold" font-size="10">'
+ htmlspecialchars(this.props.naam)+'</text>';

// Teken aarding onderaan
if (this.props.is_geaard)
Expand Down
2 changes: 1 addition & 1 deletion src/List_Item/Domotica_verticaal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Domotica_verticaal extends Electro_Item {
}

allowedChilds() : Array<string> { // returns an array with the type-names of allowed childs
return ["", "Aansluiting", "Domotica", "Domotica gestuurde verbruiker", "Leiding", "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"];
return ["", "Aansluiting", "Domotica", "Domotica module (verticaal)", "Domotica gestuurde verbruiker", "Leiding", "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", "Zekering/differentieel", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"];
}

getMaxNumChilds(): number {
Expand Down
10 changes: 8 additions & 2 deletions src/List_Item/Electro_Item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Electro_Item extends List_Item {
// -- Lijst met toegestande kinderen van het Electro_item --

allowedChilds() : Array<string> {
return ["", "Aansluiting", "Domotica", "Domotica module (verticaal)", "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"];
return ["", "Aansluiting", "Domotica", "Domotica module (verticaal)", "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", "Zekering/differentieel", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"];
}

// -- Aantal actieve kinderen van het Electro_item --
Expand Down Expand Up @@ -103,6 +103,12 @@ class Electro_Item extends List_Item {

getType() : string { return this.props.type; }

// -- Checken of parent een gevraagd type is --

isChildOf(typestr: string) {
if (this.parent != 0) return (this.getParent().getType() == typestr); else return false;
}

//-- Clear all keys, met uitzondering van nr indien er een nummer is --

clearProps() {
Expand Down Expand Up @@ -163,7 +169,7 @@ class Electro_Item extends List_Item {
let parent:Electro_Item = this.getParent();
let consumerArray;

if (parent == null) consumerArray = ["", "Kring", "Aansluiting"];
if (parent == null) consumerArray = ["", "Aansluiting", "Zekering/differentieel", "Kring"];
else consumerArray = this.getParent().allowedChilds()

output += this.selectPropToHTML('type', consumerArray);
Expand Down
2 changes: 1 addition & 1 deletion src/List_Item/Kring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Kring extends Electro_Item {
}

allowedChilds() : Array<string> { // returns an array with the type-names of allowed childs
return ["", "Aansluiting", "Bord", "Domotica", "Domotica module (verticaal)", "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"];
return ["", "Aansluiting", "Bord", "Domotica", "Domotica module (verticaal)", "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", "Zekering/differentieel", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"];
}

getMaxNumChilds(): number {
Expand Down
2 changes: 1 addition & 1 deletion src/List_Item/Meerdere_verbruikers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Meerdere_verbruikers extends Electro_Item {
}

allowedChilds() : Array<string> { // 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", "Media", "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", "Zekering/differentieel", "Zonnepaneel", "---", "Aansluitpunt", "Aftakdoos", "Leeg", "Zeldzame symbolen"];
}

getMaxNumChilds(): number {
Expand Down
Loading

0 comments on commit 28c2643

Please sign in to comment.