-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Aparte class voor Bord en deze class houdt nu ook rekening met de lengte van de naam van het bord # Kleine correctie bij de lengteberekening van de tekst in het Domotica symbool
- Loading branch information
Showing
8 changed files
with
342 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
var CONF_builddate="20231222-080521" | ||
var CONF_builddate="20231222-122151" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
class Bord extends Electro_Item { | ||
|
||
constructor(mylist: Hierarchical_List) { super(mylist); } | ||
|
||
resetKeys() { | ||
this.clearKeys(); | ||
this.keys[0][2] = "Bord"; // This is rather a formality as we should already have this at this stage | ||
this.keys[1][2] = true; // Per default geaard | ||
this.keys[15][2] = ""; // Set Adres/tekst to "" when the item is cleared | ||
} | ||
|
||
toHTML(mode: string, Parent?: List_Item) { | ||
let output = this.toHTMLHeader(mode, Parent); | ||
|
||
output += " Naam: " + this.stringToHTML(10,5) + ", " | ||
+ "Geaard: " + this.checkboxToHTML(1); | ||
|
||
return(output); | ||
} | ||
|
||
toSVG() { | ||
let mySVG:SVGelement; // = new SVGelement(); | ||
|
||
// Maak een tekening van alle kinderen | ||
mySVG = this.sourcelist.toSVG(this.id,"horizontal"); | ||
|
||
// Voorzie 10 extra pixels rechts na de allerlaatste kring | ||
mySVG.xright += 10; | ||
|
||
// Schuif het geheel voldoende naar links om plaats te hebben voor label en eventuele aarding | ||
|
||
let mintextsize = Math.max(30, svgTextWidth('<'+htmlspecialchars(this.keys[10][2])+'>',10,'font-weight="bold"') + 13); | ||
let minxleft = mintextsize + (this.keys[1][2] ? 70 : 0); //Indien geaard hebben we 70 meer nodig | ||
|
||
if (mySVG.xleft <= minxleft) { // Minstens 100 pixels indien aarding | ||
mySVG.xright = mySVG.xleft + mySVG.xright - minxleft; | ||
mySVG.xleft = minxleft; | ||
} | ||
|
||
// Indien door het schuiven er niets rechts over blijft, voorzie minstens 10 pixels | ||
if (mySVG.xright <=10) mySVG.xright = 10; | ||
|
||
// Voorzie voldoende plaats voor de lijn onderaan | ||
mySVG.ydown = Math.max(mySVG.ydown,1); | ||
|
||
// Teken de lijn onderaan | ||
mySVG.data += '<line x1="4" x2="' + (mySVG.xleft + mySVG.xright - 6) + | ||
'" y1="' + mySVG.yup + '" y2="' + mySVG.yup + '" stroke="black" stroke-width="3" />' | ||
|
||
// Voeg naam van het bord toe | ||
if (this.keys[10][2] !== "") | ||
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"><' | ||
+ htmlspecialchars(this.keys[10][2])+'></text>'; | ||
|
||
// Teken aarding onderaan | ||
if (this.keys[1][2]) | ||
mySVG.data += '<line x1="' + (mintextsize + 10) + '" y1="' + (mySVG.yup + 0) + '" x2="' + (mintextsize + 10) + '" y2="' + (mySVG.yup + 10) + '" stroke="black" />' | ||
+ '<line x1="' + (mintextsize + 10) + '" y1="' + (mySVG.yup + 15) + '" x2="' + (mintextsize + 10) + '" y2="' + (mySVG.yup + 25) + '" stroke="black" />' | ||
+ '<line x1="' + (mintextsize + 10) + '" y1="' + (mySVG.yup + 30) + '" x2="' + (mintextsize + 10) + '" y2="' + (mySVG.yup + 40) + '" stroke="black" />' | ||
+ '<line x1="' + (mintextsize + 5) + '" y1="' + (mySVG.yup + 10) + '" x2="' + (mintextsize + 15) + '" y2="' + (mySVG.yup + 10) + '" stroke="black" />' | ||
+ '<line x1="' + (mintextsize + 5) + '" y1="' + (mySVG.yup + 15) + '" x2="' + (mintextsize + 15) + '" y2="' + (mySVG.yup + 15) + '" stroke="black" />' | ||
+ '<line x1="' + (mintextsize + 5) + '" y1="' + (mySVG.yup + 25) + '" x2="' + (mintextsize + 15) + '" y2="' + (mySVG.yup + 25) + '" stroke="black" />' | ||
+ '<line x1="' + (mintextsize + 5) + '" y1="' + (mySVG.yup + 30) + '" x2="' + (mintextsize + 15) + '" y2="' + (mySVG.yup + 30) + '" stroke="black" />' | ||
+ '<line x1="' + (mintextsize + 0) + '" y1="' + (mySVG.yup + 40) + '" x2="' + (mintextsize + 20) + '" y2="' + (mySVG.yup + 40) + '" stroke="black" />' | ||
+ '<line x1="' + (mintextsize + 2.5) + '" y1="' + (mySVG.yup + 43) + '" x2="' + (mintextsize + 17.5) + '" y2="' + (mySVG.yup + 43) + '" stroke="black" />' | ||
+ '<line x1="' + (mintextsize + 5) + '" y1="' + (mySVG.yup + 46) + '" x2="' + (mintextsize + 15) + '" y2="' + (mySVG.yup + 46) + '" stroke="black" />'; | ||
|
||
return(mySVG); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class Splitsing extends Electro_Item { | ||
|
||
constructor(mylist: Hierarchical_List) { super(mylist); } | ||
|
||
resetKeys() { | ||
this.clearKeys(); | ||
this.keys[0][2] = "Splitsing"; // This is rather a formality as we should already have this at this stage | ||
this.keys[15][2] = ""; // Set Adres/tekst to "" when the item is cleared | ||
} | ||
|
||
toHTML(mode: string, Parent?: List_Item) { | ||
let output = this.toHTMLHeader(mode, Parent); | ||
|
||
return(output); | ||
} | ||
|
||
toSVG() { | ||
let mySVG:SVGelement; // = new SVGelement(); | ||
|
||
// Maak een tekening van alle kinderen | ||
mySVG = this.sourcelist.toSVG(this.id,"horizontal"); | ||
|
||
let parent = this.getParent(); | ||
|
||
// Teken de lijn onderaan | ||
if ( (parent.keys[0][2] == "Aansluiting") || (parent.keys[0][2] == "Kring") ) { | ||
mySVG.data += '<line x1="' + (mySVG.xleft) + '" x2="' + (mySVG.xleft + mySVG.xrightmin) | ||
+ '" y1="' + mySVG.yup + '" y2="' + mySVG.yup + '" stroke="black" />' | ||
|
||
} else { | ||
|
||
if ( (mySVG.xleft + mySVG.xright) <=0 ) mySVG.xrightmin = 15; // We teken altijd minstens een lijntje van 15 pixels om duidelijk te maken dat er een splitsing is | ||
|
||
if (mySVG.yup < 25) mySVG.yup = 25; | ||
if (mySVG.ydown < 25) mySVG.ydown = 25; | ||
|
||
mySVG.data += '<line x1="' + (1) + '" x2="' + (mySVG.xleft + mySVG.xrightmin) | ||
+ '" y1="' + mySVG.yup + '" y2="' + mySVG.yup + '" stroke="black" />' | ||
|
||
mySVG.xright = mySVG.xright + mySVG.xleft; | ||
mySVG.xleft = 1; //we leave one pixel for the bold kring-line at the left | ||
} | ||
|
||
return(mySVG); | ||
} | ||
|
||
} |
Oops, something went wrong.