@@ -33,7 +33,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
33
33
function verb(n) { return function (v) { return step([n, v]); }; }
34
34
function step(op) {
35
35
if (f) throw new TypeError("Generator is already executing.");
36
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
36
+ while (_) try {
37
37
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
38
38
if (y = 0, t) op = [op[0] & 2, t.value];
39
39
switch (op[0]) {
@@ -3904,6 +3904,14 @@ var Electro_Item = /** @class */ (function (_super) {
3904
3904
//this.updateSituationPlanElement(myElement); //Lijkt niet nodig aangezien dit zoiezo gebeurt in getScaledSVG bij iedere update
3905
3905
return (myElement);
3906
3906
};
3907
+ Electro_Item.prototype.getSitPlanBoundaries = function () {
3908
+ return {
3909
+ clipleft: 12,
3910
+ addright: 0,
3911
+ cliptop: 0,
3912
+ addbottom: 0
3913
+ };
3914
+ };
3907
3915
Electro_Item.prototype.updateSituationPlanElement = function (myElement) {
3908
3916
var spiegeltext = false;
3909
3917
var rotate = myElement.rotate % 360;
@@ -3913,18 +3921,17 @@ var Electro_Item = /** @class */ (function (_super) {
3913
3921
var mySVGElement = this.toSVG(true, spiegeltext);
3914
3922
var sizex = mySVGElement.xright + mySVGElement.xleft + 10;
3915
3923
var sizey = mySVGElement.yup + mySVGElement.ydown;
3916
- var clipleft = 0 ;
3917
- if (['Contactdoos', 'Bel'].includes( this.getType() )) {
3918
- clipleft = 0;
3919
- }
3920
- else {
3921
- clipleft = 12 ;
3924
+ var boundaries = this.getSitPlanBoundaries() ;
3925
+ switch ( this.getType()) {
3926
+ case 'Contactdoos':
3927
+ case 'Bel':
3928
+ boundaries.clipleft = 0;
3929
+ break ;
3922
3930
}
3923
- var addright = 0;
3924
- var width = sizex - clipleft + addright;
3925
- var height = sizey;
3931
+ var width = sizex - boundaries.clipleft + boundaries.addright;
3932
+ var height = sizey - boundaries.cliptop + boundaries.addbottom;
3926
3933
myElement.updateElectroItemSVG('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" transform="scale(1,1)" ' +
3927
- "viewBox=\"".concat(clipleft, " 0 " ).concat(sizex - clipleft, " ").concat(sizey, "\" width=\"").concat(width, "\" height=\"").concat(height, "\">") +
3934
+ "viewBox=\"".concat(boundaries. clipleft, " ").concat(boundaries.cliptop, " " ).concat(sizex - boundaries. clipleft + boundaries.addright , " ").concat(sizey - boundaries.cliptop + boundaries.addbottom , "\" width=\"").concat(width, "\" height=\"").concat(height, "\">") +
3928
3935
SVGSymbols.getNeededSymbols() + // enkel de symbolen die nodig zijn voor dit element
3929
3936
mySVGElement.data +
3930
3937
'</svg>', width, height);
@@ -6827,7 +6834,7 @@ var Media = /** @class */ (function (_super) {
6827
6834
this.props.symbool = "";
6828
6835
};
6829
6836
Media.prototype.overrideKeys = function () {
6830
- if (this.props.symbool == 'luidspreker' ) {
6837
+ if (['luidspreker', 'intercom'].includes( this.props.symbool) ) {
6831
6838
if (this.props.aantal < 1)
6832
6839
this.props.aantal = 1;
6833
6840
if (this.props.aantal > 20)
@@ -6841,8 +6848,8 @@ var Media = /** @class */ (function (_super) {
6841
6848
this.overrideKeys();
6842
6849
var output = this.toHTMLHeader(mode);
6843
6850
output += " " + this.nrToHtml()
6844
- + "Symbool: " + this.selectPropToHTML('symbool', ["", "luidspreker"]);
6845
- if (this.props.symbool == 'luidspreker' ) {
6851
+ + "Symbool: " + this.selectPropToHTML('symbool', ["", "luidspreker", "intercom" ]);
6852
+ if (['luidspreker', 'intercom'].includes( this.props.symbool) ) {
6846
6853
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"]);
6847
6854
}
6848
6855
output += ", Adres/tekst: " + this.stringPropToHTML('adres', 5);
@@ -6854,28 +6861,66 @@ var Media = /** @class */ (function (_super) {
6854
6861
SVGSymbols.addSymbol('luidspreker');
6855
6862
// Alles naar beneden schuiven als we het aantal laders boven het symbool willen plaatsen
6856
6863
var shifty = 0;
6857
- if (this.props.aantal > 1) {
6858
- shifty = 15;
6859
- mySVG.data += '<text x="31" y="12" style="text-anchor:middle" font-family="Arial, Helvetica, sans-serif" font-size="10">x' + htmlspecialchars(this.props.aantal) + '</text>';
6864
+ if ((this.props.aantal > 1) && (!sitplan) && (['luidspreker', 'intercom'].includes(this.props.symbool))) {
6865
+ switch (this.props.symbool) {
6866
+ case "luidspreker":
6867
+ shifty = 15;
6868
+ mySVG.data += '<text x="31" y="12" style="text-anchor:middle" font-family="Arial, Helvetica, sans-serif" font-size="10">x' + htmlspecialchars(this.props.aantal) + '</text>';
6869
+ break;
6870
+ case "intercom":
6871
+ shifty = 5;
6872
+ mySVG.data += '<text x="36" y="12" style="text-anchor:middle" font-family="Arial, Helvetica, sans-serif" font-size="10">x' + htmlspecialchars(this.props.aantal) + '</text>';
6873
+ break;
6874
+ }
6860
6875
}
6861
6876
mySVG.xleft = 1; // foresee at least some space for the conductor
6862
6877
mySVG.xright = 59;
6863
6878
mySVG.yup = 25 + shifty;
6864
6879
mySVG.ydown = 25;
6865
6880
switch (this.props.symbool) {
6866
6881
case "luidspreker":
6867
- mySVG.data += (sitplan ? '' : '<line x1="1" y1="' + (25 + shifty) + '" x2="21" y2="' + (25 + shifty) + '" stroke="black"></line >');
6868
- mySVG.data += '<use xlink:href="#luidspreker" x="21" y="' + (25 + shifty) + '"></use >';
6882
+ mySVG.data += (sitplan ? '' : '<line x1="1" y1="' + (25 + shifty) + '" x2="21" y2="' + (25 + shifty) + '" stroke="black" / >');
6883
+ mySVG.data += '<use xlink:href="#luidspreker" x="21" y="' + (25 + shifty) + '" / >';
6869
6884
mySVG.xright = 36;
6870
6885
mySVG.data += (sitplan ? '' : this.addAddressToSVG(mySVG, 60 + shifty, 15, 0));
6871
6886
break;
6887
+ case "intercom":
6888
+ mySVG.data += (sitplan ? '' : '<line x1="1" y1="' + (25 + shifty) + '" x2="21" y2="' + (25 + shifty) + '" stroke="black" />');
6889
+ mySVG.data += "<rect x=\"21\" y=\"".concat((15 + shifty), "\" width=\"30\" height=\"20\" stroke=\"black\" fill=\"none\" />");
6890
+ mySVG.data += "<rect x=\"36\" y=\"".concat((20 + shifty), "\" width=\"4\" height=\"10\" stroke=\"black\" fill=\"none\" />");
6891
+ mySVG.data += "<line x1=\"40\" y1=\"".concat((20 + shifty), "\" x2=\"51\" y2=\"").concat((15 + shifty), "\" stroke=\"black\" />");
6892
+ mySVG.data += "<line x1=\"40\" y1=\"".concat((30 + shifty), "\" x2=\"51\" y2=\"").concat((35 + shifty), "\" stroke=\"black\" />");
6893
+ mySVG.data += "<line x1=\"46\" y1=\"".concat((25 + shifty), "\" x2=\"56\" y2=\"").concat((25 + shifty), "\" stroke=\"black\" stroke-width=\"2\" />");
6894
+ mySVG.data += "<line x1=\"46\" y1=\"".concat((25 + shifty), "\" x2=\"48\" y2=\"").concat((23 + shifty), "\" stroke=\"black\" stroke-width=\"1\" stroke-linecap=\"round\" />");
6895
+ mySVG.data += "<line x1=\"46\" y1=\"".concat((25 + shifty), "\" x2=\"48\" y2=\"").concat((27 + shifty), "\" stroke=\"black\" stroke-width=\"1\" stroke-linecap=\"round\" />");
6896
+ mySVG.data += "<line x1=\"56\" y1=\"".concat((25 + shifty), "\" x2=\"54\" y2=\"").concat((23 + shifty), "\" stroke=\"black\" stroke-width=\"1\" stroke-linecap=\"round\" />");
6897
+ mySVG.data += "<line x1=\"56\" y1=\"".concat((25 + shifty), "\" x2=\"54\" y2=\"").concat((27 + shifty), "\" stroke=\"black\" stroke-width=\"1\" stroke-linecap=\"round\" />");
6898
+ mySVG.xright = 54;
6899
+ mySVG.data += (sitplan ? '' : this.addAddressToSVG(mySVG, 50 + shifty, 5, -3));
6900
+ break;
6872
6901
default:
6873
6902
mySVG.data += (sitplan ? '' : '<line x1="1" y1="25" x2="21" y2="25" stroke="black"></line>');
6874
6903
mySVG.xright = 19;
6875
6904
break;
6876
6905
}
6877
6906
return (mySVG);
6878
6907
};
6908
+ Media.prototype.getSitPlanBoundaries = function () {
6909
+ var clipleft = 12;
6910
+ var addright = 0;
6911
+ var cliptop = 0;
6912
+ var addbottom = 0;
6913
+ switch (this.props.symbool) {
6914
+ case 'luidspreker':
6915
+ break;
6916
+ case 'intercom':
6917
+ addright = -5;
6918
+ cliptop = 5;
6919
+ addbottom = -5;
6920
+ break;
6921
+ }
6922
+ return ({ clipleft: clipleft, addright: addright, cliptop: cliptop, addbottom: addbottom });
6923
+ };
6879
6924
return Media;
6880
6925
}(Electro_Item));
6881
6926
var Meerdere_verbruikers = /** @class */ (function (_super) {
0 commit comments