@crystaldesign/web-planner-logic 25.1.0-beta.44 → 25.1.0-beta.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/{DivaBoxPlanner-c16778e5.js → DivaBoxPlanner-af1807d8.js} +1754 -894
- package/build/cjs/{DivaStandardPlanner-98786ac5.js → DivaStandardPlanner-9ee8bca6.js} +14 -3
- package/build/cjs/{DoorPlanner-3946b7e7.js → DoorPlanner-dbd6bc6c.js} +1 -1
- package/build/cjs/{Host3DSignalR-5463d152.js → Host3DSignalR-4a3e70ed.js} +1 -1
- package/build/cjs/{LiviqueWWSHandler-da51bbc2.js → LiviqueWWSHandler-aa95d52a.js} +1 -1
- package/build/cjs/{PfisterWWSHandler-1f069ef9.js → PfisterWWSHandler-a94d4013.js} +1 -1
- package/build/cjs/{PlannerHandler2D-3fd88d44.js → PlannerHandler2D-ddb09d94.js} +1 -1
- package/build/cjs/{SeriousBasketHandler-856e436f.js → SeriousBasketHandler-2bc074bf.js} +17 -13
- package/build/cjs/{ShelfPlanner-56ecc92f.js → ShelfPlanner-3f113cf2.js} +1 -1
- package/build/cjs/{StandardWWSHandler-4ec804f8.js → StandardWWSHandler-4f2cdbee.js} +1 -1
- package/build/cjs/{index-7d055329.js → index-89f4528c.js} +175 -92
- package/build/cjs/index.js +1 -1
- package/build/esm/{DivaBoxPlanner-e8f203eb.js → DivaBoxPlanner-92b98d12.js} +1753 -893
- package/build/esm/{DivaStandardPlanner-ca0b16b0.js → DivaStandardPlanner-48846cb5.js} +14 -3
- package/build/esm/{DoorPlanner-edbec8ca.js → DoorPlanner-dd5895c0.js} +1 -1
- package/build/esm/{Host3DSignalR-6e275423.js → Host3DSignalR-d0af0f1f.js} +1 -1
- package/build/esm/{LiviqueWWSHandler-2c3ca832.js → LiviqueWWSHandler-38e9535f.js} +1 -1
- package/build/esm/{PfisterWWSHandler-55f007a2.js → PfisterWWSHandler-aeca0426.js} +1 -1
- package/build/esm/{PlannerHandler2D-c759f4f7.js → PlannerHandler2D-c9096881.js} +1 -1
- package/build/esm/{SeriousBasketHandler-06e543a0.js → SeriousBasketHandler-3ba6d570.js} +17 -13
- package/build/esm/{ShelfPlanner-38220b17.js → ShelfPlanner-1cccc3a5.js} +1 -1
- package/build/esm/{StandardWWSHandler-6e6867de.js → StandardWWSHandler-0975c1eb.js} +1 -1
- package/build/esm/{index-9c548e2e.js → index-32e677d7.js} +175 -92
- package/build/esm/index.js +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts +3 -1
- package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Articles/PartListArticleToLoadType.d.ts +3 -1
- package/build/types/web-planner-logic/src/interface/Articles/PartListArticleToLoadType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts +4 -2
- package/build/types/web-planner-logic/src/interface/FunctionTypes/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/OptionTypes/DecisionType.d.ts +2 -0
- package/build/types/web-planner-logic/src/interface/OptionTypes/DecisionType.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/Planner/IDivaPlanner.d.ts +3 -1
- package/build/types/web-planner-logic/src/interface/Planner/IDivaPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/interface/ReturnTypes/index.d.ts +1 -0
- package/build/types/web-planner-logic/src/interface/ReturnTypes/index.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +13 -1
- package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/BoxPlannerGrid.d.ts +148 -33
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/BoxPlannerGrid.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/BoxPlannerPartlistHelper.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/ConstructionRulesHandler.d.ts +2 -2
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/ConstructionRulesHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/DivaBoxPlanner.d.ts +3 -1
- package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/DivaBoxPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts +3 -1
- package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts +4 -2
- package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +7 -0
- package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts +1 -1
- package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/model/Planner/BoxPlannerData.d.ts +28 -0
- package/build/types/web-planner-logic/src/model/Planner/BoxPlannerData.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/model/Planner/PlannerInteractionData.d.ts +29 -0
- package/build/types/web-planner-logic/src/model/Planner/PlannerInteractionData.d.ts.map +1 -0
- package/build/types/web-planner-logic/src/test/datas/idm_text_routine.d.ts.map +1 -1
- package/build/types/web-planner-logic/src/test/datas/pfister_test_routine.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -5,10 +5,10 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
|
|
|
5
5
|
var _createClass = require('@babel/runtime/helpers/createClass');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
7
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
8
|
-
var index = require('./index-
|
|
8
|
+
var index = require('./index-89f4528c.js');
|
|
9
9
|
var DivaUtils = require('@crystaldesign/diva-utils');
|
|
10
10
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
11
|
-
var PlannerHandler2D = require('./PlannerHandler2D-
|
|
11
|
+
var PlannerHandler2D = require('./PlannerHandler2D-ddb09d94.js');
|
|
12
12
|
require('@babel/runtime/helpers/slicedToArray');
|
|
13
13
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
14
14
|
require('axios');
|
|
@@ -57,23 +57,35 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
57
57
|
}, {
|
|
58
58
|
key: "getGroundPlatesNumOfRightNeighbors",
|
|
59
59
|
value: function getGroundPlatesNumOfRightNeighbors(curElement, boxPlannerGrid, optionHandler) {
|
|
60
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
61
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function getGroundPlatesNumOfRightNeighbors not supported for complex boxPlaner', {
|
|
62
|
+
code: 'WC_0012'
|
|
63
|
+
}));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
60
66
|
var plateCount = 0;
|
|
61
67
|
if (this.getElementHasBottomPlate(curElement, optionHandler)) plateCount++;
|
|
62
68
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
63
69
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
64
70
|
if (this.getElementHasBottomPlate(opposideElement, optionHandler)) plateCount++;
|
|
65
71
|
if (boxPlannerGrid.getElementHasRightElement(curElement.getElementId())) {
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
var rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
73
|
+
if (rightElements.length > 0) {
|
|
74
|
+
var rightElement = rightElements[0];
|
|
75
|
+
var rightOpposideElemnt = boxPlannerGrid.getOppositeElement(rightElement.getElementId());
|
|
76
|
+
if (this.getElementHasBottomPlate(rightElement, optionHandler)) plateCount++;
|
|
77
|
+
if (this.getElementHasBottomPlate(rightOpposideElemnt, optionHandler)) plateCount++;
|
|
78
|
+
}
|
|
70
79
|
return plateCount;
|
|
71
80
|
}
|
|
72
81
|
return plateCount;
|
|
73
82
|
} else {
|
|
74
83
|
if (boxPlannerGrid.getElementHasRightElement(curElement.getElementId())) {
|
|
75
|
-
var
|
|
76
|
-
if (
|
|
84
|
+
var _rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
85
|
+
if (_rightElements.length > 0) {
|
|
86
|
+
var _rightElement = _rightElements[0];
|
|
87
|
+
if (this.getElementHasBottomPlate(_rightElement, optionHandler)) plateCount++;
|
|
88
|
+
}
|
|
77
89
|
return plateCount;
|
|
78
90
|
}
|
|
79
91
|
return plateCount;
|
|
@@ -82,23 +94,35 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
82
94
|
}, {
|
|
83
95
|
key: "getTopPlatesNumOfRightNeighbors",
|
|
84
96
|
value: function getTopPlatesNumOfRightNeighbors(curElement, boxPlannerGrid, optionHandler) {
|
|
97
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
98
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function getTopPlatesNumOfRightNeighbors not supported for complex boxPlaner', {
|
|
99
|
+
code: 'WC_0012'
|
|
100
|
+
}));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
85
103
|
var plateCount = 0;
|
|
86
104
|
if (this.getElementHasTopPlate(curElement, boxPlannerGrid, optionHandler)) plateCount++;
|
|
87
105
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
88
106
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
89
107
|
if (this.getElementHasTopPlate(opposideElement, boxPlannerGrid, optionHandler)) plateCount++;
|
|
90
108
|
if (boxPlannerGrid.getElementHasRightElement(curElement.getElementId())) {
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
109
|
+
var rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
110
|
+
if (rightElements.length > 0) {
|
|
111
|
+
var rightElement = rightElements[0];
|
|
112
|
+
var rightOpposideElemnt = boxPlannerGrid.getOppositeElement(rightElement.getElementId());
|
|
113
|
+
if (this.getElementHasTopPlate(rightElement, boxPlannerGrid, optionHandler)) plateCount++;
|
|
114
|
+
if (this.getElementHasTopPlate(rightOpposideElemnt, boxPlannerGrid, optionHandler)) plateCount++;
|
|
115
|
+
}
|
|
95
116
|
return plateCount;
|
|
96
117
|
}
|
|
97
118
|
return plateCount;
|
|
98
119
|
} else {
|
|
99
120
|
if (boxPlannerGrid.getElementHasRightElement(curElement.getElementId())) {
|
|
100
|
-
var
|
|
101
|
-
if (
|
|
121
|
+
var _rightElements2 = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
122
|
+
if (_rightElements2.length > 0) {
|
|
123
|
+
var _rightElement2 = _rightElements2[0];
|
|
124
|
+
if (this.getElementHasTopPlate(_rightElement2, boxPlannerGrid, optionHandler)) plateCount++;
|
|
125
|
+
}
|
|
102
126
|
return plateCount;
|
|
103
127
|
}
|
|
104
128
|
return plateCount;
|
|
@@ -133,7 +157,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
133
157
|
}, {
|
|
134
158
|
key: "calculateRahmen",
|
|
135
159
|
value: function calculateRahmen(boxPlannerGrid, optionHandler) {
|
|
136
|
-
var allElements = boxPlannerGrid.
|
|
160
|
+
var allElements = boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
137
161
|
for (var i = 0; i < allElements.length; i++) {
|
|
138
162
|
if (this.constructionRules.VarticalRahmenInfo) {
|
|
139
163
|
this.correctRahmenVerticalLeftFront(allElements[i], boxPlannerGrid, optionHandler);
|
|
@@ -163,7 +187,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
163
187
|
key: "correctRahmenDepthLeftBottom",
|
|
164
188
|
value: function correctRahmenDepthLeftBottom(curElement, boxPlannerGrid, optionHandler) {
|
|
165
189
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_LeftBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
166
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
190
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
167
191
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
168
192
|
|
|
169
193
|
//Only set the bottom left Tiefenverbinder if the element is on the ground
|
|
@@ -208,7 +232,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
208
232
|
key: "correctRahmenDepthLeftTop",
|
|
209
233
|
value: function correctRahmenDepthLeftTop(curElement, boxPlannerGrid, optionHandler) {
|
|
210
234
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_LeftTop, this.constructionRules.DepthRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
211
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
235
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
212
236
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
213
237
|
|
|
214
238
|
//ONly set this Tiefenverbidner wenn es links kein Element gibt
|
|
@@ -270,8 +294,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
270
294
|
}, {
|
|
271
295
|
key: "correctRahmenDepthRightBottom",
|
|
272
296
|
value: function correctRahmenDepthRightBottom(curElement, boxPlannerGrid, optionHandler) {
|
|
297
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
298
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctRahmenDepthRightBottom not supported for complex boxPlaner', {
|
|
299
|
+
code: 'WC_0012'
|
|
300
|
+
}));
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
273
303
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
274
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
304
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
275
305
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
276
306
|
if (boxPlannerGrid.getElementHasBottomElement(curElement.getElementId())) return;
|
|
277
307
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
@@ -299,31 +329,34 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
299
329
|
//-> Setze breitenverbindung
|
|
300
330
|
//Sonst
|
|
301
331
|
//-> Setze Tiefenverbinder
|
|
302
|
-
var
|
|
303
|
-
if (
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
332
|
+
var rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
333
|
+
if (rightElements.length > 0) {
|
|
334
|
+
var rightElement = rightElements[0];
|
|
335
|
+
if (!this.getElementHasBottomPlate(curElement, optionHandler) || this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
336
|
+
switch (this.getElementDepth(curElement, optionHandler)) {
|
|
337
|
+
case '18':
|
|
338
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
339
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_18_chrom, optionHandler);
|
|
340
|
+
break;
|
|
341
|
+
case '37':
|
|
342
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
343
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_37_chrom, optionHandler);
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
} else if (!this.getElementHasBottomPlate(rightElement, optionHandler) || this.getElementIsCornerElement(rightElement, optionHandler)) {
|
|
347
|
+
switch (this.getElementDepth(curElement, optionHandler)) {
|
|
348
|
+
case '18':
|
|
349
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
350
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_18_chrom, optionHandler);
|
|
351
|
+
break;
|
|
352
|
+
case '37':
|
|
353
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
354
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_37_chrom, optionHandler);
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
} else {
|
|
358
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenTV_Middle_chrom, optionHandler);
|
|
324
359
|
}
|
|
325
|
-
} else {
|
|
326
|
-
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenTV_Middle_chrom, optionHandler);
|
|
327
360
|
}
|
|
328
361
|
} else {
|
|
329
362
|
//Wenn das element keinen Rechten nachbarn hat
|
|
@@ -360,8 +393,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
360
393
|
}, {
|
|
361
394
|
key: "correctRahmenDepthRightTop",
|
|
362
395
|
value: function correctRahmenDepthRightTop(curElement, boxPlannerGrid, optionHandler) {
|
|
396
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
397
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctRahmenDepthRightTop not supported for complex boxPlaner', {
|
|
398
|
+
code: 'WC_0012'
|
|
399
|
+
}));
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
363
402
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightTop, this.constructionRules.DepthRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
364
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
403
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
365
404
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
366
405
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
367
406
|
//wenn das Doppelmodul aktiviert ist, setze immer den Breitenverbinder
|
|
@@ -397,21 +436,23 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
397
436
|
|
|
398
437
|
//Check more if Element has right neighbor
|
|
399
438
|
if (hasRightElement) {
|
|
400
|
-
var
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
439
|
+
var rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
440
|
+
if (rightNeighbors.length > 0) {
|
|
441
|
+
var rightNeighbor = rightNeighbors[0];
|
|
442
|
+
//Setze Breitenverbinder, wenn Nachbar rechts keinen Deckel hat oder ein Eckelement ist
|
|
443
|
+
if (!this.getElementHasTopPlate(rightNeighbor, boxPlannerGrid, optionHandler) || this.getElementIsCornerElement(rightNeighbor, optionHandler)) {
|
|
444
|
+
switch (this.getElementDepth(curElement, optionHandler)) {
|
|
445
|
+
case '18':
|
|
446
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
447
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightTop, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_18_chrom, optionHandler);
|
|
448
|
+
break;
|
|
449
|
+
case '37':
|
|
450
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
451
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightTop, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_37_chrom, optionHandler);
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
return;
|
|
413
455
|
}
|
|
414
|
-
return;
|
|
415
456
|
}
|
|
416
457
|
|
|
417
458
|
//es trifft nichts zu, setze normalen Tiefenverbinder für an und weiterbau
|
|
@@ -444,7 +485,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
444
485
|
key: "correctRahmenVerticalLeftFront",
|
|
445
486
|
value: function correctRahmenVerticalLeftFront(curElement, boxPlannerGrid, optionHandler) {
|
|
446
487
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_LeftFront, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
447
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
488
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
448
489
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
449
490
|
if (hasLeftElement) return;
|
|
450
491
|
switch (this.getElementHeight(curElement, optionHandler)) {
|
|
@@ -491,7 +532,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
491
532
|
key: "correctRahmenVerticalLeftBack",
|
|
492
533
|
value: function correctRahmenVerticalLeftBack(curElement, boxPlannerGrid, optionHandler) {
|
|
493
534
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_LeftBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
494
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
535
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
495
536
|
if (elementIsOnBackside) return;
|
|
496
537
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
497
538
|
if (hasLeftElement) return;
|
|
@@ -548,8 +589,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
548
589
|
}, {
|
|
549
590
|
key: "correctRahmenVerticalRightFront",
|
|
550
591
|
value: function correctRahmenVerticalRightFront(curElement, boxPlannerGrid, optionHandler) {
|
|
592
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
593
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctRahmenVerticalRightFront not supported for complex boxPlaner', {
|
|
594
|
+
code: 'WC_0012'
|
|
595
|
+
}));
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
551
598
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightFront, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
552
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
599
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
553
600
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
554
601
|
switch (this.getElementHeight(curElement, optionHandler)) {
|
|
555
602
|
case '6':
|
|
@@ -576,11 +623,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
576
623
|
case 'CHROM':
|
|
577
624
|
//Check if element has opposide Element
|
|
578
625
|
if (hasRightElement) {
|
|
579
|
-
var
|
|
580
|
-
if (
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
626
|
+
var rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
627
|
+
if (rightNeighbors.length > 0) {
|
|
628
|
+
var rightNeighbor = rightNeighbors[0];
|
|
629
|
+
if (this.getElementIsGarderobeElement(rightNeighbor, optionHandler)) {
|
|
630
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightFront, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH18_Garderobe, optionHandler);
|
|
631
|
+
} else {
|
|
632
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightFront, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH37_chrom, optionHandler);
|
|
633
|
+
}
|
|
584
634
|
}
|
|
585
635
|
} else {
|
|
586
636
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightFront, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH37_chrom, optionHandler);
|
|
@@ -605,7 +655,13 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
605
655
|
key: "correctRahmenVerticalRightBack",
|
|
606
656
|
value: function correctRahmenVerticalRightBack(curElement, boxPlannerGrid, optionHandler) {
|
|
607
657
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
608
|
-
|
|
658
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
659
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctRahmenVerticalRightBack not supported for complex boxPlaner', {
|
|
660
|
+
code: 'WC_0012'
|
|
661
|
+
}));
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
609
665
|
if (elementIsOnBackside) return;
|
|
610
666
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
611
667
|
switch (this.getElementHeight(curElement, optionHandler)) {
|
|
@@ -633,23 +689,26 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
633
689
|
case 'CHROM':
|
|
634
690
|
//Check if element has opposide Element
|
|
635
691
|
if (hasRightElement) {
|
|
636
|
-
var
|
|
637
|
-
if (
|
|
638
|
-
if (
|
|
639
|
-
var
|
|
640
|
-
if (
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH18_Garderobe, optionHandler);
|
|
692
|
+
var rightElems = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
693
|
+
if (rightElems.length == 0) return;
|
|
694
|
+
if (rightElems.length > 0) {
|
|
695
|
+
var rightElem = rightElems[0];
|
|
696
|
+
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
697
|
+
var opposideElem = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
698
|
+
if (!opposideElem) return;
|
|
699
|
+
var opposideRightElement = boxPlannerGrid.getOppositeElement(rightElem.getElementId());
|
|
700
|
+
if (!opposideRightElement) return;
|
|
701
|
+
if (this.getElementIsGarderobeElement(rightElem, optionHandler) || this.getElementIsGarderobeElement(opposideElem, optionHandler) || this.getElementIsGarderobeElement(opposideRightElement, optionHandler)) {
|
|
702
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH18_Garderobe, optionHandler);
|
|
703
|
+
} else {
|
|
704
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH37_chrom, optionHandler);
|
|
705
|
+
}
|
|
651
706
|
} else {
|
|
652
|
-
this.
|
|
707
|
+
if (this.getElementIsGarderobeElement(rightElem, optionHandler)) {
|
|
708
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH18_Garderobe, optionHandler);
|
|
709
|
+
} else {
|
|
710
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH37_chrom, optionHandler);
|
|
711
|
+
}
|
|
653
712
|
}
|
|
654
713
|
}
|
|
655
714
|
} else {
|
|
@@ -678,7 +737,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
678
737
|
key: "calculateKnots",
|
|
679
738
|
value: function calculateKnots(boxPlannerGrid, optionHandler) {
|
|
680
739
|
if (!this.constructionRules.hasKNOTS) return; //If the boxPlanner has no knots - ignore them
|
|
681
|
-
var allElements = boxPlannerGrid.
|
|
740
|
+
var allElements = boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
682
741
|
for (var i = 0; i < allElements.length; i++) {
|
|
683
742
|
this.correctKnotLeftTopFront(allElements[i], boxPlannerGrid, optionHandler);
|
|
684
743
|
this.correctKnotLeftTopBack(allElements[i], boxPlannerGrid, optionHandler);
|
|
@@ -706,8 +765,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
706
765
|
}, {
|
|
707
766
|
key: "correctKnotLeftBottomFront",
|
|
708
767
|
value: function correctKnotLeftBottomFront(curElement, boxPlannerGrid, optionHandler) {
|
|
768
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
769
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctKnotLeftBottomFront not supported for complex boxPlaner', {
|
|
770
|
+
code: 'WC_0012'
|
|
771
|
+
}));
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
709
774
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
710
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
775
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
711
776
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
712
777
|
if (boxPlannerGrid.getElementHasBottomElement(curElement.getElementId())) return;
|
|
713
778
|
if (!hasLeftElement) {
|
|
@@ -723,33 +788,39 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
723
788
|
//IT is the bottom Element. There has to be a left element, otherwise we have another problem
|
|
724
789
|
if (this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
725
790
|
//Only if left is no other corner element
|
|
726
|
-
var
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
this.
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
791
|
+
var leftElements = boxPlannerGrid.getLeftElements(curElement.getElementId());
|
|
792
|
+
if (leftElements.length > 0) {
|
|
793
|
+
var leftElement = leftElements[0];
|
|
794
|
+
//Wenn links ecke ist continue. Setze linke Ecken nur, wenn links kein Corner Element ist.
|
|
795
|
+
if (this.getElementIsCornerElement(leftElement, optionHandler)) return;
|
|
796
|
+
var rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
797
|
+
if (rightElements.length > 0) {
|
|
798
|
+
var rightElement = rightElements[0];
|
|
799
|
+
switch (this.getCornerType(curElement, optionHandler)) {
|
|
800
|
+
case 'INSIDE':
|
|
801
|
+
if (this.getElementHasBottomPlate(leftElement, optionHandler)) {
|
|
802
|
+
if (this.getElementHasBottomPlate(rightElement, optionHandler)) {
|
|
803
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
804
|
+
} else {
|
|
805
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
806
|
+
}
|
|
807
|
+
} else {
|
|
808
|
+
if (this.getElementHasBottomPlate(rightElement, optionHandler)) {
|
|
809
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
810
|
+
} else {
|
|
811
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
break;
|
|
815
|
+
case 'OUTSIDE':
|
|
816
|
+
if (this.getElementHasBottomPlate(leftElement, optionHandler)) {
|
|
817
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
818
|
+
} else {
|
|
819
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
820
|
+
}
|
|
821
|
+
break;
|
|
751
822
|
}
|
|
752
|
-
|
|
823
|
+
}
|
|
753
824
|
}
|
|
754
825
|
}
|
|
755
826
|
}
|
|
@@ -757,7 +828,13 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
757
828
|
key: "correctKnotLeftTopFront",
|
|
758
829
|
value: function correctKnotLeftTopFront(curElement, boxPlannerGrid, optionHandler) {
|
|
759
830
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
760
|
-
|
|
831
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
832
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctKnotLeftTopFront not supported for complex boxPlaner', {
|
|
833
|
+
code: 'WC_0012'
|
|
834
|
+
}));
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
761
838
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
762
839
|
if (!hasLeftElement) {
|
|
763
840
|
if (boxPlannerGrid.getPlannerHasActiveBackside() && this.getElementHasTopPlate(curElement, boxPlannerGrid, optionHandler)) {
|
|
@@ -772,38 +849,44 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
772
849
|
if (this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
773
850
|
//wenn Element keinen Nachbarn links und keinen Nachbarn rechts hat
|
|
774
851
|
var hasLeftNeighbor = boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
775
|
-
if (hasLeftElement && this.getElementIsCornerElement(boxPlannerGrid.
|
|
852
|
+
if (hasLeftElement && this.getElementIsCornerElement(boxPlannerGrid.getLeftElements(curElement.getElementId())[0], optionHandler)) return; //Wenn der Nachbar links ein Eckelement ist, sett diesen Knoten nicht
|
|
776
853
|
var hasRightNeighbor = boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
777
854
|
if (!hasLeftNeighbor && !hasRightNeighbor) {
|
|
778
855
|
//setze in beiden Eck Fällen einen 2er Knoten mit 1GT
|
|
779
856
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
780
857
|
} else if (hasRightNeighbor && !hasLeftNeighbor) {
|
|
781
858
|
//Der Knoten hat einen rechten aber keinen linken Nachbarn
|
|
782
|
-
var
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
859
|
+
var neighbors = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
860
|
+
if (neighbors.length > 0) {
|
|
861
|
+
var neighbor = neighbors[0];
|
|
862
|
+
switch (this.getCornerType(curElement, optionHandler)) {
|
|
863
|
+
case 'INSIDE':
|
|
864
|
+
if (this.getElementHasTopPlate(neighbor, boxPlannerGrid, optionHandler)) {
|
|
865
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
866
|
+
} else {
|
|
867
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
868
|
+
}
|
|
869
|
+
break;
|
|
870
|
+
case 'OUTSIDE':
|
|
788
871
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
case 'OUTSIDE':
|
|
792
|
-
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
793
|
-
break;
|
|
872
|
+
break;
|
|
873
|
+
}
|
|
794
874
|
}
|
|
795
875
|
} else if (!hasRightNeighbor && hasLeftNeighbor) {
|
|
796
876
|
//Der Knoten hat einen linken aber keinen rechten nachbarn
|
|
797
|
-
var
|
|
798
|
-
if (
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
877
|
+
var _neighbors = boxPlannerGrid.getLeftElements(curElement.getElementId());
|
|
878
|
+
if (_neighbors.length > 0) {
|
|
879
|
+
var _neighbor = _neighbors[0];
|
|
880
|
+
if (this.getElementHasTopPlate(_neighbor, boxPlannerGrid, optionHandler)) {
|
|
881
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot3erer_2GT, optionHandler);
|
|
882
|
+
} else {
|
|
883
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
884
|
+
}
|
|
802
885
|
}
|
|
803
886
|
} else if (hasRightNeighbor && hasLeftNeighbor) {
|
|
804
887
|
//Wenn der Knoten sowohl links als auch rechts nachbaren hat
|
|
805
|
-
var neighborLeft = boxPlannerGrid.
|
|
806
|
-
var neighborRight = boxPlannerGrid.
|
|
888
|
+
var neighborLeft = boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
889
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
807
890
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
808
891
|
case 'INSIDE':
|
|
809
892
|
if (this.getElementHasTopPlate(neighborLeft, boxPlannerGrid, optionHandler)) {
|
|
@@ -834,12 +917,18 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
834
917
|
}, {
|
|
835
918
|
key: "correctKnotLeftBottomBack",
|
|
836
919
|
value: function correctKnotLeftBottomBack(curElement, boxPlannerGrid, optionHandler) {
|
|
920
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
921
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctKnotLeftBottomBack not supported for complex boxPlaner', {
|
|
922
|
+
code: 'WC_0012'
|
|
923
|
+
}));
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
837
926
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
838
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
927
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
839
928
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
840
929
|
if (boxPlannerGrid.getElementHasBottomElement(curElement.getElementId())) return;
|
|
841
930
|
if (!hasLeftElement) {
|
|
842
|
-
if (boxPlannerGrid.getPlannerHasActiveBackside() && !boxPlannerGrid.
|
|
931
|
+
if (boxPlannerGrid.getPlannerHasActiveBackside() && !boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside) {
|
|
843
932
|
//The backside is set up, however the current element is at the front side of the grid
|
|
844
933
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
845
934
|
if (opposideElement) {
|
|
@@ -872,7 +961,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
872
961
|
}
|
|
873
962
|
}
|
|
874
963
|
if (this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
875
|
-
var neighborLeft = boxPlannerGrid.
|
|
964
|
+
var neighborLeft = boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
876
965
|
//setze linken Corner nur, wenn links kein Corner Element ist
|
|
877
966
|
if (this.getElementIsCornerElement(neighborLeft, optionHandler)) return;
|
|
878
967
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
@@ -884,7 +973,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
884
973
|
}
|
|
885
974
|
break;
|
|
886
975
|
case 'OUTSIDE':
|
|
887
|
-
var neighborRight = boxPlannerGrid.
|
|
976
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
888
977
|
if (this.getElementHasBottomPlate(neighborLeft, optionHandler)) {
|
|
889
978
|
if (this.getElementHasBottomPlate(neighborRight, optionHandler)) {
|
|
890
979
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomBack, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
@@ -905,11 +994,17 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
905
994
|
}, {
|
|
906
995
|
key: "correctKnotLeftTopBack",
|
|
907
996
|
value: function correctKnotLeftTopBack(curElement, boxPlannerGrid, optionHandler) {
|
|
997
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
998
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctKnotLeftTopBack not supported for complex boxPlaner', {
|
|
999
|
+
code: 'WC_0012'
|
|
1000
|
+
}));
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
908
1003
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
909
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1004
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
910
1005
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
911
1006
|
if (!hasLeftElement) {
|
|
912
|
-
if (boxPlannerGrid.getPlannerHasActiveBackside() && !boxPlannerGrid.
|
|
1007
|
+
if (boxPlannerGrid.getPlannerHasActiveBackside() && !boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside) {
|
|
913
1008
|
//The backside is set up, however the current element is at the front side of the grid
|
|
914
1009
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
915
1010
|
if (opposideElement) {
|
|
@@ -942,14 +1037,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
942
1037
|
if (this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
943
1038
|
//wenn Element keinen Nachbarn links und keinen Nachbarn rechts hat
|
|
944
1039
|
var hasLeftNeighbor = boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
945
|
-
if (hasLeftElement && this.getElementIsCornerElement(boxPlannerGrid.
|
|
1040
|
+
if (hasLeftElement && this.getElementIsCornerElement(boxPlannerGrid.getLeftElements(curElement.getElementId())[0], optionHandler)) return; //Wenn der Nachbar links ein Eckelement ist, sett diesen Knoten nicht
|
|
946
1041
|
var hasRightNeighbor = boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
947
1042
|
if (!hasLeftNeighbor && !hasRightNeighbor) {
|
|
948
1043
|
//setze in beiden Eck Fällen einen 2er Knoten mit 1GT
|
|
949
1044
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
950
1045
|
} else if (hasRightNeighbor && !hasLeftNeighbor) {
|
|
951
1046
|
//Der Knoten hat einen rechten aber keinen linken Nachbarn
|
|
952
|
-
var neighbor = boxPlannerGrid.
|
|
1047
|
+
var neighbor = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
953
1048
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
954
1049
|
case 'INSIDE':
|
|
955
1050
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -964,7 +1059,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
964
1059
|
}
|
|
965
1060
|
} else if (!hasRightNeighbor && hasLeftNeighbor) {
|
|
966
1061
|
//Der Knoten hat einen linken aber keinen rechten nachbarn
|
|
967
|
-
var _neighbor2 = boxPlannerGrid.
|
|
1062
|
+
var _neighbor2 = boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
968
1063
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
969
1064
|
case 'INSIDE':
|
|
970
1065
|
if (this.getElementHasTopPlate(_neighbor2, boxPlannerGrid, optionHandler)) {
|
|
@@ -983,8 +1078,8 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
983
1078
|
}
|
|
984
1079
|
} else if (hasRightNeighbor && hasLeftNeighbor) {
|
|
985
1080
|
//Wenn der Knoten sowohl links als auch rechts nachbaren hat
|
|
986
|
-
var neighborLeft = boxPlannerGrid.
|
|
987
|
-
var neighborRight = boxPlannerGrid.
|
|
1081
|
+
var neighborLeft = boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
1082
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
988
1083
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
989
1084
|
case 'INSIDE':
|
|
990
1085
|
if (this.getElementHasTopPlate(neighborLeft, boxPlannerGrid, optionHandler)) {
|
|
@@ -1017,20 +1112,27 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1017
1112
|
}, {
|
|
1018
1113
|
key: "correctKnotRightMiddleBack",
|
|
1019
1114
|
value: function correctKnotRightMiddleBack(curElement, boxPlannerGrid, optionHandler) {
|
|
1115
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
1116
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctKnotRightMiddleBack not supported for complex boxPlaner', {
|
|
1117
|
+
code: 'WC_0012'
|
|
1118
|
+
}));
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1020
1121
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightMiddleBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1021
1122
|
|
|
1022
1123
|
//Set it only if current Element is garderobe and is on the front side
|
|
1023
1124
|
|
|
1024
1125
|
if (!this.getElementIsGarderobeElement(curElement, optionHandler)) return;
|
|
1025
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1126
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1026
1127
|
if (elementIsOnBackside) return;
|
|
1027
1128
|
var hasRightElement = boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
1028
1129
|
if (hasRightElement) {
|
|
1029
1130
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1030
1131
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
1031
1132
|
if (!opposideElement) return;
|
|
1032
|
-
var
|
|
1033
|
-
if (
|
|
1133
|
+
var rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1134
|
+
if (rightElements.length == 0) return;
|
|
1135
|
+
var rightElement = rightElements[0];
|
|
1034
1136
|
var opposideRightElement = boxPlannerGrid.getOppositeElement(rightElement.getElementId());
|
|
1035
1137
|
if (!opposideRightElement) return;
|
|
1036
1138
|
if (this.getElementIsGarderobeElement(opposideRightElement, optionHandler)) {
|
|
@@ -1047,8 +1149,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1047
1149
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightMiddleBack, this.constructionRules.knotInfo.knotOPVs.knot2er_0GT, optionHandler);
|
|
1048
1150
|
}
|
|
1049
1151
|
} else {
|
|
1050
|
-
var
|
|
1051
|
-
if (
|
|
1152
|
+
var _rightElements3 = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1153
|
+
if (_rightElements3.length == 0) return;
|
|
1154
|
+
var _rightElement3 = _rightElements3[0];
|
|
1052
1155
|
if (this.getElementIsGarderobeElement(_rightElement3, optionHandler)) {
|
|
1053
1156
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightMiddleBack, this.constructionRules.knotInfo.knotOPVs.knot3er_0GT, optionHandler);
|
|
1054
1157
|
} else {
|
|
@@ -1074,21 +1177,28 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1074
1177
|
}, {
|
|
1075
1178
|
key: "correctKnotLeftMiddleBack",
|
|
1076
1179
|
value: function correctKnotLeftMiddleBack(curElement, boxPlannerGrid, optionHandler) {
|
|
1180
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
1181
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctKnotLeftMiddleBack not supported for complex boxPlaner', {
|
|
1182
|
+
code: 'WC_0012'
|
|
1183
|
+
}));
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1077
1186
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftMiddleBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1078
1187
|
|
|
1079
1188
|
//Set it only if current Element is garderobe and is on the front side and if left element is not a garderobe
|
|
1080
1189
|
if (!this.getElementIsGarderobeElement(curElement, optionHandler)) return;
|
|
1081
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1190
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1082
1191
|
if (elementIsOnBackside) return;
|
|
1083
1192
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
1084
1193
|
if (hasLeftElement) {
|
|
1085
|
-
var leftElement = boxPlannerGrid.
|
|
1194
|
+
var leftElement = boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
1086
1195
|
if (this.getElementIsGarderobeElement(leftElement, optionHandler)) return;
|
|
1087
1196
|
}
|
|
1088
1197
|
if (hasLeftElement) {
|
|
1089
1198
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1090
|
-
var
|
|
1091
|
-
if (
|
|
1199
|
+
var leftElements = boxPlannerGrid.getLeftElements(curElement.getElementId());
|
|
1200
|
+
if (leftElements.length == 0) return;
|
|
1201
|
+
var _leftElement = leftElements[0];
|
|
1092
1202
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
1093
1203
|
if (!opposideElement) return;
|
|
1094
1204
|
var opposideLeftElement = boxPlannerGrid.getOppositeElement(_leftElement === null || _leftElement === void 0 ? void 0 : _leftElement.getElementId());
|
|
@@ -1120,8 +1230,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1120
1230
|
}, {
|
|
1121
1231
|
key: "correctKnotRightBottomFront",
|
|
1122
1232
|
value: function correctKnotRightBottomFront(curElement, boxPlannerGrid, optionHandler) {
|
|
1233
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
1234
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctKnotRightBottomFront not supported for complex boxPlaner', {
|
|
1235
|
+
code: 'WC_0012'
|
|
1236
|
+
}));
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1123
1239
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1124
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1240
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1125
1241
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
1126
1242
|
if (boxPlannerGrid.getElementHasBottomElement(curElement.getElementId())) return;
|
|
1127
1243
|
if (!boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
@@ -1132,7 +1248,10 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1132
1248
|
//no right neighbor
|
|
1133
1249
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot1er, optionHandler);
|
|
1134
1250
|
} else {
|
|
1135
|
-
var
|
|
1251
|
+
var rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1252
|
+
var rightNeighbor = undefined;
|
|
1253
|
+
if (rightNeighbors.length > 0) rightNeighbor = rightNeighbors[0];
|
|
1254
|
+
|
|
1136
1255
|
//Only set something if element is no corner element
|
|
1137
1256
|
if (rightNeighbor && !this.getElementIsCornerElement(rightNeighbor, optionHandler)) {
|
|
1138
1257
|
if (!this.getElementHasBottomPlate(rightNeighbor, optionHandler)) {
|
|
@@ -1145,7 +1264,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1145
1264
|
}
|
|
1146
1265
|
} else {
|
|
1147
1266
|
//Element has Ground Plate
|
|
1148
|
-
var
|
|
1267
|
+
var _rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1268
|
+
var _rightNeighbor = undefined;
|
|
1269
|
+
if (_rightNeighbors.length > 0) _rightNeighbor = _rightNeighbors[0];
|
|
1149
1270
|
if (_rightNeighbor && !this.getElementHasBottomPlate(_rightNeighbor, optionHandler)) {
|
|
1150
1271
|
//if neighbor right has no ground plate
|
|
1151
1272
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1159,7 +1280,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1159
1280
|
//element has no right neighbor
|
|
1160
1281
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot1er, optionHandler);
|
|
1161
1282
|
} else {
|
|
1162
|
-
var
|
|
1283
|
+
var _rightNeighbors2 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1284
|
+
var _rightNeighbor2 = undefined;
|
|
1285
|
+
if (_rightNeighbors2.length > 0) _rightNeighbor2 = _rightNeighbors2[0];
|
|
1163
1286
|
if (_rightNeighbor2) {
|
|
1164
1287
|
if (!this.getElementHasBottomPlate(_rightNeighbor2, optionHandler)) {
|
|
1165
1288
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot1er, optionHandler);
|
|
@@ -1174,7 +1297,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1174
1297
|
//element has no right neighbor
|
|
1175
1298
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1176
1299
|
} else {
|
|
1177
|
-
var
|
|
1300
|
+
var _rightNeighbors3 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1301
|
+
var _rightNeighbor3 = undefined;
|
|
1302
|
+
if (_rightNeighbors3.length > 0) _rightNeighbor3 = _rightNeighbors3[0];
|
|
1178
1303
|
if (_rightNeighbor3) {
|
|
1179
1304
|
if (!this.getElementHasBottomPlate(_rightNeighbor3, optionHandler)) {
|
|
1180
1305
|
//right neighbor has no ground plate
|
|
@@ -1192,13 +1317,13 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1192
1317
|
//Es gibt sicher einen linken und einen rechten nachbarn
|
|
1193
1318
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1194
1319
|
case 'INSIDE':
|
|
1195
|
-
var neighborRight = boxPlannerGrid.
|
|
1320
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1196
1321
|
if (neighborRight && this.getElementIsCornerElement(neighborRight, optionHandler)) {
|
|
1197
1322
|
var hasNextNeighbor = boxPlannerGrid.getElementHasRightElement(neighborRight.getElementId());
|
|
1198
1323
|
if (!hasNextNeighbor) {
|
|
1199
1324
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
1200
1325
|
} else {
|
|
1201
|
-
var nextNeighbor = boxPlannerGrid.
|
|
1326
|
+
var nextNeighbor = boxPlannerGrid.getRightElements(neighborRight.getElementId())[0];
|
|
1202
1327
|
if (this.getElementHasBottomPlate(nextNeighbor, optionHandler)) {
|
|
1203
1328
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1204
1329
|
} else {
|
|
@@ -1222,8 +1347,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1222
1347
|
}, {
|
|
1223
1348
|
key: "correctKnotRightTopFront",
|
|
1224
1349
|
value: function correctKnotRightTopFront(curElement, boxPlannerGrid, optionHandler) {
|
|
1350
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
1351
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctKnotRightTopFront not supported for complex boxPlaner', {
|
|
1352
|
+
code: 'WC_0012'
|
|
1353
|
+
}));
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1225
1356
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1226
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1357
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1227
1358
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
1228
1359
|
if (!boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1229
1360
|
//No active backside
|
|
@@ -1233,7 +1364,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1233
1364
|
//element has no right neighbor
|
|
1234
1365
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot1er, optionHandler);
|
|
1235
1366
|
} else {
|
|
1236
|
-
var
|
|
1367
|
+
var rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1368
|
+
var rightNeighbor = undefined;
|
|
1369
|
+
if (rightNeighbors.length > 0) rightNeighbor = rightNeighbors[0];
|
|
1237
1370
|
if (rightNeighbor && !this.getElementIsCornerElement(rightNeighbor, optionHandler)) {
|
|
1238
1371
|
if (this.getElementHasTopPlate(rightNeighbor, boxPlannerGrid, optionHandler)) {
|
|
1239
1372
|
//right element has top plate
|
|
@@ -1247,7 +1380,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1247
1380
|
} else {
|
|
1248
1381
|
//Element has top Plate
|
|
1249
1382
|
if (hasRightElement) {
|
|
1250
|
-
var
|
|
1383
|
+
var _rightNeighbors4 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1384
|
+
var _rightNeighbor4 = undefined;
|
|
1385
|
+
if (_rightNeighbors4.length > 0) _rightNeighbor4 = _rightNeighbors4[0];
|
|
1251
1386
|
if (_rightNeighbor4) {
|
|
1252
1387
|
if (!this.getElementHasTopPlate(_rightNeighbor4, boxPlannerGrid, optionHandler)) {
|
|
1253
1388
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1263,7 +1398,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1263
1398
|
//element has no right neighbor
|
|
1264
1399
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot1er, optionHandler);
|
|
1265
1400
|
} else {
|
|
1266
|
-
var
|
|
1401
|
+
var _rightNeighbors5 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1402
|
+
var _rightNeighbor5 = undefined;
|
|
1403
|
+
if (_rightNeighbors5.length > 0) _rightNeighbor5 = _rightNeighbors5[0];
|
|
1267
1404
|
if (_rightNeighbor5) {
|
|
1268
1405
|
if (this.getElementHasTopPlate(_rightNeighbor5, boxPlannerGrid, optionHandler)) {
|
|
1269
1406
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1278,7 +1415,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1278
1415
|
//element has no neighbor right
|
|
1279
1416
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1280
1417
|
} else {
|
|
1281
|
-
var
|
|
1418
|
+
var _rightNeighbors6 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1419
|
+
var _rightNeighbor6 = undefined;
|
|
1420
|
+
if (_rightNeighbors6.length > 0) _rightNeighbor6 = _rightNeighbors6[0];
|
|
1282
1421
|
if (_rightNeighbor6) {
|
|
1283
1422
|
if (this.getElementHasTopPlate(_rightNeighbor6, boxPlannerGrid, optionHandler)) {
|
|
1284
1423
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
@@ -1297,7 +1436,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1297
1436
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1298
1437
|
} else if (hasRightNeighbor && !hasLeftNeighbor) {
|
|
1299
1438
|
//Der Knoten hat einen rechten aber keinen linken Nachbarn
|
|
1300
|
-
var neighbor = boxPlannerGrid.
|
|
1439
|
+
var neighbor = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1301
1440
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1302
1441
|
case 'INSIDE':
|
|
1303
1442
|
//Check if right element is Corner element
|
|
@@ -1306,7 +1445,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1306
1445
|
if (!hasNextNeighbor) {
|
|
1307
1446
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
1308
1447
|
} else {
|
|
1309
|
-
var nextNeighbor = boxPlannerGrid.
|
|
1448
|
+
var nextNeighbor = boxPlannerGrid.getRightElements(neighbor.getElementId())[0];
|
|
1310
1449
|
if (this.getElementHasTopPlate(nextNeighbor, boxPlannerGrid, optionHandler)) {
|
|
1311
1450
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1312
1451
|
} else {
|
|
@@ -1327,7 +1466,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1327
1466
|
}
|
|
1328
1467
|
} else if (!hasRightNeighbor && hasLeftNeighbor) {
|
|
1329
1468
|
//Der Knoten hat einen linken aber keinen rechten nachbarn
|
|
1330
|
-
boxPlannerGrid.
|
|
1469
|
+
boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
1331
1470
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1332
1471
|
case 'INSIDE':
|
|
1333
1472
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1338,7 +1477,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1338
1477
|
}
|
|
1339
1478
|
} else if (hasRightNeighbor && hasLeftNeighbor) {
|
|
1340
1479
|
//Wenn der Knoten sowohl links als auch rechts nachbaren hat
|
|
1341
|
-
var neighborRight = boxPlannerGrid.
|
|
1480
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1342
1481
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1343
1482
|
case 'INSIDE':
|
|
1344
1483
|
if (this.getElementIsCornerElement(neighborRight, optionHandler)) {
|
|
@@ -1346,7 +1485,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1346
1485
|
if (!_hasNextNeighbor) {
|
|
1347
1486
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
1348
1487
|
} else {
|
|
1349
|
-
var _nextNeighbor = boxPlannerGrid.
|
|
1488
|
+
var _nextNeighbor = boxPlannerGrid.getRightElements(neighborRight.getElementId())[0];
|
|
1350
1489
|
if (this.getElementHasTopPlate(_nextNeighbor, boxPlannerGrid, optionHandler)) {
|
|
1351
1490
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1352
1491
|
} else {
|
|
@@ -1371,18 +1510,26 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1371
1510
|
}, {
|
|
1372
1511
|
key: "correctKnotRightBottomBack",
|
|
1373
1512
|
value: function correctKnotRightBottomBack(curElement, boxPlannerGrid, optionHandler) {
|
|
1513
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
1514
|
+
LOG$3.error(new DivaUtils.DivaError('BoxPlannerError - function correctKnotRightBottomBack not supported for complex boxPlaner', {
|
|
1515
|
+
code: 'WC_0012'
|
|
1516
|
+
}));
|
|
1517
|
+
return;
|
|
1518
|
+
}
|
|
1374
1519
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1375
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1520
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1376
1521
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
1377
1522
|
if (boxPlannerGrid.getElementHasBottomElement(curElement.getElementId())) return;
|
|
1378
|
-
if (boxPlannerGrid.
|
|
1523
|
+
if (boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside) return;
|
|
1379
1524
|
if (!boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1380
1525
|
//No active backside
|
|
1381
1526
|
if (!this.getElementHasBottomPlate(curElement, optionHandler)) {
|
|
1382
1527
|
if (!hasRightElement) {
|
|
1383
1528
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.knot2er_0GT, optionHandler);
|
|
1384
1529
|
} else {
|
|
1385
|
-
var
|
|
1530
|
+
var rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1531
|
+
var rightNeighbor = undefined;
|
|
1532
|
+
if (rightNeighbors.length > 0) rightNeighbor = rightNeighbors[0];
|
|
1386
1533
|
if (rightNeighbor && !this.getElementIsCornerElement(rightNeighbor, optionHandler)) {
|
|
1387
1534
|
if (this.getElementHasBottomPlate(rightNeighbor, optionHandler)) {
|
|
1388
1535
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.knot3er_1GT, optionHandler);
|
|
@@ -1394,7 +1541,11 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1394
1541
|
} else {
|
|
1395
1542
|
//Element has ground plate
|
|
1396
1543
|
if (hasRightElement) {
|
|
1397
|
-
var
|
|
1544
|
+
var _rightNeighbors7 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1545
|
+
var _rightNeighbor7 = undefined;
|
|
1546
|
+
if (_rightNeighbors7.length > 0) {
|
|
1547
|
+
_rightNeighbor7 = _rightNeighbors7[0];
|
|
1548
|
+
}
|
|
1398
1549
|
if (_rightNeighbor7) {
|
|
1399
1550
|
if (!this.getElementHasBottomPlate(_rightNeighbor7, optionHandler)) {
|
|
1400
1551
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.knot3er_1GT, optionHandler);
|
|
@@ -1437,77 +1588,6 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1437
1588
|
}
|
|
1438
1589
|
break;
|
|
1439
1590
|
}
|
|
1440
|
-
/*
|
|
1441
|
-
if (!this.getElementHasBottomPlate(curElement, optionHandler)) {
|
|
1442
|
-
//Element has no ground plate
|
|
1443
|
-
if (!boxPlannerGrid.getElementHasRightElement(curElement.getElementId())) {
|
|
1444
|
-
let opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
1445
|
-
if (opposideElement) {
|
|
1446
|
-
if (this.getElementHasBottomPlate(opposideElement, optionHandler)) {
|
|
1447
|
-
//The opposide element has a ground plate
|
|
1448
|
-
this.setOptionValue(
|
|
1449
|
-
curElement.getElementId(),
|
|
1450
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1451
|
-
this.constructionRules.knotInfo.knotOPVs.knot3er_1GT,
|
|
1452
|
-
optionHandler,
|
|
1453
|
-
);
|
|
1454
|
-
} else {
|
|
1455
|
-
//The opposide element has no ground plate
|
|
1456
|
-
this.setOptionValue(
|
|
1457
|
-
curElement.getElementId(),
|
|
1458
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1459
|
-
this.constructionRules.knotInfo.knotOPVs.knot3er_0GT,
|
|
1460
|
-
optionHandler,
|
|
1461
|
-
);
|
|
1462
|
-
}
|
|
1463
|
-
}
|
|
1464
|
-
} else {
|
|
1465
|
-
//Element has neighbor element
|
|
1466
|
-
//Set the Glasteller count depending on the plates of the neighbors
|
|
1467
|
-
switch (this.getGroundPlatesNumOfRightNeighbors(curElement, boxPlannerGrid, optionHandler)) {
|
|
1468
|
-
case 0:
|
|
1469
|
-
this.setOptionValue(
|
|
1470
|
-
curElement.getElementId(),
|
|
1471
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1472
|
-
this.constructionRules.knotInfo.knotOPVs.knot4er_0GT,
|
|
1473
|
-
optionHandler,
|
|
1474
|
-
);
|
|
1475
|
-
break;
|
|
1476
|
-
case 1:
|
|
1477
|
-
this.setOptionValue(
|
|
1478
|
-
curElement.getElementId(),
|
|
1479
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1480
|
-
this.constructionRules.knotInfo.knotOPVs.knot4er_1GT,
|
|
1481
|
-
optionHandler,
|
|
1482
|
-
);
|
|
1483
|
-
break;
|
|
1484
|
-
case 2:
|
|
1485
|
-
this.setOptionValue(
|
|
1486
|
-
curElement.getElementId(),
|
|
1487
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1488
|
-
this.constructionRules.knotInfo.knotOPVs.knot4er_2GT,
|
|
1489
|
-
optionHandler,
|
|
1490
|
-
);
|
|
1491
|
-
break;
|
|
1492
|
-
case 3:
|
|
1493
|
-
this.setOptionValue(
|
|
1494
|
-
curElement.getElementId(),
|
|
1495
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1496
|
-
this.constructionRules.knotInfo.knotOPVs.knot4er_3GT,
|
|
1497
|
-
optionHandler,
|
|
1498
|
-
);
|
|
1499
|
-
break;
|
|
1500
|
-
case 4:
|
|
1501
|
-
this.setOptionValue(
|
|
1502
|
-
curElement.getElementId(),
|
|
1503
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1504
|
-
this.constructionRules.knotInfo.knotOPVs.knot4er_4GT,
|
|
1505
|
-
optionHandler,
|
|
1506
|
-
);
|
|
1507
|
-
break;
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
}*/
|
|
1511
1591
|
}
|
|
1512
1592
|
if (this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
1513
1593
|
//Element hat sicher ienen linken und rechten nachbarn
|
|
@@ -1516,11 +1596,11 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1516
1596
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1517
1597
|
break;
|
|
1518
1598
|
case 'OUTSIDE':
|
|
1519
|
-
var neighborRight = boxPlannerGrid.
|
|
1599
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1520
1600
|
if (this.getElementIsCornerElement(neighborRight, optionHandler)) {
|
|
1521
1601
|
//we are on the ground, so there is shourly a nextRightElement
|
|
1522
1602
|
|
|
1523
|
-
var nextNeighbor = boxPlannerGrid.
|
|
1603
|
+
var nextNeighbor = boxPlannerGrid.getRightElements(neighborRight.getElementId())[0];
|
|
1524
1604
|
if (this.getElementHasBottomPlate(nextNeighbor, optionHandler)) {
|
|
1525
1605
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1526
1606
|
} else {
|
|
@@ -1541,16 +1621,16 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1541
1621
|
key: "correctKnotRightTopBack",
|
|
1542
1622
|
value: function correctKnotRightTopBack(curElement, boxPlannerGrid, optionHandler) {
|
|
1543
1623
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1544
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1624
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1545
1625
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
1546
|
-
if (boxPlannerGrid.
|
|
1626
|
+
if (boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside) return;
|
|
1547
1627
|
if (!boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1548
1628
|
if (!this.getElementHasTopPlate(curElement, boxPlannerGrid, optionHandler)) {
|
|
1549
1629
|
if (!hasRightElement) {
|
|
1550
1630
|
//Element has no right neighbor
|
|
1551
1631
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_0GT, optionHandler);
|
|
1552
1632
|
} else {
|
|
1553
|
-
var rightNeighbor = elementIsOnBackside ? boxPlannerGrid.
|
|
1633
|
+
var rightNeighbor = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId())[0] : boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1554
1634
|
if (rightNeighbor && !this.getElementIsCornerElement(rightNeighbor, optionHandler)) {
|
|
1555
1635
|
if (this.getElementHasTopPlate(rightNeighbor, boxPlannerGrid, optionHandler)) {
|
|
1556
1636
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot3er_1GT, optionHandler);
|
|
@@ -1562,7 +1642,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1562
1642
|
}
|
|
1563
1643
|
} else {
|
|
1564
1644
|
if (hasRightElement) {
|
|
1565
|
-
var _rightNeighbor8 = elementIsOnBackside ? boxPlannerGrid.
|
|
1645
|
+
var _rightNeighbor8 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId())[0] : boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1566
1646
|
if (!this.getElementIsCornerElement(_rightNeighbor8, optionHandler)) {
|
|
1567
1647
|
if (!this.getElementHasTopPlate(_rightNeighbor8, boxPlannerGrid, optionHandler)) {
|
|
1568
1648
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot3er_1GT, optionHandler);
|
|
@@ -1614,7 +1694,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1614
1694
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1615
1695
|
} else if (hasRightNeighbor && !hasLeftNeighbor) {
|
|
1616
1696
|
//Der Knoten hat einen rechten aber keinen linken Nachbarn
|
|
1617
|
-
var neighbor = boxPlannerGrid.
|
|
1697
|
+
var neighbor = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1618
1698
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1619
1699
|
case 'INSIDE':
|
|
1620
1700
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1625,7 +1705,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1625
1705
|
if (!hasNextNeighbor) {
|
|
1626
1706
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
1627
1707
|
} else {
|
|
1628
|
-
var nextNeighbor = boxPlannerGrid.
|
|
1708
|
+
var nextNeighbor = boxPlannerGrid.getRightElements(neighbor.getElementId())[0];
|
|
1629
1709
|
if (this.getElementHasTopPlate(nextNeighbor, boxPlannerGrid, optionHandler)) {
|
|
1630
1710
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1631
1711
|
} else {
|
|
@@ -1647,7 +1727,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1647
1727
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1648
1728
|
} else if (hasRightNeighbor && hasLeftNeighbor) {
|
|
1649
1729
|
//Wenn der Knoten sowohl links als auch rechts nachbaren hat
|
|
1650
|
-
var neighborRight = boxPlannerGrid.
|
|
1730
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1651
1731
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1652
1732
|
case 'INSIDE':
|
|
1653
1733
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1658,7 +1738,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1658
1738
|
if (!_hasNextNeighbor2) {
|
|
1659
1739
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
1660
1740
|
} else {
|
|
1661
|
-
var _nextNeighbor2 = boxPlannerGrid.
|
|
1741
|
+
var _nextNeighbor2 = boxPlannerGrid.getRightElements(neighborRight.getElementId())[0];
|
|
1662
1742
|
if (this.getElementHasTopPlate(_nextNeighbor2, boxPlannerGrid, optionHandler)) {
|
|
1663
1743
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1664
1744
|
} else {
|
|
@@ -1736,7 +1816,6 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1736
1816
|
*/
|
|
1737
1817
|
_defineProperty__default["default"](this, "setOptionValue", function (elementId, option, optionValue, optionHandler) {
|
|
1738
1818
|
var _optionHandler$get;
|
|
1739
|
-
//LOG.log("Update Box Planner Logic.Set default Option: elementId: " + elementId + "; Option: " + option);
|
|
1740
1819
|
if (!optionHandler.has(elementId)) optionHandler.set(elementId, new Map());
|
|
1741
1820
|
(_optionHandler$get = optionHandler.get(elementId)) === null || _optionHandler$get === void 0 || _optionHandler$get.set(option, optionValue);
|
|
1742
1821
|
if (_this.hideOptionsForConstruction.has(elementId)) {
|
|
@@ -1777,14 +1856,19 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1777
1856
|
return 'NOCORNER';
|
|
1778
1857
|
});
|
|
1779
1858
|
/**
|
|
1780
|
-
* This function returns true, if the element has a top plate. It has a top plate if it has no element on the top or the
|
|
1859
|
+
* This function returns true, if the element has a top plate. It has a top plate if it has no element on the top or one of the elements on the top has a ground plate.
|
|
1781
1860
|
* It has no top plate, if the element on top has no ground plate, like a "Garderobe"
|
|
1782
1861
|
* @param curElement
|
|
1783
1862
|
* @param optionHandler
|
|
1784
1863
|
*/
|
|
1785
1864
|
_defineProperty__default["default"](this, "getElementHasTopPlate", function (curElement, boxPlannerGrid, optionHandler) {
|
|
1786
1865
|
if (boxPlannerGrid.getElementHasTopElement(curElement.getElementId())) {
|
|
1787
|
-
|
|
1866
|
+
var allTopElements = boxPlannerGrid.getTopElements(curElement.getElementId());
|
|
1867
|
+
var oneTrueFound = false;
|
|
1868
|
+
for (var i = 0; i < allTopElements.length; i++) {
|
|
1869
|
+
if (_this.getElementHasBottomPlate(allTopElements[i], optionHandler)) oneTrueFound = true;
|
|
1870
|
+
}
|
|
1871
|
+
return oneTrueFound;
|
|
1788
1872
|
}
|
|
1789
1873
|
return true;
|
|
1790
1874
|
});
|
|
@@ -1945,14 +2029,15 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1945
2029
|
this.setOptionValue(allElementIds[i], 'OPTCORNER_COL_R', 'OPVOHNE', optionHandler);
|
|
1946
2030
|
|
|
1947
2031
|
//Check if first col or last Col are eckelemente.
|
|
1948
|
-
|
|
1949
|
-
|
|
2032
|
+
//let posInGrid = boxPlannerGrid.getIndexInGridByElementId(allElementIds[i]);
|
|
2033
|
+
var cellsInGrid = boxPlannerGrid.getCellsInGridByElementId(allElementIds[i]);
|
|
2034
|
+
if (cellsInGrid.backside) {
|
|
1950
2035
|
this.setOptionValue(allElementIds[i], 'OPTELEM_ON_BACK', 'OPVJA', optionHandler);
|
|
1951
2036
|
} else {
|
|
1952
2037
|
this.setOptionValue(allElementIds[i], 'OPTELEM_ON_BACK', 'OPVNEIN', optionHandler);
|
|
1953
2038
|
//Set if col left is column with corners
|
|
1954
|
-
if (
|
|
1955
|
-
var leftElement = boxPlannerGrid.getPlannerElementAtGridPos(
|
|
2039
|
+
if (cellsInGrid.startColIndex > 0) {
|
|
2040
|
+
var leftElement = boxPlannerGrid.getPlannerElementAtGridPos(cellsInGrid.startColIndex - 1, 0, false);
|
|
1956
2041
|
if (leftElement) {
|
|
1957
2042
|
var cornerVal = this.getOptionVal(leftElement.getElementId(), 'OPTELEMENT', optionHandler);
|
|
1958
2043
|
if (cornerVal == 'OPVECK_I') {
|
|
@@ -1964,8 +2049,8 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1964
2049
|
}
|
|
1965
2050
|
}
|
|
1966
2051
|
}
|
|
1967
|
-
if (
|
|
1968
|
-
var rightElement = boxPlannerGrid.getPlannerElementAtGridPos(
|
|
2052
|
+
if (cellsInGrid.endColIndex < colCount - 1) {
|
|
2053
|
+
var rightElement = boxPlannerGrid.getPlannerElementAtGridPos(cellsInGrid.endColIndex + 1, 0, false);
|
|
1969
2054
|
if (rightElement) {
|
|
1970
2055
|
var _cornerVal = this.getOptionVal(rightElement.getElementId(), 'OPTELEMENT', optionHandler);
|
|
1971
2056
|
if (_cornerVal == 'OPVECK_I') {
|
|
@@ -1980,13 +2065,13 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1980
2065
|
}
|
|
1981
2066
|
if (this.constructionRules.avoidOptionLastCol) {
|
|
1982
2067
|
var elementType = this.getOptionVal(allElementIds[i], this.constructionRules.avoidOptionLastCol.onOPT, optionHandler);
|
|
1983
|
-
if (this.arrayContainsValue(this.constructionRules.avoidOptionLastCol.onOPVs, elementType) &&
|
|
2068
|
+
if (this.arrayContainsValue(this.constructionRules.avoidOptionLastCol.onOPVs, elementType) && cellsInGrid.endColIndex == colCount - 1) {
|
|
1984
2069
|
this.setOptionValue(allElementIds[i], this.constructionRules.avoidOptionLastCol.onOPT, this.constructionRules.avoidOptionLastCol.defaultOpv, optionHandler);
|
|
1985
2070
|
}
|
|
1986
2071
|
}
|
|
1987
2072
|
if (this.constructionRules.avoidOptionFirstCol) {
|
|
1988
2073
|
var _elementType = this.getOptionVal(allElementIds[i], this.constructionRules.avoidOptionFirstCol.onOPT, optionHandler);
|
|
1989
|
-
if (this.arrayContainsValue(this.constructionRules.avoidOptionFirstCol.onOPVs, _elementType) &&
|
|
2074
|
+
if (this.arrayContainsValue(this.constructionRules.avoidOptionFirstCol.onOPVs, _elementType) && cellsInGrid.startColIndex == 0) {
|
|
1990
2075
|
this.setOptionValue(allElementIds[i], this.constructionRules.avoidOptionFirstCol.onOPT, this.constructionRules.avoidOptionFirstCol.defaultOpv, optionHandler);
|
|
1991
2076
|
}
|
|
1992
2077
|
}
|
|
@@ -1995,7 +2080,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1995
2080
|
this.setOptionDoShow(allElementIds[i], 'OPTWERKZEUGKASTEN', optionHandler);
|
|
1996
2081
|
//Check if set Winkel
|
|
1997
2082
|
if (hasOPTWW) {
|
|
1998
|
-
if (boxPlannerGrid.getSizeOfWholeSet().y > 173 && !boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
2083
|
+
if (boxPlannerGrid.getSizeOfWholeSet(true).y > 173 && !boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1999
2084
|
this.setOptionDoShow(allElementIds[i], 'OPTWW', optionHandler);
|
|
2000
2085
|
} else {
|
|
2001
2086
|
this.setOptionDoHide(allElementIds[i], 'OPTWW', optionHandler);
|
|
@@ -2043,18 +2128,44 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2043
2128
|
var doCheckRule = false;
|
|
2044
2129
|
if (rule.dir && targetElements && targetElements.length > 0) {
|
|
2045
2130
|
//If rule == dir only correct this element if it is the target
|
|
2046
|
-
|
|
2047
|
-
|
|
2131
|
+
|
|
2132
|
+
if (rule.dir == 'TOP' && boxPlannerGrid.getElementHasBottomElement(allElementIds[i])) {
|
|
2133
|
+
var bottomElements = boxPlannerGrid.getBottomElements(allElementIds[i]);
|
|
2134
|
+
for (var bElemNr = 0; bElemNr < bottomElements.length; bElemNr++) {
|
|
2135
|
+
if (targetElements.indexOf(bottomElements[bElemNr].getElementId()) >= 0) {
|
|
2136
|
+
doCheckRule = true;
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2048
2139
|
}
|
|
2049
|
-
if (rule.dir == 'DOWN' && boxPlannerGrid.getElementHasTopElement(allElementIds[i])
|
|
2050
|
-
|
|
2140
|
+
if (rule.dir == 'DOWN' && boxPlannerGrid.getElementHasTopElement(allElementIds[i])) {
|
|
2141
|
+
var topElements = boxPlannerGrid.getTopElements(allElementIds[i]);
|
|
2142
|
+
for (var tElemNr = 0; tElemNr < topElements.length; tElemNr++) {
|
|
2143
|
+
if (targetElements.indexOf(topElements[tElemNr].getElementId()) >= 0) {
|
|
2144
|
+
doCheckRule = true;
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2051
2147
|
}
|
|
2052
|
-
if (rule.dir == 'LEFT_RIGHT'
|
|
2053
|
-
|
|
2148
|
+
if (rule.dir == 'LEFT_RIGHT') {
|
|
2149
|
+
if (boxPlannerGrid.getElementHasLeftElement(allElementIds[i])) {
|
|
2150
|
+
var allLeftElements = boxPlannerGrid.getLeftElements(allElementIds[i]);
|
|
2151
|
+
for (var lElemNr = 0; lElemNr < allLeftElements.length; lElemNr++) {
|
|
2152
|
+
if (targetElements.indexOf(allLeftElements[lElemNr].getElementId()) >= 0) {
|
|
2153
|
+
doCheckRule = true;
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
if (boxPlannerGrid.getElementHasRightElement(allElementIds[i])) {
|
|
2158
|
+
var allRightElements = boxPlannerGrid.getRightElements(allElementIds[i]);
|
|
2159
|
+
for (var rElemNr = 0; rElemNr < allRightElements.length; rElemNr++) {
|
|
2160
|
+
if (targetElements.indexOf(allRightElements[rElemNr].getElementId()) >= 0) {
|
|
2161
|
+
doCheckRule = true;
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2054
2165
|
}
|
|
2055
2166
|
if (rule.dir == 'COL') {
|
|
2056
|
-
var
|
|
2057
|
-
var allElementsInCol = boxPlannerGrid.getAllElementsInColumn(
|
|
2167
|
+
var cellPos = boxPlannerGrid.getCellsInGridByElementId(allElementIds[i]);
|
|
2168
|
+
var allElementsInCol = boxPlannerGrid.getAllElementsInColumn(cellPos.startColIndex, cellPos.backside);
|
|
2058
2169
|
allElementsInCol.forEach(function (plannerElement) {
|
|
2059
2170
|
return targetElements.indexOf(plannerElement.ElementId) >= 0 ? doCheckRule = true : undefined;
|
|
2060
2171
|
});
|
|
@@ -2077,7 +2188,6 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2077
2188
|
if (this.arrayContainsValue(rule.unvalidOPVs, articleOPV) && this.arrayContainsValue(rule.onOPVs, changedOPTs[changedOpt])) {
|
|
2078
2189
|
//Es ist nicht gültig
|
|
2079
2190
|
this.setOptionValue(allElementIds[i], rule.influenceOPT, rule.defaultOpv, optionHandler);
|
|
2080
|
-
//article[rule.influenceOPT].val = rule.defaultOpv;
|
|
2081
2191
|
if (rule.warning) messageForView = rule.warning;
|
|
2082
2192
|
}
|
|
2083
2193
|
}
|
|
@@ -2138,8 +2248,8 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2138
2248
|
for (var opt in changedOPTs) {
|
|
2139
2249
|
if (this.constructionRules.forceSameOptionInGrid && this.arrayContainsValue(this.constructionRules.forceSameOptionInGrid, opt)) {
|
|
2140
2250
|
//Bitte auf alle anwenden
|
|
2141
|
-
var
|
|
2142
|
-
var _affectedElements =
|
|
2251
|
+
var _cellPos = boxPlannerGrid.getCellsInGridByElementId(targetElementId);
|
|
2252
|
+
var _affectedElements = _cellPos.backside ? boxPlannerGrid.getAllElementsInBackGrid() : boxPlannerGrid.getAllElementsInFrontGrid();
|
|
2143
2253
|
if (_affectedElements != undefined) {
|
|
2144
2254
|
for (var i = 0; i < _affectedElements.length; i++) {
|
|
2145
2255
|
this.setOptionValue(_affectedElements[i].ElementId, opt, changedOPTs[opt], optionHandler);
|
|
@@ -2148,12 +2258,12 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2148
2258
|
}
|
|
2149
2259
|
if (this.arrayContainsValue(this.constructionRules.forceSameOptionInCol, opt)) {
|
|
2150
2260
|
//Bitte auf alle anwenden
|
|
2151
|
-
var
|
|
2152
|
-
var _affectedElements2 = boxPlannerGrid.getAllElementsInColumn(
|
|
2261
|
+
var _cellPos2 = boxPlannerGrid.getCellsInGridByElementId(targetElementId);
|
|
2262
|
+
var _affectedElements2 = boxPlannerGrid.getAllElementsInColumn(_cellPos2.startColIndex, _cellPos2.backside);
|
|
2153
2263
|
if (_affectedElements2 != undefined) {
|
|
2154
2264
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
2155
2265
|
var _affectedElements3;
|
|
2156
|
-
var affectedBackside = boxPlannerGrid.getAllElementsInColumn(
|
|
2266
|
+
var affectedBackside = boxPlannerGrid.getAllElementsInColumn(_cellPos2.startColIndex, !_cellPos2.backside);
|
|
2157
2267
|
if (affectedBackside) _affectedElements2 = (_affectedElements3 = _affectedElements2) === null || _affectedElements3 === void 0 ? void 0 : _affectedElements3.concat(affectedBackside);
|
|
2158
2268
|
}
|
|
2159
2269
|
for (var i = 0; i < _affectedElements2.length; i++) {
|
|
@@ -2163,11 +2273,11 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2163
2273
|
}
|
|
2164
2274
|
if (this.arrayContainsValue(this.constructionRules.forceSameOptionInRow, opt)) {
|
|
2165
2275
|
//Bitte auf alle anwenden
|
|
2166
|
-
var
|
|
2167
|
-
var affectedElements = boxPlannerGrid.getAllElementsInRow(
|
|
2276
|
+
var _cellPos3 = boxPlannerGrid.getCellsInGridByElementId(targetElementId);
|
|
2277
|
+
var affectedElements = boxPlannerGrid.getAllElementsInRow(_cellPos3.startRowIndex, _cellPos3.backside);
|
|
2168
2278
|
if (affectedElements) {
|
|
2169
2279
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
2170
|
-
var _affectedBackside = boxPlannerGrid.getAllElementsInRow(
|
|
2280
|
+
var _affectedBackside = boxPlannerGrid.getAllElementsInRow(_cellPos3.startRowIndex, !_cellPos3.backside);
|
|
2171
2281
|
if (_affectedBackside) affectedElements = affectedElements.concat(_affectedBackside);
|
|
2172
2282
|
}
|
|
2173
2283
|
}
|
|
@@ -2179,8 +2289,8 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2179
2289
|
}
|
|
2180
2290
|
|
|
2181
2291
|
//if the targetElement has another height than the other elements in the col - force same height
|
|
2182
|
-
var
|
|
2183
|
-
var allElementsInRow = boxPlannerGrid.getAllElementsInRow(
|
|
2292
|
+
var cellPos = boxPlannerGrid.getCellsInGridByElementId(targetElementId);
|
|
2293
|
+
var allElementsInRow = boxPlannerGrid.getAllElementsInRow(cellPos.startRowIndex, cellPos.backside);
|
|
2184
2294
|
for (var i = 0; i < allElementsInRow.length; i++) {
|
|
2185
2295
|
if (allElementsInRow[i].getElementId() == targetElementId) continue;
|
|
2186
2296
|
for (var j = 0; j < this.constructionRules.forceSameOptionInRow.length; j++) {
|
|
@@ -2322,34 +2432,58 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2322
2432
|
}
|
|
2323
2433
|
|
|
2324
2434
|
//Korrigiere if it has neighbors
|
|
2325
|
-
var
|
|
2326
|
-
var
|
|
2327
|
-
var
|
|
2328
|
-
var
|
|
2329
|
-
var
|
|
2330
|
-
if (
|
|
2331
|
-
|
|
2435
|
+
var rightElemts = !fromBackside ? boxPlannerGrid.getRightElements(curElement.ElementId) : boxPlannerGrid.getLeftElements(curElement.ElementId);
|
|
2436
|
+
var leftElemts = !fromBackside ? boxPlannerGrid.getLeftElements(curElement.ElementId) : boxPlannerGrid.getRightElements(curElement.ElementId);
|
|
2437
|
+
var topElemts = boxPlannerGrid.getTopElements(curElement.ElementId);
|
|
2438
|
+
var bottomElemts = boxPlannerGrid.getBottomElements(curElement.ElementId);
|
|
2439
|
+
var topRightElemt = !fromBackside ? boxPlannerGrid.getTopRightElement(curElement.ElementId) : boxPlannerGrid.getTopLeftElement(curElement.ElementId);
|
|
2440
|
+
if (rightElemts.length > 0) {
|
|
2441
|
+
if (rightElemts.length > 1) {
|
|
2442
|
+
LOG$2.error(new DivaUtils.DivaError('BoxPlannerError - only one OPTNACHBAR_RECHTS allowed', {
|
|
2443
|
+
code: 'WC_0012'
|
|
2444
|
+
}));
|
|
2445
|
+
} else {
|
|
2446
|
+
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_RECHTS', this.getOptionVal(rightElemts[0].ElementId, 'OPTELEMENT', optionHandler), optionHandler);
|
|
2447
|
+
}
|
|
2332
2448
|
} else {
|
|
2333
2449
|
this.setOptionDoHide(curElement.ElementId, 'OPTNACHBAR_RECHTS', optionHandler);
|
|
2334
2450
|
}
|
|
2335
|
-
if (
|
|
2336
|
-
|
|
2451
|
+
if (leftElemts.length > 0) {
|
|
2452
|
+
if (leftElemts.length > 1) {
|
|
2453
|
+
LOG$2.error(new DivaUtils.DivaError('BoxPlannerError - only one OPTNACHBAR_LINKS allowed', {
|
|
2454
|
+
code: 'WC_0012'
|
|
2455
|
+
}));
|
|
2456
|
+
} else {
|
|
2457
|
+
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_LINKS', this.getOptionVal(leftElemts[0].ElementId, 'OPTELEMENT', optionHandler), optionHandler);
|
|
2458
|
+
}
|
|
2337
2459
|
} else {
|
|
2338
2460
|
this.setOptionDoHide(curElement.ElementId, 'OPTNACHBAR_LINKS', optionHandler);
|
|
2339
2461
|
}
|
|
2340
|
-
if (
|
|
2341
|
-
|
|
2462
|
+
if (topElemts.length > 0) {
|
|
2463
|
+
if (topElemts.length > 1) {
|
|
2464
|
+
LOG$2.error(new DivaUtils.DivaError('BoxPlannerError - only one OPTNACHBAR_OBEN allowed', {
|
|
2465
|
+
code: 'WC_0012'
|
|
2466
|
+
}));
|
|
2467
|
+
} else {
|
|
2468
|
+
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_OBEN', this.getOptionVal(topElemts[0].ElementId, 'OPTELEMENT', optionHandler), optionHandler);
|
|
2469
|
+
}
|
|
2342
2470
|
} else {
|
|
2343
2471
|
this.setOptionDoHide(curElement.ElementId, 'OPTNACHBAR_OBEN', optionHandler);
|
|
2344
2472
|
}
|
|
2345
|
-
if (
|
|
2346
|
-
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_OBEN_RECHTS', this.getOptionVal(
|
|
2473
|
+
if (topRightElemt) {
|
|
2474
|
+
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_OBEN_RECHTS', this.getOptionVal(topRightElemt.ElementId, 'OPTELEMENT', optionHandler), optionHandler);
|
|
2347
2475
|
} else {
|
|
2348
2476
|
this.setOptionDoHide(curElement.ElementId, 'OPTNACHBAR_OBEN_RECHTS', optionHandler);
|
|
2349
2477
|
}
|
|
2350
2478
|
if (this.constructionRules.hasNeighbors && this.constructionRules.hasNeighbors.indexOf('OPTNACHBAR_UNTEN') >= 0) {
|
|
2351
|
-
if (
|
|
2352
|
-
|
|
2479
|
+
if (bottomElemts.length > 0) {
|
|
2480
|
+
if (bottomElemts.length > 1) {
|
|
2481
|
+
LOG$2.error(new DivaUtils.DivaError('BoxPlannerError - only one OPTNACHBAR_UNTEN allowed', {
|
|
2482
|
+
code: 'WC_0012'
|
|
2483
|
+
}));
|
|
2484
|
+
} else {
|
|
2485
|
+
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_UNTEN', this.getOptionVal(bottomElemts[0].ElementId, 'OPTELEMENT', optionHandler), optionHandler);
|
|
2486
|
+
}
|
|
2353
2487
|
} else {
|
|
2354
2488
|
this.setOptionDoHide(curElement.ElementId, 'OPTNACHBAR_UNTEN', optionHandler);
|
|
2355
2489
|
}
|
|
@@ -2485,7 +2619,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2485
2619
|
//Zuerst korrigieren wir die unterste Reihe, indem wir die richtigen leitern setzen
|
|
2486
2620
|
var allBottomElements = boxPlannerGrid.getAllElementsInRow(this.constructionRules.correctLadder.rowIndex, false);
|
|
2487
2621
|
for (var i = 0; i < allBottomElements.length; i++) {
|
|
2488
|
-
var rowCount = boxPlannerGrid.getRowCount(i);
|
|
2622
|
+
var rowCount = boxPlannerGrid.getRowCount(i, false);
|
|
2489
2623
|
//If the count of elements in column is not valid for the height 18, then the height is corrected
|
|
2490
2624
|
if (this.constructionRules.correctLadder.onElementHighestRowCount) {
|
|
2491
2625
|
if (this.constructionRules.correctLadder.onElementHighestRowCount.indexOf(rowCount) == -1) {
|
|
@@ -2575,7 +2709,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2575
2709
|
|
|
2576
2710
|
var curColI = 0;
|
|
2577
2711
|
var elementsPerCol = boxPlannerGrid.getAllElementsInColumn(curColI, false);
|
|
2578
|
-
while (elementsPerCol
|
|
2712
|
+
while (elementsPerCol.length > 0) {
|
|
2579
2713
|
if (elementsPerCol.length == sizeOfHighesRow) {
|
|
2580
2714
|
var element = elementsPerCol[sizeOfHighesRow - 1];
|
|
2581
2715
|
curRow.push(element);
|
|
@@ -2615,12 +2749,12 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2615
2749
|
opvValue = 'OPVABDECKPLATTE_227';
|
|
2616
2750
|
}
|
|
2617
2751
|
if (opvValue != '' && !oneCornerColumn) {
|
|
2618
|
-
var _allElements = boxPlannerGrid.
|
|
2752
|
+
var _allElements = boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
2619
2753
|
for (var _i = 0; _i < _allElements.length; _i++) {
|
|
2620
2754
|
if (this.checkArticleHasOption(_allElements[_i].getElementId(), 'OPTABD_HIDE')) this.setOptionDoHide(_allElements[_i].getElementId(), 'OPTABD_HIDE', optionHandler);
|
|
2621
2755
|
}
|
|
2622
2756
|
} else {
|
|
2623
|
-
var _allElements2 = boxPlannerGrid.
|
|
2757
|
+
var _allElements2 = boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
2624
2758
|
for (var _i2 = 0; _i2 < _allElements2.length; _i2++) {
|
|
2625
2759
|
if (this.checkArticleHasOption(_allElements2[_i2].getElementId(), 'OPTABD_HIDE')) this.setOptionDoShow(_allElements2[_i2].getElementId(), 'OPTABD_HIDE', optionHandler);
|
|
2626
2760
|
}
|
|
@@ -2640,8 +2774,8 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2640
2774
|
}, {
|
|
2641
2775
|
key: "correctForceOptOfElement",
|
|
2642
2776
|
value: function correctForceOptOfElement(curElementId, boxPlannerGrid, optionHandler, fromBackside) {
|
|
2643
|
-
var
|
|
2644
|
-
if (
|
|
2777
|
+
var curCellPos = boxPlannerGrid.getCellsInGridByElementId(curElementId);
|
|
2778
|
+
if (curCellPos.cells.length == 0) return;
|
|
2645
2779
|
var rulesForCurArticle = this.getCurOptionBasedConstructionRules(curElementId, optionHandler);
|
|
2646
2780
|
for (var ruleNum = 0; ruleNum < rulesForCurArticle.length; ruleNum++) {
|
|
2647
2781
|
//Das muss angepasst werden die Option
|
|
@@ -2661,88 +2795,86 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2661
2795
|
if (fromBackside) {
|
|
2662
2796
|
if (tempComplementDir == 'LEFT') tempComplementDir = 'RIGHT';else if (tempComplementDir == 'RIGHT') tempComplementDir = 'LEFT';
|
|
2663
2797
|
}
|
|
2664
|
-
var
|
|
2665
|
-
if (
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
var forceOption2 = rulesForNeighborArticle[ruleNum2].forceOptions[forceOptNum2];
|
|
2679
|
-
if (forceOption2.rule && forceOption2.rule != '') {
|
|
2680
|
-
if (!this.evalRule(neighbourElement.ElementId, forceOption2.rule, optionHandler)) continue;
|
|
2681
|
-
}
|
|
2682
|
-
if (this.arrayContainsValue(forceOption2.options, complementOptName)) {
|
|
2683
|
-
//Es wurde gefunden als FORCE. jetzt müssen beide angepasst werden.
|
|
2684
|
-
complementOptNameIsForce = true;
|
|
2685
|
-
//case 2 curOption is force und complementOPT is force
|
|
2686
|
-
// - Beide to show: Show opt von actConfig, hide complementOPT
|
|
2687
|
-
// - Beide to hide: Hide both options
|
|
2688
|
-
if (forceOptValue == 'doShow' && forceOption2.value == 'doShow') {
|
|
2689
|
-
//Zeige option von aktuellem an und hide andere
|
|
2690
|
-
//setOptionDoShow(curArticle, optName);
|
|
2691
|
-
//Außnahme wenn Beide Element mit FUELLUNG sind - da darf jetzt keine Füllung dazwischen sein.
|
|
2692
|
-
if (this.getOptionVal(curElementId, 'OPTELEMENT', optionHandler) == 'OPVFUELLUNG' && this.getOptionVal(neighbourElement.ElementId, 'OPTELEMENT', optionHandler) == 'OPVFUELLUNG') {
|
|
2693
|
-
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2694
|
-
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2695
|
-
} else {
|
|
2696
|
-
this.setOptionDoShow(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2697
|
-
}
|
|
2798
|
+
var neighbourElements = boxPlannerGrid.getNeighborElements(curElementId, tempComplementDir);
|
|
2799
|
+
if (neighbourElements.length > 0) {
|
|
2800
|
+
for (var i = 0; i < neighbourElements.length; i++) {
|
|
2801
|
+
//Check complementary option
|
|
2802
|
+
var neighbourElement = neighbourElements[i];
|
|
2803
|
+
var rulesForNeighborArticle = this.getCurOptionBasedConstructionRules(neighbourElement.ElementId, optionHandler);
|
|
2804
|
+
var complementOptName = optInfo.complementOPT;
|
|
2805
|
+
var complementOptNameIsForce = false;
|
|
2806
|
+
for (var ruleNum2 = 0; ruleNum2 < rulesForNeighborArticle.length; ruleNum2++) {
|
|
2807
|
+
if (!rulesForNeighborArticle[ruleNum2].forceOptions) continue;
|
|
2808
|
+
for (var forceOptNum2 = 0; forceOptNum2 < rulesForNeighborArticle[ruleNum2].forceOptions.length; forceOptNum2++) {
|
|
2809
|
+
var forceOption2 = rulesForNeighborArticle[ruleNum2].forceOptions[forceOptNum2];
|
|
2810
|
+
if (forceOption2.rule && forceOption2.rule != '') {
|
|
2811
|
+
if (!this.evalRule(neighbourElement.ElementId, forceOption2.rule, optionHandler)) continue;
|
|
2698
2812
|
}
|
|
2699
|
-
if (
|
|
2700
|
-
//
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
} else if (forceOption.prio) {
|
|
2711
|
-
doPrioCurArt = true;
|
|
2712
|
-
} else if (forceOption2.prio) {
|
|
2713
|
-
doPrioCurArt = false;
|
|
2714
|
-
}
|
|
2715
|
-
if (doPrioCurArt) {
|
|
2716
|
-
if (forceOptValue == 'doHide') {
|
|
2717
|
-
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2718
|
-
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler);
|
|
2719
|
-
} else if (forceOptValue == 'doShow') {
|
|
2720
|
-
this.setOptionDoShow(curElementId, optName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2813
|
+
if (this.arrayContainsValue(forceOption2.options, complementOptName)) {
|
|
2814
|
+
//Es wurde gefunden als FORCE. jetzt müssen beide angepasst werden.
|
|
2815
|
+
complementOptNameIsForce = true;
|
|
2816
|
+
//case 2 curOption is force und complementOPT is force
|
|
2817
|
+
// - Beide to show: Show opt von actConfig, hide complementOPT
|
|
2818
|
+
// - Beide to hide: Hide both options
|
|
2819
|
+
if (forceOptValue == 'doShow' && forceOption2.value == 'doShow') {
|
|
2820
|
+
//Zeige option von aktuellem an und hide andere
|
|
2821
|
+
//setOptionDoShow(curArticle, optName);
|
|
2822
|
+
//Außnahme wenn Beide Element mit FUELLUNG sind - da darf jetzt keine Füllung dazwischen sein.
|
|
2823
|
+
if (this.getOptionVal(curElementId, 'OPTELEMENT', optionHandler) == 'OPVFUELLUNG' && this.getOptionVal(neighbourElement.ElementId, 'OPTELEMENT', optionHandler) == 'OPVFUELLUNG') {
|
|
2721
2824
|
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2722
|
-
}
|
|
2723
|
-
} else {
|
|
2724
|
-
if (forceOption2.value == 'doHide') {
|
|
2725
|
-
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2726
2825
|
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2727
|
-
} else
|
|
2728
|
-
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2826
|
+
} else {
|
|
2729
2827
|
this.setOptionDoShow(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2730
2828
|
}
|
|
2731
2829
|
}
|
|
2830
|
+
if (forceOptValue == 'doHide' && forceOption2.value == 'doHide') {
|
|
2831
|
+
//Hide beide
|
|
2832
|
+
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2833
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler);
|
|
2834
|
+
}
|
|
2835
|
+
if (forceOptValue == 'doShow' && forceOption2.value == 'doHide' || forceOptValue == 'doHide' && forceOption2.value == 'doShow') {
|
|
2836
|
+
//Tausche die Option Element vom anderen!
|
|
2837
|
+
//Now evaluate if one option has the higher prio than the other. The lower the number the higher the prio. If the prio is the same - do nothing!
|
|
2838
|
+
var doPrioCurArt = true;
|
|
2839
|
+
if (forceOption.prio && forceOption2.prio) {
|
|
2840
|
+
doPrioCurArt = forceOption.prio <= forceOption2.prio;
|
|
2841
|
+
} else if (forceOption.prio) {
|
|
2842
|
+
doPrioCurArt = true;
|
|
2843
|
+
} else if (forceOption2.prio) {
|
|
2844
|
+
doPrioCurArt = false;
|
|
2845
|
+
}
|
|
2846
|
+
if (doPrioCurArt) {
|
|
2847
|
+
if (forceOptValue == 'doHide') {
|
|
2848
|
+
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2849
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler);
|
|
2850
|
+
} else if (forceOptValue == 'doShow') {
|
|
2851
|
+
this.setOptionDoShow(curElementId, optName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2852
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2853
|
+
}
|
|
2854
|
+
} else {
|
|
2855
|
+
if (forceOption2.value == 'doHide') {
|
|
2856
|
+
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2857
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2858
|
+
} else if (forceOption2.value == 'doShow') {
|
|
2859
|
+
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2860
|
+
this.setOptionDoShow(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2732
2864
|
}
|
|
2733
2865
|
}
|
|
2734
2866
|
}
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2867
|
+
if (!complementOptNameIsForce) {
|
|
2868
|
+
//Case 1 curOption is force and complementOPT is obligatory
|
|
2869
|
+
// Zeige curOption an oder nicht an - complementOPT wird NICHT angezeigt
|
|
2870
|
+
if (forceOptValue == 'doShow') {
|
|
2871
|
+
this.setOptionDoShow(curElementId, optName, optionHandler);
|
|
2872
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler);
|
|
2873
|
+
}
|
|
2874
|
+
if (forceOptValue == 'doHide') {
|
|
2875
|
+
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2876
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler);
|
|
2877
|
+
}
|
|
2746
2878
|
}
|
|
2747
2879
|
}
|
|
2748
2880
|
} else {
|
|
@@ -2781,30 +2913,17 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2781
2913
|
}
|
|
2782
2914
|
}
|
|
2783
2915
|
}
|
|
2784
|
-
|
|
2785
|
-
/*
|
|
2786
|
-
"_comment_correctRetailArticleNumberByRule": "Specifies that SAP numbers have to be switched when all Elements (range=global) satisfy the rule",
|
|
2787
|
-
"range": "global",
|
|
2788
|
-
"rule": "OPTFARBE_RAHMEN=OPVCHROM&OPTFARBE=OPVWEISS",
|
|
2789
|
-
"retailArticleRules": [
|
|
2790
|
-
{
|
|
2791
|
-
"origRetailArticleNr": 91194,
|
|
2792
|
-
"origPrefix": "SAP",
|
|
2793
|
-
"newRetailArticleNr": 90771,
|
|
2794
|
-
"newPrefix": "SAP"
|
|
2795
|
-
},
|
|
2796
|
-
*/
|
|
2797
2916
|
}, {
|
|
2798
2917
|
key: "correctNeighborCustomOLTs",
|
|
2799
2918
|
value: function correctNeighborCustomOLTs(curElementId, boxPlannerGrid, optionHandler) {
|
|
2800
2919
|
if (!this.constructionRules.correctNeighborOPT || this.constructionRules.correctNeighborOPT.length == 0) return;
|
|
2801
2920
|
for (var i = 0; i < this.constructionRules.correctNeighborOPT.length; i++) {
|
|
2802
|
-
var
|
|
2921
|
+
var curCellPos = boxPlannerGrid.getCellsInGridByElementId(curElementId);
|
|
2803
2922
|
this.setOptionValue(curElementId, this.constructionRules.correctNeighborOPT[i].opt, 'OPVOHNE', optionHandler);
|
|
2804
|
-
if (
|
|
2805
|
-
var
|
|
2806
|
-
if (
|
|
2807
|
-
var optionNeighborVal = this.getOptionVal(
|
|
2923
|
+
if (curCellPos.cells.length == 0) return;
|
|
2924
|
+
var neighbourElements = boxPlannerGrid.getNeighborElements(curElementId, this.constructionRules.correctNeighborOPT[i].dir);
|
|
2925
|
+
if (neighbourElements.length > 0) {
|
|
2926
|
+
var optionNeighborVal = this.getOptionVal(neighbourElements[0].ElementId, this.constructionRules.correctNeighborOPT[i].neighborOPT, optionHandler);
|
|
2808
2927
|
if (optionNeighborVal != '') this.setOptionValue(curElementId, this.constructionRules.correctNeighborOPT[i].opt, optionNeighborVal, optionHandler);
|
|
2809
2928
|
}
|
|
2810
2929
|
}
|
|
@@ -2812,7 +2931,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2812
2931
|
}, {
|
|
2813
2932
|
key: "doChangeRetailArticleNumbers",
|
|
2814
2933
|
value: function doChangeRetailArticleNumbers(boxPlannerGrid, optionHandler) {
|
|
2815
|
-
var allElements = boxPlannerGrid.
|
|
2934
|
+
var allElements = boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
2816
2935
|
if (this.constructionRules.correctRetailArticleNumberByRule && this.constructionRules.correctRetailArticleNumberByRule.length > 0) {
|
|
2817
2936
|
var allValid = true;
|
|
2818
2937
|
for (var i = 0; i < this.constructionRules.correctRetailArticleNumberByRule.length; i++) {
|
|
@@ -2904,26 +3023,26 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2904
3023
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) this.correctBottom(boxPlannerGrid, optionHandler, true);
|
|
2905
3024
|
this.correctSeries(boxPlannerGrid, optionHandler);
|
|
2906
3025
|
for (i = 0; i < boxPlannerGrid.getColumnCount(); i++) {
|
|
2907
|
-
for (j = 0; j < boxPlannerGrid.getRowCount(i); j++) {
|
|
3026
|
+
for (j = 0; j < boxPlannerGrid.getRowCount(i, false); j++) {
|
|
2908
3027
|
this.correctSimpleOpt(i, j, boxPlannerGrid, optionHandler, false);
|
|
2909
3028
|
}
|
|
2910
3029
|
}
|
|
2911
3030
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
2912
3031
|
for (i = boxPlannerGrid.getColumnCount() - 1; i >= 0; i--) {
|
|
2913
|
-
for (j = 0; j < boxPlannerGrid.getRowCount(i); j++) {
|
|
3032
|
+
for (j = 0; j < boxPlannerGrid.getRowCount(i, false); j++) {
|
|
2914
3033
|
this.correctSimpleOpt(i, j, boxPlannerGrid, optionHandler, true);
|
|
2915
3034
|
}
|
|
2916
3035
|
}
|
|
2917
3036
|
}
|
|
2918
3037
|
for (i = 0; i < boxPlannerGrid.getColumnCount(); i++) {
|
|
2919
|
-
for (j = 0; j < boxPlannerGrid.getRowCount(i); j++) {
|
|
3038
|
+
for (j = 0; j < boxPlannerGrid.getRowCount(i, false); j++) {
|
|
2920
3039
|
this.correctForceOptOfElement(boxPlannerGrid.getPlannerElementAtGridPos(i, j, false).ElementId, boxPlannerGrid, optionHandler, false);
|
|
2921
3040
|
this.correctNeighborCustomOLTs(boxPlannerGrid.getPlannerElementAtGridPos(i, j, false).ElementId, boxPlannerGrid, optionHandler);
|
|
2922
3041
|
}
|
|
2923
3042
|
}
|
|
2924
3043
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
2925
3044
|
for (i = boxPlannerGrid.getColumnCount() - 1; i >= 0; i--) {
|
|
2926
|
-
for (j = 0; j < boxPlannerGrid.getRowCount(i); j++) {
|
|
3045
|
+
for (j = 0; j < boxPlannerGrid.getRowCount(i, false); j++) {
|
|
2927
3046
|
this.correctForceOptOfElement(boxPlannerGrid.getPlannerElementAtGridPos(i, j, true).ElementId, boxPlannerGrid, optionHandler, true);
|
|
2928
3047
|
this.correctNeighborCustomOLTs(boxPlannerGrid.getPlannerElementAtGridPos(i, j, true).ElementId, boxPlannerGrid, optionHandler);
|
|
2929
3048
|
}
|
|
@@ -2933,7 +3052,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2933
3052
|
this.partlistHelper.calculateKnots(boxPlannerGrid, optionHandler);
|
|
2934
3053
|
this.partlistHelper.calculateRahmen(boxPlannerGrid, optionHandler);
|
|
2935
3054
|
for (i = 0; i < boxPlannerGrid.getColumnCount(); i++) {
|
|
2936
|
-
for (j = 0; j < boxPlannerGrid.getRowCount(i); j++) {
|
|
3055
|
+
for (j = 0; j < boxPlannerGrid.getRowCount(i, false); j++) {
|
|
2937
3056
|
this.correctBack(boxPlannerGrid, optionHandler, boxPlannerGrid.getPlannerElementAtGridPos(i, j, false).getElementId());
|
|
2938
3057
|
}
|
|
2939
3058
|
}
|
|
@@ -3003,99 +3122,208 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
3003
3122
|
}]);
|
|
3004
3123
|
}();
|
|
3005
3124
|
|
|
3006
|
-
var
|
|
3125
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
3126
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3127
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
3128
|
+
var LOG$1 = DivaUtils__default["default"].initLog('Planner', 'BOX-PLANNER_GRID');
|
|
3007
3129
|
var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
3008
|
-
function BoxPlannerGrid(getValueOfOptionOfArticle) {
|
|
3130
|
+
function BoxPlannerGrid(gridSetupParams, getValueOfOptionOfArticle) {
|
|
3009
3131
|
_classCallCheck__default["default"](this, BoxPlannerGrid);
|
|
3010
|
-
_defineProperty__default["default"](this, "
|
|
3011
|
-
_defineProperty__default["default"](this, "
|
|
3012
|
-
//
|
|
3132
|
+
_defineProperty__default["default"](this, "plannerElements", void 0);
|
|
3133
|
+
_defineProperty__default["default"](this, "frontGrid", void 0);
|
|
3134
|
+
//first entry is width, second height
|
|
3135
|
+
_defineProperty__default["default"](this, "backGrid", void 0);
|
|
3136
|
+
//if cell is empty it is undefined
|
|
3013
3137
|
_defineProperty__default["default"](this, "hasActiveBackside", void 0);
|
|
3014
3138
|
_defineProperty__default["default"](this, "getValueOfOptionOfArticle", void 0);
|
|
3015
|
-
this
|
|
3016
|
-
this.
|
|
3017
|
-
this.
|
|
3139
|
+
_defineProperty__default["default"](this, "gridSetupParams", void 0);
|
|
3140
|
+
this.plannerElements = new Map();
|
|
3141
|
+
this.frontGrid = new Array();
|
|
3142
|
+
this.backGrid = new Array();
|
|
3143
|
+
this.gridSetupParams = gridSetupParams;
|
|
3018
3144
|
this.getValueOfOptionOfArticle = getValueOfOptionOfArticle;
|
|
3145
|
+
this.hasActiveBackside = false;
|
|
3019
3146
|
}
|
|
3020
3147
|
|
|
3021
|
-
|
|
3022
|
-
*
|
|
3148
|
+
/**
|
|
3149
|
+
* This function creates the new cells that are needed when copying an element
|
|
3150
|
+
* @param newElement
|
|
3151
|
+
* @param startColIndex
|
|
3152
|
+
* @param startRowIndex
|
|
3153
|
+
* @returns
|
|
3023
3154
|
*/
|
|
3024
3155
|
return _createClass__default["default"](BoxPlannerGrid, [{
|
|
3156
|
+
key: "createNewCells",
|
|
3157
|
+
value: function createNewCells(newElement, startColIndex, startRowIndex, backside) {
|
|
3158
|
+
if (this.gridSetupParams.forceSingleCellPerElement) {
|
|
3159
|
+
var cell = {
|
|
3160
|
+
//isEmpty: false,
|
|
3161
|
+
plannerElementId: newElement.ElementId,
|
|
3162
|
+
width: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterWidth : newElement.getWidth(),
|
|
3163
|
+
height: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterHeight : newElement.getHeight(),
|
|
3164
|
+
index: new index.Vector2(startColIndex, startRowIndex)
|
|
3165
|
+
};
|
|
3166
|
+
return {
|
|
3167
|
+
cells: [cell],
|
|
3168
|
+
startColIndex: startColIndex,
|
|
3169
|
+
endColIndex: startColIndex,
|
|
3170
|
+
startRowIndex: startRowIndex,
|
|
3171
|
+
endRowIndex: startRowIndex,
|
|
3172
|
+
backside: backside,
|
|
3173
|
+
colCount: 1,
|
|
3174
|
+
rowCount: 1
|
|
3175
|
+
};
|
|
3176
|
+
}
|
|
3177
|
+
if (!this.gridSetupParams.forceFixCellRasterSize) {
|
|
3178
|
+
LOG$1.error(new DivaUtils.DivaError('Box planner with params forceSingleCellPerElement is false and forceFixCellRasterSize is false are not allowed'));
|
|
3179
|
+
}
|
|
3180
|
+
var colCount = Math.round(newElement.getWidth() / this.gridSetupParams.fixCellRasterWidth);
|
|
3181
|
+
var rowCount = Math.round(newElement.getHeight() / this.gridSetupParams.fixCellRasterWidth);
|
|
3182
|
+
var cells = [];
|
|
3183
|
+
for (var i = 0; i < colCount; i++) {
|
|
3184
|
+
for (var j = 0; j < rowCount; j++) {
|
|
3185
|
+
var _cell = {
|
|
3186
|
+
// isEmpty: false,
|
|
3187
|
+
plannerElementId: newElement.ElementId,
|
|
3188
|
+
width: this.gridSetupParams.fixCellRasterWidth,
|
|
3189
|
+
height: this.gridSetupParams.fixCellRasterHeight,
|
|
3190
|
+
index: new index.Vector2(startColIndex + i, startRowIndex + j)
|
|
3191
|
+
};
|
|
3192
|
+
cells.push(_cell);
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
return {
|
|
3196
|
+
cells: cells,
|
|
3197
|
+
startColIndex: startColIndex,
|
|
3198
|
+
endColIndex: startColIndex + colCount - 1,
|
|
3199
|
+
startRowIndex: startRowIndex,
|
|
3200
|
+
endRowIndex: startRowIndex + rowCount - 1,
|
|
3201
|
+
backside: backside,
|
|
3202
|
+
colCount: colCount,
|
|
3203
|
+
rowCount: rowCount
|
|
3204
|
+
};
|
|
3205
|
+
}
|
|
3206
|
+
}, {
|
|
3207
|
+
key: "createEmptyCells",
|
|
3208
|
+
value: function createEmptyCells(colStartIndex, rowStartIndex, colEndIndex, rowEndIndex, refElementWidth, refElementHeight) {
|
|
3209
|
+
var cells = [];
|
|
3210
|
+
for (var i = colStartIndex; i <= colEndIndex; i++) {
|
|
3211
|
+
for (var j = rowStartIndex; j <= rowEndIndex; j++) {
|
|
3212
|
+
var cell = {
|
|
3213
|
+
plannerElementId: -1,
|
|
3214
|
+
width: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterWidth : refElementWidth,
|
|
3215
|
+
height: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterHeight : refElementHeight,
|
|
3216
|
+
index: new index.Vector2(i, j)
|
|
3217
|
+
};
|
|
3218
|
+
cells.push(cell);
|
|
3219
|
+
}
|
|
3220
|
+
}
|
|
3221
|
+
return cells;
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
/**
|
|
3225
|
+
* This function returns the amount of cols and rows an element occupies inside the grid
|
|
3226
|
+
* @param element
|
|
3227
|
+
* @returns
|
|
3228
|
+
*/
|
|
3229
|
+
}, {
|
|
3230
|
+
key: "getCellCount",
|
|
3231
|
+
value: function getCellCount(element) {
|
|
3232
|
+
if (this.gridSetupParams.forceSingleCellPerElement) {
|
|
3233
|
+
return {
|
|
3234
|
+
colCount: 1,
|
|
3235
|
+
rowCount: 1
|
|
3236
|
+
};
|
|
3237
|
+
}
|
|
3238
|
+
var colCount = Math.round(element.getWidth() / this.gridSetupParams.fixCellRasterWidth);
|
|
3239
|
+
var rowCount = Math.round(element.getHeight() / this.gridSetupParams.fixCellRasterWidth);
|
|
3240
|
+
return {
|
|
3241
|
+
colCount: colCount,
|
|
3242
|
+
rowCount: rowCount
|
|
3243
|
+
};
|
|
3244
|
+
}
|
|
3245
|
+
/** this function returns all not Empty cells in the grid */
|
|
3246
|
+
}, {
|
|
3247
|
+
key: "getAllUsedCellsInGrid",
|
|
3248
|
+
value: function getAllUsedCellsInGrid(backside) {
|
|
3249
|
+
var allCellsInGrid = new Array();
|
|
3250
|
+
var curGrid = backside ? this.backGrid : this.frontGrid;
|
|
3251
|
+
for (var i = 0; i < curGrid.length; i++) {
|
|
3252
|
+
for (var j = 0; j < curGrid[i].length; j++) {
|
|
3253
|
+
if (curGrid[i][j] != undefined) allCellsInGrid.push(curGrid[i][j]);
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3256
|
+
return allCellsInGrid;
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
/*
|
|
3260
|
+
* Gibt die Breite einer Spalte im Grid zurück. Die Spalten sind immer gleich breit
|
|
3261
|
+
*/
|
|
3262
|
+
}, {
|
|
3025
3263
|
key: "getGridColumnWidth",
|
|
3026
|
-
value: function getGridColumnWidth(columnIndex
|
|
3027
|
-
var
|
|
3028
|
-
|
|
3029
|
-
for (var j = 0; j < curElementGrid[columnIndex].length; j++) {
|
|
3030
|
-
var width = curElementGrid[columnIndex][j] ? curElementGrid[columnIndex][j].Width == undefined ? 0 : curElementGrid[columnIndex][j].Width : 0;
|
|
3031
|
-
if (width > biggestWidth) biggestWidth = width;
|
|
3264
|
+
value: function getGridColumnWidth(columnIndex) {
|
|
3265
|
+
for (var i = 0; i < this.frontGrid[columnIndex].length; i++) {
|
|
3266
|
+
if (this.frontGrid[columnIndex][i]) return this.frontGrid[columnIndex][i].width;
|
|
3032
3267
|
}
|
|
3033
|
-
return
|
|
3268
|
+
return 0;
|
|
3034
3269
|
}
|
|
3270
|
+
|
|
3271
|
+
/**
|
|
3272
|
+
* Gibt die Höhe einer Spalte zurück
|
|
3273
|
+
* @param columnIdex
|
|
3274
|
+
* @returns
|
|
3275
|
+
*/
|
|
3035
3276
|
}, {
|
|
3036
3277
|
key: "getGridColumnHeight",
|
|
3037
3278
|
value: function getGridColumnHeight(columnIdex) {
|
|
3038
3279
|
var height = 0;
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3280
|
+
var firstElementFound = false;
|
|
3281
|
+
if (this.frontGrid.length > columnIdex) {
|
|
3282
|
+
var allCellsInCol = this.frontGrid[columnIdex];
|
|
3283
|
+
for (var i = allCellsInCol.length; i >= 0; i--) {
|
|
3284
|
+
if (!firstElementFound && allCellsInCol[i]) firstElementFound = true;
|
|
3285
|
+
if (firstElementFound) height += allCellsInCol[i] == undefined ? 0 : allCellsInCol[i].height;
|
|
3044
3286
|
}
|
|
3045
3287
|
}
|
|
3046
3288
|
return height;
|
|
3047
3289
|
}
|
|
3290
|
+
|
|
3048
3291
|
/*
|
|
3049
3292
|
Deletes the Element on the specified grid Position. If there is no other element in the column, the whole column is deleted.
|
|
3050
3293
|
*/
|
|
3051
3294
|
}, {
|
|
3052
|
-
key: "
|
|
3053
|
-
value: function
|
|
3054
|
-
var
|
|
3055
|
-
var
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3295
|
+
key: "deleteElementByIdFromGrid",
|
|
3296
|
+
value: function deleteElementByIdFromGrid(elementIdTodelete) {
|
|
3297
|
+
var gridCellsToDelete = this.getCellsInGridByElementId(elementIdTodelete);
|
|
3298
|
+
var curGrid = gridCellsToDelete.backside ? this.backGrid : this.frontGrid;
|
|
3299
|
+
var rowCountToDelete = 1 + (gridCellsToDelete.endRowIndex - gridCellsToDelete.startRowIndex);
|
|
3300
|
+
var doDeleteCol = false;
|
|
3301
|
+
var startColToDelete = gridCellsToDelete.startColIndex;
|
|
3302
|
+
var colCountToDelete = 1 + (gridCellsToDelete.startColIndex - gridCellsToDelete.endColIndex);
|
|
3303
|
+
|
|
3304
|
+
//check if we need to delete all cols
|
|
3305
|
+
if (this.getRowCount(gridCellsToDelete.startColIndex, gridCellsToDelete.backside) == rowCountToDelete) {
|
|
3306
|
+
doDeleteCol = true;
|
|
3307
|
+
}
|
|
3308
|
+
var allUsedCellCurGrid = this.getAllUsedCellsInGrid(gridCellsToDelete.backside);
|
|
3309
|
+
curGrid = new Array();
|
|
3310
|
+
for (var i = 0; i < allUsedCellCurGrid.length; i++) {
|
|
3311
|
+
var curCellFrontGrid = allUsedCellCurGrid[i];
|
|
3312
|
+
if (curCellFrontGrid.plannerElementId != elementIdTodelete) {
|
|
3313
|
+
if (doDeleteCol && curCellFrontGrid.index.x > startColToDelete) {
|
|
3314
|
+
curCellFrontGrid.index.x -= colCountToDelete;
|
|
3067
3315
|
}
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
//Lösche nur Element
|
|
3071
|
-
for (var i = 0; i < curElementGrid.length; i++) {
|
|
3072
|
-
if (i != gridPos.col) {
|
|
3073
|
-
//Diese Spalte kann gelöscht werden, also nicht mitnehmen
|
|
3074
|
-
helperGrid[i] = curElementGrid[i];
|
|
3075
|
-
} else {
|
|
3076
|
-
helperGrid[i] = new Array();
|
|
3077
|
-
for (var j = 0; j < curElementGrid[i].length; j++) {
|
|
3078
|
-
if (j != gridPos.row) {
|
|
3079
|
-
helperGrid[i][j] = curElementGrid[i][j];
|
|
3080
|
-
}
|
|
3081
|
-
}
|
|
3316
|
+
if (!curGrid[curCellFrontGrid.index.x]) {
|
|
3317
|
+
curGrid[curCellFrontGrid.index.x] = [];
|
|
3082
3318
|
}
|
|
3319
|
+
curGrid[curCellFrontGrid.index.x][curCellFrontGrid.index.y] = curCellFrontGrid;
|
|
3083
3320
|
}
|
|
3084
3321
|
}
|
|
3085
|
-
if (
|
|
3086
|
-
this.backModulPlannedElementGrid = helperGrid;
|
|
3087
|
-
} else {
|
|
3088
|
-
this.plannedElementGrid = helperGrid;
|
|
3089
|
-
}
|
|
3322
|
+
if (gridCellsToDelete.backside) this.backGrid = curGrid;else this.frontGrid = curGrid;
|
|
3090
3323
|
}
|
|
3091
3324
|
|
|
3092
|
-
/*
|
|
3093
|
-
private correctWorldPosInGrid(plannerElement: PlannerElementData) {
|
|
3094
|
-
//Braucht es das überhaupt?
|
|
3095
|
-
}
|
|
3096
|
-
*/
|
|
3097
|
-
|
|
3098
3325
|
/**
|
|
3326
|
+
* CHECK OK
|
|
3099
3327
|
* This function returns the ElementID of the element at a specific GridPosition.
|
|
3100
3328
|
* If there is no element at this position, the function returns undefined
|
|
3101
3329
|
* @param curXPos
|
|
@@ -3104,111 +3332,182 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3104
3332
|
}, {
|
|
3105
3333
|
key: "getPlannerElementAtGridPos",
|
|
3106
3334
|
value: function getPlannerElementAtGridPos(curXPos, curYPos, fromBackmodul) {
|
|
3107
|
-
var curElementGrid = fromBackmodul ? this.
|
|
3335
|
+
var curElementGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
3108
3336
|
if (curElementGrid[curXPos] && curElementGrid[curXPos][curYPos]) {
|
|
3109
|
-
|
|
3337
|
+
var cell = curElementGrid[curXPos][curYPos];
|
|
3338
|
+
if (cell == undefined) return undefined;
|
|
3339
|
+
return this.plannerElements.get(cell.plannerElementId);
|
|
3110
3340
|
}
|
|
3111
3341
|
return undefined;
|
|
3112
3342
|
}
|
|
3113
|
-
|
|
3114
3343
|
/**
|
|
3344
|
+
*
|
|
3115
3345
|
* This function returns the index of an element by elementId in the grid.
|
|
3116
3346
|
* It returns the column and row position in the grid and if it is in the front or backgrid
|
|
3347
|
+
* With onlin it is possible, that one element occupies more than one grid cell. All occupied grid cells are returned in an array
|
|
3117
3348
|
* @param elementId
|
|
3118
3349
|
*/
|
|
3119
3350
|
}, {
|
|
3120
|
-
key: "
|
|
3121
|
-
value: function
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3351
|
+
key: "getCellsInGridByElementId",
|
|
3352
|
+
value: function getCellsInGridByElementId(elementId) {
|
|
3353
|
+
var firstCell = undefined;
|
|
3354
|
+
var onBacksideFound = false;
|
|
3355
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
3356
|
+
for (var j = 0; j < this.frontGrid[i].length; j++) {
|
|
3357
|
+
var cell = this.frontGrid[i][j];
|
|
3358
|
+
if (cell && cell.plannerElementId == elementId) {
|
|
3359
|
+
firstCell = cell;
|
|
3360
|
+
onBacksideFound = false;
|
|
3361
|
+
}
|
|
3129
3362
|
}
|
|
3130
3363
|
}
|
|
3131
|
-
|
|
3132
|
-
for (var
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3364
|
+
if (firstCell == undefined) {
|
|
3365
|
+
for (var i = 0; i < this.backGrid.length; i++) {
|
|
3366
|
+
for (var j = 0; j < this.backGrid[i].length; j++) {
|
|
3367
|
+
var _cell2 = this.backGrid[i][j];
|
|
3368
|
+
if (_cell2 && _cell2.plannerElementId == elementId) {
|
|
3369
|
+
firstCell = _cell2;
|
|
3370
|
+
onBacksideFound = true;
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
}
|
|
3375
|
+
if (firstCell == undefined) return {
|
|
3376
|
+
cells: [],
|
|
3377
|
+
backside: false,
|
|
3378
|
+
startColIndex: -1,
|
|
3379
|
+
endColIndex: -1,
|
|
3380
|
+
startRowIndex: -1,
|
|
3381
|
+
endRowIndex: -1,
|
|
3382
|
+
colCount: 0,
|
|
3383
|
+
rowCount: 0
|
|
3384
|
+
};
|
|
3385
|
+
if (this.gridSetupParams.forceSingleCellPerElement) return {
|
|
3386
|
+
cells: [firstCell],
|
|
3387
|
+
backside: onBacksideFound,
|
|
3388
|
+
startColIndex: firstCell.index.x,
|
|
3389
|
+
endColIndex: firstCell.index.x,
|
|
3390
|
+
startRowIndex: firstCell.index.y,
|
|
3391
|
+
endRowIndex: firstCell.index.y,
|
|
3392
|
+
colCount: 1,
|
|
3393
|
+
rowCount: 1
|
|
3394
|
+
};
|
|
3395
|
+
//Now find the other cells that have the same element
|
|
3396
|
+
|
|
3397
|
+
var curGrid = onBacksideFound ? this.backGrid : this.frontGrid;
|
|
3398
|
+
var cells = [firstCell];
|
|
3399
|
+
var startColIndex = Infinity;
|
|
3400
|
+
var endColIndex = -Infinity;
|
|
3401
|
+
var startRowIndex = Infinity;
|
|
3402
|
+
var endRowIndex = -Infinity;
|
|
3403
|
+
for (var i = firstCell.index.x; i < curGrid.length; i++) {
|
|
3404
|
+
for (var j = firstCell.index.y + 1; j < curGrid.length; j++) {
|
|
3405
|
+
var nextCell = curGrid[i][j];
|
|
3406
|
+
if (nextCell && nextCell.plannerElementId == elementId) {
|
|
3407
|
+
if (i < startColIndex) startColIndex = i;
|
|
3408
|
+
if (i > endColIndex) endColIndex = i;
|
|
3409
|
+
if (j < startRowIndex) startRowIndex = j;
|
|
3410
|
+
if (j > endColIndex) endRowIndex = j;
|
|
3411
|
+
cells.push(nextCell); //also this cell has the same element
|
|
3412
|
+
//TODO
|
|
3413
|
+
} else {
|
|
3414
|
+
break;
|
|
3415
|
+
}
|
|
3138
3416
|
}
|
|
3139
3417
|
}
|
|
3140
3418
|
return {
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3419
|
+
cells: cells,
|
|
3420
|
+
backside: onBacksideFound,
|
|
3421
|
+
startColIndex: startColIndex,
|
|
3422
|
+
endColIndex: endColIndex,
|
|
3423
|
+
startRowIndex: startRowIndex,
|
|
3424
|
+
endRowIndex: endRowIndex,
|
|
3425
|
+
colCount: endColIndex - startColIndex + 1,
|
|
3426
|
+
rowCount: endRowIndex - startRowIndex + 1
|
|
3144
3427
|
};
|
|
3145
3428
|
}
|
|
3429
|
+
|
|
3146
3430
|
/**
|
|
3147
3431
|
* This function returns all elementIds that are inside the grid
|
|
3148
3432
|
*/
|
|
3149
3433
|
}, {
|
|
3150
3434
|
key: "getAllElementIdsInGrid",
|
|
3151
3435
|
value: function getAllElementIdsInGrid() {
|
|
3436
|
+
return Array.from(this.plannerElements.keys());
|
|
3437
|
+
}
|
|
3438
|
+
}, {
|
|
3439
|
+
key: "_getAllElementsInGrid",
|
|
3440
|
+
value: function _getAllElementsInGrid(grid) {
|
|
3152
3441
|
var allElementIds = [];
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3442
|
+
var allElements = [];
|
|
3443
|
+
for (var i = 0; i < grid.length; i++) {
|
|
3444
|
+
for (var j = 0; j < grid[i].length; j++) {
|
|
3445
|
+
var cell = grid[i][j];
|
|
3446
|
+
if (cell == undefined) continue;
|
|
3447
|
+
if (allElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3448
|
+
allElementIds.push(cell.plannerElementId);
|
|
3449
|
+
allElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3450
|
+
}
|
|
3161
3451
|
}
|
|
3162
3452
|
}
|
|
3163
|
-
return
|
|
3453
|
+
return allElements;
|
|
3164
3454
|
}
|
|
3165
3455
|
}, {
|
|
3166
3456
|
key: "getAllElementsInFrontGrid",
|
|
3167
3457
|
value: function getAllElementsInFrontGrid() {
|
|
3168
|
-
|
|
3169
|
-
for (var i = 0; i < this.plannedElementGrid.length; i++) {
|
|
3170
|
-
for (var j = 0; j < this.plannedElementGrid[i].length; j++) {
|
|
3171
|
-
allElements.push(this.plannedElementGrid[i][j]);
|
|
3172
|
-
}
|
|
3173
|
-
}
|
|
3174
|
-
return allElements;
|
|
3458
|
+
return this._getAllElementsInGrid(this.frontGrid);
|
|
3175
3459
|
}
|
|
3176
3460
|
}, {
|
|
3177
3461
|
key: "getAllElementsInBackGrid",
|
|
3178
3462
|
value: function getAllElementsInBackGrid() {
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3463
|
+
return this._getAllElementsInGrid(this.backGrid);
|
|
3464
|
+
}
|
|
3465
|
+
}, {
|
|
3466
|
+
key: "getAllElementsInBacksideModuleGrid",
|
|
3467
|
+
value: function getAllElementsInBacksideModuleGrid() {
|
|
3468
|
+
return this._getAllElementsInGrid(this.backGrid).map(function (element) {
|
|
3469
|
+
return element.ElementId;
|
|
3470
|
+
});
|
|
3186
3471
|
}
|
|
3187
3472
|
/**
|
|
3188
3473
|
* This function returns all elements In grid - from frontside and from backside
|
|
3189
3474
|
*/
|
|
3190
3475
|
}, {
|
|
3191
|
-
key: "
|
|
3192
|
-
value: function
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3476
|
+
key: "getAllElementsInGridSortedbyElementId",
|
|
3477
|
+
value: function getAllElementsInGridSortedbyElementId() {
|
|
3478
|
+
return Array.from(this.plannerElements.values());
|
|
3479
|
+
}
|
|
3480
|
+
}, {
|
|
3481
|
+
key: "getAllElementsInGridSortedbyGridPos",
|
|
3482
|
+
value: function getAllElementsInGridSortedbyGridPos() {
|
|
3483
|
+
var returnElements = [];
|
|
3484
|
+
var allCheckedElementIds = [];
|
|
3485
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
3486
|
+
for (var j = 0; j < this.frontGrid[i].length; j++) {
|
|
3487
|
+
var cell = this.frontGrid[i][j];
|
|
3488
|
+
if (cell && allCheckedElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3489
|
+
var element = this.getElementById(cell.plannerElementId);
|
|
3490
|
+
allCheckedElementIds.push(cell.plannerElementId);
|
|
3491
|
+
returnElements.push(element);
|
|
3492
|
+
}
|
|
3197
3493
|
}
|
|
3198
3494
|
}
|
|
3199
|
-
for (var i = 0; i < this.
|
|
3200
|
-
for (var j = 0; j < this.
|
|
3201
|
-
|
|
3495
|
+
for (var i = 0; i < this.backGrid.length; i++) {
|
|
3496
|
+
for (var j = 0; j < this.backGrid[i].length; j++) {
|
|
3497
|
+
var _cell3 = this.backGrid[i][j];
|
|
3498
|
+
if (_cell3 && allCheckedElementIds.indexOf(_cell3.plannerElementId) == -1) {
|
|
3499
|
+
var _element = this.getElementById(_cell3.plannerElementId);
|
|
3500
|
+
allCheckedElementIds.push(_cell3.plannerElementId);
|
|
3501
|
+
returnElements.push(_element);
|
|
3502
|
+
}
|
|
3202
3503
|
}
|
|
3203
3504
|
}
|
|
3204
|
-
return
|
|
3505
|
+
return returnElements;
|
|
3205
3506
|
}
|
|
3206
3507
|
}, {
|
|
3207
3508
|
key: "getElementById",
|
|
3208
3509
|
value: function getElementById(elementId) {
|
|
3209
|
-
|
|
3210
|
-
var curElementGrid = pos.backside ? this.backModulPlannedElementGrid : this.plannedElementGrid;
|
|
3211
|
-
return curElementGrid[pos.col][pos.row];
|
|
3510
|
+
return this.plannerElements.get(elementId);
|
|
3212
3511
|
}
|
|
3213
3512
|
|
|
3214
3513
|
/**
|
|
@@ -3218,8 +3517,9 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3218
3517
|
}, {
|
|
3219
3518
|
key: "getElementIsFirstInGrid",
|
|
3220
3519
|
value: function getElementIsFirstInGrid(elementId) {
|
|
3221
|
-
var
|
|
3222
|
-
|
|
3520
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3521
|
+
if (result.cells.length == 0) return false;
|
|
3522
|
+
return result.cells[0].index.x == 0 && result.cells[0].index.y == 0 && !result.backside;
|
|
3223
3523
|
}
|
|
3224
3524
|
|
|
3225
3525
|
/**
|
|
@@ -3229,9 +3529,9 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3229
3529
|
}, {
|
|
3230
3530
|
key: "getElementIsInLastCol",
|
|
3231
3531
|
value: function getElementIsInLastCol(elementId, fromBackmodul) {
|
|
3232
|
-
var curElementGrid = fromBackmodul ? this.
|
|
3233
|
-
var
|
|
3234
|
-
return
|
|
3532
|
+
var curElementGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
3533
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3534
|
+
return result.endColIndex + 1 == curElementGrid.length;
|
|
3235
3535
|
}
|
|
3236
3536
|
|
|
3237
3537
|
/**
|
|
@@ -3241,22 +3541,39 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3241
3541
|
}, {
|
|
3242
3542
|
key: "getElementHasTopElement",
|
|
3243
3543
|
value: function getElementHasTopElement(elementId) {
|
|
3244
|
-
var
|
|
3245
|
-
var
|
|
3246
|
-
|
|
3544
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3545
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3546
|
+
for (var i = result.startColIndex; i <= result.endColIndex; i++) {
|
|
3547
|
+
//Check if in one of the top cells is another element
|
|
3548
|
+
if (curGrid[i].length > result.endRowIndex + 1 && curGrid[i][result.endRowIndex + 1]) {
|
|
3549
|
+
return true;
|
|
3550
|
+
}
|
|
3551
|
+
}
|
|
3247
3552
|
return false;
|
|
3248
3553
|
}
|
|
3554
|
+
|
|
3249
3555
|
/**
|
|
3250
|
-
* returns the
|
|
3556
|
+
* returns the elements on the top of the current element
|
|
3251
3557
|
* @param elementId
|
|
3252
3558
|
*/
|
|
3253
3559
|
}, {
|
|
3254
|
-
key: "
|
|
3255
|
-
value: function
|
|
3256
|
-
var
|
|
3257
|
-
var
|
|
3258
|
-
|
|
3259
|
-
|
|
3560
|
+
key: "getTopElements",
|
|
3561
|
+
value: function getTopElements(elementId) {
|
|
3562
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3563
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3564
|
+
var neighborPlannerElements = [];
|
|
3565
|
+
var neighborElementIds = [];
|
|
3566
|
+
for (var i = result.startColIndex; i <= result.endColIndex; i++) {
|
|
3567
|
+
if (curGrid[i].length > result.endRowIndex + 1 && curGrid[i][result.endRowIndex + 1]) {
|
|
3568
|
+
var neighborCell = curGrid[i][result.endRowIndex + 1];
|
|
3569
|
+
if (!neighborCell) continue;
|
|
3570
|
+
if (neighborElementIds.indexOf(neighborCell.plannerElementId) == -1) {
|
|
3571
|
+
neighborElementIds.push(neighborCell.plannerElementId);
|
|
3572
|
+
neighborPlannerElements.push(this.plannerElements.get(neighborCell.plannerElementId));
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
}
|
|
3576
|
+
return neighborPlannerElements;
|
|
3260
3577
|
}
|
|
3261
3578
|
|
|
3262
3579
|
/**
|
|
@@ -3266,9 +3583,12 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3266
3583
|
}, {
|
|
3267
3584
|
key: "getTopRightElement",
|
|
3268
3585
|
value: function getTopRightElement(elementId) {
|
|
3269
|
-
var
|
|
3270
|
-
var
|
|
3271
|
-
if (
|
|
3586
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3587
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3588
|
+
if (curGrid.length > result.endColIndex + 1 && curGrid[result.endColIndex + 1].length > result.endRowIndex + 1 && curGrid[result.endColIndex + 1][result.endRowIndex + 1]) {
|
|
3589
|
+
var cell = curGrid[result.endColIndex + 1][result.endRowIndex + 1];
|
|
3590
|
+
return this.plannerElements.get(cell.plannerElementId);
|
|
3591
|
+
}
|
|
3272
3592
|
return undefined;
|
|
3273
3593
|
}
|
|
3274
3594
|
|
|
@@ -3279,11 +3599,15 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3279
3599
|
}, {
|
|
3280
3600
|
key: "getTopLeftElement",
|
|
3281
3601
|
value: function getTopLeftElement(elementId) {
|
|
3282
|
-
var
|
|
3283
|
-
var
|
|
3284
|
-
if (
|
|
3602
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3603
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3604
|
+
if (result.startColIndex > 0 && curGrid[result.startColIndex - 1].length > 0 && curGrid[result.startColIndex - 1][result.endRowIndex + 1]) {
|
|
3605
|
+
var cell = curGrid[result.startColIndex - 1][result.endRowIndex + 1];
|
|
3606
|
+
return this.plannerElements.get(cell.plannerElementId);
|
|
3607
|
+
}
|
|
3285
3608
|
return undefined;
|
|
3286
3609
|
}
|
|
3610
|
+
|
|
3287
3611
|
/**
|
|
3288
3612
|
* returns true if the element has another element on the bottom
|
|
3289
3613
|
* @param elementId
|
|
@@ -3291,22 +3615,40 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3291
3615
|
}, {
|
|
3292
3616
|
key: "getElementHasBottomElement",
|
|
3293
3617
|
value: function getElementHasBottomElement(elementId) {
|
|
3294
|
-
var
|
|
3295
|
-
if (
|
|
3618
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3619
|
+
if (result.startRowIndex - 1 >= 0) return true;
|
|
3296
3620
|
return false;
|
|
3297
3621
|
}
|
|
3622
|
+
|
|
3298
3623
|
/**
|
|
3299
|
-
* returns
|
|
3624
|
+
* returns all elements on the bottom of the current element from left to right
|
|
3625
|
+
* now following construction of elements is possible. When you want to return the bottom elements of a it returns b,c,d
|
|
3626
|
+
* aaaaaa
|
|
3627
|
+
* bbccdd
|
|
3628
|
+
*
|
|
3300
3629
|
* @param elementId
|
|
3301
3630
|
*/
|
|
3302
3631
|
}, {
|
|
3303
|
-
key: "
|
|
3304
|
-
value: function
|
|
3305
|
-
var
|
|
3306
|
-
var
|
|
3307
|
-
|
|
3308
|
-
|
|
3632
|
+
key: "getBottomElements",
|
|
3633
|
+
value: function getBottomElements(elementId) {
|
|
3634
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3635
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3636
|
+
var bottomElements = [];
|
|
3637
|
+
var bottomElementIds = [];
|
|
3638
|
+
if (result.startRowIndex - 1 >= 0) {
|
|
3639
|
+
for (var i = result.startColIndex; i <= result.endColIndex; i++) {
|
|
3640
|
+
var cell = curGrid[i][result.startRowIndex - 1];
|
|
3641
|
+
if (cell) {
|
|
3642
|
+
if (bottomElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3643
|
+
bottomElementIds.push(cell.plannerElementId);
|
|
3644
|
+
bottomElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3645
|
+
}
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3649
|
+
return bottomElements;
|
|
3309
3650
|
}
|
|
3651
|
+
|
|
3310
3652
|
/**
|
|
3311
3653
|
* returns true if the element has another element on its right side
|
|
3312
3654
|
* @param elementId
|
|
@@ -3314,22 +3656,41 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3314
3656
|
}, {
|
|
3315
3657
|
key: "getElementHasRightElement",
|
|
3316
3658
|
value: function getElementHasRightElement(elementId) {
|
|
3317
|
-
var
|
|
3318
|
-
var
|
|
3319
|
-
if (
|
|
3320
|
-
|
|
3659
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3660
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3661
|
+
if (curGrid.length > result.endColIndex + 1 && curGrid[result.endColIndex + 1].length > result.startRowIndex) {
|
|
3662
|
+
var cell = curGrid[result.endColIndex + 1][result.startRowIndex];
|
|
3663
|
+
if (cell) return true;
|
|
3321
3664
|
}
|
|
3322
3665
|
return false;
|
|
3323
3666
|
}
|
|
3667
|
+
/**
|
|
3668
|
+
* returns all elements right of the current element from bottom to up
|
|
3669
|
+
* now following construction of elements is possible. When getting right Elements of Element a it returns b and c
|
|
3670
|
+
* aabb
|
|
3671
|
+
* aabb
|
|
3672
|
+
* aacc
|
|
3673
|
+
* @param elementId
|
|
3674
|
+
*/
|
|
3324
3675
|
}, {
|
|
3325
|
-
key: "
|
|
3326
|
-
value: function
|
|
3327
|
-
var
|
|
3328
|
-
var
|
|
3329
|
-
|
|
3330
|
-
|
|
3676
|
+
key: "getRightElements",
|
|
3677
|
+
value: function getRightElements(elementId) {
|
|
3678
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3679
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3680
|
+
var rightElements = [];
|
|
3681
|
+
var rightElementIds = [];
|
|
3682
|
+
if (curGrid.length > result.endColIndex + 1) {
|
|
3683
|
+
for (var i = result.startRowIndex; i <= result.endRowIndex; i++) {
|
|
3684
|
+
var cell = curGrid[result.endColIndex + 1][i];
|
|
3685
|
+
if (cell) {
|
|
3686
|
+
if (rightElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3687
|
+
rightElementIds.push(cell.plannerElementId);
|
|
3688
|
+
rightElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3689
|
+
}
|
|
3690
|
+
}
|
|
3691
|
+
}
|
|
3331
3692
|
}
|
|
3332
|
-
return
|
|
3693
|
+
return rightElements;
|
|
3333
3694
|
}
|
|
3334
3695
|
|
|
3335
3696
|
/**
|
|
@@ -3339,39 +3700,72 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3339
3700
|
}, {
|
|
3340
3701
|
key: "getElementHasLeftElement",
|
|
3341
3702
|
value: function getElementHasLeftElement(elementId) {
|
|
3342
|
-
var
|
|
3343
|
-
|
|
3703
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3704
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3705
|
+
if (result.startColIndex > 0 && curGrid[result.startColIndex - 1][result.startRowIndex]) {
|
|
3706
|
+
return true;
|
|
3707
|
+
}
|
|
3344
3708
|
return false;
|
|
3345
3709
|
}
|
|
3710
|
+
/**
|
|
3711
|
+
* returns all elements left of the current element from bottom to up
|
|
3712
|
+
* now following construction of elements is possible. When getting left Elements of Element a it returns b and c
|
|
3713
|
+
* bbaa
|
|
3714
|
+
* bbaa
|
|
3715
|
+
* ccaa
|
|
3716
|
+
* @param elementId
|
|
3717
|
+
*/
|
|
3346
3718
|
}, {
|
|
3347
|
-
key: "
|
|
3348
|
-
value: function
|
|
3349
|
-
var
|
|
3350
|
-
|
|
3351
|
-
|
|
3719
|
+
key: "getLeftElements",
|
|
3720
|
+
value: function getLeftElements(elementId) {
|
|
3721
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3722
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3723
|
+
var leftElements = [];
|
|
3724
|
+
var leftElementIds = [];
|
|
3725
|
+
if (result.startColIndex - 1 >= 0) {
|
|
3726
|
+
for (var i = result.startRowIndex; i <= result.endRowIndex; i++) {
|
|
3727
|
+
var cell = curGrid[result.startColIndex - 1][i];
|
|
3728
|
+
if (cell) {
|
|
3729
|
+
if (leftElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3730
|
+
leftElementIds.push(cell.plannerElementId);
|
|
3731
|
+
leftElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3732
|
+
}
|
|
3733
|
+
}
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
return leftElements;
|
|
3352
3737
|
}
|
|
3738
|
+
|
|
3353
3739
|
/*
|
|
3740
|
+
CHECK OK
|
|
3354
3741
|
returns all Elements in the column.
|
|
3355
3742
|
index: index of the column in the grid
|
|
3356
3743
|
*/
|
|
3357
3744
|
}, {
|
|
3358
3745
|
key: "getAllElementsInColumn",
|
|
3359
3746
|
value: function getAllElementsInColumn(index, fromBackmodul) {
|
|
3360
|
-
var
|
|
3361
|
-
var
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3747
|
+
var curGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
3748
|
+
var allElements = [];
|
|
3749
|
+
var allElementIds = [];
|
|
3750
|
+
if (curGrid.length > index) {
|
|
3751
|
+
for (var i = 0; i < curGrid[index].length; i++) {
|
|
3752
|
+
var cell = curGrid[index][i];
|
|
3753
|
+
if (cell && allElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3754
|
+
allElementIds.push(cell.plannerElementId);
|
|
3755
|
+
allElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3756
|
+
}
|
|
3757
|
+
}
|
|
3365
3758
|
}
|
|
3366
|
-
return
|
|
3759
|
+
return allElements;
|
|
3367
3760
|
}
|
|
3761
|
+
|
|
3368
3762
|
/**
|
|
3369
3763
|
* This function returns the count of columns in the grid
|
|
3370
3764
|
*/
|
|
3371
3765
|
}, {
|
|
3372
3766
|
key: "getColumnCount",
|
|
3373
3767
|
value: function getColumnCount() {
|
|
3374
|
-
return this.
|
|
3768
|
+
return this.frontGrid.length;
|
|
3375
3769
|
}
|
|
3376
3770
|
|
|
3377
3771
|
/**
|
|
@@ -3380,95 +3774,171 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3380
3774
|
*/
|
|
3381
3775
|
}, {
|
|
3382
3776
|
key: "getRowCount",
|
|
3383
|
-
value: function getRowCount(colIndex) {
|
|
3384
|
-
return this.
|
|
3777
|
+
value: function getRowCount(colIndex, fromBackmodul) {
|
|
3778
|
+
return fromBackmodul ? this.backGrid[colIndex].length : this.frontGrid[colIndex].length;
|
|
3385
3779
|
}
|
|
3386
3780
|
|
|
3387
3781
|
/*
|
|
3782
|
+
CHECK OK
|
|
3388
3783
|
returns all Elements in the row of the grid.
|
|
3389
3784
|
index: index of the row in the grid
|
|
3390
3785
|
*/
|
|
3391
3786
|
}, {
|
|
3392
3787
|
key: "getAllElementsInRow",
|
|
3393
3788
|
value: function getAllElementsInRow(index, fromBackmodul) {
|
|
3394
|
-
var
|
|
3789
|
+
var curGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
3395
3790
|
var allElements = [];
|
|
3396
|
-
|
|
3397
|
-
|
|
3791
|
+
var allElementIds = [];
|
|
3792
|
+
for (var i = 0; i < curGrid.length; i++) {
|
|
3793
|
+
if (curGrid[i].length > index) {
|
|
3794
|
+
var cell = curGrid[i][index];
|
|
3795
|
+
if (cell && allElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3796
|
+
allElementIds.push(cell.plannerElementId);
|
|
3797
|
+
allElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3398
3800
|
}
|
|
3399
3801
|
return allElements;
|
|
3400
3802
|
}
|
|
3401
3803
|
|
|
3402
3804
|
/**
|
|
3805
|
+
* CHECK OK
|
|
3403
3806
|
* This function returns the size of the highes row element over all columns
|
|
3404
3807
|
*/
|
|
3405
3808
|
}, {
|
|
3406
3809
|
key: "getSizeOfHighesRow",
|
|
3407
3810
|
value: function getSizeOfHighesRow(fromBackmodul) {
|
|
3408
|
-
var
|
|
3811
|
+
var curGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
3409
3812
|
var highestRow = 0;
|
|
3410
|
-
for (var i = 0; i <
|
|
3411
|
-
|
|
3813
|
+
for (var i = 0; i < curGrid.length; i++) {
|
|
3814
|
+
for (var j = curGrid[i].length; j >= 0; j--) {
|
|
3815
|
+
var cell = curGrid[i][j];
|
|
3816
|
+
if (cell) {
|
|
3817
|
+
if (highestRow < j) highestRow = j;
|
|
3818
|
+
break; //first cell that is not empty was found, skip this loop
|
|
3819
|
+
}
|
|
3820
|
+
}
|
|
3412
3821
|
}
|
|
3413
|
-
return highestRow;
|
|
3822
|
+
return highestRow + 1;
|
|
3414
3823
|
}
|
|
3415
3824
|
|
|
3416
3825
|
/**
|
|
3417
|
-
* This function returns the neighbor
|
|
3826
|
+
* This function returns the neighbor elements in the grid. Now it can be more than one element.
|
|
3827
|
+
* If for example the element has several grid cells in one colum, the function checks all grid cells on the right side. It returns then one or more Elements, depending on the construction
|
|
3828
|
+
* Example:
|
|
3829
|
+
* AAB
|
|
3830
|
+
* AAB
|
|
3831
|
+
* AAC
|
|
3832
|
+
* The right elements of A are B and C
|
|
3418
3833
|
* @param curXPos
|
|
3419
3834
|
* @param curYPos
|
|
3420
3835
|
* @param dir
|
|
3421
3836
|
*/
|
|
3422
3837
|
}, {
|
|
3423
|
-
key: "
|
|
3424
|
-
value: function
|
|
3425
|
-
|
|
3426
|
-
var
|
|
3838
|
+
key: "getNeighborElements",
|
|
3839
|
+
value: function getNeighborElements(elementId, dir) {
|
|
3840
|
+
console.log('ELEMENT ID beim aufruf von getNeighborElements ' + elementId + '; dir: ' + dir);
|
|
3841
|
+
var cellPos = this.getCellsInGridByElementId(elementId);
|
|
3842
|
+
var curGrid = cellPos.backside ? this.backGrid : this.frontGrid;
|
|
3843
|
+
var result = [];
|
|
3844
|
+
var resultPlannerIds = [];
|
|
3427
3845
|
switch (dir) {
|
|
3428
3846
|
case 'TOP':
|
|
3429
|
-
|
|
3847
|
+
for (var i = cellPos.startColIndex; i <= cellPos.endColIndex; i++) {
|
|
3848
|
+
var neighborX = i;
|
|
3849
|
+
var neighborY = cellPos.endRowIndex + 1;
|
|
3850
|
+
if (curGrid[neighborX].length > neighborY) {
|
|
3851
|
+
var neighborCell = curGrid[neighborX][neighborY];
|
|
3852
|
+
if (neighborCell && resultPlannerIds.indexOf(neighborCell.plannerElementId) == -1) {
|
|
3853
|
+
resultPlannerIds.push(neighborCell.plannerElementId);
|
|
3854
|
+
result.push(this.plannerElements.get(neighborCell.plannerElementId));
|
|
3855
|
+
}
|
|
3856
|
+
}
|
|
3857
|
+
}
|
|
3430
3858
|
break;
|
|
3431
3859
|
case 'DOWN':
|
|
3432
|
-
|
|
3860
|
+
for (var i = cellPos.startColIndex; i <= cellPos.endColIndex; i++) {
|
|
3861
|
+
var _neighborX = i;
|
|
3862
|
+
var _neighborY = cellPos.startRowIndex - 1;
|
|
3863
|
+
if (_neighborY >= 0) {
|
|
3864
|
+
var _neighborCell = curGrid[_neighborX][_neighborY];
|
|
3865
|
+
if (_neighborCell && resultPlannerIds.indexOf(_neighborCell.plannerElementId) == -1) {
|
|
3866
|
+
resultPlannerIds.push(_neighborCell.plannerElementId);
|
|
3867
|
+
result.push(this.plannerElements.get(_neighborCell.plannerElementId));
|
|
3868
|
+
}
|
|
3869
|
+
}
|
|
3870
|
+
}
|
|
3433
3871
|
break;
|
|
3434
3872
|
case 'LEFT':
|
|
3435
|
-
|
|
3873
|
+
for (var i = cellPos.startRowIndex; i <= cellPos.endRowIndex; i++) {
|
|
3874
|
+
var _neighborX2 = cellPos.startColIndex - 1;
|
|
3875
|
+
var _neighborY2 = i;
|
|
3876
|
+
if (_neighborX2 >= 0) {
|
|
3877
|
+
var _neighborCell2 = curGrid[_neighborX2][_neighborY2];
|
|
3878
|
+
if (_neighborCell2 && resultPlannerIds.indexOf(_neighborCell2.plannerElementId) == -1) {
|
|
3879
|
+
resultPlannerIds.push(_neighborCell2.plannerElementId);
|
|
3880
|
+
result.push(this.plannerElements.get(_neighborCell2.plannerElementId));
|
|
3881
|
+
}
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3436
3884
|
break;
|
|
3437
3885
|
case 'RIGHT':
|
|
3438
|
-
|
|
3886
|
+
for (var i = cellPos.startRowIndex; i <= cellPos.endRowIndex; i++) {
|
|
3887
|
+
var _neighborX3 = cellPos.startColIndex + 1;
|
|
3888
|
+
var _neighborY3 = i;
|
|
3889
|
+
if (curGrid.length > _neighborX3) {
|
|
3890
|
+
var _neighborCell3 = curGrid[_neighborX3][_neighborY3];
|
|
3891
|
+
if (_neighborCell3 && resultPlannerIds.indexOf(_neighborCell3.plannerElementId) == -1) {
|
|
3892
|
+
resultPlannerIds.push(_neighborCell3.plannerElementId);
|
|
3893
|
+
result.push(this.plannerElements.get(_neighborCell3.plannerElementId));
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3896
|
+
}
|
|
3439
3897
|
break;
|
|
3440
3898
|
case 'BACK':
|
|
3441
3899
|
if (this.hasActiveBackside) {
|
|
3442
|
-
|
|
3900
|
+
var plannerElement = this.getPlannerElementAtGridPos(cellPos.startColIndex, cellPos.startRowIndex, true);
|
|
3901
|
+
if (plannerElement != undefined) result = [plannerElement];
|
|
3443
3902
|
}
|
|
3444
3903
|
break;
|
|
3445
3904
|
}
|
|
3446
|
-
return
|
|
3905
|
+
return result;
|
|
3447
3906
|
}
|
|
3907
|
+
|
|
3908
|
+
/**
|
|
3909
|
+
* Returns the opposide element in the grid. This function only looks at the element that is placed at the same grid pos as the start Col und start Row Index of the element.
|
|
3910
|
+
* It always returns only one element or none
|
|
3911
|
+
* @param elementId
|
|
3912
|
+
* @returns
|
|
3913
|
+
*/
|
|
3448
3914
|
}, {
|
|
3449
3915
|
key: "getOppositeElement",
|
|
3450
3916
|
value: function getOppositeElement(elementId) {
|
|
3451
3917
|
if (this.hasActiveBackside) {
|
|
3452
|
-
var pos = this.
|
|
3918
|
+
var pos = this.getCellsInGridByElementId(elementId);
|
|
3453
3919
|
if (pos.backside) {
|
|
3454
|
-
return this.
|
|
3920
|
+
return this.getPlannerElementAtGridPos(pos.startColIndex, pos.startRowIndex, false);
|
|
3455
3921
|
} else {
|
|
3456
|
-
return this.
|
|
3922
|
+
return this.getPlannerElementAtGridPos(pos.startColIndex, pos.startRowIndex, true);
|
|
3457
3923
|
}
|
|
3458
3924
|
}
|
|
3459
3925
|
return undefined;
|
|
3460
3926
|
}
|
|
3927
|
+
/**
|
|
3928
|
+
* Returns the opposide elements in the grid given an array of element ids. This function only looks at the element that is placed at the same grid pos as the start Col und start Row Index of the element.
|
|
3929
|
+
* It always returns only one element or none
|
|
3930
|
+
* @param elementId
|
|
3931
|
+
* @returns
|
|
3932
|
+
*/
|
|
3461
3933
|
}, {
|
|
3462
|
-
key: "
|
|
3463
|
-
value: function
|
|
3934
|
+
key: "getOppositeElements",
|
|
3935
|
+
value: function getOppositeElements(elementIds) {
|
|
3464
3936
|
var oppositeElements = [];
|
|
3465
3937
|
if (this.hasActiveBackside) {
|
|
3466
3938
|
for (var i = 0; i < elementIds.length; i++) {
|
|
3467
|
-
var
|
|
3468
|
-
if (
|
|
3469
|
-
oppositeElements.push(
|
|
3470
|
-
} else {
|
|
3471
|
-
if (this.backModulPlannedElementGrid[pos.col][pos.row]) oppositeElements.push(this.backModulPlannedElementGrid[pos.col][pos.row].getElementId());
|
|
3939
|
+
var oppositeElement = this.getOppositeElement(elementIds[i]);
|
|
3940
|
+
if (oppositeElement != undefined) {
|
|
3941
|
+
oppositeElements.push(oppositeElement);
|
|
3472
3942
|
}
|
|
3473
3943
|
}
|
|
3474
3944
|
}
|
|
@@ -3481,20 +3951,23 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3481
3951
|
*/
|
|
3482
3952
|
}, {
|
|
3483
3953
|
key: "getSizeOfWholeSet",
|
|
3484
|
-
value: function getSizeOfWholeSet() {
|
|
3954
|
+
value: function getSizeOfWholeSet(correctSizeSystem4) {
|
|
3485
3955
|
var width = 0;
|
|
3486
3956
|
var depth = 0;
|
|
3487
3957
|
var height = 0;
|
|
3488
|
-
|
|
3958
|
+
var checkedElementIds = [];
|
|
3959
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
3489
3960
|
var curHeight = 0;
|
|
3490
|
-
for (var j = 0; j < this.
|
|
3491
|
-
var
|
|
3492
|
-
|
|
3493
|
-
|
|
3961
|
+
for (var j = 0; j < this.frontGrid[i].length; j++) {
|
|
3962
|
+
var cell = this.frontGrid[i][j];
|
|
3963
|
+
if (cell && checkedElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3964
|
+
curHeight += this.plannerElements.get(cell.plannerElementId).getHeight();
|
|
3965
|
+
if (i == 0 && j == 0) depth = this.plannerElements.get(cell.plannerElementId).getDepth();
|
|
3966
|
+
}
|
|
3494
3967
|
}
|
|
3495
3968
|
if (curHeight > height) height = curHeight;
|
|
3496
|
-
var curWidth = this.getGridColumnWidth(i
|
|
3497
|
-
if (i > 0) {
|
|
3969
|
+
var curWidth = this.getGridColumnWidth(i);
|
|
3970
|
+
if (correctSizeSystem4 && i > 0) {
|
|
3498
3971
|
//Correct width
|
|
3499
3972
|
if (curWidth == 77.9) curWidth = 75;else if (curWidth == 40.4) curWidth = 37.5;else if (curWidth == 21.7) curWidth = 18.75;
|
|
3500
3973
|
}
|
|
@@ -3505,193 +3978,226 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3505
3978
|
}
|
|
3506
3979
|
|
|
3507
3980
|
/**
|
|
3508
|
-
* Returns all other elements in the grid that are in the same row as the elementId from the parameter
|
|
3981
|
+
* Returns all other elements in the grid that are in the same row as the elementId from the parameter. It only returns the elements on along the startRowIndex
|
|
3982
|
+
* Excample:
|
|
3983
|
+
* AAC
|
|
3984
|
+
* AAB
|
|
3985
|
+
* AABD
|
|
3986
|
+
* EEED
|
|
3987
|
+
* The elements that are in the same row as A are B and D
|
|
3509
3988
|
* @param elementId
|
|
3510
3989
|
*/
|
|
3511
3990
|
}, {
|
|
3512
3991
|
key: "getAllElementsInSameRowByElementId",
|
|
3513
3992
|
value: function getAllElementsInSameRowByElementId(elementId) {
|
|
3514
|
-
var
|
|
3515
|
-
var allElementsInRow = this.getAllElementsInRow(
|
|
3993
|
+
var curPos = this.getCellsInGridByElementId(elementId);
|
|
3994
|
+
var allElementsInRow = this.getAllElementsInRow(curPos.startRowIndex, false);
|
|
3516
3995
|
if (this.hasActiveBackside) {
|
|
3517
|
-
allElementsInRow = allElementsInRow.concat(this.getAllElementsInRow(
|
|
3996
|
+
allElementsInRow = allElementsInRow.concat(this.getAllElementsInRow(curPos.startRowIndex, true));
|
|
3518
3997
|
}
|
|
3519
3998
|
return {
|
|
3520
3999
|
elementIds: allElementsInRow.map(function (obj) {
|
|
3521
4000
|
return obj.ElementId;
|
|
3522
4001
|
}),
|
|
3523
4002
|
plannerElements: allElementsInRow,
|
|
3524
|
-
backside:
|
|
4003
|
+
backside: curPos.backside
|
|
3525
4004
|
};
|
|
3526
4005
|
}
|
|
3527
4006
|
|
|
3528
4007
|
/**
|
|
3529
4008
|
* Returns all Elements that are under the specified element
|
|
4009
|
+
* AAAE
|
|
4010
|
+
* BBCE
|
|
4011
|
+
* DDDD
|
|
4012
|
+
* DDDD
|
|
4013
|
+
* The Elements that are under A are B, C and D
|
|
3530
4014
|
*/
|
|
3531
4015
|
}, {
|
|
3532
4016
|
key: "getAllElementsDown",
|
|
3533
4017
|
value: function getAllElementsDown(elementId) {
|
|
3534
|
-
var
|
|
3535
|
-
if (
|
|
4018
|
+
var curPos = this.getCellsInGridByElementId(elementId);
|
|
4019
|
+
if (curPos.startRowIndex == 0) return {
|
|
3536
4020
|
elements: [],
|
|
3537
4021
|
backside: false
|
|
3538
4022
|
};
|
|
3539
|
-
var
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
4023
|
+
var curGrid = curPos.backside ? this.backGrid : this.frontGrid;
|
|
4024
|
+
var resultPlannerIds = [];
|
|
4025
|
+
for (var i = curPos.startColIndex; i <= curPos.endColIndex; i++) {
|
|
4026
|
+
for (var j = curPos.startRowIndex--; j >= 0; j--) {
|
|
4027
|
+
var neighborCell = curGrid[i][j];
|
|
4028
|
+
if (neighborCell && resultPlannerIds.indexOf(neighborCell.plannerElementId) == -1) {
|
|
4029
|
+
resultPlannerIds.push(neighborCell.plannerElementId);
|
|
4030
|
+
}
|
|
3544
4031
|
}
|
|
3545
4032
|
}
|
|
3546
4033
|
return {
|
|
3547
|
-
elements:
|
|
3548
|
-
backside:
|
|
4034
|
+
elements: resultPlannerIds,
|
|
4035
|
+
backside: curPos.backside
|
|
3549
4036
|
};
|
|
3550
4037
|
}
|
|
4038
|
+
/**
|
|
4039
|
+
* Returns all other elements in the grid that are in the same col as the elementId from the parameter. It only returns the elements on along the startRowIndex
|
|
4040
|
+
* Excample:
|
|
4041
|
+
* HHHH
|
|
4042
|
+
* FAAC
|
|
4043
|
+
* FAAB
|
|
4044
|
+
* FAABD
|
|
4045
|
+
* FEEED
|
|
4046
|
+
* GGGGG
|
|
4047
|
+
* The elements that are in the same col as A are E, G and H
|
|
4048
|
+
* @param elementId
|
|
4049
|
+
*/
|
|
3551
4050
|
}, {
|
|
3552
4051
|
key: "getAllElementsInSameCol",
|
|
3553
4052
|
value: function getAllElementsInSameCol(elementId) {
|
|
3554
|
-
var
|
|
3555
|
-
var allElements = this.getAllElementsInColumn(
|
|
4053
|
+
var curPos = this.getCellsInGridByElementId(elementId);
|
|
4054
|
+
var allElements = this.getAllElementsInColumn(curPos.startColIndex, curPos.backside);
|
|
3556
4055
|
if (allElements == undefined) allElements = [];
|
|
3557
4056
|
return {
|
|
3558
4057
|
elements: allElements.map(function (obj) {
|
|
3559
4058
|
return obj.ElementId;
|
|
3560
4059
|
}),
|
|
3561
|
-
backside:
|
|
4060
|
+
backside: curPos.backside
|
|
3562
4061
|
};
|
|
3563
4062
|
}
|
|
3564
4063
|
}, {
|
|
3565
|
-
key: "
|
|
3566
|
-
value: function
|
|
3567
|
-
|
|
3568
|
-
var
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
var
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
}
|
|
3583
|
-
for (var i = 0; i < this.plannedElementGrid.length; i++) {
|
|
3584
|
-
for (var j = 0; j < this.plannedElementGrid[i].length; j++) {
|
|
3585
|
-
if (i < colIndexToMove) {
|
|
3586
|
-
helperGrid[i][j] = this.plannedElementGrid[i][j];
|
|
3587
|
-
} else {
|
|
3588
|
-
helperGrid[i + 1][j] = this.plannedElementGrid[i][j];
|
|
3589
|
-
}
|
|
4064
|
+
key: "prepareGridForColCopy",
|
|
4065
|
+
value: function prepareGridForColCopy(elementId, copyDir) {
|
|
4066
|
+
if (copyDir == 'AVO') return;
|
|
4067
|
+
var elementToCopyPos = this.getCellsInGridByElementId(elementId);
|
|
4068
|
+
this.plannerElements.get(elementId);
|
|
4069
|
+
//Kopiere das Grid nach rechts abhängig von der Breite des aktuellen Elementes
|
|
4070
|
+
//now correct all indices in all cells:
|
|
4071
|
+
|
|
4072
|
+
var copyStartIndex = 0;
|
|
4073
|
+
if (copyDir == 'AVR') copyStartIndex = elementToCopyPos.endColIndex + 1;else if (copyDir == 'AVL') copyStartIndex = elementToCopyPos.startColIndex;
|
|
4074
|
+
var copyIndexCount = 1 + (elementToCopyPos.endColIndex - elementToCopyPos.startColIndex);
|
|
4075
|
+
var allUsedCellsFrontGrid = this.getAllUsedCellsInGrid(false);
|
|
4076
|
+
this.frontGrid = new Array();
|
|
4077
|
+
for (var i = 0; i < allUsedCellsFrontGrid.length; i++) {
|
|
4078
|
+
var curCellFrontGrid = allUsedCellsFrontGrid[i];
|
|
4079
|
+
if (curCellFrontGrid.index.x >= copyStartIndex) {
|
|
4080
|
+
curCellFrontGrid.index.x += copyIndexCount;
|
|
3590
4081
|
}
|
|
4082
|
+
if (!this.frontGrid[curCellFrontGrid.index.x]) {
|
|
4083
|
+
this.frontGrid[curCellFrontGrid.index.x] = [];
|
|
4084
|
+
}
|
|
4085
|
+
this.frontGrid[curCellFrontGrid.index.x][curCellFrontGrid.index.y] = curCellFrontGrid;
|
|
4086
|
+
}
|
|
4087
|
+
//Init empty cols
|
|
4088
|
+
for (var i = copyStartIndex; i < copyStartIndex + copyIndexCount; i++) {
|
|
4089
|
+
if (!this.frontGrid[i]) this.frontGrid[i] = [];
|
|
3591
4090
|
}
|
|
3592
|
-
this.plannedElementGrid = helperGrid;
|
|
3593
4091
|
if (this.hasActiveBackside) {
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
for (var i = 0; i <
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
for (var j = 0; j < this.backModulPlannedElementGrid[i].length; j++) {
|
|
3601
|
-
if (i < colIndexToMove) {
|
|
3602
|
-
helperGrid[i][j] = this.backModulPlannedElementGrid[i][j];
|
|
3603
|
-
} else {
|
|
3604
|
-
helperGrid[i + 1][j] = this.backModulPlannedElementGrid[i][j];
|
|
3605
|
-
}
|
|
4092
|
+
var allUsedCellsBackGrid = this.getAllUsedCellsInGrid(true);
|
|
4093
|
+
this.backGrid = new Array();
|
|
4094
|
+
for (var i = 0; i < allUsedCellsBackGrid.length; i++) {
|
|
4095
|
+
var curCellBackGrid = allUsedCellsBackGrid[i];
|
|
4096
|
+
if (curCellBackGrid.index.x >= copyStartIndex) {
|
|
4097
|
+
curCellBackGrid.index.x += copyIndexCount;
|
|
3606
4098
|
}
|
|
4099
|
+
if (!this.backGrid[curCellBackGrid.index.x]) {
|
|
4100
|
+
this.backGrid[curCellBackGrid.index.x] = [];
|
|
4101
|
+
}
|
|
4102
|
+
this.backGrid[curCellBackGrid.index.x][curCellBackGrid.index.y] = curCellBackGrid;
|
|
4103
|
+
}
|
|
4104
|
+
|
|
4105
|
+
//Init empty cols
|
|
4106
|
+
for (var i = copyStartIndex; i < copyStartIndex + copyIndexCount; i++) {
|
|
4107
|
+
if (!this.backGrid[i]) this.backGrid[i] = [];
|
|
3607
4108
|
}
|
|
3608
|
-
this.backModulPlannedElementGrid = helperGrid;
|
|
3609
4109
|
}
|
|
3610
4110
|
}
|
|
3611
4111
|
}, {
|
|
3612
4112
|
key: "prepareGridForBackSideCopy",
|
|
3613
4113
|
value: function prepareGridForBackSideCopy() {
|
|
3614
|
-
this.
|
|
3615
|
-
for (var i = 0; i < this.plannedElementGrid.length; i++) {
|
|
3616
|
-
this.backModulPlannedElementGrid.push(new Array());
|
|
3617
|
-
}
|
|
4114
|
+
this.backGrid = new Array();
|
|
3618
4115
|
this.hasActiveBackside = true;
|
|
3619
4116
|
}
|
|
4117
|
+
|
|
4118
|
+
/**
|
|
4119
|
+
* This function adds an element to the grid. It gives the start col and row and calculates how many grid cells are used by the element
|
|
4120
|
+
* @param newElement
|
|
4121
|
+
* @param col
|
|
4122
|
+
* @param row
|
|
4123
|
+
* @param fromBackmodul
|
|
4124
|
+
*/
|
|
3620
4125
|
}, {
|
|
3621
4126
|
key: "addElementAtGridPos",
|
|
3622
4127
|
value: function addElementAtGridPos(newElement, col, row, fromBackmodul) {
|
|
3623
|
-
var
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
this.hasActiveBackside = true;
|
|
3633
|
-
this.backModulPlannedElementGrid = curElementGrid;
|
|
3634
|
-
} else {
|
|
3635
|
-
this.plannedElementGrid = curElementGrid;
|
|
4128
|
+
var curGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
4129
|
+
var result = this.createNewCells(newElement, col, row, fromBackmodul);
|
|
4130
|
+
for (var i = 0; i < result.cells.length; i++) {
|
|
4131
|
+
var cell = result.cells[i];
|
|
4132
|
+
// Prüfen, ob das innere Array existiert, sonst erstellen
|
|
4133
|
+
if (!curGrid[cell.index.x]) {
|
|
4134
|
+
curGrid[cell.index.x] = [];
|
|
4135
|
+
}
|
|
4136
|
+
curGrid[cell.index.x][cell.index.y] = cell;
|
|
3636
4137
|
}
|
|
4138
|
+
this.plannerElements.set(newElement.getElementId(), newElement);
|
|
4139
|
+
if (fromBackmodul) this.hasActiveBackside = true;
|
|
3637
4140
|
}
|
|
4141
|
+
|
|
4142
|
+
/**
|
|
4143
|
+
* Assume that the grid is already prepared and there is enough empty space for the new element.
|
|
4144
|
+
* @param elementIDToCopy
|
|
4145
|
+
* @param newElement
|
|
4146
|
+
* @param copyInfo
|
|
4147
|
+
*/
|
|
3638
4148
|
}, {
|
|
3639
4149
|
key: "addElementAsCopy",
|
|
3640
4150
|
value: function addElementAsCopy(elementIDToCopy, newElement, copyDir) {
|
|
3641
|
-
var
|
|
3642
|
-
var
|
|
3643
|
-
var
|
|
4151
|
+
var curPos = this.getCellsInGridByElementId(elementIDToCopy);
|
|
4152
|
+
var startColIndexForCopy = -1;
|
|
4153
|
+
var startRowIndexForCopy = -1;
|
|
4154
|
+
var backsideForCopy = copyDir == 'BACKSIDE' ? !curPos.backside : curPos.backside;
|
|
4155
|
+
var cellCount = this.getCellCount(newElement);
|
|
3644
4156
|
switch (copyDir) {
|
|
3645
4157
|
case 'AVR':
|
|
3646
|
-
|
|
4158
|
+
startColIndexForCopy = curPos.endColIndex + 1;
|
|
4159
|
+
startRowIndexForCopy = curPos.startRowIndex;
|
|
3647
4160
|
break;
|
|
3648
4161
|
case 'AVL':
|
|
3649
|
-
|
|
4162
|
+
startColIndexForCopy = curPos.startColIndex - cellCount.colCount;
|
|
4163
|
+
startRowIndexForCopy = curPos.startRowIndex;
|
|
3650
4164
|
break;
|
|
3651
4165
|
case 'AVO':
|
|
3652
|
-
|
|
4166
|
+
startColIndexForCopy = curPos.startColIndex;
|
|
4167
|
+
startRowIndexForCopy = curPos.endRowIndex + 1;
|
|
3653
4168
|
break;
|
|
3654
4169
|
case 'BACKSIDE':
|
|
3655
|
-
|
|
3656
|
-
|
|
4170
|
+
startColIndexForCopy = curPos.startColIndex;
|
|
4171
|
+
startRowIndexForCopy = curPos.startRowIndex;
|
|
3657
4172
|
break;
|
|
3658
4173
|
}
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
}
|
|
4174
|
+
var newCellInfos = this.createNewCells(newElement, startColIndexForCopy, startRowIndexForCopy, backsideForCopy);
|
|
4175
|
+
var curGrid = backsideForCopy ? this.backGrid : this.frontGrid;
|
|
4176
|
+
for (var i = 0; i < newCellInfos.cells.length; i++) {
|
|
4177
|
+
if (!curGrid[newCellInfos.cells[i].index.x]) curGrid[newCellInfos.cells[i].index.x] = [];
|
|
4178
|
+
curGrid[newCellInfos.cells[i].index.x][newCellInfos.cells[i].index.y] = newCellInfos.cells[i];
|
|
3665
4179
|
}
|
|
4180
|
+
this.plannerElements.set(newElement.getElementId(), newElement);
|
|
3666
4181
|
}
|
|
3667
4182
|
|
|
3668
4183
|
/**
|
|
3669
4184
|
* This function deletes an Element from the grid.
|
|
3670
4185
|
* If backsideModule is active, than the oppsite Element is deleted as well
|
|
3671
4186
|
* If the boxPlanner_backside switch deletion type is set, do not delete the opposite element
|
|
4187
|
+
* If the last element in col was deleted, do delete whole col.
|
|
3672
4188
|
* @param elementId
|
|
3673
|
-
* @returns all elements that are deleted - it can happen that multiple elements get deleted
|
|
3674
4189
|
*/
|
|
3675
4190
|
}, {
|
|
3676
4191
|
key: "deleteElement",
|
|
3677
4192
|
value: function deleteElement(elementId, deletionType) {
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
for (var i = 0; i < elementsToDelete.length; i++) {
|
|
3687
|
-
PlannerHandler2D.dockingPointHandlerInst.removeDockingPointRelations(elementsToDelete[i]);
|
|
3688
|
-
if (!deletionType || deletionType != 'BoxPlanner_backside') this.deleteGridPos(this.getIndexInGridByElementId(elementsToDelete[i].ElementId));else if (deletionType && deletionType == 'BoxPlanner_backside') {
|
|
3689
|
-
//Do not delete gridPos - only delete element.
|
|
3690
|
-
this.backModulPlannedElementGrid[gridPos.col][gridPos.row] = undefined;
|
|
3691
|
-
}
|
|
3692
|
-
result.push(elementsToDelete[i].getElementId());
|
|
3693
|
-
}
|
|
3694
|
-
return result;
|
|
4193
|
+
if (!this.plannerElements.has(elementId)) {
|
|
4194
|
+
LOG$1.error(new DivaUtils.DivaError('Try to delete an elementId that does not exist'));
|
|
4195
|
+
}
|
|
4196
|
+
this.getCellsInGridByElementId(elementId);
|
|
4197
|
+
PlannerHandler2D.dockingPointHandlerInst.removeDockingPointRelations(this.plannerElements.get(elementId));
|
|
4198
|
+
this.deleteElementByIdFromGrid(elementId);
|
|
4199
|
+
this.plannerElements["delete"](elementId);
|
|
4200
|
+
if (this.hasActiveBackside) ;
|
|
3695
4201
|
}
|
|
3696
4202
|
|
|
3697
4203
|
/**
|
|
@@ -3701,55 +4207,65 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3701
4207
|
}, {
|
|
3702
4208
|
key: "updateWorldPosOfElements",
|
|
3703
4209
|
value: function updateWorldPosOfElements() {
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
for (var i = 0; i < this.backModulPlannedElementGrid.length; i++) {
|
|
3712
|
-
for (var j = 0; j < this.backModulPlannedElementGrid[i].length; j++) {
|
|
3713
|
-
var _plannerElement = this.backModulPlannedElementGrid[i][j];
|
|
3714
|
-
if (_plannerElement) PlannerHandler2D.dockingPointHandlerInst.removeDockingPointRelations(_plannerElement);
|
|
3715
|
-
}
|
|
4210
|
+
//First remove all docking Point relation information
|
|
4211
|
+
var _iterator = _createForOfIteratorHelper(this.plannerElements.values()),
|
|
4212
|
+
_step;
|
|
4213
|
+
try {
|
|
4214
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
4215
|
+
var _element3 = _step.value;
|
|
4216
|
+
PlannerHandler2D.dockingPointHandlerInst.removeDockingPointRelations(_element3);
|
|
3716
4217
|
}
|
|
4218
|
+
} catch (err) {
|
|
4219
|
+
_iterator.e(err);
|
|
4220
|
+
} finally {
|
|
4221
|
+
_iterator.f();
|
|
3717
4222
|
}
|
|
3718
4223
|
var posNr = 1;
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
4224
|
+
//First remove all docking Point relation information
|
|
4225
|
+
|
|
4226
|
+
var allCheckedElementIds = [];
|
|
4227
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
4228
|
+
for (var j = 0; j < this.frontGrid[i].length; j++) {
|
|
4229
|
+
var cell = this.frontGrid[i][j];
|
|
4230
|
+
if (allCheckedElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
4231
|
+
var element = this.plannerElements.get(cell.plannerElementId);
|
|
4232
|
+
allCheckedElementIds.push(cell.plannerElementId);
|
|
4233
|
+
var topNeighbors = this.getNeighborElements(cell.plannerElementId, 'TOP');
|
|
4234
|
+
var rightNeighbors = this.getNeighborElements(cell.plannerElementId, 'RIGHT');
|
|
4235
|
+
for (var n = 0; n < topNeighbors.length; n++) {
|
|
4236
|
+
PlannerHandler2D.dockingPointHandlerInst.tryDockElement(element, 'AVO', [topNeighbors[n]]);
|
|
4237
|
+
}
|
|
4238
|
+
for (var n = 0; n < rightNeighbors.length; n++) {
|
|
4239
|
+
PlannerHandler2D.dockingPointHandlerInst.tryDockElement(element, 'AVR', [rightNeighbors[n]]);
|
|
4240
|
+
}
|
|
4241
|
+
element.PosNr = posNr;
|
|
4242
|
+
posNr++;
|
|
3725
4243
|
}
|
|
3726
|
-
//correct PosNr
|
|
3727
|
-
_plannerElement2.PosNr = posNr;
|
|
3728
|
-
posNr++;
|
|
3729
|
-
}
|
|
3730
|
-
//check if Elements are on the right side and dock them
|
|
3731
|
-
if (this.plannedElementGrid[i + 1] && this.plannedElementGrid[i + 1][0]) {
|
|
3732
|
-
PlannerHandler2D.dockingPointHandlerInst.tryDockElement(this.plannedElementGrid[i][0], 'AVR', [this.plannedElementGrid[i + 1][0]]);
|
|
3733
4244
|
}
|
|
3734
4245
|
}
|
|
3735
|
-
|
|
3736
|
-
for (var
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
var
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
4246
|
+
for (var i = 0; i < this.backGrid.length; i++) {
|
|
4247
|
+
for (var j = 0; j < this.backGrid[i].length; j++) {
|
|
4248
|
+
var _cell4 = this.backGrid[i][j];
|
|
4249
|
+
if (allCheckedElementIds.indexOf(_cell4.plannerElementId) == -1) {
|
|
4250
|
+
var _element2 = this.plannerElements.get(_cell4.plannerElementId);
|
|
4251
|
+
allCheckedElementIds.push(_cell4.plannerElementId);
|
|
4252
|
+
var cellFrontGrid = this.frontGrid[i][j];
|
|
4253
|
+
var elementFrontGrid = this.plannerElements.get(cellFrontGrid.plannerElementId);
|
|
4254
|
+
if (elementFrontGrid) {
|
|
4255
|
+
var targetDPFrontGrid = elementFrontGrid === null || elementFrontGrid === void 0 ? void 0 : elementFrontGrid.getDockingPointById('AVO_AVO_2_IL');
|
|
4256
|
+
if (!targetDPFrontGrid) LOG$1.error(new DivaUtils.DivaError('Error Loading DockingPoint AVO_2 for plannerElement'));else if (_element2) PlannerHandler2D.dockingPointHandlerInst.tryDockElementToDP(_element2, elementFrontGrid, targetDPFrontGrid);
|
|
3744
4257
|
}
|
|
3745
|
-
|
|
3746
|
-
|
|
4258
|
+
var _topNeighbors = this.getNeighborElements(_cell4.plannerElementId, 'TOP');
|
|
4259
|
+
var _rightNeighbors = this.getNeighborElements(_cell4.plannerElementId, 'RIGHT');
|
|
4260
|
+
for (var n = 0; n < _topNeighbors.length; n++) {
|
|
4261
|
+
PlannerHandler2D.dockingPointHandlerInst.tryDockElement(_element2, 'AVO', [_topNeighbors[n]]);
|
|
4262
|
+
}
|
|
4263
|
+
for (var n = 0; n < _rightNeighbors.length; n++) {
|
|
4264
|
+
PlannerHandler2D.dockingPointHandlerInst.tryDockElement(_element2, 'AVL', [_rightNeighbors[n]]);
|
|
4265
|
+
}
|
|
4266
|
+
_element2.PosNr = posNr;
|
|
3747
4267
|
posNr++;
|
|
3748
4268
|
}
|
|
3749
|
-
//check if Elements are on the right side and dock them
|
|
3750
|
-
if (this.backModulPlannedElementGrid[i + 1] && this.backModulPlannedElementGrid[i + 1][0] && this.backModulPlannedElementGrid[i][0]) {
|
|
3751
|
-
PlannerHandler2D.dockingPointHandlerInst.tryDockElement(this.backModulPlannedElementGrid[i][0], 'AVL', [this.backModulPlannedElementGrid[i + 1][0]]);
|
|
3752
|
-
}
|
|
3753
4269
|
}
|
|
3754
4270
|
}
|
|
3755
4271
|
}
|
|
@@ -3761,66 +4277,60 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3761
4277
|
}, {
|
|
3762
4278
|
key: "destroyBoxPlannerGrid",
|
|
3763
4279
|
value: function destroyBoxPlannerGrid() {
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
4280
|
+
var _iterator2 = _createForOfIteratorHelper(this.plannerElements.values()),
|
|
4281
|
+
_step2;
|
|
4282
|
+
try {
|
|
4283
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
4284
|
+
var element = _step2.value;
|
|
4285
|
+
element.destroy();
|
|
3768
4286
|
}
|
|
3769
|
-
|
|
4287
|
+
} catch (err) {
|
|
4288
|
+
_iterator2.e(err);
|
|
4289
|
+
} finally {
|
|
4290
|
+
_iterator2.f();
|
|
3770
4291
|
}
|
|
3771
|
-
this.
|
|
4292
|
+
this.plannerElements.clear();
|
|
4293
|
+
this.frontGrid = new Array();
|
|
3772
4294
|
if (this.hasActiveBackside) {
|
|
3773
4295
|
this.hasActiveBackside = false;
|
|
3774
|
-
|
|
3775
|
-
for (var j = 0; j < this.backModulPlannedElementGrid[i].length; j++) {
|
|
3776
|
-
var _plannerElement4 = this.backModulPlannedElementGrid[i][j];
|
|
3777
|
-
if (_plannerElement4) _plannerElement4.destroy();
|
|
3778
|
-
}
|
|
3779
|
-
this.backModulPlannedElementGrid[i] = [];
|
|
3780
|
-
}
|
|
3781
|
-
this.backModulPlannedElementGrid = [];
|
|
3782
|
-
}
|
|
3783
|
-
}
|
|
3784
|
-
/**
|
|
3785
|
-
|
|
3786
|
-
*/
|
|
3787
|
-
}, {
|
|
3788
|
-
key: "getAllElementsInBacksideModuleGrid",
|
|
3789
|
-
value: function getAllElementsInBacksideModuleGrid() {
|
|
3790
|
-
var elementsInGrid = [];
|
|
3791
|
-
for (var i = 0; i < this.backModulPlannedElementGrid.length; i++) {
|
|
3792
|
-
for (var j = 0; j < this.backModulPlannedElementGrid[i].length; j++) {
|
|
3793
|
-
if (this.backModulPlannedElementGrid[i][j]) elementsInGrid.push(this.backModulPlannedElementGrid[i][j].ElementId);
|
|
3794
|
-
}
|
|
4296
|
+
this.backGrid = new Array();
|
|
3795
4297
|
}
|
|
3796
|
-
return elementsInGrid;
|
|
3797
4298
|
}
|
|
3798
4299
|
|
|
3799
4300
|
/**
|
|
3800
|
-
* Destroys the backside module Grid
|
|
4301
|
+
* Destroys the backside module Grid
|
|
3801
4302
|
*/
|
|
3802
4303
|
}, {
|
|
3803
4304
|
key: "destroyBacksideModuleGrid",
|
|
3804
4305
|
value: function destroyBacksideModuleGrid() {
|
|
3805
4306
|
this.hasActiveBackside = false;
|
|
3806
|
-
var
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
4307
|
+
var allElements = this.getAllElementsInBackGrid();
|
|
4308
|
+
var _iterator3 = _createForOfIteratorHelper(allElements.values()),
|
|
4309
|
+
_step3;
|
|
4310
|
+
try {
|
|
4311
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
4312
|
+
var element = _step3.value;
|
|
4313
|
+
this.plannerElements["delete"](element.ElementId);
|
|
4314
|
+
element.destroy();
|
|
3814
4315
|
}
|
|
3815
|
-
|
|
4316
|
+
} catch (err) {
|
|
4317
|
+
_iterator3.e(err);
|
|
4318
|
+
} finally {
|
|
4319
|
+
_iterator3.f();
|
|
3816
4320
|
}
|
|
3817
|
-
|
|
4321
|
+
allElements = [];
|
|
4322
|
+
this.backGrid = new Array();
|
|
3818
4323
|
}
|
|
3819
4324
|
}, {
|
|
3820
4325
|
key: "getPlannerHasActiveBackside",
|
|
3821
4326
|
value: function getPlannerHasActiveBackside() {
|
|
3822
4327
|
return this.hasActiveBackside;
|
|
3823
4328
|
}
|
|
4329
|
+
}, {
|
|
4330
|
+
key: "getForceSingleCellPerElement",
|
|
4331
|
+
value: function getForceSingleCellPerElement() {
|
|
4332
|
+
return this.gridSetupParams.forceSingleCellPerElement;
|
|
4333
|
+
}
|
|
3824
4334
|
}, {
|
|
3825
4335
|
key: "getBoundingBox",
|
|
3826
4336
|
value: function getBoundingBox() {
|
|
@@ -3829,56 +4339,63 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3829
4339
|
var maxX = 0;
|
|
3830
4340
|
var curX = 0;
|
|
3831
4341
|
var minZ = 0;
|
|
3832
|
-
var curZ = this.
|
|
4342
|
+
var curZ = this.plannerElements.get(this.frontGrid[0][0].plannerElementId).getDepth();
|
|
3833
4343
|
var maxZ = 0;
|
|
3834
4344
|
var curDir;
|
|
3835
4345
|
curDir = 'RIGHT';
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
//
|
|
3840
|
-
|
|
3841
|
-
if (
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
} else if (curDir == 'BACK') {
|
|
3848
|
-
curZ -= this.plannedElementGrid[i][0].getWidth();
|
|
3849
|
-
}
|
|
3850
|
-
if (elementOption == 'OPVECK_I') {
|
|
4346
|
+
var allCheckedElementIds = [];
|
|
4347
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
4348
|
+
var groundCell = this.frontGrid[i][0];
|
|
4349
|
+
if (!groundCell) break; //if on the lowest position the cell is empty, the grid ist finished - no wholes are allowed
|
|
4350
|
+
|
|
4351
|
+
if (allCheckedElementIds.indexOf(groundCell.plannerElementId) == -1) {
|
|
4352
|
+
allCheckedElementIds.push(groundCell.plannerElementId);
|
|
4353
|
+
var groundElement = this.plannerElements.get(groundCell.plannerElementId);
|
|
4354
|
+
if (!groundElement) continue;
|
|
4355
|
+
//Check if the col has a corner.
|
|
4356
|
+
var elementOption = this.getValueOfOptionOfArticle(groundCell.plannerElementId, 'OPTELEMENT');
|
|
3851
4357
|
if (curDir == 'RIGHT') {
|
|
3852
|
-
|
|
4358
|
+
curX += groundElement.getWidth();
|
|
3853
4359
|
} else if (curDir == 'FRONT') {
|
|
3854
|
-
|
|
4360
|
+
curZ += groundElement.getWidth();
|
|
3855
4361
|
} else if (curDir == 'LEFT') {
|
|
3856
|
-
|
|
4362
|
+
curX -= groundElement.getWidth();
|
|
3857
4363
|
} else if (curDir == 'BACK') {
|
|
3858
|
-
|
|
4364
|
+
curZ -= groundElement.getWidth();
|
|
3859
4365
|
}
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
4366
|
+
if (elementOption == 'OPVECK_I') {
|
|
4367
|
+
if (curDir == 'RIGHT') {
|
|
4368
|
+
curDir = 'FRONT';
|
|
4369
|
+
} else if (curDir == 'FRONT') {
|
|
4370
|
+
curDir = 'LEFT';
|
|
4371
|
+
} else if (curDir == 'LEFT') {
|
|
4372
|
+
curDir = 'BACK';
|
|
4373
|
+
} else if (curDir == 'BACK') {
|
|
4374
|
+
curDir = 'RIGHT';
|
|
4375
|
+
}
|
|
4376
|
+
} else if (elementOption == 'OPVECK_A') {
|
|
4377
|
+
if (curDir == 'RIGHT') {
|
|
4378
|
+
curDir = 'BACK';
|
|
4379
|
+
} else if (curDir == 'FRONT') {
|
|
4380
|
+
curDir = 'RIGHT';
|
|
4381
|
+
} else if (curDir == 'LEFT') {
|
|
4382
|
+
curDir = 'FRONT';
|
|
4383
|
+
} else if (curDir == 'BACK') {
|
|
4384
|
+
curDir = 'LEFT';
|
|
4385
|
+
}
|
|
3869
4386
|
}
|
|
4387
|
+
if (curX < minX) minX = curX;
|
|
4388
|
+
if (curX > maxX) maxX = curX;
|
|
4389
|
+
if (curZ < minZ) minZ = curZ;
|
|
4390
|
+
if (curZ > maxZ) maxZ = curZ;
|
|
4391
|
+
var colHeight = this.getGridColumnHeight(i);
|
|
4392
|
+
height = height < colHeight ? colHeight : height;
|
|
3870
4393
|
}
|
|
3871
|
-
if (curX < minX) minX = curX;
|
|
3872
|
-
if (curX > maxX) maxX = curX;
|
|
3873
|
-
if (curZ < minZ) minZ = curZ;
|
|
3874
|
-
if (curZ > maxZ) maxZ = curZ;
|
|
3875
|
-
var colHeight = this.getGridColumnHeight(i);
|
|
3876
|
-
height = height < colHeight ? colHeight : height;
|
|
3877
4394
|
}
|
|
3878
4395
|
var depth = maxZ - minZ;
|
|
3879
4396
|
var width = maxX - minX;
|
|
3880
4397
|
if (this.hasActiveBackside) {
|
|
3881
|
-
depth =
|
|
4398
|
+
depth = curZ * 2;
|
|
3882
4399
|
}
|
|
3883
4400
|
return {
|
|
3884
4401
|
width: Math.round(width * 1000) / 1000,
|
|
@@ -3886,6 +4403,304 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3886
4403
|
depth: Math.round(depth * 1000) / 1000
|
|
3887
4404
|
};
|
|
3888
4405
|
}
|
|
4406
|
+
|
|
4407
|
+
/**
|
|
4408
|
+
* This function returns all free cell locations to move a specific element
|
|
4409
|
+
* @param elementId
|
|
4410
|
+
* @returns
|
|
4411
|
+
*/
|
|
4412
|
+
}, {
|
|
4413
|
+
key: "getFreeMoveLocation",
|
|
4414
|
+
value: function getFreeMoveLocation(elementId) {
|
|
4415
|
+
var element = this.getElementById(elementId);
|
|
4416
|
+
if (!element) return [];
|
|
4417
|
+
var elementCells = this.getCellsInGridByElementId(elementId);
|
|
4418
|
+
if (elementCells.cells.length === 0) return [];
|
|
4419
|
+
var allFreeMoveLocations = [];
|
|
4420
|
+
// Helper function to check if a cell is valid and empty
|
|
4421
|
+
var isEmptyCell = function isEmptyCell(x, y) {
|
|
4422
|
+
var _curGrid$x;
|
|
4423
|
+
return ((_curGrid$x = curGrid[x]) === null || _curGrid$x === void 0 ? void 0 : _curGrid$x[y]) === undefined;
|
|
4424
|
+
};
|
|
4425
|
+
var curGrid = elementCells.backside ? this.backGrid : this.frontGrid;
|
|
4426
|
+
var _iterator4 = _createForOfIteratorHelper(this.plannerElements.keys()),
|
|
4427
|
+
_step4;
|
|
4428
|
+
try {
|
|
4429
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
4430
|
+
var otherElementId = _step4.value;
|
|
4431
|
+
if (otherElementId != elementId) {
|
|
4432
|
+
var otherElement = this.getElementById(otherElementId);
|
|
4433
|
+
if (this.gridSetupParams.forceSingleCellPerElement) {
|
|
4434
|
+
//Check if the with is ok and the height
|
|
4435
|
+
|
|
4436
|
+
if (!this.getElementHasTopElement(otherElementId) && otherElement.getWidth() == element.getWidth()) {
|
|
4437
|
+
//now check if there is another element for the correct height
|
|
4438
|
+
var otherElementCells = this.getCellsInGridByElementId(otherElementId);
|
|
4439
|
+
var allElementsInRowAbove = this.getAllElementsInRow(otherElementCells.endRowIndex + 1, otherElementCells.backside);
|
|
4440
|
+
if (allElementsInRowAbove.length > 0 && allElementsInRowAbove[0].getHeight() != element.getHeight()) continue;
|
|
4441
|
+
|
|
4442
|
+
//Now we found a possible place
|
|
4443
|
+
|
|
4444
|
+
var locationInformation = this.createLocationInformation(element, elementCells.backside, this.createEmptyCells(otherElementCells.startColIndex, otherElementCells.endRowIndex + 1, otherElementCells.startColIndex, otherElementCells.endRowIndex + 1, element.getWidth(), element.getHeight()), otherElementCells.startColIndex, otherElementCells.endRowIndex + 1, 1, 1);
|
|
4445
|
+
allFreeMoveLocations.push(locationInformation);
|
|
4446
|
+
}
|
|
4447
|
+
} else {
|
|
4448
|
+
//In this case it is more complex
|
|
4449
|
+
|
|
4450
|
+
var _otherElementCells = this.getCellsInGridByElementId(otherElementId);
|
|
4451
|
+
var freeStartTopColIndex = -1;
|
|
4452
|
+
var freeEndTopColIndex = -1;
|
|
4453
|
+
var topRow = _otherElementCells.endRowIndex + 1;
|
|
4454
|
+
for (var x = _otherElementCells.startColIndex; x <= _otherElementCells.startColIndex + _otherElementCells.colCount - 1; x++) {
|
|
4455
|
+
var freeSpaceFound = false;
|
|
4456
|
+
if (isEmptyCell(x, topRow)) {
|
|
4457
|
+
if (freeStartTopColIndex == -1) {
|
|
4458
|
+
freeStartTopColIndex = x;
|
|
4459
|
+
freeEndTopColIndex = x;
|
|
4460
|
+
} else {
|
|
4461
|
+
freeEndTopColIndex = x;
|
|
4462
|
+
}
|
|
4463
|
+
if (x == _otherElementCells.startColIndex + _otherElementCells.colCount - 1) {
|
|
4464
|
+
if (elementCells.colCount <= freeEndTopColIndex - freeStartTopColIndex + 1) {
|
|
4465
|
+
freeSpaceFound = true;
|
|
4466
|
+
} else {
|
|
4467
|
+
//Check overstand
|
|
4468
|
+
freeSpaceFound = true;
|
|
4469
|
+
for (var i = 0; i < elementCells.colCount; i++) {
|
|
4470
|
+
if (isEmptyCell(freeStartTopColIndex + i, _otherElementCells.endRowIndex)) {
|
|
4471
|
+
freeSpaceFound = false; //invalid overstand found
|
|
4472
|
+
break;
|
|
4473
|
+
}
|
|
4474
|
+
}
|
|
4475
|
+
}
|
|
4476
|
+
}
|
|
4477
|
+
} else {
|
|
4478
|
+
//we found a obstacle
|
|
4479
|
+
if (elementCells.colCount <= freeEndTopColIndex - freeStartTopColIndex + 1) {
|
|
4480
|
+
//The element has place here
|
|
4481
|
+
freeSpaceFound = true;
|
|
4482
|
+
}
|
|
4483
|
+
}
|
|
4484
|
+
if (freeSpaceFound) {
|
|
4485
|
+
var _locationInformation = this.createLocationInformation(element, elementCells.backside, this.createEmptyCells(freeStartTopColIndex, _otherElementCells.endRowIndex + 1, freeStartTopColIndex + elementCells.colCount - 1, _otherElementCells.endRowIndex + elementCells.rowCount - 1, element.getWidth(), element.getHeight()), freeStartTopColIndex, _otherElementCells.endRowIndex + 1, elementCells.colCount, elementCells.rowCount);
|
|
4486
|
+
allFreeMoveLocations.push(_locationInformation);
|
|
4487
|
+
}
|
|
4488
|
+
}
|
|
4489
|
+
}
|
|
4490
|
+
}
|
|
4491
|
+
}
|
|
4492
|
+
|
|
4493
|
+
//now add most left and most right location
|
|
4494
|
+
} catch (err) {
|
|
4495
|
+
_iterator4.e(err);
|
|
4496
|
+
} finally {
|
|
4497
|
+
_iterator4.f();
|
|
4498
|
+
}
|
|
4499
|
+
var locationInformationLeft = this.createLocationInformation(element, elementCells.backside, this.createEmptyCells(-elementCells.colCount, 0, -1, elementCells.rowCount - 1, element.getWidth(), element.getHeight()), -elementCells.colCount, 0, elementCells.colCount, elementCells.rowCount);
|
|
4500
|
+
allFreeMoveLocations.push(locationInformationLeft);
|
|
4501
|
+
var locationInformationRight = this.createLocationInformation(element, elementCells.backside, this.createEmptyCells(this.getColumnCount(), 0, this.getColumnCount() + elementCells.colCount - 1, elementCells.rowCount - 1, element.getWidth(), element.getHeight()), this.getColumnCount(), 0, elementCells.colCount, elementCells.rowCount);
|
|
4502
|
+
allFreeMoveLocations.push(locationInformationRight);
|
|
4503
|
+
return allFreeMoveLocations;
|
|
4504
|
+
}
|
|
4505
|
+
|
|
4506
|
+
/**
|
|
4507
|
+
* This function returns free locations for an element when trying to copy it in LEFT TOP or RIGHT direction
|
|
4508
|
+
* @param elementId
|
|
4509
|
+
* @param direction
|
|
4510
|
+
* @returns
|
|
4511
|
+
*/
|
|
4512
|
+
}, {
|
|
4513
|
+
key: "getFreePlanningLocation",
|
|
4514
|
+
value: function getFreePlanningLocation(elementId, direction) {
|
|
4515
|
+
// Retrieve all cells associated with the element
|
|
4516
|
+
var element = this.getElementById(elementId);
|
|
4517
|
+
if (!element) return undefined;
|
|
4518
|
+
var elementCells = this.getCellsInGridByElementId(elementId);
|
|
4519
|
+
|
|
4520
|
+
// If no cells are found, return an empty array as the element cannot be copied
|
|
4521
|
+
if (elementCells.cells.length === 0) {
|
|
4522
|
+
return undefined;
|
|
4523
|
+
}
|
|
4524
|
+
|
|
4525
|
+
// Determine the grid to work with (front or back) based on the element's location
|
|
4526
|
+
var curGrid = elementCells.backside ? this.backGrid : this.frontGrid;
|
|
4527
|
+
|
|
4528
|
+
// Get the boundaries of the element in the grid
|
|
4529
|
+
var startColIndex = elementCells.startColIndex;
|
|
4530
|
+
var endColIndex = elementCells.endColIndex;
|
|
4531
|
+
var startRowIndex = elementCells.startRowIndex;
|
|
4532
|
+
var endRowIndex = elementCells.endRowIndex;
|
|
4533
|
+
var copyStartColIndex = -1;
|
|
4534
|
+
var copyStartRowIndex = -1;
|
|
4535
|
+
var copyEndColIndex = -1;
|
|
4536
|
+
var copyEndRowIndex = -1;
|
|
4537
|
+
|
|
4538
|
+
// Store potential free cells for copying
|
|
4539
|
+
var freeCells = [];
|
|
4540
|
+
|
|
4541
|
+
// Helper function to check if a cell is valid and empty
|
|
4542
|
+
var isValidCell = function isValidCell(x, y) {
|
|
4543
|
+
var _curGrid$x2;
|
|
4544
|
+
return ((_curGrid$x2 = curGrid[x]) === null || _curGrid$x2 === void 0 ? void 0 : _curGrid$x2[y]) === undefined;
|
|
4545
|
+
};
|
|
4546
|
+
|
|
4547
|
+
// Handle logic for each copy direction
|
|
4548
|
+
switch (direction) {
|
|
4549
|
+
case 'LEFT':
|
|
4550
|
+
{
|
|
4551
|
+
// Target column to the left of the element
|
|
4552
|
+
var targetColIndex = startColIndex - 1;
|
|
4553
|
+
var copyPossible = false;
|
|
4554
|
+
// Iterate through rows within the element's height
|
|
4555
|
+
for (var y = startRowIndex; y <= endRowIndex; y++) {
|
|
4556
|
+
if (isValidCell(targetColIndex, y)) {
|
|
4557
|
+
copyStartRowIndex = y;
|
|
4558
|
+
copyPossible = true;
|
|
4559
|
+
break;
|
|
4560
|
+
}
|
|
4561
|
+
}
|
|
4562
|
+
if (!copyPossible) return undefined;
|
|
4563
|
+
copyPossible = false;
|
|
4564
|
+
for (var x = startColIndex - 1; x >= startColIndex - elementCells.colCount; x--) {
|
|
4565
|
+
if (isValidCell(x, copyStartRowIndex) && (copyStartRowIndex == 0 || !isValidCell(x, copyStartRowIndex - 1))) {
|
|
4566
|
+
//check also for overhang
|
|
4567
|
+
copyPossible = true;
|
|
4568
|
+
copyStartColIndex = x;
|
|
4569
|
+
} else {
|
|
4570
|
+
break; //when you find one situation where it is not valid skip outside.
|
|
4571
|
+
}
|
|
4572
|
+
}
|
|
4573
|
+
if (!copyPossible) return undefined;
|
|
4574
|
+
copyEndColIndex = startColIndex - 1;
|
|
4575
|
+
copyEndRowIndex = endRowIndex;
|
|
4576
|
+
freeCells = this.createEmptyCells(copyStartColIndex, copyStartRowIndex, copyEndColIndex, copyEndRowIndex, element.getWidth(), element.getHeight());
|
|
4577
|
+
break;
|
|
4578
|
+
}
|
|
4579
|
+
case 'TOP':
|
|
4580
|
+
{
|
|
4581
|
+
// Target row above the element
|
|
4582
|
+
var targetRowIndex = endRowIndex + 1;
|
|
4583
|
+
var _copyPossible = false;
|
|
4584
|
+
// Iterate through columns within the element's width
|
|
4585
|
+
for (var _x = endColIndex; _x >= startColIndex; _x--) {
|
|
4586
|
+
if (isValidCell(_x, targetRowIndex)) {
|
|
4587
|
+
copyStartColIndex = _x;
|
|
4588
|
+
_copyPossible = true;
|
|
4589
|
+
}
|
|
4590
|
+
}
|
|
4591
|
+
if (!_copyPossible) return undefined;
|
|
4592
|
+
copyStartRowIndex = targetRowIndex;
|
|
4593
|
+
copyEndColIndex = endColIndex;
|
|
4594
|
+
copyEndRowIndex = targetRowIndex + elementCells.rowCount - 1;
|
|
4595
|
+
freeCells = this.createEmptyCells(copyStartColIndex, copyStartRowIndex, copyEndColIndex, copyEndRowIndex, element.getWidth(), element.getHeight());
|
|
4596
|
+
break;
|
|
4597
|
+
}
|
|
4598
|
+
case 'RIGHT':
|
|
4599
|
+
{
|
|
4600
|
+
// Target column to the left of the element
|
|
4601
|
+
var _targetColIndex = endColIndex + 1;
|
|
4602
|
+
var _copyPossible2 = false;
|
|
4603
|
+
// Iterate through rows within the element's height
|
|
4604
|
+
for (var _y = startRowIndex; _y <= endRowIndex; _y++) {
|
|
4605
|
+
if (isValidCell(_targetColIndex, _y)) {
|
|
4606
|
+
copyStartRowIndex = _y;
|
|
4607
|
+
_copyPossible2 = true;
|
|
4608
|
+
break;
|
|
4609
|
+
}
|
|
4610
|
+
}
|
|
4611
|
+
if (!_copyPossible2) return undefined;
|
|
4612
|
+
_copyPossible2 = false;
|
|
4613
|
+
for (var _x2 = endColIndex + 1; _x2 <= endColIndex + elementCells.colCount; _x2++) {
|
|
4614
|
+
if (isValidCell(_x2, copyStartRowIndex) && (copyStartRowIndex == 0 || !isValidCell(_x2, copyStartRowIndex - 1))) {
|
|
4615
|
+
//check also for overhang
|
|
4616
|
+
copyEndColIndex = _x2;
|
|
4617
|
+
_copyPossible2 = true;
|
|
4618
|
+
} else {
|
|
4619
|
+
break; //when you find one situation where it is not valid skip outside.
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
if (!_copyPossible2) return undefined;
|
|
4623
|
+
copyStartColIndex = endColIndex + 1;
|
|
4624
|
+
copyEndRowIndex = endRowIndex;
|
|
4625
|
+
freeCells = this.createEmptyCells(copyStartColIndex, copyStartRowIndex, copyEndColIndex, copyEndRowIndex, element.getWidth(), element.getHeight());
|
|
4626
|
+
break;
|
|
4627
|
+
}
|
|
4628
|
+
default:
|
|
4629
|
+
// If direction is invalid, return an empty array
|
|
4630
|
+
return undefined;
|
|
4631
|
+
}
|
|
4632
|
+
|
|
4633
|
+
// Return the collected free cells for the given direction
|
|
4634
|
+
var locationInformation = this.createLocationInformation(element, elementCells.backside, freeCells, copyStartColIndex, copyStartRowIndex, copyEndColIndex - copyStartColIndex + 1, copyEndRowIndex - copyStartRowIndex + 1);
|
|
4635
|
+
return locationInformation;
|
|
4636
|
+
}
|
|
4637
|
+
}, {
|
|
4638
|
+
key: "createLocationInformation",
|
|
4639
|
+
value: function createLocationInformation(element, fromBackside, cells, cellsStartColIndex, cellsStartRowIndex, cellsColCount, cellsRowCount) {
|
|
4640
|
+
var curGrid = fromBackside ? this.backGrid : this.frontGrid;
|
|
4641
|
+
var elementLocation = {
|
|
4642
|
+
cells: cells,
|
|
4643
|
+
widthPerCell: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterWidth : element.getWidth(),
|
|
4644
|
+
heightPerCell: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterHeight : element.getHeight(),
|
|
4645
|
+
depthPerCell: element.getDepth(),
|
|
4646
|
+
width: this.gridSetupParams.forceFixCellRasterSize ? cellsColCount * this.gridSetupParams.fixCellRasterWidth : element.getWidth(),
|
|
4647
|
+
height: this.gridSetupParams.forceFixCellRasterSize ? cellsRowCount * this.gridSetupParams.fixCellRasterHeight : element.getHeight(),
|
|
4648
|
+
depth: element.getDepth(),
|
|
4649
|
+
startIndexWorldPos: new index.Vector2(0, 0)
|
|
4650
|
+
};
|
|
4651
|
+
if (this.gridSetupParams.forceFixCellRasterSize) {
|
|
4652
|
+
elementLocation.startIndexWorldPos = new index.Vector2(cellsStartColIndex * this.gridSetupParams.fixCellRasterWidth, cellsStartRowIndex * this.gridSetupParams.fixCellRasterHeight);
|
|
4653
|
+
} else {
|
|
4654
|
+
var distToOriginX = 0;
|
|
4655
|
+
for (var i = 0; i < cellsStartColIndex; i++) {
|
|
4656
|
+
distToOriginX += curGrid[i][0].width;
|
|
4657
|
+
}
|
|
4658
|
+
if (cellsStartColIndex < 0) {
|
|
4659
|
+
distToOriginX = -element.getWidth();
|
|
4660
|
+
}
|
|
4661
|
+
var distToOriginY = 0;
|
|
4662
|
+
for (var i = 0; i < cellsStartRowIndex; i++) {
|
|
4663
|
+
distToOriginY += curGrid[cellsStartColIndex][i].height;
|
|
4664
|
+
}
|
|
4665
|
+
elementLocation.startIndexWorldPos = new index.Vector2(distToOriginX, distToOriginY);
|
|
4666
|
+
}
|
|
4667
|
+
return elementLocation;
|
|
4668
|
+
}
|
|
4669
|
+
}, {
|
|
4670
|
+
key: "getPlannerInteractionInformation",
|
|
4671
|
+
value: function getPlannerInteractionInformation() {
|
|
4672
|
+
var allElements = this.getAllElementsInGridSortedbyGridPos();
|
|
4673
|
+
var plannerInteractionInfo = {
|
|
4674
|
+
boxPlannerInteractionInformationPerElement: new Map()
|
|
4675
|
+
};
|
|
4676
|
+
for (var i = 0; i < allElements.length; i++) {
|
|
4677
|
+
var element = allElements[i];
|
|
4678
|
+
var elementCells = this.getCellsInGridByElementId(element.getElementId());
|
|
4679
|
+
elementCells.backside ? this.backGrid : this.frontGrid;
|
|
4680
|
+
var elementLocation = this.createLocationInformation(element, elementCells.backside, elementCells.cells, elementCells.startColIndex, elementCells.startRowIndex, elementCells.colCount, elementCells.rowCount);
|
|
4681
|
+
var planningLeftLocation = this.getFreePlanningLocation(element.getElementId(), 'LEFT');
|
|
4682
|
+
var planningRighttLocation = this.getFreePlanningLocation(element.getElementId(), 'RIGHT');
|
|
4683
|
+
var planningTopLocation = this.getFreePlanningLocation(element.getElementId(), 'TOP');
|
|
4684
|
+
var hasTopElements = this.getElementHasTopElement(element.getElementId());
|
|
4685
|
+
var moveLocations = [];
|
|
4686
|
+
if (!hasTopElements && allElements.length > 1) {
|
|
4687
|
+
//Calculate positions where element can be moved.
|
|
4688
|
+
moveLocations = this.getFreeMoveLocation(element.getElementId());
|
|
4689
|
+
}
|
|
4690
|
+
var plannerInteractionInfoElement = {
|
|
4691
|
+
location: elementLocation,
|
|
4692
|
+
isDeletable: !hasTopElements && allElements.length > 1,
|
|
4693
|
+
availablePlanningLocations: {
|
|
4694
|
+
availableBoxPlannerCellsLeft: planningLeftLocation,
|
|
4695
|
+
availableBoxPlannerCellsTop: planningTopLocation,
|
|
4696
|
+
availableBoxPlannerCellsRight: planningRighttLocation
|
|
4697
|
+
},
|
|
4698
|
+
availableMovingLocations: moveLocations
|
|
4699
|
+
};
|
|
4700
|
+
plannerInteractionInfo.boxPlannerInteractionInformationPerElement.set(element.getElementId(), plannerInteractionInfoElement);
|
|
4701
|
+
}
|
|
4702
|
+
return plannerInteractionInfo;
|
|
4703
|
+
}
|
|
3889
4704
|
}]);
|
|
3890
4705
|
}();
|
|
3891
4706
|
|
|
@@ -3902,7 +4717,13 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
3902
4717
|
this.set = set;
|
|
3903
4718
|
this.plannerID = plannerId;
|
|
3904
4719
|
this.constructionRulesHandler = new ConstructionRulesHandler(this.set.getValueOfOptionOfArticle, this.set.checkArticleHasOption, this.set.updateCfgValuesByPlanner);
|
|
3905
|
-
|
|
4720
|
+
var gridSetupParams = {
|
|
4721
|
+
hasMaxGridRasterHeight: false,
|
|
4722
|
+
hasMaxGridRasterWidth: false,
|
|
4723
|
+
forceSingleCellPerElement: true,
|
|
4724
|
+
forceFixCellRasterSize: false
|
|
4725
|
+
};
|
|
4726
|
+
this.boxPlannerGrid = new BoxPlannerGrid(gridSetupParams, this.set.getValueOfOptionOfArticle);
|
|
3906
4727
|
}
|
|
3907
4728
|
return _createClass__default["default"](DivaBoxPlanner, [{
|
|
3908
4729
|
key: "initPlanner",
|
|
@@ -4006,7 +4827,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4006
4827
|
for (var i = 0; i < allElementIds.length; i++) {
|
|
4007
4828
|
var plannerElement = this.boxPlannerGrid.getElementById(allElementIds[i]);
|
|
4008
4829
|
if (!plannerElement) continue;
|
|
4009
|
-
var posInGrid = this.boxPlannerGrid.
|
|
4830
|
+
var posInGrid = this.boxPlannerGrid.getCellsInGridByElementId(allElementIds[i]);
|
|
4010
4831
|
var dockingDPs = plannerElement.getDockingDockingPoints();
|
|
4011
4832
|
var dpArr = [];
|
|
4012
4833
|
for (var j = 0; j < dockingDPs.length; j++) {
|
|
@@ -4033,8 +4854,8 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4033
4854
|
depth: plannerElement.Depth ? plannerElement.Depth : -1,
|
|
4034
4855
|
DP: dpArr,
|
|
4035
4856
|
boxPlannerInfo: {
|
|
4036
|
-
gridPosCol: posInGrid.
|
|
4037
|
-
gridPosRow: posInGrid.
|
|
4857
|
+
gridPosCol: posInGrid.startColIndex,
|
|
4858
|
+
gridPosRow: posInGrid.startRowIndex,
|
|
4038
4859
|
isOnBackside: posInGrid.backside
|
|
4039
4860
|
}
|
|
4040
4861
|
};
|
|
@@ -4135,7 +4956,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4135
4956
|
value: (function () {
|
|
4136
4957
|
var _copyPlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(articleCopyRelation, copyInfo) {
|
|
4137
4958
|
var _this = this;
|
|
4138
|
-
var gridIsPrepared, plannerElementsToLoadSVG, that, copyType, i, allDPs, j;
|
|
4959
|
+
var gridIsPrepared, plannerElementsToLoadSVG, that, copyType, i, cellPos, allDPs, j;
|
|
4139
4960
|
return _regeneratorRuntime__default["default"].wrap(function _callee4$(_context4) {
|
|
4140
4961
|
while (1) switch (_context4.prev = _context4.next) {
|
|
4141
4962
|
case 0:
|
|
@@ -4157,7 +4978,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4157
4978
|
var _copyInfo$targetEleme;
|
|
4158
4979
|
if (!gridIsPrepared) {
|
|
4159
4980
|
if (copyInfo && (copyInfo.dpType == 'AVL' || copyInfo.dpType == 'AVR')) {
|
|
4160
|
-
_this.boxPlannerGrid.
|
|
4981
|
+
_this.boxPlannerGrid.prepareGridForColCopy(elementToCopyId, copyInfo.dpType);
|
|
4161
4982
|
} else if (copyInfo && copyInfo.copyType && copyInfo.copyType == 'BoxPlanner_backside') {
|
|
4162
4983
|
if (!_this.boxPlannerGrid.getPlannerHasActiveBackside()) _this.boxPlannerGrid.prepareGridForBackSideCopy();
|
|
4163
4984
|
}
|
|
@@ -4187,7 +5008,8 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4187
5008
|
//Check if we have to prevent to build even higher in this col
|
|
4188
5009
|
if (copyType == 'AVO' && this.constructionRulesHandler.getHasMaxElemCountPerColumn()) {
|
|
4189
5010
|
//The max height of col is reached
|
|
4190
|
-
|
|
5011
|
+
cellPos = this.boxPlannerGrid.getCellsInGridByElementId(plannerElementsToLoadSVG[i].ElementId);
|
|
5012
|
+
if (cellPos.endRowIndex + 1 == that.constructionRulesHandler.getMaxElemCountPerColumn()) {
|
|
4191
5013
|
allDPs = plannerElementsToLoadSVG[i].getFreeDockingPointsByType('AVO');
|
|
4192
5014
|
for (j = 0; j < allDPs.length; j++) {
|
|
4193
5015
|
allDPs[j].disableDP(true);
|
|
@@ -4226,15 +5048,27 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4226
5048
|
*/
|
|
4227
5049
|
}, {
|
|
4228
5050
|
key: "getPlannerElementsInfluencedByDeletion",
|
|
4229
|
-
value: function getPlannerElementsInfluencedByDeletion(elementId) {
|
|
5051
|
+
value: function getPlannerElementsInfluencedByDeletion(elementId, deletionType) {
|
|
4230
5052
|
if (this.constructionRulesHandler.getForceWholePlanningSameHeight()) {
|
|
4231
|
-
var
|
|
4232
|
-
if (
|
|
5053
|
+
var cellPos = this.boxPlannerGrid.getCellsInGridByElementId(elementId);
|
|
5054
|
+
if (cellPos.startRowIndex == 0) return []; //In the base row only delete the actual element, not the whole row
|
|
4233
5055
|
var result = this.boxPlannerGrid.getAllElementsInSameRowByElementId(elementId);
|
|
4234
5056
|
return result.elementIds.filter(function (eId) {
|
|
4235
5057
|
return eId != elementId;
|
|
4236
5058
|
});
|
|
4237
5059
|
} else {
|
|
5060
|
+
if (this.boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
5061
|
+
if (deletionType == 'BoxPlanner_backside') {
|
|
5062
|
+
return this.boxPlannerGrid.getAllElementsInBackGrid().map(function (element) {
|
|
5063
|
+
return element.ElementId;
|
|
5064
|
+
}).filter(function (eId) {
|
|
5065
|
+
return eId != elementId;
|
|
5066
|
+
});
|
|
5067
|
+
} else {
|
|
5068
|
+
var opposideElement = this.boxPlannerGrid.getOppositeElement(elementId);
|
|
5069
|
+
if (opposideElement) return [opposideElement.getElementId()];
|
|
5070
|
+
}
|
|
5071
|
+
}
|
|
4238
5072
|
return [];
|
|
4239
5073
|
}
|
|
4240
5074
|
}
|
|
@@ -4254,8 +5088,8 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4254
5088
|
return this.boxPlannerGrid.getAllElementIdsInGrid();
|
|
4255
5089
|
} else if (copyInfo && copyInfo.copyType == 'BoxPlanner_COL') {
|
|
4256
5090
|
//Copy all col
|
|
4257
|
-
var
|
|
4258
|
-
var allElementsInCol = this.boxPlannerGrid.getAllElementsInColumn(
|
|
5091
|
+
var cellPos = this.boxPlannerGrid.getCellsInGridByElementId(elementId);
|
|
5092
|
+
var allElementsInCol = this.boxPlannerGrid.getAllElementsInColumn(cellPos.startColIndex, cellPos.backside);
|
|
4259
5093
|
for (var i = 0; i < allElementsInCol.length; i++) {
|
|
4260
5094
|
allElementsToCopy.push(allElementsInCol[i].getElementId());
|
|
4261
5095
|
}
|
|
@@ -4284,11 +5118,14 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4284
5118
|
}
|
|
4285
5119
|
}
|
|
4286
5120
|
if (this.boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
4287
|
-
allElementsToCopy = allElementsToCopy.concat(this.boxPlannerGrid.
|
|
5121
|
+
allElementsToCopy = allElementsToCopy.concat(this.boxPlannerGrid.getOppositeElements(allElementsToCopy).map(function (element) {
|
|
5122
|
+
return element.ElementId;
|
|
5123
|
+
}));
|
|
4288
5124
|
}
|
|
4289
5125
|
}
|
|
4290
5126
|
}
|
|
4291
|
-
|
|
5127
|
+
//remove duplicate
|
|
5128
|
+
return Array.from(new Set(allElementsToCopy));
|
|
4292
5129
|
}
|
|
4293
5130
|
|
|
4294
5131
|
/**
|
|
@@ -4302,26 +5139,24 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4302
5139
|
key: "deletePlannerElement",
|
|
4303
5140
|
value: (function () {
|
|
4304
5141
|
var _deletePlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(elementId, autoCorrectAVL_AVR, deletionType) {
|
|
4305
|
-
var
|
|
5142
|
+
var cellPos, newSelectedPos, doUpdateWholeLogic, _this$boxPlannerGrid$;
|
|
4306
5143
|
return _regeneratorRuntime__default["default"].wrap(function _callee5$(_context5) {
|
|
4307
5144
|
while (1) switch (_context5.prev = _context5.next) {
|
|
4308
5145
|
case 0:
|
|
4309
|
-
|
|
5146
|
+
//TODO ÜBERLEGEN WIE MAN DAS JETZT RICHTET: BESSER WÄRE ES MAN GIBT DAS NÄCHSTE ZU SELECTIERENDE ELEMENT ID ZURÜCK
|
|
5147
|
+
//var pos = this.boxPlannerGrid.getIndexInGridByElementId(elementId);
|
|
5148
|
+
cellPos = this.boxPlannerGrid.getCellsInGridByElementId(elementId);
|
|
4310
5149
|
newSelectedPos = {
|
|
4311
|
-
row:
|
|
4312
|
-
col:
|
|
4313
|
-
backside:
|
|
5150
|
+
row: cellPos.startRowIndex,
|
|
5151
|
+
col: cellPos.startColIndex,
|
|
5152
|
+
backside: false
|
|
4314
5153
|
};
|
|
4315
5154
|
if (!deletionType || deletionType != 'BoxPlanner_backside') {
|
|
4316
|
-
if (
|
|
5155
|
+
if (cellPos.startRowIndex > 0) {
|
|
4317
5156
|
newSelectedPos.row--;
|
|
4318
5157
|
} else {
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
if (allElements && allElements.length > 0) {
|
|
4322
|
-
newSelectedPos.col = newSelectedCol;
|
|
4323
|
-
newSelectedPos.row = allElements.length - 1;
|
|
4324
|
-
}
|
|
5158
|
+
newSelectedPos.col = cellPos.startColIndex == 0 ? 0 : cellPos.startColIndex - 1;
|
|
5159
|
+
newSelectedPos.row = this.boxPlannerGrid.getRowCount(newSelectedPos.col, cellPos.backside) - 1;
|
|
4325
5160
|
}
|
|
4326
5161
|
} else {
|
|
4327
5162
|
newSelectedPos = {
|
|
@@ -4330,18 +5165,14 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4330
5165
|
backside: false
|
|
4331
5166
|
};
|
|
4332
5167
|
}
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
this.constructionRulesHandler.onElemDeleted(allElementsToDelete[i]);
|
|
4336
|
-
}
|
|
5168
|
+
this.boxPlannerGrid.deleteElement(elementId, deletionType);
|
|
5169
|
+
this.constructionRulesHandler.onElemDeleted(elementId);
|
|
4337
5170
|
doUpdateWholeLogic = true;
|
|
4338
|
-
if (deletionType
|
|
4339
|
-
if (
|
|
5171
|
+
if (deletionType) {
|
|
5172
|
+
if (deletionType == 'BoxPlanner_backside') {
|
|
4340
5173
|
this.boxPlannerGrid.destroyBacksideModuleGrid();
|
|
4341
5174
|
doUpdateWholeLogic = true;
|
|
4342
|
-
} else
|
|
4343
|
-
doUpdateWholeLogic = false;
|
|
4344
|
-
}
|
|
5175
|
+
} else if (deletionType == 'STD_DONTUPDATE') doUpdateWholeLogic = false;
|
|
4345
5176
|
}
|
|
4346
5177
|
if (!doUpdateWholeLogic) {
|
|
4347
5178
|
_context5.next = 11;
|
|
@@ -4378,7 +5209,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4378
5209
|
}, {
|
|
4379
5210
|
key: "getAllViewPlannerElements",
|
|
4380
5211
|
value: function getAllViewPlannerElements() {
|
|
4381
|
-
return this.boxPlannerGrid.
|
|
5212
|
+
return this.boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
4382
5213
|
}
|
|
4383
5214
|
}, {
|
|
4384
5215
|
key: "getNeighborElements",
|
|
@@ -4447,7 +5278,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4447
5278
|
key: "updatePlanner",
|
|
4448
5279
|
value: (function () {
|
|
4449
5280
|
var _updatePlanner = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee6(changedOPT, targetElements) {
|
|
4450
|
-
var message,
|
|
5281
|
+
var message, cellPos, elemToCheck, copyDir, allElementsToCopy, _allElementsToCopy, allElementsInBackGrid, _allElementsInBackGrid, _message;
|
|
4451
5282
|
return _regeneratorRuntime__default["default"].wrap(function _callee6$(_context6) {
|
|
4452
5283
|
while (1) switch (_context6.prev = _context6.next) {
|
|
4453
5284
|
case 0:
|
|
@@ -4469,19 +5300,21 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4469
5300
|
break;
|
|
4470
5301
|
}
|
|
4471
5302
|
return _context6.abrupt("return", {
|
|
5303
|
+
doDeleteBackGrid: false,
|
|
4472
5304
|
elemIdsToDelete: [],
|
|
4473
5305
|
viewMessageCodex: message
|
|
4474
5306
|
});
|
|
4475
5307
|
case 8:
|
|
4476
5308
|
return _context6.abrupt("return", {
|
|
5309
|
+
doDeleteBackGrid: false,
|
|
4477
5310
|
elemIdsToDelete: []
|
|
4478
5311
|
});
|
|
4479
5312
|
case 9:
|
|
4480
5313
|
//If the most bottom element has no neighbor right or left - copy element
|
|
4481
|
-
|
|
5314
|
+
cellPos = this.boxPlannerGrid.getCellsInGridByElementId(targetElements[0]);
|
|
4482
5315
|
elemToCheck = targetElements[0];
|
|
4483
|
-
if (
|
|
4484
|
-
elemToCheck = this.boxPlannerGrid.getPlannerElementAtGridPos(
|
|
5316
|
+
if (cellPos.startRowIndex > 0) {
|
|
5317
|
+
elemToCheck = this.boxPlannerGrid.getPlannerElementAtGridPos(cellPos.startColIndex, 0, false).getElementId();
|
|
4485
5318
|
}
|
|
4486
5319
|
if (!(!this.boxPlannerGrid.getElementHasLeftElement(elemToCheck) || !this.boxPlannerGrid.getElementHasRightElement(elemToCheck))) {
|
|
4487
5320
|
_context6.next = 18;
|
|
@@ -4502,6 +5335,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4502
5335
|
copyType: 'BoxPlanner_COL'
|
|
4503
5336
|
});
|
|
4504
5337
|
return _context6.abrupt("return", {
|
|
5338
|
+
doDeleteBackGrid: false,
|
|
4505
5339
|
elemIdsToDelete: [],
|
|
4506
5340
|
elementIdToCopy: allElementsToCopy,
|
|
4507
5341
|
copyDPType: copyDir,
|
|
@@ -4512,11 +5346,11 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4512
5346
|
});
|
|
4513
5347
|
case 18:
|
|
4514
5348
|
if (!(changedOPT && changedOPT['OPTDMOD'])) {
|
|
4515
|
-
_context6.next =
|
|
5349
|
+
_context6.next = 33;
|
|
4516
5350
|
break;
|
|
4517
5351
|
}
|
|
4518
5352
|
_context6.t0 = changedOPT['OPTDMOD'];
|
|
4519
|
-
_context6.next = _context6.t0 === 'OPVD_EIN' ? 22 : _context6.t0 === 'OPVD_AUS' ? 26 :
|
|
5353
|
+
_context6.next = _context6.t0 === 'OPVD_EIN' ? 22 : _context6.t0 === 'OPVD_AUS' ? 26 : 31;
|
|
4520
5354
|
break;
|
|
4521
5355
|
case 22:
|
|
4522
5356
|
if (this.boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
@@ -4528,65 +5362,86 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4528
5362
|
copyType: 'BoxPlanner_backside'
|
|
4529
5363
|
});
|
|
4530
5364
|
return _context6.abrupt("return", {
|
|
5365
|
+
doDeleteBackGrid: false,
|
|
4531
5366
|
elemIdsToDelete: [],
|
|
4532
5367
|
elementIdToCopy: _allElementsToCopy,
|
|
4533
5368
|
copyType: 'BoxPlanner_backside',
|
|
4534
5369
|
changedOPT: changedOPT
|
|
4535
5370
|
});
|
|
4536
5371
|
case 25:
|
|
4537
|
-
return _context6.abrupt("break",
|
|
5372
|
+
return _context6.abrupt("break", 31);
|
|
4538
5373
|
case 26:
|
|
4539
5374
|
if (!this.boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
4540
|
-
_context6.next =
|
|
5375
|
+
_context6.next = 30;
|
|
5376
|
+
break;
|
|
5377
|
+
}
|
|
5378
|
+
allElementsInBackGrid = this.boxPlannerGrid.getAllElementsInBackGrid();
|
|
5379
|
+
if (!(allElementsInBackGrid.length > 0)) {
|
|
5380
|
+
_context6.next = 30;
|
|
4541
5381
|
break;
|
|
4542
5382
|
}
|
|
4543
|
-
allElementsToDelete = this.boxPlannerGrid.getAllElementsInBacksideModuleGrid();
|
|
4544
5383
|
return _context6.abrupt("return", {
|
|
4545
|
-
|
|
5384
|
+
doDeleteBackGrid: true,
|
|
5385
|
+
elemIdsToDelete: allElementsInBackGrid.map(function (element) {
|
|
5386
|
+
return element.ElementId;
|
|
5387
|
+
}),
|
|
4546
5388
|
deletionType: 'BoxPlanner_backside',
|
|
4547
5389
|
changedOPT: changedOPT
|
|
4548
5390
|
});
|
|
4549
|
-
case 29:
|
|
4550
|
-
return _context6.abrupt("break", 30);
|
|
4551
5391
|
case 30:
|
|
4552
|
-
_context6.
|
|
5392
|
+
return _context6.abrupt("break", 31);
|
|
5393
|
+
case 31:
|
|
5394
|
+
_context6.next = 47;
|
|
4553
5395
|
break;
|
|
4554
|
-
case
|
|
5396
|
+
case 33:
|
|
4555
5397
|
if (!(changedOPT && changedOPT['OPTFARBE_RAHMEN'] && changedOPT['OPTFARBE_RAHMEN'] == 'OPVSCHWARZ_MATT' && this.boxPlannerGrid.getPlannerHasActiveBackside())) {
|
|
4556
|
-
_context6.next =
|
|
5398
|
+
_context6.next = 39;
|
|
4557
5399
|
break;
|
|
4558
5400
|
}
|
|
4559
5401
|
//If the double modul is active but the color is changed to black - disable double modul
|
|
4560
|
-
|
|
5402
|
+
_allElementsInBackGrid = this.boxPlannerGrid.getAllElementsInBackGrid();
|
|
5403
|
+
if (!(_allElementsInBackGrid.length > 0)) {
|
|
5404
|
+
_context6.next = 37;
|
|
5405
|
+
break;
|
|
5406
|
+
}
|
|
4561
5407
|
return _context6.abrupt("return", {
|
|
4562
|
-
|
|
5408
|
+
doDeleteBackGrid: true,
|
|
5409
|
+
elemIdsToDelete: _allElementsInBackGrid.map(function (element) {
|
|
5410
|
+
return element.ElementId;
|
|
5411
|
+
}),
|
|
4563
5412
|
deletionType: 'BoxPlanner_backside',
|
|
4564
5413
|
changedOPT: changedOPT,
|
|
4565
5414
|
targetElements: targetElements,
|
|
4566
5415
|
viewMessageCodex: 'BOXPLAN_BLACKFRAME_INCOMPATIBLE_ELEMENT_WARNING'
|
|
4567
5416
|
});
|
|
4568
5417
|
case 37:
|
|
4569
|
-
_context6.next =
|
|
4570
|
-
|
|
5418
|
+
_context6.next = 47;
|
|
5419
|
+
break;
|
|
4571
5420
|
case 39:
|
|
5421
|
+
_context6.next = 41;
|
|
5422
|
+
return this.constructionRulesHandler.updateOptionLogicBoxPlanner(this.boxPlannerGrid, changedOPT, targetElements);
|
|
5423
|
+
case 41:
|
|
4572
5424
|
_message = _context6.sent;
|
|
4573
5425
|
if (!_message) {
|
|
4574
|
-
_context6.next =
|
|
5426
|
+
_context6.next = 46;
|
|
4575
5427
|
break;
|
|
4576
5428
|
}
|
|
4577
5429
|
return _context6.abrupt("return", {
|
|
5430
|
+
doDeleteBackGrid: false,
|
|
4578
5431
|
elemIdsToDelete: [],
|
|
4579
5432
|
viewMessageCodex: _message
|
|
4580
5433
|
});
|
|
4581
|
-
case
|
|
5434
|
+
case 46:
|
|
4582
5435
|
return _context6.abrupt("return", {
|
|
5436
|
+
doDeleteBackGrid: false,
|
|
4583
5437
|
elemIdsToDelete: []
|
|
4584
5438
|
});
|
|
4585
|
-
case
|
|
5439
|
+
case 47:
|
|
4586
5440
|
return _context6.abrupt("return", {
|
|
5441
|
+
doDeleteBackGrid: false,
|
|
4587
5442
|
elemIdsToDelete: []
|
|
4588
5443
|
});
|
|
4589
|
-
case
|
|
5444
|
+
case 48:
|
|
4590
5445
|
case "end":
|
|
4591
5446
|
return _context6.stop();
|
|
4592
5447
|
}
|
|
@@ -4616,7 +5471,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4616
5471
|
Cat: this.set.getCatalogCodex(),
|
|
4617
5472
|
ShowDim: doShow3DDimensionLines
|
|
4618
5473
|
};
|
|
4619
|
-
var allPlannerElemnts = this.boxPlannerGrid.
|
|
5474
|
+
var allPlannerElemnts = this.boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
4620
5475
|
for (var i = 0; i < allPlannerElemnts.length; i++) {
|
|
4621
5476
|
var elem = allPlannerElemnts[i];
|
|
4622
5477
|
var elemId = elem.ElementId;
|
|
@@ -4713,6 +5568,11 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4713
5568
|
clone.initPlanner(setData);
|
|
4714
5569
|
return clone;
|
|
4715
5570
|
}
|
|
5571
|
+
}, {
|
|
5572
|
+
key: "getPlannerInteractionInformation",
|
|
5573
|
+
value: function getPlannerInteractionInformation() {
|
|
5574
|
+
return this.boxPlannerGrid.getPlannerInteractionInformation();
|
|
5575
|
+
}
|
|
4716
5576
|
}]);
|
|
4717
5577
|
}();
|
|
4718
5578
|
_defineProperty__default["default"](DivaBoxPlanner, "plannerType", 'BOX');
|