@crystaldesign/web-planner-logic 25.1.0-beta.43 → 25.1.0-beta.45
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-fa1a3269.js → DivaBoxPlanner-4ec80868.js} +1754 -894
- package/build/cjs/{DivaStandardPlanner-6eff952e.js → DivaStandardPlanner-50764892.js} +17 -6
- package/build/cjs/{DoorPlanner-525130a9.js → DoorPlanner-cd30fe6d.js} +1 -1
- package/build/cjs/{Host3DSignalR-38070d5f.js → Host3DSignalR-3c0886e4.js} +1 -1
- package/build/cjs/{LiviqueWWSHandler-fab1690a.js → LiviqueWWSHandler-f0f1c990.js} +1 -1
- package/build/cjs/{PfisterWWSHandler-1fc96841.js → PfisterWWSHandler-d9bd87c4.js} +1 -1
- package/build/cjs/{PlannerHandler2D-fd93e3e1.js → PlannerHandler2D-93a5534b.js} +53 -6
- package/build/cjs/{SeriousBasketHandler-7365c285.js → SeriousBasketHandler-31d0db9d.js} +10 -10
- package/build/cjs/{ShelfPlanner-0ea275f7.js → ShelfPlanner-ec8a306b.js} +1 -1
- package/build/cjs/{StandardWWSHandler-fbf9c70f.js → StandardWWSHandler-69e5b463.js} +1 -1
- package/build/cjs/{index-08a7e63a.js → index-e69e165a.js} +89 -56
- package/build/cjs/index.js +1 -1
- package/build/esm/{DivaBoxPlanner-6605ea66.js → DivaBoxPlanner-e75cbebd.js} +1753 -893
- package/build/esm/{DivaStandardPlanner-99d4be78.js → DivaStandardPlanner-47585e2f.js} +17 -6
- package/build/esm/{DoorPlanner-c6140ba7.js → DoorPlanner-076fdc95.js} +1 -1
- package/build/esm/{Host3DSignalR-8e48172b.js → Host3DSignalR-b60bf8db.js} +1 -1
- package/build/esm/{LiviqueWWSHandler-99ce24cb.js → LiviqueWWSHandler-a107be68.js} +1 -1
- package/build/esm/{PfisterWWSHandler-0648b06e.js → PfisterWWSHandler-d839bfdc.js} +1 -1
- package/build/esm/{PlannerHandler2D-b154d013.js → PlannerHandler2D-24bcbad9.js} +53 -6
- package/build/esm/{SeriousBasketHandler-05abf48c.js → SeriousBasketHandler-a7960831.js} +10 -10
- package/build/esm/{ShelfPlanner-451dc570.js → ShelfPlanner-4e293168.js} +1 -1
- package/build/esm/{StandardWWSHandler-28dab1d2.js → StandardWWSHandler-6e2d3bfe.js} +1 -1
- package/build/esm/{index-439dd20c.js → index-ee8cbb0a.js} +89 -56
- 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/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/Planner/PlannerElementDataType.d.ts +4 -0
- package/build/types/web-planner-logic/src/interface/Planner/PlannerElementDataType.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 +3 -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/Planner/PlannerUtils/PlannerHandler2D.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/PlannerElementData.d.ts +5 -0
- package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts.map +1 -1
- 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/pfister_test_routine.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -3,10 +3,10 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
|
3
3
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
4
4
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
5
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
6
|
-
import { V as Vector3, B as BoundingBox } from './index-
|
|
6
|
+
import { c as Vector2, V as Vector3, B as BoundingBox } from './index-ee8cbb0a.js';
|
|
7
7
|
import DivaUtils, { DivaError, md5 } from '@crystaldesign/diva-utils';
|
|
8
8
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
9
|
-
import { d as dockingPointHandlerInst, P as PlannerElementData, h as handler2D } from './PlannerHandler2D-
|
|
9
|
+
import { d as dockingPointHandlerInst, P as PlannerElementData, h as handler2D } from './PlannerHandler2D-24bcbad9.js';
|
|
10
10
|
import '@babel/runtime/helpers/slicedToArray';
|
|
11
11
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
12
12
|
import 'axios';
|
|
@@ -45,23 +45,35 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
45
45
|
}, {
|
|
46
46
|
key: "getGroundPlatesNumOfRightNeighbors",
|
|
47
47
|
value: function getGroundPlatesNumOfRightNeighbors(curElement, boxPlannerGrid, optionHandler) {
|
|
48
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
49
|
+
LOG$3.error(new DivaError('BoxPlannerError - function getGroundPlatesNumOfRightNeighbors not supported for complex boxPlaner', {
|
|
50
|
+
code: 'WC_0012'
|
|
51
|
+
}));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
48
54
|
var plateCount = 0;
|
|
49
55
|
if (this.getElementHasBottomPlate(curElement, optionHandler)) plateCount++;
|
|
50
56
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
51
57
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
52
58
|
if (this.getElementHasBottomPlate(opposideElement, optionHandler)) plateCount++;
|
|
53
59
|
if (boxPlannerGrid.getElementHasRightElement(curElement.getElementId())) {
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
var rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
61
|
+
if (rightElements.length > 0) {
|
|
62
|
+
var rightElement = rightElements[0];
|
|
63
|
+
var rightOpposideElemnt = boxPlannerGrid.getOppositeElement(rightElement.getElementId());
|
|
64
|
+
if (this.getElementHasBottomPlate(rightElement, optionHandler)) plateCount++;
|
|
65
|
+
if (this.getElementHasBottomPlate(rightOpposideElemnt, optionHandler)) plateCount++;
|
|
66
|
+
}
|
|
58
67
|
return plateCount;
|
|
59
68
|
}
|
|
60
69
|
return plateCount;
|
|
61
70
|
} else {
|
|
62
71
|
if (boxPlannerGrid.getElementHasRightElement(curElement.getElementId())) {
|
|
63
|
-
var
|
|
64
|
-
if (
|
|
72
|
+
var _rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
73
|
+
if (_rightElements.length > 0) {
|
|
74
|
+
var _rightElement = _rightElements[0];
|
|
75
|
+
if (this.getElementHasBottomPlate(_rightElement, optionHandler)) plateCount++;
|
|
76
|
+
}
|
|
65
77
|
return plateCount;
|
|
66
78
|
}
|
|
67
79
|
return plateCount;
|
|
@@ -70,23 +82,35 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
70
82
|
}, {
|
|
71
83
|
key: "getTopPlatesNumOfRightNeighbors",
|
|
72
84
|
value: function getTopPlatesNumOfRightNeighbors(curElement, boxPlannerGrid, optionHandler) {
|
|
85
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
86
|
+
LOG$3.error(new DivaError('BoxPlannerError - function getTopPlatesNumOfRightNeighbors not supported for complex boxPlaner', {
|
|
87
|
+
code: 'WC_0012'
|
|
88
|
+
}));
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
73
91
|
var plateCount = 0;
|
|
74
92
|
if (this.getElementHasTopPlate(curElement, boxPlannerGrid, optionHandler)) plateCount++;
|
|
75
93
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
76
94
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
77
95
|
if (this.getElementHasTopPlate(opposideElement, boxPlannerGrid, optionHandler)) plateCount++;
|
|
78
96
|
if (boxPlannerGrid.getElementHasRightElement(curElement.getElementId())) {
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
97
|
+
var rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
98
|
+
if (rightElements.length > 0) {
|
|
99
|
+
var rightElement = rightElements[0];
|
|
100
|
+
var rightOpposideElemnt = boxPlannerGrid.getOppositeElement(rightElement.getElementId());
|
|
101
|
+
if (this.getElementHasTopPlate(rightElement, boxPlannerGrid, optionHandler)) plateCount++;
|
|
102
|
+
if (this.getElementHasTopPlate(rightOpposideElemnt, boxPlannerGrid, optionHandler)) plateCount++;
|
|
103
|
+
}
|
|
83
104
|
return plateCount;
|
|
84
105
|
}
|
|
85
106
|
return plateCount;
|
|
86
107
|
} else {
|
|
87
108
|
if (boxPlannerGrid.getElementHasRightElement(curElement.getElementId())) {
|
|
88
|
-
var
|
|
89
|
-
if (
|
|
109
|
+
var _rightElements2 = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
110
|
+
if (_rightElements2.length > 0) {
|
|
111
|
+
var _rightElement2 = _rightElements2[0];
|
|
112
|
+
if (this.getElementHasTopPlate(_rightElement2, boxPlannerGrid, optionHandler)) plateCount++;
|
|
113
|
+
}
|
|
90
114
|
return plateCount;
|
|
91
115
|
}
|
|
92
116
|
return plateCount;
|
|
@@ -121,7 +145,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
121
145
|
}, {
|
|
122
146
|
key: "calculateRahmen",
|
|
123
147
|
value: function calculateRahmen(boxPlannerGrid, optionHandler) {
|
|
124
|
-
var allElements = boxPlannerGrid.
|
|
148
|
+
var allElements = boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
125
149
|
for (var i = 0; i < allElements.length; i++) {
|
|
126
150
|
if (this.constructionRules.VarticalRahmenInfo) {
|
|
127
151
|
this.correctRahmenVerticalLeftFront(allElements[i], boxPlannerGrid, optionHandler);
|
|
@@ -151,7 +175,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
151
175
|
key: "correctRahmenDepthLeftBottom",
|
|
152
176
|
value: function correctRahmenDepthLeftBottom(curElement, boxPlannerGrid, optionHandler) {
|
|
153
177
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_LeftBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
154
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
178
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
155
179
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
156
180
|
|
|
157
181
|
//Only set the bottom left Tiefenverbinder if the element is on the ground
|
|
@@ -196,7 +220,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
196
220
|
key: "correctRahmenDepthLeftTop",
|
|
197
221
|
value: function correctRahmenDepthLeftTop(curElement, boxPlannerGrid, optionHandler) {
|
|
198
222
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_LeftTop, this.constructionRules.DepthRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
199
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
223
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
200
224
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
201
225
|
|
|
202
226
|
//ONly set this Tiefenverbidner wenn es links kein Element gibt
|
|
@@ -258,8 +282,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
258
282
|
}, {
|
|
259
283
|
key: "correctRahmenDepthRightBottom",
|
|
260
284
|
value: function correctRahmenDepthRightBottom(curElement, boxPlannerGrid, optionHandler) {
|
|
285
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
286
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctRahmenDepthRightBottom not supported for complex boxPlaner', {
|
|
287
|
+
code: 'WC_0012'
|
|
288
|
+
}));
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
261
291
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
262
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
292
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
263
293
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
264
294
|
if (boxPlannerGrid.getElementHasBottomElement(curElement.getElementId())) return;
|
|
265
295
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
@@ -287,31 +317,34 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
287
317
|
//-> Setze breitenverbindung
|
|
288
318
|
//Sonst
|
|
289
319
|
//-> Setze Tiefenverbinder
|
|
290
|
-
var
|
|
291
|
-
if (
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
320
|
+
var rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
321
|
+
if (rightElements.length > 0) {
|
|
322
|
+
var rightElement = rightElements[0];
|
|
323
|
+
if (!this.getElementHasBottomPlate(curElement, optionHandler) || this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
324
|
+
switch (this.getElementDepth(curElement, optionHandler)) {
|
|
325
|
+
case '18':
|
|
326
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
327
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_18_chrom, optionHandler);
|
|
328
|
+
break;
|
|
329
|
+
case '37':
|
|
330
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
331
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_37_chrom, optionHandler);
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
} else if (!this.getElementHasBottomPlate(rightElement, optionHandler) || this.getElementIsCornerElement(rightElement, optionHandler)) {
|
|
335
|
+
switch (this.getElementDepth(curElement, optionHandler)) {
|
|
336
|
+
case '18':
|
|
337
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
338
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_18_chrom, optionHandler);
|
|
339
|
+
break;
|
|
340
|
+
case '37':
|
|
341
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
342
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_37_chrom, optionHandler);
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
} else {
|
|
346
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenTV_Middle_chrom, optionHandler);
|
|
312
347
|
}
|
|
313
|
-
} else {
|
|
314
|
-
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightBottom, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenTV_Middle_chrom, optionHandler);
|
|
315
348
|
}
|
|
316
349
|
} else {
|
|
317
350
|
//Wenn das element keinen Rechten nachbarn hat
|
|
@@ -348,8 +381,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
348
381
|
}, {
|
|
349
382
|
key: "correctRahmenDepthRightTop",
|
|
350
383
|
value: function correctRahmenDepthRightTop(curElement, boxPlannerGrid, optionHandler) {
|
|
384
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
385
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctRahmenDepthRightTop not supported for complex boxPlaner', {
|
|
386
|
+
code: 'WC_0012'
|
|
387
|
+
}));
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
351
390
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightTop, this.constructionRules.DepthRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
352
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
391
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
353
392
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
354
393
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
355
394
|
//wenn das Doppelmodul aktiviert ist, setze immer den Breitenverbinder
|
|
@@ -385,21 +424,23 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
385
424
|
|
|
386
425
|
//Check more if Element has right neighbor
|
|
387
426
|
if (hasRightElement) {
|
|
388
|
-
var
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
427
|
+
var rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
428
|
+
if (rightNeighbors.length > 0) {
|
|
429
|
+
var rightNeighbor = rightNeighbors[0];
|
|
430
|
+
//Setze Breitenverbinder, wenn Nachbar rechts keinen Deckel hat oder ein Eckelement ist
|
|
431
|
+
if (!this.getElementHasTopPlate(rightNeighbor, boxPlannerGrid, optionHandler) || this.getElementIsCornerElement(rightNeighbor, optionHandler)) {
|
|
432
|
+
switch (this.getElementDepth(curElement, optionHandler)) {
|
|
433
|
+
case '18':
|
|
434
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
435
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightTop, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_18_chrom, optionHandler);
|
|
436
|
+
break;
|
|
437
|
+
case '37':
|
|
438
|
+
//Wenn das Element keinen Boden hat, dann setze einen Breitenverbinden statt tiefenverbinder.
|
|
439
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.DepthRahmenInfo.rahmenOPT_RightTop, this.constructionRules.DepthRahmenInfo.rahmenOPVs.rahmenBV_37_chrom, optionHandler);
|
|
440
|
+
break;
|
|
441
|
+
}
|
|
442
|
+
return;
|
|
401
443
|
}
|
|
402
|
-
return;
|
|
403
444
|
}
|
|
404
445
|
|
|
405
446
|
//es trifft nichts zu, setze normalen Tiefenverbinder für an und weiterbau
|
|
@@ -432,7 +473,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
432
473
|
key: "correctRahmenVerticalLeftFront",
|
|
433
474
|
value: function correctRahmenVerticalLeftFront(curElement, boxPlannerGrid, optionHandler) {
|
|
434
475
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_LeftFront, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
435
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
476
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
436
477
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
437
478
|
if (hasLeftElement) return;
|
|
438
479
|
switch (this.getElementHeight(curElement, optionHandler)) {
|
|
@@ -479,7 +520,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
479
520
|
key: "correctRahmenVerticalLeftBack",
|
|
480
521
|
value: function correctRahmenVerticalLeftBack(curElement, boxPlannerGrid, optionHandler) {
|
|
481
522
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_LeftBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
482
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
523
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
483
524
|
if (elementIsOnBackside) return;
|
|
484
525
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
485
526
|
if (hasLeftElement) return;
|
|
@@ -536,8 +577,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
536
577
|
}, {
|
|
537
578
|
key: "correctRahmenVerticalRightFront",
|
|
538
579
|
value: function correctRahmenVerticalRightFront(curElement, boxPlannerGrid, optionHandler) {
|
|
580
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
581
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctRahmenVerticalRightFront not supported for complex boxPlaner', {
|
|
582
|
+
code: 'WC_0012'
|
|
583
|
+
}));
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
539
586
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightFront, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
540
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
587
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
541
588
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
542
589
|
switch (this.getElementHeight(curElement, optionHandler)) {
|
|
543
590
|
case '6':
|
|
@@ -564,11 +611,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
564
611
|
case 'CHROM':
|
|
565
612
|
//Check if element has opposide Element
|
|
566
613
|
if (hasRightElement) {
|
|
567
|
-
var
|
|
568
|
-
if (
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
614
|
+
var rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
615
|
+
if (rightNeighbors.length > 0) {
|
|
616
|
+
var rightNeighbor = rightNeighbors[0];
|
|
617
|
+
if (this.getElementIsGarderobeElement(rightNeighbor, optionHandler)) {
|
|
618
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightFront, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH18_Garderobe, optionHandler);
|
|
619
|
+
} else {
|
|
620
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightFront, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH37_chrom, optionHandler);
|
|
621
|
+
}
|
|
572
622
|
}
|
|
573
623
|
} else {
|
|
574
624
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightFront, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH37_chrom, optionHandler);
|
|
@@ -593,7 +643,13 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
593
643
|
key: "correctRahmenVerticalRightBack",
|
|
594
644
|
value: function correctRahmenVerticalRightBack(curElement, boxPlannerGrid, optionHandler) {
|
|
595
645
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.noRahmen, optionHandler);
|
|
596
|
-
|
|
646
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
647
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctRahmenVerticalRightBack not supported for complex boxPlaner', {
|
|
648
|
+
code: 'WC_0012'
|
|
649
|
+
}));
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
597
653
|
if (elementIsOnBackside) return;
|
|
598
654
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
599
655
|
switch (this.getElementHeight(curElement, optionHandler)) {
|
|
@@ -621,23 +677,26 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
621
677
|
case 'CHROM':
|
|
622
678
|
//Check if element has opposide Element
|
|
623
679
|
if (hasRightElement) {
|
|
624
|
-
var
|
|
625
|
-
if (
|
|
626
|
-
if (
|
|
627
|
-
var
|
|
628
|
-
if (
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH18_Garderobe, optionHandler);
|
|
680
|
+
var rightElems = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
681
|
+
if (rightElems.length == 0) return;
|
|
682
|
+
if (rightElems.length > 0) {
|
|
683
|
+
var rightElem = rightElems[0];
|
|
684
|
+
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
685
|
+
var opposideElem = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
686
|
+
if (!opposideElem) return;
|
|
687
|
+
var opposideRightElement = boxPlannerGrid.getOppositeElement(rightElem.getElementId());
|
|
688
|
+
if (!opposideRightElement) return;
|
|
689
|
+
if (this.getElementIsGarderobeElement(rightElem, optionHandler) || this.getElementIsGarderobeElement(opposideElem, optionHandler) || this.getElementIsGarderobeElement(opposideRightElement, optionHandler)) {
|
|
690
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH18_Garderobe, optionHandler);
|
|
691
|
+
} else {
|
|
692
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH37_chrom, optionHandler);
|
|
693
|
+
}
|
|
639
694
|
} else {
|
|
640
|
-
this.
|
|
695
|
+
if (this.getElementIsGarderobeElement(rightElem, optionHandler)) {
|
|
696
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH18_Garderobe, optionHandler);
|
|
697
|
+
} else {
|
|
698
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.VarticalRahmenInfo.rahmenOPT_RightBack, this.constructionRules.VarticalRahmenInfo.rahmenOPVs.rahmenH37_chrom, optionHandler);
|
|
699
|
+
}
|
|
641
700
|
}
|
|
642
701
|
}
|
|
643
702
|
} else {
|
|
@@ -666,7 +725,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
666
725
|
key: "calculateKnots",
|
|
667
726
|
value: function calculateKnots(boxPlannerGrid, optionHandler) {
|
|
668
727
|
if (!this.constructionRules.hasKNOTS) return; //If the boxPlanner has no knots - ignore them
|
|
669
|
-
var allElements = boxPlannerGrid.
|
|
728
|
+
var allElements = boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
670
729
|
for (var i = 0; i < allElements.length; i++) {
|
|
671
730
|
this.correctKnotLeftTopFront(allElements[i], boxPlannerGrid, optionHandler);
|
|
672
731
|
this.correctKnotLeftTopBack(allElements[i], boxPlannerGrid, optionHandler);
|
|
@@ -694,8 +753,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
694
753
|
}, {
|
|
695
754
|
key: "correctKnotLeftBottomFront",
|
|
696
755
|
value: function correctKnotLeftBottomFront(curElement, boxPlannerGrid, optionHandler) {
|
|
756
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
757
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctKnotLeftBottomFront not supported for complex boxPlaner', {
|
|
758
|
+
code: 'WC_0012'
|
|
759
|
+
}));
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
697
762
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
698
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
763
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
699
764
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
700
765
|
if (boxPlannerGrid.getElementHasBottomElement(curElement.getElementId())) return;
|
|
701
766
|
if (!hasLeftElement) {
|
|
@@ -711,33 +776,39 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
711
776
|
//IT is the bottom Element. There has to be a left element, otherwise we have another problem
|
|
712
777
|
if (this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
713
778
|
//Only if left is no other corner element
|
|
714
|
-
var
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
this.
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
779
|
+
var leftElements = boxPlannerGrid.getLeftElements(curElement.getElementId());
|
|
780
|
+
if (leftElements.length > 0) {
|
|
781
|
+
var leftElement = leftElements[0];
|
|
782
|
+
//Wenn links ecke ist continue. Setze linke Ecken nur, wenn links kein Corner Element ist.
|
|
783
|
+
if (this.getElementIsCornerElement(leftElement, optionHandler)) return;
|
|
784
|
+
var rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
785
|
+
if (rightElements.length > 0) {
|
|
786
|
+
var rightElement = rightElements[0];
|
|
787
|
+
switch (this.getCornerType(curElement, optionHandler)) {
|
|
788
|
+
case 'INSIDE':
|
|
789
|
+
if (this.getElementHasBottomPlate(leftElement, optionHandler)) {
|
|
790
|
+
if (this.getElementHasBottomPlate(rightElement, optionHandler)) {
|
|
791
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
792
|
+
} else {
|
|
793
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
794
|
+
}
|
|
795
|
+
} else {
|
|
796
|
+
if (this.getElementHasBottomPlate(rightElement, optionHandler)) {
|
|
797
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
798
|
+
} else {
|
|
799
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
break;
|
|
803
|
+
case 'OUTSIDE':
|
|
804
|
+
if (this.getElementHasBottomPlate(leftElement, optionHandler)) {
|
|
805
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
806
|
+
} else {
|
|
807
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
808
|
+
}
|
|
809
|
+
break;
|
|
739
810
|
}
|
|
740
|
-
|
|
811
|
+
}
|
|
741
812
|
}
|
|
742
813
|
}
|
|
743
814
|
}
|
|
@@ -745,7 +816,13 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
745
816
|
key: "correctKnotLeftTopFront",
|
|
746
817
|
value: function correctKnotLeftTopFront(curElement, boxPlannerGrid, optionHandler) {
|
|
747
818
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
748
|
-
|
|
819
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
820
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctKnotLeftTopFront not supported for complex boxPlaner', {
|
|
821
|
+
code: 'WC_0012'
|
|
822
|
+
}));
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
749
826
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
750
827
|
if (!hasLeftElement) {
|
|
751
828
|
if (boxPlannerGrid.getPlannerHasActiveBackside() && this.getElementHasTopPlate(curElement, boxPlannerGrid, optionHandler)) {
|
|
@@ -760,38 +837,44 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
760
837
|
if (this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
761
838
|
//wenn Element keinen Nachbarn links und keinen Nachbarn rechts hat
|
|
762
839
|
var hasLeftNeighbor = boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
763
|
-
if (hasLeftElement && this.getElementIsCornerElement(boxPlannerGrid.
|
|
840
|
+
if (hasLeftElement && this.getElementIsCornerElement(boxPlannerGrid.getLeftElements(curElement.getElementId())[0], optionHandler)) return; //Wenn der Nachbar links ein Eckelement ist, sett diesen Knoten nicht
|
|
764
841
|
var hasRightNeighbor = boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
765
842
|
if (!hasLeftNeighbor && !hasRightNeighbor) {
|
|
766
843
|
//setze in beiden Eck Fällen einen 2er Knoten mit 1GT
|
|
767
844
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
768
845
|
} else if (hasRightNeighbor && !hasLeftNeighbor) {
|
|
769
846
|
//Der Knoten hat einen rechten aber keinen linken Nachbarn
|
|
770
|
-
var
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
847
|
+
var neighbors = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
848
|
+
if (neighbors.length > 0) {
|
|
849
|
+
var neighbor = neighbors[0];
|
|
850
|
+
switch (this.getCornerType(curElement, optionHandler)) {
|
|
851
|
+
case 'INSIDE':
|
|
852
|
+
if (this.getElementHasTopPlate(neighbor, boxPlannerGrid, optionHandler)) {
|
|
853
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
854
|
+
} else {
|
|
855
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
856
|
+
}
|
|
857
|
+
break;
|
|
858
|
+
case 'OUTSIDE':
|
|
776
859
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
case 'OUTSIDE':
|
|
780
|
-
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
781
|
-
break;
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
782
862
|
}
|
|
783
863
|
} else if (!hasRightNeighbor && hasLeftNeighbor) {
|
|
784
864
|
//Der Knoten hat einen linken aber keinen rechten nachbarn
|
|
785
|
-
var
|
|
786
|
-
if (
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
865
|
+
var _neighbors = boxPlannerGrid.getLeftElements(curElement.getElementId());
|
|
866
|
+
if (_neighbors.length > 0) {
|
|
867
|
+
var _neighbor = _neighbors[0];
|
|
868
|
+
if (this.getElementHasTopPlate(_neighbor, boxPlannerGrid, optionHandler)) {
|
|
869
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot3erer_2GT, optionHandler);
|
|
870
|
+
} else {
|
|
871
|
+
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
872
|
+
}
|
|
790
873
|
}
|
|
791
874
|
} else if (hasRightNeighbor && hasLeftNeighbor) {
|
|
792
875
|
//Wenn der Knoten sowohl links als auch rechts nachbaren hat
|
|
793
|
-
var neighborLeft = boxPlannerGrid.
|
|
794
|
-
var neighborRight = boxPlannerGrid.
|
|
876
|
+
var neighborLeft = boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
877
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
795
878
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
796
879
|
case 'INSIDE':
|
|
797
880
|
if (this.getElementHasTopPlate(neighborLeft, boxPlannerGrid, optionHandler)) {
|
|
@@ -822,12 +905,18 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
822
905
|
}, {
|
|
823
906
|
key: "correctKnotLeftBottomBack",
|
|
824
907
|
value: function correctKnotLeftBottomBack(curElement, boxPlannerGrid, optionHandler) {
|
|
908
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
909
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctKnotLeftBottomBack not supported for complex boxPlaner', {
|
|
910
|
+
code: 'WC_0012'
|
|
911
|
+
}));
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
825
914
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
826
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
915
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
827
916
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
828
917
|
if (boxPlannerGrid.getElementHasBottomElement(curElement.getElementId())) return;
|
|
829
918
|
if (!hasLeftElement) {
|
|
830
|
-
if (boxPlannerGrid.getPlannerHasActiveBackside() && !boxPlannerGrid.
|
|
919
|
+
if (boxPlannerGrid.getPlannerHasActiveBackside() && !boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside) {
|
|
831
920
|
//The backside is set up, however the current element is at the front side of the grid
|
|
832
921
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
833
922
|
if (opposideElement) {
|
|
@@ -860,7 +949,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
860
949
|
}
|
|
861
950
|
}
|
|
862
951
|
if (this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
863
|
-
var neighborLeft = boxPlannerGrid.
|
|
952
|
+
var neighborLeft = boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
864
953
|
//setze linken Corner nur, wenn links kein Corner Element ist
|
|
865
954
|
if (this.getElementIsCornerElement(neighborLeft, optionHandler)) return;
|
|
866
955
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
@@ -872,7 +961,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
872
961
|
}
|
|
873
962
|
break;
|
|
874
963
|
case 'OUTSIDE':
|
|
875
|
-
var neighborRight = boxPlannerGrid.
|
|
964
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
876
965
|
if (this.getElementHasBottomPlate(neighborLeft, optionHandler)) {
|
|
877
966
|
if (this.getElementHasBottomPlate(neighborRight, optionHandler)) {
|
|
878
967
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftBottomBack, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
@@ -893,11 +982,17 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
893
982
|
}, {
|
|
894
983
|
key: "correctKnotLeftTopBack",
|
|
895
984
|
value: function correctKnotLeftTopBack(curElement, boxPlannerGrid, optionHandler) {
|
|
985
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
986
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctKnotLeftTopBack not supported for complex boxPlaner', {
|
|
987
|
+
code: 'WC_0012'
|
|
988
|
+
}));
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
896
991
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
897
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
992
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
898
993
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
899
994
|
if (!hasLeftElement) {
|
|
900
|
-
if (boxPlannerGrid.getPlannerHasActiveBackside() && !boxPlannerGrid.
|
|
995
|
+
if (boxPlannerGrid.getPlannerHasActiveBackside() && !boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside) {
|
|
901
996
|
//The backside is set up, however the current element is at the front side of the grid
|
|
902
997
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
903
998
|
if (opposideElement) {
|
|
@@ -930,14 +1025,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
930
1025
|
if (this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
931
1026
|
//wenn Element keinen Nachbarn links und keinen Nachbarn rechts hat
|
|
932
1027
|
var hasLeftNeighbor = boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
933
|
-
if (hasLeftElement && this.getElementIsCornerElement(boxPlannerGrid.
|
|
1028
|
+
if (hasLeftElement && this.getElementIsCornerElement(boxPlannerGrid.getLeftElements(curElement.getElementId())[0], optionHandler)) return; //Wenn der Nachbar links ein Eckelement ist, sett diesen Knoten nicht
|
|
934
1029
|
var hasRightNeighbor = boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
935
1030
|
if (!hasLeftNeighbor && !hasRightNeighbor) {
|
|
936
1031
|
//setze in beiden Eck Fällen einen 2er Knoten mit 1GT
|
|
937
1032
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
938
1033
|
} else if (hasRightNeighbor && !hasLeftNeighbor) {
|
|
939
1034
|
//Der Knoten hat einen rechten aber keinen linken Nachbarn
|
|
940
|
-
var neighbor = boxPlannerGrid.
|
|
1035
|
+
var neighbor = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
941
1036
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
942
1037
|
case 'INSIDE':
|
|
943
1038
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -952,7 +1047,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
952
1047
|
}
|
|
953
1048
|
} else if (!hasRightNeighbor && hasLeftNeighbor) {
|
|
954
1049
|
//Der Knoten hat einen linken aber keinen rechten nachbarn
|
|
955
|
-
var _neighbor2 = boxPlannerGrid.
|
|
1050
|
+
var _neighbor2 = boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
956
1051
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
957
1052
|
case 'INSIDE':
|
|
958
1053
|
if (this.getElementHasTopPlate(_neighbor2, boxPlannerGrid, optionHandler)) {
|
|
@@ -971,8 +1066,8 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
971
1066
|
}
|
|
972
1067
|
} else if (hasRightNeighbor && hasLeftNeighbor) {
|
|
973
1068
|
//Wenn der Knoten sowohl links als auch rechts nachbaren hat
|
|
974
|
-
var neighborLeft = boxPlannerGrid.
|
|
975
|
-
var neighborRight = boxPlannerGrid.
|
|
1069
|
+
var neighborLeft = boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
1070
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
976
1071
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
977
1072
|
case 'INSIDE':
|
|
978
1073
|
if (this.getElementHasTopPlate(neighborLeft, boxPlannerGrid, optionHandler)) {
|
|
@@ -1005,20 +1100,27 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1005
1100
|
}, {
|
|
1006
1101
|
key: "correctKnotRightMiddleBack",
|
|
1007
1102
|
value: function correctKnotRightMiddleBack(curElement, boxPlannerGrid, optionHandler) {
|
|
1103
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
1104
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctKnotRightMiddleBack not supported for complex boxPlaner', {
|
|
1105
|
+
code: 'WC_0012'
|
|
1106
|
+
}));
|
|
1107
|
+
return;
|
|
1108
|
+
}
|
|
1008
1109
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightMiddleBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1009
1110
|
|
|
1010
1111
|
//Set it only if current Element is garderobe and is on the front side
|
|
1011
1112
|
|
|
1012
1113
|
if (!this.getElementIsGarderobeElement(curElement, optionHandler)) return;
|
|
1013
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1114
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1014
1115
|
if (elementIsOnBackside) return;
|
|
1015
1116
|
var hasRightElement = boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
1016
1117
|
if (hasRightElement) {
|
|
1017
1118
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1018
1119
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
1019
1120
|
if (!opposideElement) return;
|
|
1020
|
-
var
|
|
1021
|
-
if (
|
|
1121
|
+
var rightElements = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1122
|
+
if (rightElements.length == 0) return;
|
|
1123
|
+
var rightElement = rightElements[0];
|
|
1022
1124
|
var opposideRightElement = boxPlannerGrid.getOppositeElement(rightElement.getElementId());
|
|
1023
1125
|
if (!opposideRightElement) return;
|
|
1024
1126
|
if (this.getElementIsGarderobeElement(opposideRightElement, optionHandler)) {
|
|
@@ -1035,8 +1137,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1035
1137
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightMiddleBack, this.constructionRules.knotInfo.knotOPVs.knot2er_0GT, optionHandler);
|
|
1036
1138
|
}
|
|
1037
1139
|
} else {
|
|
1038
|
-
var
|
|
1039
|
-
if (
|
|
1140
|
+
var _rightElements3 = boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1141
|
+
if (_rightElements3.length == 0) return;
|
|
1142
|
+
var _rightElement3 = _rightElements3[0];
|
|
1040
1143
|
if (this.getElementIsGarderobeElement(_rightElement3, optionHandler)) {
|
|
1041
1144
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightMiddleBack, this.constructionRules.knotInfo.knotOPVs.knot3er_0GT, optionHandler);
|
|
1042
1145
|
} else {
|
|
@@ -1062,21 +1165,28 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1062
1165
|
}, {
|
|
1063
1166
|
key: "correctKnotLeftMiddleBack",
|
|
1064
1167
|
value: function correctKnotLeftMiddleBack(curElement, boxPlannerGrid, optionHandler) {
|
|
1168
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
1169
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctKnotLeftMiddleBack not supported for complex boxPlaner', {
|
|
1170
|
+
code: 'WC_0012'
|
|
1171
|
+
}));
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1065
1174
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_LeftMiddleBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1066
1175
|
|
|
1067
1176
|
//Set it only if current Element is garderobe and is on the front side and if left element is not a garderobe
|
|
1068
1177
|
if (!this.getElementIsGarderobeElement(curElement, optionHandler)) return;
|
|
1069
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1178
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1070
1179
|
if (elementIsOnBackside) return;
|
|
1071
1180
|
var hasLeftElement = elementIsOnBackside ? boxPlannerGrid.getElementHasRightElement(curElement.getElementId()) : boxPlannerGrid.getElementHasLeftElement(curElement.getElementId());
|
|
1072
1181
|
if (hasLeftElement) {
|
|
1073
|
-
var leftElement = boxPlannerGrid.
|
|
1182
|
+
var leftElement = boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
1074
1183
|
if (this.getElementIsGarderobeElement(leftElement, optionHandler)) return;
|
|
1075
1184
|
}
|
|
1076
1185
|
if (hasLeftElement) {
|
|
1077
1186
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1078
|
-
var
|
|
1079
|
-
if (
|
|
1187
|
+
var leftElements = boxPlannerGrid.getLeftElements(curElement.getElementId());
|
|
1188
|
+
if (leftElements.length == 0) return;
|
|
1189
|
+
var _leftElement = leftElements[0];
|
|
1080
1190
|
var opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
1081
1191
|
if (!opposideElement) return;
|
|
1082
1192
|
var opposideLeftElement = boxPlannerGrid.getOppositeElement(_leftElement === null || _leftElement === void 0 ? void 0 : _leftElement.getElementId());
|
|
@@ -1108,8 +1218,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1108
1218
|
}, {
|
|
1109
1219
|
key: "correctKnotRightBottomFront",
|
|
1110
1220
|
value: function correctKnotRightBottomFront(curElement, boxPlannerGrid, optionHandler) {
|
|
1221
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
1222
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctKnotRightBottomFront not supported for complex boxPlaner', {
|
|
1223
|
+
code: 'WC_0012'
|
|
1224
|
+
}));
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1111
1227
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1112
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1228
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1113
1229
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
1114
1230
|
if (boxPlannerGrid.getElementHasBottomElement(curElement.getElementId())) return;
|
|
1115
1231
|
if (!boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
@@ -1120,7 +1236,10 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1120
1236
|
//no right neighbor
|
|
1121
1237
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot1er, optionHandler);
|
|
1122
1238
|
} else {
|
|
1123
|
-
var
|
|
1239
|
+
var rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1240
|
+
var rightNeighbor = undefined;
|
|
1241
|
+
if (rightNeighbors.length > 0) rightNeighbor = rightNeighbors[0];
|
|
1242
|
+
|
|
1124
1243
|
//Only set something if element is no corner element
|
|
1125
1244
|
if (rightNeighbor && !this.getElementIsCornerElement(rightNeighbor, optionHandler)) {
|
|
1126
1245
|
if (!this.getElementHasBottomPlate(rightNeighbor, optionHandler)) {
|
|
@@ -1133,7 +1252,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1133
1252
|
}
|
|
1134
1253
|
} else {
|
|
1135
1254
|
//Element has Ground Plate
|
|
1136
|
-
var
|
|
1255
|
+
var _rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1256
|
+
var _rightNeighbor = undefined;
|
|
1257
|
+
if (_rightNeighbors.length > 0) _rightNeighbor = _rightNeighbors[0];
|
|
1137
1258
|
if (_rightNeighbor && !this.getElementHasBottomPlate(_rightNeighbor, optionHandler)) {
|
|
1138
1259
|
//if neighbor right has no ground plate
|
|
1139
1260
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1147,7 +1268,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1147
1268
|
//element has no right neighbor
|
|
1148
1269
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot1er, optionHandler);
|
|
1149
1270
|
} else {
|
|
1150
|
-
var
|
|
1271
|
+
var _rightNeighbors2 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1272
|
+
var _rightNeighbor2 = undefined;
|
|
1273
|
+
if (_rightNeighbors2.length > 0) _rightNeighbor2 = _rightNeighbors2[0];
|
|
1151
1274
|
if (_rightNeighbor2) {
|
|
1152
1275
|
if (!this.getElementHasBottomPlate(_rightNeighbor2, optionHandler)) {
|
|
1153
1276
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot1er, optionHandler);
|
|
@@ -1162,7 +1285,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1162
1285
|
//element has no right neighbor
|
|
1163
1286
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1164
1287
|
} else {
|
|
1165
|
-
var
|
|
1288
|
+
var _rightNeighbors3 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1289
|
+
var _rightNeighbor3 = undefined;
|
|
1290
|
+
if (_rightNeighbors3.length > 0) _rightNeighbor3 = _rightNeighbors3[0];
|
|
1166
1291
|
if (_rightNeighbor3) {
|
|
1167
1292
|
if (!this.getElementHasBottomPlate(_rightNeighbor3, optionHandler)) {
|
|
1168
1293
|
//right neighbor has no ground plate
|
|
@@ -1180,13 +1305,13 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1180
1305
|
//Es gibt sicher einen linken und einen rechten nachbarn
|
|
1181
1306
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1182
1307
|
case 'INSIDE':
|
|
1183
|
-
var neighborRight = boxPlannerGrid.
|
|
1308
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1184
1309
|
if (neighborRight && this.getElementIsCornerElement(neighborRight, optionHandler)) {
|
|
1185
1310
|
var hasNextNeighbor = boxPlannerGrid.getElementHasRightElement(neighborRight.getElementId());
|
|
1186
1311
|
if (!hasNextNeighbor) {
|
|
1187
1312
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
1188
1313
|
} else {
|
|
1189
|
-
var nextNeighbor = boxPlannerGrid.
|
|
1314
|
+
var nextNeighbor = boxPlannerGrid.getRightElements(neighborRight.getElementId())[0];
|
|
1190
1315
|
if (this.getElementHasBottomPlate(nextNeighbor, optionHandler)) {
|
|
1191
1316
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomFront, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1192
1317
|
} else {
|
|
@@ -1210,8 +1335,14 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1210
1335
|
}, {
|
|
1211
1336
|
key: "correctKnotRightTopFront",
|
|
1212
1337
|
value: function correctKnotRightTopFront(curElement, boxPlannerGrid, optionHandler) {
|
|
1338
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
1339
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctKnotRightTopFront not supported for complex boxPlaner', {
|
|
1340
|
+
code: 'WC_0012'
|
|
1341
|
+
}));
|
|
1342
|
+
return;
|
|
1343
|
+
}
|
|
1213
1344
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1214
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1345
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1215
1346
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
1216
1347
|
if (!boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1217
1348
|
//No active backside
|
|
@@ -1221,7 +1352,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1221
1352
|
//element has no right neighbor
|
|
1222
1353
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot1er, optionHandler);
|
|
1223
1354
|
} else {
|
|
1224
|
-
var
|
|
1355
|
+
var rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1356
|
+
var rightNeighbor = undefined;
|
|
1357
|
+
if (rightNeighbors.length > 0) rightNeighbor = rightNeighbors[0];
|
|
1225
1358
|
if (rightNeighbor && !this.getElementIsCornerElement(rightNeighbor, optionHandler)) {
|
|
1226
1359
|
if (this.getElementHasTopPlate(rightNeighbor, boxPlannerGrid, optionHandler)) {
|
|
1227
1360
|
//right element has top plate
|
|
@@ -1235,7 +1368,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1235
1368
|
} else {
|
|
1236
1369
|
//Element has top Plate
|
|
1237
1370
|
if (hasRightElement) {
|
|
1238
|
-
var
|
|
1371
|
+
var _rightNeighbors4 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1372
|
+
var _rightNeighbor4 = undefined;
|
|
1373
|
+
if (_rightNeighbors4.length > 0) _rightNeighbor4 = _rightNeighbors4[0];
|
|
1239
1374
|
if (_rightNeighbor4) {
|
|
1240
1375
|
if (!this.getElementHasTopPlate(_rightNeighbor4, boxPlannerGrid, optionHandler)) {
|
|
1241
1376
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1251,7 +1386,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1251
1386
|
//element has no right neighbor
|
|
1252
1387
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot1er, optionHandler);
|
|
1253
1388
|
} else {
|
|
1254
|
-
var
|
|
1389
|
+
var _rightNeighbors5 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1390
|
+
var _rightNeighbor5 = undefined;
|
|
1391
|
+
if (_rightNeighbors5.length > 0) _rightNeighbor5 = _rightNeighbors5[0];
|
|
1255
1392
|
if (_rightNeighbor5) {
|
|
1256
1393
|
if (this.getElementHasTopPlate(_rightNeighbor5, boxPlannerGrid, optionHandler)) {
|
|
1257
1394
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1266,7 +1403,9 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1266
1403
|
//element has no neighbor right
|
|
1267
1404
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1268
1405
|
} else {
|
|
1269
|
-
var
|
|
1406
|
+
var _rightNeighbors6 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1407
|
+
var _rightNeighbor6 = undefined;
|
|
1408
|
+
if (_rightNeighbors6.length > 0) _rightNeighbor6 = _rightNeighbors6[0];
|
|
1270
1409
|
if (_rightNeighbor6) {
|
|
1271
1410
|
if (this.getElementHasTopPlate(_rightNeighbor6, boxPlannerGrid, optionHandler)) {
|
|
1272
1411
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
@@ -1285,7 +1424,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1285
1424
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1286
1425
|
} else if (hasRightNeighbor && !hasLeftNeighbor) {
|
|
1287
1426
|
//Der Knoten hat einen rechten aber keinen linken Nachbarn
|
|
1288
|
-
var neighbor = boxPlannerGrid.
|
|
1427
|
+
var neighbor = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1289
1428
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1290
1429
|
case 'INSIDE':
|
|
1291
1430
|
//Check if right element is Corner element
|
|
@@ -1294,7 +1433,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1294
1433
|
if (!hasNextNeighbor) {
|
|
1295
1434
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
1296
1435
|
} else {
|
|
1297
|
-
var nextNeighbor = boxPlannerGrid.
|
|
1436
|
+
var nextNeighbor = boxPlannerGrid.getRightElements(neighbor.getElementId())[0];
|
|
1298
1437
|
if (this.getElementHasTopPlate(nextNeighbor, boxPlannerGrid, optionHandler)) {
|
|
1299
1438
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1300
1439
|
} else {
|
|
@@ -1315,7 +1454,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1315
1454
|
}
|
|
1316
1455
|
} else if (!hasRightNeighbor && hasLeftNeighbor) {
|
|
1317
1456
|
//Der Knoten hat einen linken aber keinen rechten nachbarn
|
|
1318
|
-
boxPlannerGrid.
|
|
1457
|
+
boxPlannerGrid.getLeftElements(curElement.getElementId())[0];
|
|
1319
1458
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1320
1459
|
case 'INSIDE':
|
|
1321
1460
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1326,7 +1465,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1326
1465
|
}
|
|
1327
1466
|
} else if (hasRightNeighbor && hasLeftNeighbor) {
|
|
1328
1467
|
//Wenn der Knoten sowohl links als auch rechts nachbaren hat
|
|
1329
|
-
var neighborRight = boxPlannerGrid.
|
|
1468
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1330
1469
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1331
1470
|
case 'INSIDE':
|
|
1332
1471
|
if (this.getElementIsCornerElement(neighborRight, optionHandler)) {
|
|
@@ -1334,7 +1473,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1334
1473
|
if (!_hasNextNeighbor) {
|
|
1335
1474
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
1336
1475
|
} else {
|
|
1337
|
-
var _nextNeighbor = boxPlannerGrid.
|
|
1476
|
+
var _nextNeighbor = boxPlannerGrid.getRightElements(neighborRight.getElementId())[0];
|
|
1338
1477
|
if (this.getElementHasTopPlate(_nextNeighbor, boxPlannerGrid, optionHandler)) {
|
|
1339
1478
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopFront, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1340
1479
|
} else {
|
|
@@ -1359,18 +1498,26 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1359
1498
|
}, {
|
|
1360
1499
|
key: "correctKnotRightBottomBack",
|
|
1361
1500
|
value: function correctKnotRightBottomBack(curElement, boxPlannerGrid, optionHandler) {
|
|
1501
|
+
if (!boxPlannerGrid.getForceSingleCellPerElement()) {
|
|
1502
|
+
LOG$3.error(new DivaError('BoxPlannerError - function correctKnotRightBottomBack not supported for complex boxPlaner', {
|
|
1503
|
+
code: 'WC_0012'
|
|
1504
|
+
}));
|
|
1505
|
+
return;
|
|
1506
|
+
}
|
|
1362
1507
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1363
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1508
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1364
1509
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
1365
1510
|
if (boxPlannerGrid.getElementHasBottomElement(curElement.getElementId())) return;
|
|
1366
|
-
if (boxPlannerGrid.
|
|
1511
|
+
if (boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside) return;
|
|
1367
1512
|
if (!boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1368
1513
|
//No active backside
|
|
1369
1514
|
if (!this.getElementHasBottomPlate(curElement, optionHandler)) {
|
|
1370
1515
|
if (!hasRightElement) {
|
|
1371
1516
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.knot2er_0GT, optionHandler);
|
|
1372
1517
|
} else {
|
|
1373
|
-
var
|
|
1518
|
+
var rightNeighbors = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1519
|
+
var rightNeighbor = undefined;
|
|
1520
|
+
if (rightNeighbors.length > 0) rightNeighbor = rightNeighbors[0];
|
|
1374
1521
|
if (rightNeighbor && !this.getElementIsCornerElement(rightNeighbor, optionHandler)) {
|
|
1375
1522
|
if (this.getElementHasBottomPlate(rightNeighbor, optionHandler)) {
|
|
1376
1523
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.knot3er_1GT, optionHandler);
|
|
@@ -1382,7 +1529,11 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1382
1529
|
} else {
|
|
1383
1530
|
//Element has ground plate
|
|
1384
1531
|
if (hasRightElement) {
|
|
1385
|
-
var
|
|
1532
|
+
var _rightNeighbors7 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId()) : boxPlannerGrid.getRightElements(curElement.getElementId());
|
|
1533
|
+
var _rightNeighbor7 = undefined;
|
|
1534
|
+
if (_rightNeighbors7.length > 0) {
|
|
1535
|
+
_rightNeighbor7 = _rightNeighbors7[0];
|
|
1536
|
+
}
|
|
1386
1537
|
if (_rightNeighbor7) {
|
|
1387
1538
|
if (!this.getElementHasBottomPlate(_rightNeighbor7, optionHandler)) {
|
|
1388
1539
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.knot3er_1GT, optionHandler);
|
|
@@ -1425,77 +1576,6 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1425
1576
|
}
|
|
1426
1577
|
break;
|
|
1427
1578
|
}
|
|
1428
|
-
/*
|
|
1429
|
-
if (!this.getElementHasBottomPlate(curElement, optionHandler)) {
|
|
1430
|
-
//Element has no ground plate
|
|
1431
|
-
if (!boxPlannerGrid.getElementHasRightElement(curElement.getElementId())) {
|
|
1432
|
-
let opposideElement = boxPlannerGrid.getOppositeElement(curElement.getElementId());
|
|
1433
|
-
if (opposideElement) {
|
|
1434
|
-
if (this.getElementHasBottomPlate(opposideElement, optionHandler)) {
|
|
1435
|
-
//The opposide element has a ground plate
|
|
1436
|
-
this.setOptionValue(
|
|
1437
|
-
curElement.getElementId(),
|
|
1438
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1439
|
-
this.constructionRules.knotInfo.knotOPVs.knot3er_1GT,
|
|
1440
|
-
optionHandler,
|
|
1441
|
-
);
|
|
1442
|
-
} else {
|
|
1443
|
-
//The opposide element has no ground plate
|
|
1444
|
-
this.setOptionValue(
|
|
1445
|
-
curElement.getElementId(),
|
|
1446
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1447
|
-
this.constructionRules.knotInfo.knotOPVs.knot3er_0GT,
|
|
1448
|
-
optionHandler,
|
|
1449
|
-
);
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
} else {
|
|
1453
|
-
//Element has neighbor element
|
|
1454
|
-
//Set the Glasteller count depending on the plates of the neighbors
|
|
1455
|
-
switch (this.getGroundPlatesNumOfRightNeighbors(curElement, boxPlannerGrid, optionHandler)) {
|
|
1456
|
-
case 0:
|
|
1457
|
-
this.setOptionValue(
|
|
1458
|
-
curElement.getElementId(),
|
|
1459
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1460
|
-
this.constructionRules.knotInfo.knotOPVs.knot4er_0GT,
|
|
1461
|
-
optionHandler,
|
|
1462
|
-
);
|
|
1463
|
-
break;
|
|
1464
|
-
case 1:
|
|
1465
|
-
this.setOptionValue(
|
|
1466
|
-
curElement.getElementId(),
|
|
1467
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1468
|
-
this.constructionRules.knotInfo.knotOPVs.knot4er_1GT,
|
|
1469
|
-
optionHandler,
|
|
1470
|
-
);
|
|
1471
|
-
break;
|
|
1472
|
-
case 2:
|
|
1473
|
-
this.setOptionValue(
|
|
1474
|
-
curElement.getElementId(),
|
|
1475
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1476
|
-
this.constructionRules.knotInfo.knotOPVs.knot4er_2GT,
|
|
1477
|
-
optionHandler,
|
|
1478
|
-
);
|
|
1479
|
-
break;
|
|
1480
|
-
case 3:
|
|
1481
|
-
this.setOptionValue(
|
|
1482
|
-
curElement.getElementId(),
|
|
1483
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1484
|
-
this.constructionRules.knotInfo.knotOPVs.knot4er_3GT,
|
|
1485
|
-
optionHandler,
|
|
1486
|
-
);
|
|
1487
|
-
break;
|
|
1488
|
-
case 4:
|
|
1489
|
-
this.setOptionValue(
|
|
1490
|
-
curElement.getElementId(),
|
|
1491
|
-
this.constructionRules.knotInfo.knotOPT_RightBottomBack,
|
|
1492
|
-
this.constructionRules.knotInfo.knotOPVs.knot4er_4GT,
|
|
1493
|
-
optionHandler,
|
|
1494
|
-
);
|
|
1495
|
-
break;
|
|
1496
|
-
}
|
|
1497
|
-
}
|
|
1498
|
-
}*/
|
|
1499
1579
|
}
|
|
1500
1580
|
if (this.getElementIsCornerElement(curElement, optionHandler)) {
|
|
1501
1581
|
//Element hat sicher ienen linken und rechten nachbarn
|
|
@@ -1504,11 +1584,11 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1504
1584
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1505
1585
|
break;
|
|
1506
1586
|
case 'OUTSIDE':
|
|
1507
|
-
var neighborRight = boxPlannerGrid.
|
|
1587
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1508
1588
|
if (this.getElementIsCornerElement(neighborRight, optionHandler)) {
|
|
1509
1589
|
//we are on the ground, so there is shourly a nextRightElement
|
|
1510
1590
|
|
|
1511
|
-
var nextNeighbor = boxPlannerGrid.
|
|
1591
|
+
var nextNeighbor = boxPlannerGrid.getRightElements(neighborRight.getElementId())[0];
|
|
1512
1592
|
if (this.getElementHasBottomPlate(nextNeighbor, optionHandler)) {
|
|
1513
1593
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightBottomBack, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1514
1594
|
} else {
|
|
@@ -1529,16 +1609,16 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1529
1609
|
key: "correctKnotRightTopBack",
|
|
1530
1610
|
value: function correctKnotRightTopBack(curElement, boxPlannerGrid, optionHandler) {
|
|
1531
1611
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.noKnot, optionHandler);
|
|
1532
|
-
var elementIsOnBackside = boxPlannerGrid.
|
|
1612
|
+
var elementIsOnBackside = boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside;
|
|
1533
1613
|
var hasRightElement = elementIsOnBackside ? boxPlannerGrid.getElementHasLeftElement(curElement.getElementId()) : boxPlannerGrid.getElementHasRightElement(curElement.getElementId());
|
|
1534
|
-
if (boxPlannerGrid.
|
|
1614
|
+
if (boxPlannerGrid.getCellsInGridByElementId(curElement.getElementId()).backside) return;
|
|
1535
1615
|
if (!boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1536
1616
|
if (!this.getElementHasTopPlate(curElement, boxPlannerGrid, optionHandler)) {
|
|
1537
1617
|
if (!hasRightElement) {
|
|
1538
1618
|
//Element has no right neighbor
|
|
1539
1619
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_0GT, optionHandler);
|
|
1540
1620
|
} else {
|
|
1541
|
-
var rightNeighbor = elementIsOnBackside ? boxPlannerGrid.
|
|
1621
|
+
var rightNeighbor = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId())[0] : boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1542
1622
|
if (rightNeighbor && !this.getElementIsCornerElement(rightNeighbor, optionHandler)) {
|
|
1543
1623
|
if (this.getElementHasTopPlate(rightNeighbor, boxPlannerGrid, optionHandler)) {
|
|
1544
1624
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot3er_1GT, optionHandler);
|
|
@@ -1550,7 +1630,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1550
1630
|
}
|
|
1551
1631
|
} else {
|
|
1552
1632
|
if (hasRightElement) {
|
|
1553
|
-
var _rightNeighbor8 = elementIsOnBackside ? boxPlannerGrid.
|
|
1633
|
+
var _rightNeighbor8 = elementIsOnBackside ? boxPlannerGrid.getLeftElements(curElement.getElementId())[0] : boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1554
1634
|
if (!this.getElementIsCornerElement(_rightNeighbor8, optionHandler)) {
|
|
1555
1635
|
if (!this.getElementHasTopPlate(_rightNeighbor8, boxPlannerGrid, optionHandler)) {
|
|
1556
1636
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot3er_1GT, optionHandler);
|
|
@@ -1602,7 +1682,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1602
1682
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1603
1683
|
} else if (hasRightNeighbor && !hasLeftNeighbor) {
|
|
1604
1684
|
//Der Knoten hat einen rechten aber keinen linken Nachbarn
|
|
1605
|
-
var neighbor = boxPlannerGrid.
|
|
1685
|
+
var neighbor = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1606
1686
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1607
1687
|
case 'INSIDE':
|
|
1608
1688
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1613,7 +1693,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1613
1693
|
if (!hasNextNeighbor) {
|
|
1614
1694
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
1615
1695
|
} else {
|
|
1616
|
-
var nextNeighbor = boxPlannerGrid.
|
|
1696
|
+
var nextNeighbor = boxPlannerGrid.getRightElements(neighbor.getElementId())[0];
|
|
1617
1697
|
if (this.getElementHasTopPlate(nextNeighbor, boxPlannerGrid, optionHandler)) {
|
|
1618
1698
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1619
1699
|
} else {
|
|
@@ -1635,7 +1715,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1635
1715
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
1636
1716
|
} else if (hasRightNeighbor && hasLeftNeighbor) {
|
|
1637
1717
|
//Wenn der Knoten sowohl links als auch rechts nachbaren hat
|
|
1638
|
-
var neighborRight = boxPlannerGrid.
|
|
1718
|
+
var neighborRight = boxPlannerGrid.getRightElements(curElement.getElementId())[0];
|
|
1639
1719
|
switch (this.getCornerType(curElement, optionHandler)) {
|
|
1640
1720
|
case 'INSIDE':
|
|
1641
1721
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot2er_1GT, optionHandler);
|
|
@@ -1646,7 +1726,7 @@ var BoxPlannerPartlistHelper = /*#__PURE__*/function () {
|
|
|
1646
1726
|
if (!_hasNextNeighbor2) {
|
|
1647
1727
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot3er_2GT, optionHandler);
|
|
1648
1728
|
} else {
|
|
1649
|
-
var _nextNeighbor2 = boxPlannerGrid.
|
|
1729
|
+
var _nextNeighbor2 = boxPlannerGrid.getRightElements(neighborRight.getElementId())[0];
|
|
1650
1730
|
if (this.getElementHasTopPlate(_nextNeighbor2, boxPlannerGrid, optionHandler)) {
|
|
1651
1731
|
this.setOptionValue(curElement.getElementId(), this.constructionRules.knotInfo.knotOPT_RightTopBack, this.constructionRules.knotInfo.knotOPVs.knot4er_3GT, optionHandler);
|
|
1652
1732
|
} else {
|
|
@@ -1724,7 +1804,6 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1724
1804
|
*/
|
|
1725
1805
|
_defineProperty(this, "setOptionValue", function (elementId, option, optionValue, optionHandler) {
|
|
1726
1806
|
var _optionHandler$get;
|
|
1727
|
-
//LOG.log("Update Box Planner Logic.Set default Option: elementId: " + elementId + "; Option: " + option);
|
|
1728
1807
|
if (!optionHandler.has(elementId)) optionHandler.set(elementId, new Map());
|
|
1729
1808
|
(_optionHandler$get = optionHandler.get(elementId)) === null || _optionHandler$get === void 0 || _optionHandler$get.set(option, optionValue);
|
|
1730
1809
|
if (_this.hideOptionsForConstruction.has(elementId)) {
|
|
@@ -1765,14 +1844,19 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1765
1844
|
return 'NOCORNER';
|
|
1766
1845
|
});
|
|
1767
1846
|
/**
|
|
1768
|
-
* 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
|
|
1847
|
+
* 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.
|
|
1769
1848
|
* It has no top plate, if the element on top has no ground plate, like a "Garderobe"
|
|
1770
1849
|
* @param curElement
|
|
1771
1850
|
* @param optionHandler
|
|
1772
1851
|
*/
|
|
1773
1852
|
_defineProperty(this, "getElementHasTopPlate", function (curElement, boxPlannerGrid, optionHandler) {
|
|
1774
1853
|
if (boxPlannerGrid.getElementHasTopElement(curElement.getElementId())) {
|
|
1775
|
-
|
|
1854
|
+
var allTopElements = boxPlannerGrid.getTopElements(curElement.getElementId());
|
|
1855
|
+
var oneTrueFound = false;
|
|
1856
|
+
for (var i = 0; i < allTopElements.length; i++) {
|
|
1857
|
+
if (_this.getElementHasBottomPlate(allTopElements[i], optionHandler)) oneTrueFound = true;
|
|
1858
|
+
}
|
|
1859
|
+
return oneTrueFound;
|
|
1776
1860
|
}
|
|
1777
1861
|
return true;
|
|
1778
1862
|
});
|
|
@@ -1933,14 +2017,15 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1933
2017
|
this.setOptionValue(allElementIds[i], 'OPTCORNER_COL_R', 'OPVOHNE', optionHandler);
|
|
1934
2018
|
|
|
1935
2019
|
//Check if first col or last Col are eckelemente.
|
|
1936
|
-
|
|
1937
|
-
|
|
2020
|
+
//let posInGrid = boxPlannerGrid.getIndexInGridByElementId(allElementIds[i]);
|
|
2021
|
+
var cellsInGrid = boxPlannerGrid.getCellsInGridByElementId(allElementIds[i]);
|
|
2022
|
+
if (cellsInGrid.backside) {
|
|
1938
2023
|
this.setOptionValue(allElementIds[i], 'OPTELEM_ON_BACK', 'OPVJA', optionHandler);
|
|
1939
2024
|
} else {
|
|
1940
2025
|
this.setOptionValue(allElementIds[i], 'OPTELEM_ON_BACK', 'OPVNEIN', optionHandler);
|
|
1941
2026
|
//Set if col left is column with corners
|
|
1942
|
-
if (
|
|
1943
|
-
var leftElement = boxPlannerGrid.getPlannerElementAtGridPos(
|
|
2027
|
+
if (cellsInGrid.startColIndex > 0) {
|
|
2028
|
+
var leftElement = boxPlannerGrid.getPlannerElementAtGridPos(cellsInGrid.startColIndex - 1, 0, false);
|
|
1944
2029
|
if (leftElement) {
|
|
1945
2030
|
var cornerVal = this.getOptionVal(leftElement.getElementId(), 'OPTELEMENT', optionHandler);
|
|
1946
2031
|
if (cornerVal == 'OPVECK_I') {
|
|
@@ -1952,8 +2037,8 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1952
2037
|
}
|
|
1953
2038
|
}
|
|
1954
2039
|
}
|
|
1955
|
-
if (
|
|
1956
|
-
var rightElement = boxPlannerGrid.getPlannerElementAtGridPos(
|
|
2040
|
+
if (cellsInGrid.endColIndex < colCount - 1) {
|
|
2041
|
+
var rightElement = boxPlannerGrid.getPlannerElementAtGridPos(cellsInGrid.endColIndex + 1, 0, false);
|
|
1957
2042
|
if (rightElement) {
|
|
1958
2043
|
var _cornerVal = this.getOptionVal(rightElement.getElementId(), 'OPTELEMENT', optionHandler);
|
|
1959
2044
|
if (_cornerVal == 'OPVECK_I') {
|
|
@@ -1968,13 +2053,13 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1968
2053
|
}
|
|
1969
2054
|
if (this.constructionRules.avoidOptionLastCol) {
|
|
1970
2055
|
var elementType = this.getOptionVal(allElementIds[i], this.constructionRules.avoidOptionLastCol.onOPT, optionHandler);
|
|
1971
|
-
if (this.arrayContainsValue(this.constructionRules.avoidOptionLastCol.onOPVs, elementType) &&
|
|
2056
|
+
if (this.arrayContainsValue(this.constructionRules.avoidOptionLastCol.onOPVs, elementType) && cellsInGrid.endColIndex == colCount - 1) {
|
|
1972
2057
|
this.setOptionValue(allElementIds[i], this.constructionRules.avoidOptionLastCol.onOPT, this.constructionRules.avoidOptionLastCol.defaultOpv, optionHandler);
|
|
1973
2058
|
}
|
|
1974
2059
|
}
|
|
1975
2060
|
if (this.constructionRules.avoidOptionFirstCol) {
|
|
1976
2061
|
var _elementType = this.getOptionVal(allElementIds[i], this.constructionRules.avoidOptionFirstCol.onOPT, optionHandler);
|
|
1977
|
-
if (this.arrayContainsValue(this.constructionRules.avoidOptionFirstCol.onOPVs, _elementType) &&
|
|
2062
|
+
if (this.arrayContainsValue(this.constructionRules.avoidOptionFirstCol.onOPVs, _elementType) && cellsInGrid.startColIndex == 0) {
|
|
1978
2063
|
this.setOptionValue(allElementIds[i], this.constructionRules.avoidOptionFirstCol.onOPT, this.constructionRules.avoidOptionFirstCol.defaultOpv, optionHandler);
|
|
1979
2064
|
}
|
|
1980
2065
|
}
|
|
@@ -1983,7 +2068,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
1983
2068
|
this.setOptionDoShow(allElementIds[i], 'OPTWERKZEUGKASTEN', optionHandler);
|
|
1984
2069
|
//Check if set Winkel
|
|
1985
2070
|
if (hasOPTWW) {
|
|
1986
|
-
if (boxPlannerGrid.getSizeOfWholeSet().y > 173 && !boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
2071
|
+
if (boxPlannerGrid.getSizeOfWholeSet(true).y > 173 && !boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
1987
2072
|
this.setOptionDoShow(allElementIds[i], 'OPTWW', optionHandler);
|
|
1988
2073
|
} else {
|
|
1989
2074
|
this.setOptionDoHide(allElementIds[i], 'OPTWW', optionHandler);
|
|
@@ -2031,18 +2116,44 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2031
2116
|
var doCheckRule = false;
|
|
2032
2117
|
if (rule.dir && targetElements && targetElements.length > 0) {
|
|
2033
2118
|
//If rule == dir only correct this element if it is the target
|
|
2034
|
-
|
|
2035
|
-
|
|
2119
|
+
|
|
2120
|
+
if (rule.dir == 'TOP' && boxPlannerGrid.getElementHasBottomElement(allElementIds[i])) {
|
|
2121
|
+
var bottomElements = boxPlannerGrid.getBottomElements(allElementIds[i]);
|
|
2122
|
+
for (var bElemNr = 0; bElemNr < bottomElements.length; bElemNr++) {
|
|
2123
|
+
if (targetElements.indexOf(bottomElements[bElemNr].getElementId()) >= 0) {
|
|
2124
|
+
doCheckRule = true;
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2036
2127
|
}
|
|
2037
|
-
if (rule.dir == 'DOWN' && boxPlannerGrid.getElementHasTopElement(allElementIds[i])
|
|
2038
|
-
|
|
2128
|
+
if (rule.dir == 'DOWN' && boxPlannerGrid.getElementHasTopElement(allElementIds[i])) {
|
|
2129
|
+
var topElements = boxPlannerGrid.getTopElements(allElementIds[i]);
|
|
2130
|
+
for (var tElemNr = 0; tElemNr < topElements.length; tElemNr++) {
|
|
2131
|
+
if (targetElements.indexOf(topElements[tElemNr].getElementId()) >= 0) {
|
|
2132
|
+
doCheckRule = true;
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2039
2135
|
}
|
|
2040
|
-
if (rule.dir == 'LEFT_RIGHT'
|
|
2041
|
-
|
|
2136
|
+
if (rule.dir == 'LEFT_RIGHT') {
|
|
2137
|
+
if (boxPlannerGrid.getElementHasLeftElement(allElementIds[i])) {
|
|
2138
|
+
var allLeftElements = boxPlannerGrid.getLeftElements(allElementIds[i]);
|
|
2139
|
+
for (var lElemNr = 0; lElemNr < allLeftElements.length; lElemNr++) {
|
|
2140
|
+
if (targetElements.indexOf(allLeftElements[lElemNr].getElementId()) >= 0) {
|
|
2141
|
+
doCheckRule = true;
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
if (boxPlannerGrid.getElementHasRightElement(allElementIds[i])) {
|
|
2146
|
+
var allRightElements = boxPlannerGrid.getRightElements(allElementIds[i]);
|
|
2147
|
+
for (var rElemNr = 0; rElemNr < allRightElements.length; rElemNr++) {
|
|
2148
|
+
if (targetElements.indexOf(allRightElements[rElemNr].getElementId()) >= 0) {
|
|
2149
|
+
doCheckRule = true;
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2042
2153
|
}
|
|
2043
2154
|
if (rule.dir == 'COL') {
|
|
2044
|
-
var
|
|
2045
|
-
var allElementsInCol = boxPlannerGrid.getAllElementsInColumn(
|
|
2155
|
+
var cellPos = boxPlannerGrid.getCellsInGridByElementId(allElementIds[i]);
|
|
2156
|
+
var allElementsInCol = boxPlannerGrid.getAllElementsInColumn(cellPos.startColIndex, cellPos.backside);
|
|
2046
2157
|
allElementsInCol.forEach(function (plannerElement) {
|
|
2047
2158
|
return targetElements.indexOf(plannerElement.ElementId) >= 0 ? doCheckRule = true : undefined;
|
|
2048
2159
|
});
|
|
@@ -2065,7 +2176,6 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2065
2176
|
if (this.arrayContainsValue(rule.unvalidOPVs, articleOPV) && this.arrayContainsValue(rule.onOPVs, changedOPTs[changedOpt])) {
|
|
2066
2177
|
//Es ist nicht gültig
|
|
2067
2178
|
this.setOptionValue(allElementIds[i], rule.influenceOPT, rule.defaultOpv, optionHandler);
|
|
2068
|
-
//article[rule.influenceOPT].val = rule.defaultOpv;
|
|
2069
2179
|
if (rule.warning) messageForView = rule.warning;
|
|
2070
2180
|
}
|
|
2071
2181
|
}
|
|
@@ -2126,8 +2236,8 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2126
2236
|
for (var opt in changedOPTs) {
|
|
2127
2237
|
if (this.constructionRules.forceSameOptionInGrid && this.arrayContainsValue(this.constructionRules.forceSameOptionInGrid, opt)) {
|
|
2128
2238
|
//Bitte auf alle anwenden
|
|
2129
|
-
var
|
|
2130
|
-
var _affectedElements =
|
|
2239
|
+
var _cellPos = boxPlannerGrid.getCellsInGridByElementId(targetElementId);
|
|
2240
|
+
var _affectedElements = _cellPos.backside ? boxPlannerGrid.getAllElementsInBackGrid() : boxPlannerGrid.getAllElementsInFrontGrid();
|
|
2131
2241
|
if (_affectedElements != undefined) {
|
|
2132
2242
|
for (var i = 0; i < _affectedElements.length; i++) {
|
|
2133
2243
|
this.setOptionValue(_affectedElements[i].ElementId, opt, changedOPTs[opt], optionHandler);
|
|
@@ -2136,12 +2246,12 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2136
2246
|
}
|
|
2137
2247
|
if (this.arrayContainsValue(this.constructionRules.forceSameOptionInCol, opt)) {
|
|
2138
2248
|
//Bitte auf alle anwenden
|
|
2139
|
-
var
|
|
2140
|
-
var _affectedElements2 = boxPlannerGrid.getAllElementsInColumn(
|
|
2249
|
+
var _cellPos2 = boxPlannerGrid.getCellsInGridByElementId(targetElementId);
|
|
2250
|
+
var _affectedElements2 = boxPlannerGrid.getAllElementsInColumn(_cellPos2.startColIndex, _cellPos2.backside);
|
|
2141
2251
|
if (_affectedElements2 != undefined) {
|
|
2142
2252
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
2143
2253
|
var _affectedElements3;
|
|
2144
|
-
var affectedBackside = boxPlannerGrid.getAllElementsInColumn(
|
|
2254
|
+
var affectedBackside = boxPlannerGrid.getAllElementsInColumn(_cellPos2.startColIndex, !_cellPos2.backside);
|
|
2145
2255
|
if (affectedBackside) _affectedElements2 = (_affectedElements3 = _affectedElements2) === null || _affectedElements3 === void 0 ? void 0 : _affectedElements3.concat(affectedBackside);
|
|
2146
2256
|
}
|
|
2147
2257
|
for (var i = 0; i < _affectedElements2.length; i++) {
|
|
@@ -2151,11 +2261,11 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2151
2261
|
}
|
|
2152
2262
|
if (this.arrayContainsValue(this.constructionRules.forceSameOptionInRow, opt)) {
|
|
2153
2263
|
//Bitte auf alle anwenden
|
|
2154
|
-
var
|
|
2155
|
-
var affectedElements = boxPlannerGrid.getAllElementsInRow(
|
|
2264
|
+
var _cellPos3 = boxPlannerGrid.getCellsInGridByElementId(targetElementId);
|
|
2265
|
+
var affectedElements = boxPlannerGrid.getAllElementsInRow(_cellPos3.startRowIndex, _cellPos3.backside);
|
|
2156
2266
|
if (affectedElements) {
|
|
2157
2267
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
2158
|
-
var _affectedBackside = boxPlannerGrid.getAllElementsInRow(
|
|
2268
|
+
var _affectedBackside = boxPlannerGrid.getAllElementsInRow(_cellPos3.startRowIndex, !_cellPos3.backside);
|
|
2159
2269
|
if (_affectedBackside) affectedElements = affectedElements.concat(_affectedBackside);
|
|
2160
2270
|
}
|
|
2161
2271
|
}
|
|
@@ -2167,8 +2277,8 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2167
2277
|
}
|
|
2168
2278
|
|
|
2169
2279
|
//if the targetElement has another height than the other elements in the col - force same height
|
|
2170
|
-
var
|
|
2171
|
-
var allElementsInRow = boxPlannerGrid.getAllElementsInRow(
|
|
2280
|
+
var cellPos = boxPlannerGrid.getCellsInGridByElementId(targetElementId);
|
|
2281
|
+
var allElementsInRow = boxPlannerGrid.getAllElementsInRow(cellPos.startRowIndex, cellPos.backside);
|
|
2172
2282
|
for (var i = 0; i < allElementsInRow.length; i++) {
|
|
2173
2283
|
if (allElementsInRow[i].getElementId() == targetElementId) continue;
|
|
2174
2284
|
for (var j = 0; j < this.constructionRules.forceSameOptionInRow.length; j++) {
|
|
@@ -2310,34 +2420,58 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2310
2420
|
}
|
|
2311
2421
|
|
|
2312
2422
|
//Korrigiere if it has neighbors
|
|
2313
|
-
var
|
|
2314
|
-
var
|
|
2315
|
-
var
|
|
2316
|
-
var
|
|
2317
|
-
var
|
|
2318
|
-
if (
|
|
2319
|
-
|
|
2423
|
+
var rightElemts = !fromBackside ? boxPlannerGrid.getRightElements(curElement.ElementId) : boxPlannerGrid.getLeftElements(curElement.ElementId);
|
|
2424
|
+
var leftElemts = !fromBackside ? boxPlannerGrid.getLeftElements(curElement.ElementId) : boxPlannerGrid.getRightElements(curElement.ElementId);
|
|
2425
|
+
var topElemts = boxPlannerGrid.getTopElements(curElement.ElementId);
|
|
2426
|
+
var bottomElemts = boxPlannerGrid.getBottomElements(curElement.ElementId);
|
|
2427
|
+
var topRightElemt = !fromBackside ? boxPlannerGrid.getTopRightElement(curElement.ElementId) : boxPlannerGrid.getTopLeftElement(curElement.ElementId);
|
|
2428
|
+
if (rightElemts.length > 0) {
|
|
2429
|
+
if (rightElemts.length > 1) {
|
|
2430
|
+
LOG$2.error(new DivaError('BoxPlannerError - only one OPTNACHBAR_RECHTS allowed', {
|
|
2431
|
+
code: 'WC_0012'
|
|
2432
|
+
}));
|
|
2433
|
+
} else {
|
|
2434
|
+
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_RECHTS', this.getOptionVal(rightElemts[0].ElementId, 'OPTELEMENT', optionHandler), optionHandler);
|
|
2435
|
+
}
|
|
2320
2436
|
} else {
|
|
2321
2437
|
this.setOptionDoHide(curElement.ElementId, 'OPTNACHBAR_RECHTS', optionHandler);
|
|
2322
2438
|
}
|
|
2323
|
-
if (
|
|
2324
|
-
|
|
2439
|
+
if (leftElemts.length > 0) {
|
|
2440
|
+
if (leftElemts.length > 1) {
|
|
2441
|
+
LOG$2.error(new DivaError('BoxPlannerError - only one OPTNACHBAR_LINKS allowed', {
|
|
2442
|
+
code: 'WC_0012'
|
|
2443
|
+
}));
|
|
2444
|
+
} else {
|
|
2445
|
+
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_LINKS', this.getOptionVal(leftElemts[0].ElementId, 'OPTELEMENT', optionHandler), optionHandler);
|
|
2446
|
+
}
|
|
2325
2447
|
} else {
|
|
2326
2448
|
this.setOptionDoHide(curElement.ElementId, 'OPTNACHBAR_LINKS', optionHandler);
|
|
2327
2449
|
}
|
|
2328
|
-
if (
|
|
2329
|
-
|
|
2450
|
+
if (topElemts.length > 0) {
|
|
2451
|
+
if (topElemts.length > 1) {
|
|
2452
|
+
LOG$2.error(new DivaError('BoxPlannerError - only one OPTNACHBAR_OBEN allowed', {
|
|
2453
|
+
code: 'WC_0012'
|
|
2454
|
+
}));
|
|
2455
|
+
} else {
|
|
2456
|
+
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_OBEN', this.getOptionVal(topElemts[0].ElementId, 'OPTELEMENT', optionHandler), optionHandler);
|
|
2457
|
+
}
|
|
2330
2458
|
} else {
|
|
2331
2459
|
this.setOptionDoHide(curElement.ElementId, 'OPTNACHBAR_OBEN', optionHandler);
|
|
2332
2460
|
}
|
|
2333
|
-
if (
|
|
2334
|
-
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_OBEN_RECHTS', this.getOptionVal(
|
|
2461
|
+
if (topRightElemt) {
|
|
2462
|
+
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_OBEN_RECHTS', this.getOptionVal(topRightElemt.ElementId, 'OPTELEMENT', optionHandler), optionHandler);
|
|
2335
2463
|
} else {
|
|
2336
2464
|
this.setOptionDoHide(curElement.ElementId, 'OPTNACHBAR_OBEN_RECHTS', optionHandler);
|
|
2337
2465
|
}
|
|
2338
2466
|
if (this.constructionRules.hasNeighbors && this.constructionRules.hasNeighbors.indexOf('OPTNACHBAR_UNTEN') >= 0) {
|
|
2339
|
-
if (
|
|
2340
|
-
|
|
2467
|
+
if (bottomElemts.length > 0) {
|
|
2468
|
+
if (bottomElemts.length > 1) {
|
|
2469
|
+
LOG$2.error(new DivaError('BoxPlannerError - only one OPTNACHBAR_UNTEN allowed', {
|
|
2470
|
+
code: 'WC_0012'
|
|
2471
|
+
}));
|
|
2472
|
+
} else {
|
|
2473
|
+
this.setOptionValue(curElement.ElementId, 'OPTNACHBAR_UNTEN', this.getOptionVal(bottomElemts[0].ElementId, 'OPTELEMENT', optionHandler), optionHandler);
|
|
2474
|
+
}
|
|
2341
2475
|
} else {
|
|
2342
2476
|
this.setOptionDoHide(curElement.ElementId, 'OPTNACHBAR_UNTEN', optionHandler);
|
|
2343
2477
|
}
|
|
@@ -2473,7 +2607,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2473
2607
|
//Zuerst korrigieren wir die unterste Reihe, indem wir die richtigen leitern setzen
|
|
2474
2608
|
var allBottomElements = boxPlannerGrid.getAllElementsInRow(this.constructionRules.correctLadder.rowIndex, false);
|
|
2475
2609
|
for (var i = 0; i < allBottomElements.length; i++) {
|
|
2476
|
-
var rowCount = boxPlannerGrid.getRowCount(i);
|
|
2610
|
+
var rowCount = boxPlannerGrid.getRowCount(i, false);
|
|
2477
2611
|
//If the count of elements in column is not valid for the height 18, then the height is corrected
|
|
2478
2612
|
if (this.constructionRules.correctLadder.onElementHighestRowCount) {
|
|
2479
2613
|
if (this.constructionRules.correctLadder.onElementHighestRowCount.indexOf(rowCount) == -1) {
|
|
@@ -2563,7 +2697,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2563
2697
|
|
|
2564
2698
|
var curColI = 0;
|
|
2565
2699
|
var elementsPerCol = boxPlannerGrid.getAllElementsInColumn(curColI, false);
|
|
2566
|
-
while (elementsPerCol
|
|
2700
|
+
while (elementsPerCol.length > 0) {
|
|
2567
2701
|
if (elementsPerCol.length == sizeOfHighesRow) {
|
|
2568
2702
|
var element = elementsPerCol[sizeOfHighesRow - 1];
|
|
2569
2703
|
curRow.push(element);
|
|
@@ -2603,12 +2737,12 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2603
2737
|
opvValue = 'OPVABDECKPLATTE_227';
|
|
2604
2738
|
}
|
|
2605
2739
|
if (opvValue != '' && !oneCornerColumn) {
|
|
2606
|
-
var _allElements = boxPlannerGrid.
|
|
2740
|
+
var _allElements = boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
2607
2741
|
for (var _i = 0; _i < _allElements.length; _i++) {
|
|
2608
2742
|
if (this.checkArticleHasOption(_allElements[_i].getElementId(), 'OPTABD_HIDE')) this.setOptionDoHide(_allElements[_i].getElementId(), 'OPTABD_HIDE', optionHandler);
|
|
2609
2743
|
}
|
|
2610
2744
|
} else {
|
|
2611
|
-
var _allElements2 = boxPlannerGrid.
|
|
2745
|
+
var _allElements2 = boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
2612
2746
|
for (var _i2 = 0; _i2 < _allElements2.length; _i2++) {
|
|
2613
2747
|
if (this.checkArticleHasOption(_allElements2[_i2].getElementId(), 'OPTABD_HIDE')) this.setOptionDoShow(_allElements2[_i2].getElementId(), 'OPTABD_HIDE', optionHandler);
|
|
2614
2748
|
}
|
|
@@ -2628,8 +2762,8 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2628
2762
|
}, {
|
|
2629
2763
|
key: "correctForceOptOfElement",
|
|
2630
2764
|
value: function correctForceOptOfElement(curElementId, boxPlannerGrid, optionHandler, fromBackside) {
|
|
2631
|
-
var
|
|
2632
|
-
if (
|
|
2765
|
+
var curCellPos = boxPlannerGrid.getCellsInGridByElementId(curElementId);
|
|
2766
|
+
if (curCellPos.cells.length == 0) return;
|
|
2633
2767
|
var rulesForCurArticle = this.getCurOptionBasedConstructionRules(curElementId, optionHandler);
|
|
2634
2768
|
for (var ruleNum = 0; ruleNum < rulesForCurArticle.length; ruleNum++) {
|
|
2635
2769
|
//Das muss angepasst werden die Option
|
|
@@ -2649,88 +2783,86 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2649
2783
|
if (fromBackside) {
|
|
2650
2784
|
if (tempComplementDir == 'LEFT') tempComplementDir = 'RIGHT';else if (tempComplementDir == 'RIGHT') tempComplementDir = 'LEFT';
|
|
2651
2785
|
}
|
|
2652
|
-
var
|
|
2653
|
-
if (
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
var forceOption2 = rulesForNeighborArticle[ruleNum2].forceOptions[forceOptNum2];
|
|
2667
|
-
if (forceOption2.rule && forceOption2.rule != '') {
|
|
2668
|
-
if (!this.evalRule(neighbourElement.ElementId, forceOption2.rule, optionHandler)) continue;
|
|
2669
|
-
}
|
|
2670
|
-
if (this.arrayContainsValue(forceOption2.options, complementOptName)) {
|
|
2671
|
-
//Es wurde gefunden als FORCE. jetzt müssen beide angepasst werden.
|
|
2672
|
-
complementOptNameIsForce = true;
|
|
2673
|
-
//case 2 curOption is force und complementOPT is force
|
|
2674
|
-
// - Beide to show: Show opt von actConfig, hide complementOPT
|
|
2675
|
-
// - Beide to hide: Hide both options
|
|
2676
|
-
if (forceOptValue == 'doShow' && forceOption2.value == 'doShow') {
|
|
2677
|
-
//Zeige option von aktuellem an und hide andere
|
|
2678
|
-
//setOptionDoShow(curArticle, optName);
|
|
2679
|
-
//Außnahme wenn Beide Element mit FUELLUNG sind - da darf jetzt keine Füllung dazwischen sein.
|
|
2680
|
-
if (this.getOptionVal(curElementId, 'OPTELEMENT', optionHandler) == 'OPVFUELLUNG' && this.getOptionVal(neighbourElement.ElementId, 'OPTELEMENT', optionHandler) == 'OPVFUELLUNG') {
|
|
2681
|
-
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2682
|
-
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2683
|
-
} else {
|
|
2684
|
-
this.setOptionDoShow(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2685
|
-
}
|
|
2786
|
+
var neighbourElements = boxPlannerGrid.getNeighborElements(curElementId, tempComplementDir);
|
|
2787
|
+
if (neighbourElements.length > 0) {
|
|
2788
|
+
for (var i = 0; i < neighbourElements.length; i++) {
|
|
2789
|
+
//Check complementary option
|
|
2790
|
+
var neighbourElement = neighbourElements[i];
|
|
2791
|
+
var rulesForNeighborArticle = this.getCurOptionBasedConstructionRules(neighbourElement.ElementId, optionHandler);
|
|
2792
|
+
var complementOptName = optInfo.complementOPT;
|
|
2793
|
+
var complementOptNameIsForce = false;
|
|
2794
|
+
for (var ruleNum2 = 0; ruleNum2 < rulesForNeighborArticle.length; ruleNum2++) {
|
|
2795
|
+
if (!rulesForNeighborArticle[ruleNum2].forceOptions) continue;
|
|
2796
|
+
for (var forceOptNum2 = 0; forceOptNum2 < rulesForNeighborArticle[ruleNum2].forceOptions.length; forceOptNum2++) {
|
|
2797
|
+
var forceOption2 = rulesForNeighborArticle[ruleNum2].forceOptions[forceOptNum2];
|
|
2798
|
+
if (forceOption2.rule && forceOption2.rule != '') {
|
|
2799
|
+
if (!this.evalRule(neighbourElement.ElementId, forceOption2.rule, optionHandler)) continue;
|
|
2686
2800
|
}
|
|
2687
|
-
if (
|
|
2688
|
-
//
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
} else if (forceOption.prio) {
|
|
2699
|
-
doPrioCurArt = true;
|
|
2700
|
-
} else if (forceOption2.prio) {
|
|
2701
|
-
doPrioCurArt = false;
|
|
2702
|
-
}
|
|
2703
|
-
if (doPrioCurArt) {
|
|
2704
|
-
if (forceOptValue == 'doHide') {
|
|
2705
|
-
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2706
|
-
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler);
|
|
2707
|
-
} else if (forceOptValue == 'doShow') {
|
|
2708
|
-
this.setOptionDoShow(curElementId, optName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2801
|
+
if (this.arrayContainsValue(forceOption2.options, complementOptName)) {
|
|
2802
|
+
//Es wurde gefunden als FORCE. jetzt müssen beide angepasst werden.
|
|
2803
|
+
complementOptNameIsForce = true;
|
|
2804
|
+
//case 2 curOption is force und complementOPT is force
|
|
2805
|
+
// - Beide to show: Show opt von actConfig, hide complementOPT
|
|
2806
|
+
// - Beide to hide: Hide both options
|
|
2807
|
+
if (forceOptValue == 'doShow' && forceOption2.value == 'doShow') {
|
|
2808
|
+
//Zeige option von aktuellem an und hide andere
|
|
2809
|
+
//setOptionDoShow(curArticle, optName);
|
|
2810
|
+
//Außnahme wenn Beide Element mit FUELLUNG sind - da darf jetzt keine Füllung dazwischen sein.
|
|
2811
|
+
if (this.getOptionVal(curElementId, 'OPTELEMENT', optionHandler) == 'OPVFUELLUNG' && this.getOptionVal(neighbourElement.ElementId, 'OPTELEMENT', optionHandler) == 'OPVFUELLUNG') {
|
|
2709
2812
|
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2710
|
-
}
|
|
2711
|
-
} else {
|
|
2712
|
-
if (forceOption2.value == 'doHide') {
|
|
2713
|
-
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2714
2813
|
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2715
|
-
} else
|
|
2716
|
-
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2814
|
+
} else {
|
|
2717
2815
|
this.setOptionDoShow(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2718
2816
|
}
|
|
2719
2817
|
}
|
|
2818
|
+
if (forceOptValue == 'doHide' && forceOption2.value == 'doHide') {
|
|
2819
|
+
//Hide beide
|
|
2820
|
+
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2821
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler);
|
|
2822
|
+
}
|
|
2823
|
+
if (forceOptValue == 'doShow' && forceOption2.value == 'doHide' || forceOptValue == 'doHide' && forceOption2.value == 'doShow') {
|
|
2824
|
+
//Tausche die Option Element vom anderen!
|
|
2825
|
+
//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!
|
|
2826
|
+
var doPrioCurArt = true;
|
|
2827
|
+
if (forceOption.prio && forceOption2.prio) {
|
|
2828
|
+
doPrioCurArt = forceOption.prio <= forceOption2.prio;
|
|
2829
|
+
} else if (forceOption.prio) {
|
|
2830
|
+
doPrioCurArt = true;
|
|
2831
|
+
} else if (forceOption2.prio) {
|
|
2832
|
+
doPrioCurArt = false;
|
|
2833
|
+
}
|
|
2834
|
+
if (doPrioCurArt) {
|
|
2835
|
+
if (forceOptValue == 'doHide') {
|
|
2836
|
+
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2837
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler);
|
|
2838
|
+
} else if (forceOptValue == 'doShow') {
|
|
2839
|
+
this.setOptionDoShow(curElementId, optName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2840
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2841
|
+
}
|
|
2842
|
+
} else {
|
|
2843
|
+
if (forceOption2.value == 'doHide') {
|
|
2844
|
+
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2845
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2846
|
+
} else if (forceOption2.value == 'doShow') {
|
|
2847
|
+
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2848
|
+
this.setOptionDoShow(neighbourElement.ElementId, complementOptName, optionHandler); //In diesem Fall müssen beide gesetzt werden
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2720
2852
|
}
|
|
2721
2853
|
}
|
|
2722
2854
|
}
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2855
|
+
if (!complementOptNameIsForce) {
|
|
2856
|
+
//Case 1 curOption is force and complementOPT is obligatory
|
|
2857
|
+
// Zeige curOption an oder nicht an - complementOPT wird NICHT angezeigt
|
|
2858
|
+
if (forceOptValue == 'doShow') {
|
|
2859
|
+
this.setOptionDoShow(curElementId, optName, optionHandler);
|
|
2860
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler);
|
|
2861
|
+
}
|
|
2862
|
+
if (forceOptValue == 'doHide') {
|
|
2863
|
+
this.setOptionDoHide(curElementId, optName, optionHandler);
|
|
2864
|
+
this.setOptionDoHide(neighbourElement.ElementId, complementOptName, optionHandler);
|
|
2865
|
+
}
|
|
2734
2866
|
}
|
|
2735
2867
|
}
|
|
2736
2868
|
} else {
|
|
@@ -2769,30 +2901,17 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2769
2901
|
}
|
|
2770
2902
|
}
|
|
2771
2903
|
}
|
|
2772
|
-
|
|
2773
|
-
/*
|
|
2774
|
-
"_comment_correctRetailArticleNumberByRule": "Specifies that SAP numbers have to be switched when all Elements (range=global) satisfy the rule",
|
|
2775
|
-
"range": "global",
|
|
2776
|
-
"rule": "OPTFARBE_RAHMEN=OPVCHROM&OPTFARBE=OPVWEISS",
|
|
2777
|
-
"retailArticleRules": [
|
|
2778
|
-
{
|
|
2779
|
-
"origRetailArticleNr": 91194,
|
|
2780
|
-
"origPrefix": "SAP",
|
|
2781
|
-
"newRetailArticleNr": 90771,
|
|
2782
|
-
"newPrefix": "SAP"
|
|
2783
|
-
},
|
|
2784
|
-
*/
|
|
2785
2904
|
}, {
|
|
2786
2905
|
key: "correctNeighborCustomOLTs",
|
|
2787
2906
|
value: function correctNeighborCustomOLTs(curElementId, boxPlannerGrid, optionHandler) {
|
|
2788
2907
|
if (!this.constructionRules.correctNeighborOPT || this.constructionRules.correctNeighborOPT.length == 0) return;
|
|
2789
2908
|
for (var i = 0; i < this.constructionRules.correctNeighborOPT.length; i++) {
|
|
2790
|
-
var
|
|
2909
|
+
var curCellPos = boxPlannerGrid.getCellsInGridByElementId(curElementId);
|
|
2791
2910
|
this.setOptionValue(curElementId, this.constructionRules.correctNeighborOPT[i].opt, 'OPVOHNE', optionHandler);
|
|
2792
|
-
if (
|
|
2793
|
-
var
|
|
2794
|
-
if (
|
|
2795
|
-
var optionNeighborVal = this.getOptionVal(
|
|
2911
|
+
if (curCellPos.cells.length == 0) return;
|
|
2912
|
+
var neighbourElements = boxPlannerGrid.getNeighborElements(curElementId, this.constructionRules.correctNeighborOPT[i].dir);
|
|
2913
|
+
if (neighbourElements.length > 0) {
|
|
2914
|
+
var optionNeighborVal = this.getOptionVal(neighbourElements[0].ElementId, this.constructionRules.correctNeighborOPT[i].neighborOPT, optionHandler);
|
|
2796
2915
|
if (optionNeighborVal != '') this.setOptionValue(curElementId, this.constructionRules.correctNeighborOPT[i].opt, optionNeighborVal, optionHandler);
|
|
2797
2916
|
}
|
|
2798
2917
|
}
|
|
@@ -2800,7 +2919,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2800
2919
|
}, {
|
|
2801
2920
|
key: "doChangeRetailArticleNumbers",
|
|
2802
2921
|
value: function doChangeRetailArticleNumbers(boxPlannerGrid, optionHandler) {
|
|
2803
|
-
var allElements = boxPlannerGrid.
|
|
2922
|
+
var allElements = boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
2804
2923
|
if (this.constructionRules.correctRetailArticleNumberByRule && this.constructionRules.correctRetailArticleNumberByRule.length > 0) {
|
|
2805
2924
|
var allValid = true;
|
|
2806
2925
|
for (var i = 0; i < this.constructionRules.correctRetailArticleNumberByRule.length; i++) {
|
|
@@ -2892,26 +3011,26 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2892
3011
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) this.correctBottom(boxPlannerGrid, optionHandler, true);
|
|
2893
3012
|
this.correctSeries(boxPlannerGrid, optionHandler);
|
|
2894
3013
|
for (i = 0; i < boxPlannerGrid.getColumnCount(); i++) {
|
|
2895
|
-
for (j = 0; j < boxPlannerGrid.getRowCount(i); j++) {
|
|
3014
|
+
for (j = 0; j < boxPlannerGrid.getRowCount(i, false); j++) {
|
|
2896
3015
|
this.correctSimpleOpt(i, j, boxPlannerGrid, optionHandler, false);
|
|
2897
3016
|
}
|
|
2898
3017
|
}
|
|
2899
3018
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
2900
3019
|
for (i = boxPlannerGrid.getColumnCount() - 1; i >= 0; i--) {
|
|
2901
|
-
for (j = 0; j < boxPlannerGrid.getRowCount(i); j++) {
|
|
3020
|
+
for (j = 0; j < boxPlannerGrid.getRowCount(i, false); j++) {
|
|
2902
3021
|
this.correctSimpleOpt(i, j, boxPlannerGrid, optionHandler, true);
|
|
2903
3022
|
}
|
|
2904
3023
|
}
|
|
2905
3024
|
}
|
|
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.correctForceOptOfElement(boxPlannerGrid.getPlannerElementAtGridPos(i, j, false).ElementId, boxPlannerGrid, optionHandler, false);
|
|
2909
3028
|
this.correctNeighborCustomOLTs(boxPlannerGrid.getPlannerElementAtGridPos(i, j, false).ElementId, boxPlannerGrid, optionHandler);
|
|
2910
3029
|
}
|
|
2911
3030
|
}
|
|
2912
3031
|
if (boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
2913
3032
|
for (i = boxPlannerGrid.getColumnCount() - 1; i >= 0; i--) {
|
|
2914
|
-
for (j = 0; j < boxPlannerGrid.getRowCount(i); j++) {
|
|
3033
|
+
for (j = 0; j < boxPlannerGrid.getRowCount(i, false); j++) {
|
|
2915
3034
|
this.correctForceOptOfElement(boxPlannerGrid.getPlannerElementAtGridPos(i, j, true).ElementId, boxPlannerGrid, optionHandler, true);
|
|
2916
3035
|
this.correctNeighborCustomOLTs(boxPlannerGrid.getPlannerElementAtGridPos(i, j, true).ElementId, boxPlannerGrid, optionHandler);
|
|
2917
3036
|
}
|
|
@@ -2921,7 +3040,7 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2921
3040
|
this.partlistHelper.calculateKnots(boxPlannerGrid, optionHandler);
|
|
2922
3041
|
this.partlistHelper.calculateRahmen(boxPlannerGrid, optionHandler);
|
|
2923
3042
|
for (i = 0; i < boxPlannerGrid.getColumnCount(); i++) {
|
|
2924
|
-
for (j = 0; j < boxPlannerGrid.getRowCount(i); j++) {
|
|
3043
|
+
for (j = 0; j < boxPlannerGrid.getRowCount(i, false); j++) {
|
|
2925
3044
|
this.correctBack(boxPlannerGrid, optionHandler, boxPlannerGrid.getPlannerElementAtGridPos(i, j, false).getElementId());
|
|
2926
3045
|
}
|
|
2927
3046
|
}
|
|
@@ -2991,99 +3110,208 @@ var ConstructionRulesHandler = /*#__PURE__*/function () {
|
|
|
2991
3110
|
}]);
|
|
2992
3111
|
}();
|
|
2993
3112
|
|
|
2994
|
-
var
|
|
3113
|
+
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; } } }; }
|
|
3114
|
+
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; } }
|
|
3115
|
+
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; }
|
|
3116
|
+
var LOG$1 = DivaUtils.initLog('Planner', 'BOX-PLANNER_GRID');
|
|
2995
3117
|
var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
2996
|
-
function BoxPlannerGrid(getValueOfOptionOfArticle) {
|
|
3118
|
+
function BoxPlannerGrid(gridSetupParams, getValueOfOptionOfArticle) {
|
|
2997
3119
|
_classCallCheck(this, BoxPlannerGrid);
|
|
2998
|
-
_defineProperty(this, "
|
|
2999
|
-
_defineProperty(this, "
|
|
3000
|
-
//
|
|
3120
|
+
_defineProperty(this, "plannerElements", void 0);
|
|
3121
|
+
_defineProperty(this, "frontGrid", void 0);
|
|
3122
|
+
//first entry is width, second height
|
|
3123
|
+
_defineProperty(this, "backGrid", void 0);
|
|
3124
|
+
//if cell is empty it is undefined
|
|
3001
3125
|
_defineProperty(this, "hasActiveBackside", void 0);
|
|
3002
3126
|
_defineProperty(this, "getValueOfOptionOfArticle", void 0);
|
|
3003
|
-
this
|
|
3004
|
-
this.
|
|
3005
|
-
this.
|
|
3127
|
+
_defineProperty(this, "gridSetupParams", void 0);
|
|
3128
|
+
this.plannerElements = new Map();
|
|
3129
|
+
this.frontGrid = new Array();
|
|
3130
|
+
this.backGrid = new Array();
|
|
3131
|
+
this.gridSetupParams = gridSetupParams;
|
|
3006
3132
|
this.getValueOfOptionOfArticle = getValueOfOptionOfArticle;
|
|
3133
|
+
this.hasActiveBackside = false;
|
|
3007
3134
|
}
|
|
3008
3135
|
|
|
3009
|
-
|
|
3010
|
-
*
|
|
3136
|
+
/**
|
|
3137
|
+
* This function creates the new cells that are needed when copying an element
|
|
3138
|
+
* @param newElement
|
|
3139
|
+
* @param startColIndex
|
|
3140
|
+
* @param startRowIndex
|
|
3141
|
+
* @returns
|
|
3011
3142
|
*/
|
|
3012
3143
|
return _createClass(BoxPlannerGrid, [{
|
|
3144
|
+
key: "createNewCells",
|
|
3145
|
+
value: function createNewCells(newElement, startColIndex, startRowIndex, backside) {
|
|
3146
|
+
if (this.gridSetupParams.forceSingleCellPerElement) {
|
|
3147
|
+
var cell = {
|
|
3148
|
+
//isEmpty: false,
|
|
3149
|
+
plannerElementId: newElement.ElementId,
|
|
3150
|
+
width: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterWidth : newElement.getWidth(),
|
|
3151
|
+
height: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterHeight : newElement.getHeight(),
|
|
3152
|
+
index: new Vector2(startColIndex, startRowIndex)
|
|
3153
|
+
};
|
|
3154
|
+
return {
|
|
3155
|
+
cells: [cell],
|
|
3156
|
+
startColIndex: startColIndex,
|
|
3157
|
+
endColIndex: startColIndex,
|
|
3158
|
+
startRowIndex: startRowIndex,
|
|
3159
|
+
endRowIndex: startRowIndex,
|
|
3160
|
+
backside: backside,
|
|
3161
|
+
colCount: 1,
|
|
3162
|
+
rowCount: 1
|
|
3163
|
+
};
|
|
3164
|
+
}
|
|
3165
|
+
if (!this.gridSetupParams.forceFixCellRasterSize) {
|
|
3166
|
+
LOG$1.error(new DivaError('Box planner with params forceSingleCellPerElement is false and forceFixCellRasterSize is false are not allowed'));
|
|
3167
|
+
}
|
|
3168
|
+
var colCount = Math.round(newElement.getWidth() / this.gridSetupParams.fixCellRasterWidth);
|
|
3169
|
+
var rowCount = Math.round(newElement.getHeight() / this.gridSetupParams.fixCellRasterWidth);
|
|
3170
|
+
var cells = [];
|
|
3171
|
+
for (var i = 0; i < colCount; i++) {
|
|
3172
|
+
for (var j = 0; j < rowCount; j++) {
|
|
3173
|
+
var _cell = {
|
|
3174
|
+
// isEmpty: false,
|
|
3175
|
+
plannerElementId: newElement.ElementId,
|
|
3176
|
+
width: this.gridSetupParams.fixCellRasterWidth,
|
|
3177
|
+
height: this.gridSetupParams.fixCellRasterHeight,
|
|
3178
|
+
index: new Vector2(startColIndex + i, startRowIndex + j)
|
|
3179
|
+
};
|
|
3180
|
+
cells.push(_cell);
|
|
3181
|
+
}
|
|
3182
|
+
}
|
|
3183
|
+
return {
|
|
3184
|
+
cells: cells,
|
|
3185
|
+
startColIndex: startColIndex,
|
|
3186
|
+
endColIndex: startColIndex + colCount - 1,
|
|
3187
|
+
startRowIndex: startRowIndex,
|
|
3188
|
+
endRowIndex: startRowIndex + rowCount - 1,
|
|
3189
|
+
backside: backside,
|
|
3190
|
+
colCount: colCount,
|
|
3191
|
+
rowCount: rowCount
|
|
3192
|
+
};
|
|
3193
|
+
}
|
|
3194
|
+
}, {
|
|
3195
|
+
key: "createEmptyCells",
|
|
3196
|
+
value: function createEmptyCells(colStartIndex, rowStartIndex, colEndIndex, rowEndIndex, refElementWidth, refElementHeight) {
|
|
3197
|
+
var cells = [];
|
|
3198
|
+
for (var i = colStartIndex; i <= colEndIndex; i++) {
|
|
3199
|
+
for (var j = rowStartIndex; j <= rowEndIndex; j++) {
|
|
3200
|
+
var cell = {
|
|
3201
|
+
plannerElementId: -1,
|
|
3202
|
+
width: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterWidth : refElementWidth,
|
|
3203
|
+
height: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterHeight : refElementHeight,
|
|
3204
|
+
index: new Vector2(i, j)
|
|
3205
|
+
};
|
|
3206
|
+
cells.push(cell);
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3209
|
+
return cells;
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
/**
|
|
3213
|
+
* This function returns the amount of cols and rows an element occupies inside the grid
|
|
3214
|
+
* @param element
|
|
3215
|
+
* @returns
|
|
3216
|
+
*/
|
|
3217
|
+
}, {
|
|
3218
|
+
key: "getCellCount",
|
|
3219
|
+
value: function getCellCount(element) {
|
|
3220
|
+
if (this.gridSetupParams.forceSingleCellPerElement) {
|
|
3221
|
+
return {
|
|
3222
|
+
colCount: 1,
|
|
3223
|
+
rowCount: 1
|
|
3224
|
+
};
|
|
3225
|
+
}
|
|
3226
|
+
var colCount = Math.round(element.getWidth() / this.gridSetupParams.fixCellRasterWidth);
|
|
3227
|
+
var rowCount = Math.round(element.getHeight() / this.gridSetupParams.fixCellRasterWidth);
|
|
3228
|
+
return {
|
|
3229
|
+
colCount: colCount,
|
|
3230
|
+
rowCount: rowCount
|
|
3231
|
+
};
|
|
3232
|
+
}
|
|
3233
|
+
/** this function returns all not Empty cells in the grid */
|
|
3234
|
+
}, {
|
|
3235
|
+
key: "getAllUsedCellsInGrid",
|
|
3236
|
+
value: function getAllUsedCellsInGrid(backside) {
|
|
3237
|
+
var allCellsInGrid = new Array();
|
|
3238
|
+
var curGrid = backside ? this.backGrid : this.frontGrid;
|
|
3239
|
+
for (var i = 0; i < curGrid.length; i++) {
|
|
3240
|
+
for (var j = 0; j < curGrid[i].length; j++) {
|
|
3241
|
+
if (curGrid[i][j] != undefined) allCellsInGrid.push(curGrid[i][j]);
|
|
3242
|
+
}
|
|
3243
|
+
}
|
|
3244
|
+
return allCellsInGrid;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
/*
|
|
3248
|
+
* Gibt die Breite einer Spalte im Grid zurück. Die Spalten sind immer gleich breit
|
|
3249
|
+
*/
|
|
3250
|
+
}, {
|
|
3013
3251
|
key: "getGridColumnWidth",
|
|
3014
|
-
value: function getGridColumnWidth(columnIndex
|
|
3015
|
-
var
|
|
3016
|
-
|
|
3017
|
-
for (var j = 0; j < curElementGrid[columnIndex].length; j++) {
|
|
3018
|
-
var width = curElementGrid[columnIndex][j] ? curElementGrid[columnIndex][j].Width == undefined ? 0 : curElementGrid[columnIndex][j].Width : 0;
|
|
3019
|
-
if (width > biggestWidth) biggestWidth = width;
|
|
3252
|
+
value: function getGridColumnWidth(columnIndex) {
|
|
3253
|
+
for (var i = 0; i < this.frontGrid[columnIndex].length; i++) {
|
|
3254
|
+
if (this.frontGrid[columnIndex][i]) return this.frontGrid[columnIndex][i].width;
|
|
3020
3255
|
}
|
|
3021
|
-
return
|
|
3256
|
+
return 0;
|
|
3022
3257
|
}
|
|
3258
|
+
|
|
3259
|
+
/**
|
|
3260
|
+
* Gibt die Höhe einer Spalte zurück
|
|
3261
|
+
* @param columnIdex
|
|
3262
|
+
* @returns
|
|
3263
|
+
*/
|
|
3023
3264
|
}, {
|
|
3024
3265
|
key: "getGridColumnHeight",
|
|
3025
3266
|
value: function getGridColumnHeight(columnIdex) {
|
|
3026
3267
|
var height = 0;
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3268
|
+
var firstElementFound = false;
|
|
3269
|
+
if (this.frontGrid.length > columnIdex) {
|
|
3270
|
+
var allCellsInCol = this.frontGrid[columnIdex];
|
|
3271
|
+
for (var i = allCellsInCol.length; i >= 0; i--) {
|
|
3272
|
+
if (!firstElementFound && allCellsInCol[i]) firstElementFound = true;
|
|
3273
|
+
if (firstElementFound) height += allCellsInCol[i] == undefined ? 0 : allCellsInCol[i].height;
|
|
3032
3274
|
}
|
|
3033
3275
|
}
|
|
3034
3276
|
return height;
|
|
3035
3277
|
}
|
|
3278
|
+
|
|
3036
3279
|
/*
|
|
3037
3280
|
Deletes the Element on the specified grid Position. If there is no other element in the column, the whole column is deleted.
|
|
3038
3281
|
*/
|
|
3039
3282
|
}, {
|
|
3040
|
-
key: "
|
|
3041
|
-
value: function
|
|
3042
|
-
var
|
|
3043
|
-
var
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3283
|
+
key: "deleteElementByIdFromGrid",
|
|
3284
|
+
value: function deleteElementByIdFromGrid(elementIdTodelete) {
|
|
3285
|
+
var gridCellsToDelete = this.getCellsInGridByElementId(elementIdTodelete);
|
|
3286
|
+
var curGrid = gridCellsToDelete.backside ? this.backGrid : this.frontGrid;
|
|
3287
|
+
var rowCountToDelete = 1 + (gridCellsToDelete.endRowIndex - gridCellsToDelete.startRowIndex);
|
|
3288
|
+
var doDeleteCol = false;
|
|
3289
|
+
var startColToDelete = gridCellsToDelete.startColIndex;
|
|
3290
|
+
var colCountToDelete = 1 + (gridCellsToDelete.startColIndex - gridCellsToDelete.endColIndex);
|
|
3291
|
+
|
|
3292
|
+
//check if we need to delete all cols
|
|
3293
|
+
if (this.getRowCount(gridCellsToDelete.startColIndex, gridCellsToDelete.backside) == rowCountToDelete) {
|
|
3294
|
+
doDeleteCol = true;
|
|
3295
|
+
}
|
|
3296
|
+
var allUsedCellCurGrid = this.getAllUsedCellsInGrid(gridCellsToDelete.backside);
|
|
3297
|
+
curGrid = new Array();
|
|
3298
|
+
for (var i = 0; i < allUsedCellCurGrid.length; i++) {
|
|
3299
|
+
var curCellFrontGrid = allUsedCellCurGrid[i];
|
|
3300
|
+
if (curCellFrontGrid.plannerElementId != elementIdTodelete) {
|
|
3301
|
+
if (doDeleteCol && curCellFrontGrid.index.x > startColToDelete) {
|
|
3302
|
+
curCellFrontGrid.index.x -= colCountToDelete;
|
|
3055
3303
|
}
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
//Lösche nur Element
|
|
3059
|
-
for (var i = 0; i < curElementGrid.length; i++) {
|
|
3060
|
-
if (i != gridPos.col) {
|
|
3061
|
-
//Diese Spalte kann gelöscht werden, also nicht mitnehmen
|
|
3062
|
-
helperGrid[i] = curElementGrid[i];
|
|
3063
|
-
} else {
|
|
3064
|
-
helperGrid[i] = new Array();
|
|
3065
|
-
for (var j = 0; j < curElementGrid[i].length; j++) {
|
|
3066
|
-
if (j != gridPos.row) {
|
|
3067
|
-
helperGrid[i][j] = curElementGrid[i][j];
|
|
3068
|
-
}
|
|
3069
|
-
}
|
|
3304
|
+
if (!curGrid[curCellFrontGrid.index.x]) {
|
|
3305
|
+
curGrid[curCellFrontGrid.index.x] = [];
|
|
3070
3306
|
}
|
|
3307
|
+
curGrid[curCellFrontGrid.index.x][curCellFrontGrid.index.y] = curCellFrontGrid;
|
|
3071
3308
|
}
|
|
3072
3309
|
}
|
|
3073
|
-
if (
|
|
3074
|
-
this.backModulPlannedElementGrid = helperGrid;
|
|
3075
|
-
} else {
|
|
3076
|
-
this.plannedElementGrid = helperGrid;
|
|
3077
|
-
}
|
|
3310
|
+
if (gridCellsToDelete.backside) this.backGrid = curGrid;else this.frontGrid = curGrid;
|
|
3078
3311
|
}
|
|
3079
3312
|
|
|
3080
|
-
/*
|
|
3081
|
-
private correctWorldPosInGrid(plannerElement: PlannerElementData) {
|
|
3082
|
-
//Braucht es das überhaupt?
|
|
3083
|
-
}
|
|
3084
|
-
*/
|
|
3085
|
-
|
|
3086
3313
|
/**
|
|
3314
|
+
* CHECK OK
|
|
3087
3315
|
* This function returns the ElementID of the element at a specific GridPosition.
|
|
3088
3316
|
* If there is no element at this position, the function returns undefined
|
|
3089
3317
|
* @param curXPos
|
|
@@ -3092,111 +3320,182 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3092
3320
|
}, {
|
|
3093
3321
|
key: "getPlannerElementAtGridPos",
|
|
3094
3322
|
value: function getPlannerElementAtGridPos(curXPos, curYPos, fromBackmodul) {
|
|
3095
|
-
var curElementGrid = fromBackmodul ? this.
|
|
3323
|
+
var curElementGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
3096
3324
|
if (curElementGrid[curXPos] && curElementGrid[curXPos][curYPos]) {
|
|
3097
|
-
|
|
3325
|
+
var cell = curElementGrid[curXPos][curYPos];
|
|
3326
|
+
if (cell == undefined) return undefined;
|
|
3327
|
+
return this.plannerElements.get(cell.plannerElementId);
|
|
3098
3328
|
}
|
|
3099
3329
|
return undefined;
|
|
3100
3330
|
}
|
|
3101
|
-
|
|
3102
3331
|
/**
|
|
3332
|
+
*
|
|
3103
3333
|
* This function returns the index of an element by elementId in the grid.
|
|
3104
3334
|
* It returns the column and row position in the grid and if it is in the front or backgrid
|
|
3335
|
+
* With onlin it is possible, that one element occupies more than one grid cell. All occupied grid cells are returned in an array
|
|
3105
3336
|
* @param elementId
|
|
3106
3337
|
*/
|
|
3107
3338
|
}, {
|
|
3108
|
-
key: "
|
|
3109
|
-
value: function
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3339
|
+
key: "getCellsInGridByElementId",
|
|
3340
|
+
value: function getCellsInGridByElementId(elementId) {
|
|
3341
|
+
var firstCell = undefined;
|
|
3342
|
+
var onBacksideFound = false;
|
|
3343
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
3344
|
+
for (var j = 0; j < this.frontGrid[i].length; j++) {
|
|
3345
|
+
var cell = this.frontGrid[i][j];
|
|
3346
|
+
if (cell && cell.plannerElementId == elementId) {
|
|
3347
|
+
firstCell = cell;
|
|
3348
|
+
onBacksideFound = false;
|
|
3349
|
+
}
|
|
3117
3350
|
}
|
|
3118
3351
|
}
|
|
3119
|
-
|
|
3120
|
-
for (var
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3352
|
+
if (firstCell == undefined) {
|
|
3353
|
+
for (var i = 0; i < this.backGrid.length; i++) {
|
|
3354
|
+
for (var j = 0; j < this.backGrid[i].length; j++) {
|
|
3355
|
+
var _cell2 = this.backGrid[i][j];
|
|
3356
|
+
if (_cell2 && _cell2.plannerElementId == elementId) {
|
|
3357
|
+
firstCell = _cell2;
|
|
3358
|
+
onBacksideFound = true;
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
}
|
|
3362
|
+
}
|
|
3363
|
+
if (firstCell == undefined) return {
|
|
3364
|
+
cells: [],
|
|
3365
|
+
backside: false,
|
|
3366
|
+
startColIndex: -1,
|
|
3367
|
+
endColIndex: -1,
|
|
3368
|
+
startRowIndex: -1,
|
|
3369
|
+
endRowIndex: -1,
|
|
3370
|
+
colCount: 0,
|
|
3371
|
+
rowCount: 0
|
|
3372
|
+
};
|
|
3373
|
+
if (this.gridSetupParams.forceSingleCellPerElement) return {
|
|
3374
|
+
cells: [firstCell],
|
|
3375
|
+
backside: onBacksideFound,
|
|
3376
|
+
startColIndex: firstCell.index.x,
|
|
3377
|
+
endColIndex: firstCell.index.x,
|
|
3378
|
+
startRowIndex: firstCell.index.y,
|
|
3379
|
+
endRowIndex: firstCell.index.y,
|
|
3380
|
+
colCount: 1,
|
|
3381
|
+
rowCount: 1
|
|
3382
|
+
};
|
|
3383
|
+
//Now find the other cells that have the same element
|
|
3384
|
+
|
|
3385
|
+
var curGrid = onBacksideFound ? this.backGrid : this.frontGrid;
|
|
3386
|
+
var cells = [firstCell];
|
|
3387
|
+
var startColIndex = Infinity;
|
|
3388
|
+
var endColIndex = -Infinity;
|
|
3389
|
+
var startRowIndex = Infinity;
|
|
3390
|
+
var endRowIndex = -Infinity;
|
|
3391
|
+
for (var i = firstCell.index.x; i < curGrid.length; i++) {
|
|
3392
|
+
for (var j = firstCell.index.y + 1; j < curGrid.length; j++) {
|
|
3393
|
+
var nextCell = curGrid[i][j];
|
|
3394
|
+
if (nextCell && nextCell.plannerElementId == elementId) {
|
|
3395
|
+
if (i < startColIndex) startColIndex = i;
|
|
3396
|
+
if (i > endColIndex) endColIndex = i;
|
|
3397
|
+
if (j < startRowIndex) startRowIndex = j;
|
|
3398
|
+
if (j > endColIndex) endRowIndex = j;
|
|
3399
|
+
cells.push(nextCell); //also this cell has the same element
|
|
3400
|
+
//TODO
|
|
3401
|
+
} else {
|
|
3402
|
+
break;
|
|
3403
|
+
}
|
|
3126
3404
|
}
|
|
3127
3405
|
}
|
|
3128
3406
|
return {
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3407
|
+
cells: cells,
|
|
3408
|
+
backside: onBacksideFound,
|
|
3409
|
+
startColIndex: startColIndex,
|
|
3410
|
+
endColIndex: endColIndex,
|
|
3411
|
+
startRowIndex: startRowIndex,
|
|
3412
|
+
endRowIndex: endRowIndex,
|
|
3413
|
+
colCount: endColIndex - startColIndex + 1,
|
|
3414
|
+
rowCount: endRowIndex - startRowIndex + 1
|
|
3132
3415
|
};
|
|
3133
3416
|
}
|
|
3417
|
+
|
|
3134
3418
|
/**
|
|
3135
3419
|
* This function returns all elementIds that are inside the grid
|
|
3136
3420
|
*/
|
|
3137
3421
|
}, {
|
|
3138
3422
|
key: "getAllElementIdsInGrid",
|
|
3139
3423
|
value: function getAllElementIdsInGrid() {
|
|
3424
|
+
return Array.from(this.plannerElements.keys());
|
|
3425
|
+
}
|
|
3426
|
+
}, {
|
|
3427
|
+
key: "_getAllElementsInGrid",
|
|
3428
|
+
value: function _getAllElementsInGrid(grid) {
|
|
3140
3429
|
var allElementIds = [];
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3430
|
+
var allElements = [];
|
|
3431
|
+
for (var i = 0; i < grid.length; i++) {
|
|
3432
|
+
for (var j = 0; j < grid[i].length; j++) {
|
|
3433
|
+
var cell = grid[i][j];
|
|
3434
|
+
if (cell == undefined) continue;
|
|
3435
|
+
if (allElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3436
|
+
allElementIds.push(cell.plannerElementId);
|
|
3437
|
+
allElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3438
|
+
}
|
|
3149
3439
|
}
|
|
3150
3440
|
}
|
|
3151
|
-
return
|
|
3441
|
+
return allElements;
|
|
3152
3442
|
}
|
|
3153
3443
|
}, {
|
|
3154
3444
|
key: "getAllElementsInFrontGrid",
|
|
3155
3445
|
value: function getAllElementsInFrontGrid() {
|
|
3156
|
-
|
|
3157
|
-
for (var i = 0; i < this.plannedElementGrid.length; i++) {
|
|
3158
|
-
for (var j = 0; j < this.plannedElementGrid[i].length; j++) {
|
|
3159
|
-
allElements.push(this.plannedElementGrid[i][j]);
|
|
3160
|
-
}
|
|
3161
|
-
}
|
|
3162
|
-
return allElements;
|
|
3446
|
+
return this._getAllElementsInGrid(this.frontGrid);
|
|
3163
3447
|
}
|
|
3164
3448
|
}, {
|
|
3165
3449
|
key: "getAllElementsInBackGrid",
|
|
3166
3450
|
value: function getAllElementsInBackGrid() {
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3451
|
+
return this._getAllElementsInGrid(this.backGrid);
|
|
3452
|
+
}
|
|
3453
|
+
}, {
|
|
3454
|
+
key: "getAllElementsInBacksideModuleGrid",
|
|
3455
|
+
value: function getAllElementsInBacksideModuleGrid() {
|
|
3456
|
+
return this._getAllElementsInGrid(this.backGrid).map(function (element) {
|
|
3457
|
+
return element.ElementId;
|
|
3458
|
+
});
|
|
3174
3459
|
}
|
|
3175
3460
|
/**
|
|
3176
3461
|
* This function returns all elements In grid - from frontside and from backside
|
|
3177
3462
|
*/
|
|
3178
3463
|
}, {
|
|
3179
|
-
key: "
|
|
3180
|
-
value: function
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3464
|
+
key: "getAllElementsInGridSortedbyElementId",
|
|
3465
|
+
value: function getAllElementsInGridSortedbyElementId() {
|
|
3466
|
+
return Array.from(this.plannerElements.values());
|
|
3467
|
+
}
|
|
3468
|
+
}, {
|
|
3469
|
+
key: "getAllElementsInGridSortedbyGridPos",
|
|
3470
|
+
value: function getAllElementsInGridSortedbyGridPos() {
|
|
3471
|
+
var returnElements = [];
|
|
3472
|
+
var allCheckedElementIds = [];
|
|
3473
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
3474
|
+
for (var j = 0; j < this.frontGrid[i].length; j++) {
|
|
3475
|
+
var cell = this.frontGrid[i][j];
|
|
3476
|
+
if (cell && allCheckedElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3477
|
+
var element = this.getElementById(cell.plannerElementId);
|
|
3478
|
+
allCheckedElementIds.push(cell.plannerElementId);
|
|
3479
|
+
returnElements.push(element);
|
|
3480
|
+
}
|
|
3185
3481
|
}
|
|
3186
3482
|
}
|
|
3187
|
-
for (var i = 0; i < this.
|
|
3188
|
-
for (var j = 0; j < this.
|
|
3189
|
-
|
|
3483
|
+
for (var i = 0; i < this.backGrid.length; i++) {
|
|
3484
|
+
for (var j = 0; j < this.backGrid[i].length; j++) {
|
|
3485
|
+
var _cell3 = this.backGrid[i][j];
|
|
3486
|
+
if (_cell3 && allCheckedElementIds.indexOf(_cell3.plannerElementId) == -1) {
|
|
3487
|
+
var _element = this.getElementById(_cell3.plannerElementId);
|
|
3488
|
+
allCheckedElementIds.push(_cell3.plannerElementId);
|
|
3489
|
+
returnElements.push(_element);
|
|
3490
|
+
}
|
|
3190
3491
|
}
|
|
3191
3492
|
}
|
|
3192
|
-
return
|
|
3493
|
+
return returnElements;
|
|
3193
3494
|
}
|
|
3194
3495
|
}, {
|
|
3195
3496
|
key: "getElementById",
|
|
3196
3497
|
value: function getElementById(elementId) {
|
|
3197
|
-
|
|
3198
|
-
var curElementGrid = pos.backside ? this.backModulPlannedElementGrid : this.plannedElementGrid;
|
|
3199
|
-
return curElementGrid[pos.col][pos.row];
|
|
3498
|
+
return this.plannerElements.get(elementId);
|
|
3200
3499
|
}
|
|
3201
3500
|
|
|
3202
3501
|
/**
|
|
@@ -3206,8 +3505,9 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3206
3505
|
}, {
|
|
3207
3506
|
key: "getElementIsFirstInGrid",
|
|
3208
3507
|
value: function getElementIsFirstInGrid(elementId) {
|
|
3209
|
-
var
|
|
3210
|
-
|
|
3508
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3509
|
+
if (result.cells.length == 0) return false;
|
|
3510
|
+
return result.cells[0].index.x == 0 && result.cells[0].index.y == 0 && !result.backside;
|
|
3211
3511
|
}
|
|
3212
3512
|
|
|
3213
3513
|
/**
|
|
@@ -3217,9 +3517,9 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3217
3517
|
}, {
|
|
3218
3518
|
key: "getElementIsInLastCol",
|
|
3219
3519
|
value: function getElementIsInLastCol(elementId, fromBackmodul) {
|
|
3220
|
-
var curElementGrid = fromBackmodul ? this.
|
|
3221
|
-
var
|
|
3222
|
-
return
|
|
3520
|
+
var curElementGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
3521
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3522
|
+
return result.endColIndex + 1 == curElementGrid.length;
|
|
3223
3523
|
}
|
|
3224
3524
|
|
|
3225
3525
|
/**
|
|
@@ -3229,22 +3529,39 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3229
3529
|
}, {
|
|
3230
3530
|
key: "getElementHasTopElement",
|
|
3231
3531
|
value: function getElementHasTopElement(elementId) {
|
|
3232
|
-
var
|
|
3233
|
-
var
|
|
3234
|
-
|
|
3532
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3533
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3534
|
+
for (var i = result.startColIndex; i <= result.endColIndex; i++) {
|
|
3535
|
+
//Check if in one of the top cells is another element
|
|
3536
|
+
if (curGrid[i].length > result.endRowIndex + 1 && curGrid[i][result.endRowIndex + 1]) {
|
|
3537
|
+
return true;
|
|
3538
|
+
}
|
|
3539
|
+
}
|
|
3235
3540
|
return false;
|
|
3236
3541
|
}
|
|
3542
|
+
|
|
3237
3543
|
/**
|
|
3238
|
-
* returns the
|
|
3544
|
+
* returns the elements on the top of the current element
|
|
3239
3545
|
* @param elementId
|
|
3240
3546
|
*/
|
|
3241
3547
|
}, {
|
|
3242
|
-
key: "
|
|
3243
|
-
value: function
|
|
3244
|
-
var
|
|
3245
|
-
var
|
|
3246
|
-
|
|
3247
|
-
|
|
3548
|
+
key: "getTopElements",
|
|
3549
|
+
value: function getTopElements(elementId) {
|
|
3550
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3551
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3552
|
+
var neighborPlannerElements = [];
|
|
3553
|
+
var neighborElementIds = [];
|
|
3554
|
+
for (var i = result.startColIndex; i <= result.endColIndex; i++) {
|
|
3555
|
+
if (curGrid[i].length > result.endRowIndex + 1 && curGrid[i][result.endRowIndex + 1]) {
|
|
3556
|
+
var neighborCell = curGrid[i][result.endRowIndex + 1];
|
|
3557
|
+
if (!neighborCell) continue;
|
|
3558
|
+
if (neighborElementIds.indexOf(neighborCell.plannerElementId) == -1) {
|
|
3559
|
+
neighborElementIds.push(neighborCell.plannerElementId);
|
|
3560
|
+
neighborPlannerElements.push(this.plannerElements.get(neighborCell.plannerElementId));
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
return neighborPlannerElements;
|
|
3248
3565
|
}
|
|
3249
3566
|
|
|
3250
3567
|
/**
|
|
@@ -3254,9 +3571,12 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3254
3571
|
}, {
|
|
3255
3572
|
key: "getTopRightElement",
|
|
3256
3573
|
value: function getTopRightElement(elementId) {
|
|
3257
|
-
var
|
|
3258
|
-
var
|
|
3259
|
-
if (
|
|
3574
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3575
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3576
|
+
if (curGrid.length > result.endColIndex + 1 && curGrid[result.endColIndex + 1].length > result.endRowIndex + 1 && curGrid[result.endColIndex + 1][result.endRowIndex + 1]) {
|
|
3577
|
+
var cell = curGrid[result.endColIndex + 1][result.endRowIndex + 1];
|
|
3578
|
+
return this.plannerElements.get(cell.plannerElementId);
|
|
3579
|
+
}
|
|
3260
3580
|
return undefined;
|
|
3261
3581
|
}
|
|
3262
3582
|
|
|
@@ -3267,11 +3587,15 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3267
3587
|
}, {
|
|
3268
3588
|
key: "getTopLeftElement",
|
|
3269
3589
|
value: function getTopLeftElement(elementId) {
|
|
3270
|
-
var
|
|
3271
|
-
var
|
|
3272
|
-
if (
|
|
3590
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3591
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3592
|
+
if (result.startColIndex > 0 && curGrid[result.startColIndex - 1].length > 0 && curGrid[result.startColIndex - 1][result.endRowIndex + 1]) {
|
|
3593
|
+
var cell = curGrid[result.startColIndex - 1][result.endRowIndex + 1];
|
|
3594
|
+
return this.plannerElements.get(cell.plannerElementId);
|
|
3595
|
+
}
|
|
3273
3596
|
return undefined;
|
|
3274
3597
|
}
|
|
3598
|
+
|
|
3275
3599
|
/**
|
|
3276
3600
|
* returns true if the element has another element on the bottom
|
|
3277
3601
|
* @param elementId
|
|
@@ -3279,22 +3603,40 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3279
3603
|
}, {
|
|
3280
3604
|
key: "getElementHasBottomElement",
|
|
3281
3605
|
value: function getElementHasBottomElement(elementId) {
|
|
3282
|
-
var
|
|
3283
|
-
if (
|
|
3606
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3607
|
+
if (result.startRowIndex - 1 >= 0) return true;
|
|
3284
3608
|
return false;
|
|
3285
3609
|
}
|
|
3610
|
+
|
|
3286
3611
|
/**
|
|
3287
|
-
* returns
|
|
3612
|
+
* returns all elements on the bottom of the current element from left to right
|
|
3613
|
+
* now following construction of elements is possible. When you want to return the bottom elements of a it returns b,c,d
|
|
3614
|
+
* aaaaaa
|
|
3615
|
+
* bbccdd
|
|
3616
|
+
*
|
|
3288
3617
|
* @param elementId
|
|
3289
3618
|
*/
|
|
3290
3619
|
}, {
|
|
3291
|
-
key: "
|
|
3292
|
-
value: function
|
|
3293
|
-
var
|
|
3294
|
-
var
|
|
3295
|
-
|
|
3296
|
-
|
|
3620
|
+
key: "getBottomElements",
|
|
3621
|
+
value: function getBottomElements(elementId) {
|
|
3622
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3623
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3624
|
+
var bottomElements = [];
|
|
3625
|
+
var bottomElementIds = [];
|
|
3626
|
+
if (result.startRowIndex - 1 >= 0) {
|
|
3627
|
+
for (var i = result.startColIndex; i <= result.endColIndex; i++) {
|
|
3628
|
+
var cell = curGrid[i][result.startRowIndex - 1];
|
|
3629
|
+
if (cell) {
|
|
3630
|
+
if (bottomElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3631
|
+
bottomElementIds.push(cell.plannerElementId);
|
|
3632
|
+
bottomElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
}
|
|
3637
|
+
return bottomElements;
|
|
3297
3638
|
}
|
|
3639
|
+
|
|
3298
3640
|
/**
|
|
3299
3641
|
* returns true if the element has another element on its right side
|
|
3300
3642
|
* @param elementId
|
|
@@ -3302,22 +3644,41 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3302
3644
|
}, {
|
|
3303
3645
|
key: "getElementHasRightElement",
|
|
3304
3646
|
value: function getElementHasRightElement(elementId) {
|
|
3305
|
-
var
|
|
3306
|
-
var
|
|
3307
|
-
if (
|
|
3308
|
-
|
|
3647
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3648
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3649
|
+
if (curGrid.length > result.endColIndex + 1 && curGrid[result.endColIndex + 1].length > result.startRowIndex) {
|
|
3650
|
+
var cell = curGrid[result.endColIndex + 1][result.startRowIndex];
|
|
3651
|
+
if (cell) return true;
|
|
3309
3652
|
}
|
|
3310
3653
|
return false;
|
|
3311
3654
|
}
|
|
3655
|
+
/**
|
|
3656
|
+
* returns all elements right of the current element from bottom to up
|
|
3657
|
+
* now following construction of elements is possible. When getting right Elements of Element a it returns b and c
|
|
3658
|
+
* aabb
|
|
3659
|
+
* aabb
|
|
3660
|
+
* aacc
|
|
3661
|
+
* @param elementId
|
|
3662
|
+
*/
|
|
3312
3663
|
}, {
|
|
3313
|
-
key: "
|
|
3314
|
-
value: function
|
|
3315
|
-
var
|
|
3316
|
-
var
|
|
3317
|
-
|
|
3318
|
-
|
|
3664
|
+
key: "getRightElements",
|
|
3665
|
+
value: function getRightElements(elementId) {
|
|
3666
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3667
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3668
|
+
var rightElements = [];
|
|
3669
|
+
var rightElementIds = [];
|
|
3670
|
+
if (curGrid.length > result.endColIndex + 1) {
|
|
3671
|
+
for (var i = result.startRowIndex; i <= result.endRowIndex; i++) {
|
|
3672
|
+
var cell = curGrid[result.endColIndex + 1][i];
|
|
3673
|
+
if (cell) {
|
|
3674
|
+
if (rightElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3675
|
+
rightElementIds.push(cell.plannerElementId);
|
|
3676
|
+
rightElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3319
3680
|
}
|
|
3320
|
-
return
|
|
3681
|
+
return rightElements;
|
|
3321
3682
|
}
|
|
3322
3683
|
|
|
3323
3684
|
/**
|
|
@@ -3327,39 +3688,72 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3327
3688
|
}, {
|
|
3328
3689
|
key: "getElementHasLeftElement",
|
|
3329
3690
|
value: function getElementHasLeftElement(elementId) {
|
|
3330
|
-
var
|
|
3331
|
-
|
|
3691
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3692
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3693
|
+
if (result.startColIndex > 0 && curGrid[result.startColIndex - 1][result.startRowIndex]) {
|
|
3694
|
+
return true;
|
|
3695
|
+
}
|
|
3332
3696
|
return false;
|
|
3333
3697
|
}
|
|
3698
|
+
/**
|
|
3699
|
+
* returns all elements left of the current element from bottom to up
|
|
3700
|
+
* now following construction of elements is possible. When getting left Elements of Element a it returns b and c
|
|
3701
|
+
* bbaa
|
|
3702
|
+
* bbaa
|
|
3703
|
+
* ccaa
|
|
3704
|
+
* @param elementId
|
|
3705
|
+
*/
|
|
3334
3706
|
}, {
|
|
3335
|
-
key: "
|
|
3336
|
-
value: function
|
|
3337
|
-
var
|
|
3338
|
-
|
|
3339
|
-
|
|
3707
|
+
key: "getLeftElements",
|
|
3708
|
+
value: function getLeftElements(elementId) {
|
|
3709
|
+
var result = this.getCellsInGridByElementId(elementId);
|
|
3710
|
+
var curGrid = result.backside ? this.backGrid : this.frontGrid;
|
|
3711
|
+
var leftElements = [];
|
|
3712
|
+
var leftElementIds = [];
|
|
3713
|
+
if (result.startColIndex - 1 >= 0) {
|
|
3714
|
+
for (var i = result.startRowIndex; i <= result.endRowIndex; i++) {
|
|
3715
|
+
var cell = curGrid[result.startColIndex - 1][i];
|
|
3716
|
+
if (cell) {
|
|
3717
|
+
if (leftElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3718
|
+
leftElementIds.push(cell.plannerElementId);
|
|
3719
|
+
leftElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
}
|
|
3724
|
+
return leftElements;
|
|
3340
3725
|
}
|
|
3726
|
+
|
|
3341
3727
|
/*
|
|
3728
|
+
CHECK OK
|
|
3342
3729
|
returns all Elements in the column.
|
|
3343
3730
|
index: index of the column in the grid
|
|
3344
3731
|
*/
|
|
3345
3732
|
}, {
|
|
3346
3733
|
key: "getAllElementsInColumn",
|
|
3347
3734
|
value: function getAllElementsInColumn(index, fromBackmodul) {
|
|
3348
|
-
var
|
|
3349
|
-
var
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3735
|
+
var curGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
3736
|
+
var allElements = [];
|
|
3737
|
+
var allElementIds = [];
|
|
3738
|
+
if (curGrid.length > index) {
|
|
3739
|
+
for (var i = 0; i < curGrid[index].length; i++) {
|
|
3740
|
+
var cell = curGrid[index][i];
|
|
3741
|
+
if (cell && allElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3742
|
+
allElementIds.push(cell.plannerElementId);
|
|
3743
|
+
allElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3744
|
+
}
|
|
3745
|
+
}
|
|
3353
3746
|
}
|
|
3354
|
-
return
|
|
3747
|
+
return allElements;
|
|
3355
3748
|
}
|
|
3749
|
+
|
|
3356
3750
|
/**
|
|
3357
3751
|
* This function returns the count of columns in the grid
|
|
3358
3752
|
*/
|
|
3359
3753
|
}, {
|
|
3360
3754
|
key: "getColumnCount",
|
|
3361
3755
|
value: function getColumnCount() {
|
|
3362
|
-
return this.
|
|
3756
|
+
return this.frontGrid.length;
|
|
3363
3757
|
}
|
|
3364
3758
|
|
|
3365
3759
|
/**
|
|
@@ -3368,95 +3762,171 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3368
3762
|
*/
|
|
3369
3763
|
}, {
|
|
3370
3764
|
key: "getRowCount",
|
|
3371
|
-
value: function getRowCount(colIndex) {
|
|
3372
|
-
return this.
|
|
3765
|
+
value: function getRowCount(colIndex, fromBackmodul) {
|
|
3766
|
+
return fromBackmodul ? this.backGrid[colIndex].length : this.frontGrid[colIndex].length;
|
|
3373
3767
|
}
|
|
3374
3768
|
|
|
3375
3769
|
/*
|
|
3770
|
+
CHECK OK
|
|
3376
3771
|
returns all Elements in the row of the grid.
|
|
3377
3772
|
index: index of the row in the grid
|
|
3378
3773
|
*/
|
|
3379
3774
|
}, {
|
|
3380
3775
|
key: "getAllElementsInRow",
|
|
3381
3776
|
value: function getAllElementsInRow(index, fromBackmodul) {
|
|
3382
|
-
var
|
|
3777
|
+
var curGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
3383
3778
|
var allElements = [];
|
|
3384
|
-
|
|
3385
|
-
|
|
3779
|
+
var allElementIds = [];
|
|
3780
|
+
for (var i = 0; i < curGrid.length; i++) {
|
|
3781
|
+
if (curGrid[i].length > index) {
|
|
3782
|
+
var cell = curGrid[i][index];
|
|
3783
|
+
if (cell && allElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3784
|
+
allElementIds.push(cell.plannerElementId);
|
|
3785
|
+
allElements.push(this.plannerElements.get(cell.plannerElementId));
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3386
3788
|
}
|
|
3387
3789
|
return allElements;
|
|
3388
3790
|
}
|
|
3389
3791
|
|
|
3390
3792
|
/**
|
|
3793
|
+
* CHECK OK
|
|
3391
3794
|
* This function returns the size of the highes row element over all columns
|
|
3392
3795
|
*/
|
|
3393
3796
|
}, {
|
|
3394
3797
|
key: "getSizeOfHighesRow",
|
|
3395
3798
|
value: function getSizeOfHighesRow(fromBackmodul) {
|
|
3396
|
-
var
|
|
3799
|
+
var curGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
3397
3800
|
var highestRow = 0;
|
|
3398
|
-
for (var i = 0; i <
|
|
3399
|
-
|
|
3801
|
+
for (var i = 0; i < curGrid.length; i++) {
|
|
3802
|
+
for (var j = curGrid[i].length; j >= 0; j--) {
|
|
3803
|
+
var cell = curGrid[i][j];
|
|
3804
|
+
if (cell) {
|
|
3805
|
+
if (highestRow < j) highestRow = j;
|
|
3806
|
+
break; //first cell that is not empty was found, skip this loop
|
|
3807
|
+
}
|
|
3808
|
+
}
|
|
3400
3809
|
}
|
|
3401
|
-
return highestRow;
|
|
3810
|
+
return highestRow + 1;
|
|
3402
3811
|
}
|
|
3403
3812
|
|
|
3404
3813
|
/**
|
|
3405
|
-
* This function returns the neighbor
|
|
3814
|
+
* This function returns the neighbor elements in the grid. Now it can be more than one element.
|
|
3815
|
+
* 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
|
|
3816
|
+
* Example:
|
|
3817
|
+
* AAB
|
|
3818
|
+
* AAB
|
|
3819
|
+
* AAC
|
|
3820
|
+
* The right elements of A are B and C
|
|
3406
3821
|
* @param curXPos
|
|
3407
3822
|
* @param curYPos
|
|
3408
3823
|
* @param dir
|
|
3409
3824
|
*/
|
|
3410
3825
|
}, {
|
|
3411
|
-
key: "
|
|
3412
|
-
value: function
|
|
3413
|
-
|
|
3414
|
-
var
|
|
3826
|
+
key: "getNeighborElements",
|
|
3827
|
+
value: function getNeighborElements(elementId, dir) {
|
|
3828
|
+
console.log('ELEMENT ID beim aufruf von getNeighborElements ' + elementId + '; dir: ' + dir);
|
|
3829
|
+
var cellPos = this.getCellsInGridByElementId(elementId);
|
|
3830
|
+
var curGrid = cellPos.backside ? this.backGrid : this.frontGrid;
|
|
3831
|
+
var result = [];
|
|
3832
|
+
var resultPlannerIds = [];
|
|
3415
3833
|
switch (dir) {
|
|
3416
3834
|
case 'TOP':
|
|
3417
|
-
|
|
3835
|
+
for (var i = cellPos.startColIndex; i <= cellPos.endColIndex; i++) {
|
|
3836
|
+
var neighborX = i;
|
|
3837
|
+
var neighborY = cellPos.endRowIndex + 1;
|
|
3838
|
+
if (curGrid[neighborX].length > neighborY) {
|
|
3839
|
+
var neighborCell = curGrid[neighborX][neighborY];
|
|
3840
|
+
if (neighborCell && resultPlannerIds.indexOf(neighborCell.plannerElementId) == -1) {
|
|
3841
|
+
resultPlannerIds.push(neighborCell.plannerElementId);
|
|
3842
|
+
result.push(this.plannerElements.get(neighborCell.plannerElementId));
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
}
|
|
3418
3846
|
break;
|
|
3419
3847
|
case 'DOWN':
|
|
3420
|
-
|
|
3848
|
+
for (var i = cellPos.startColIndex; i <= cellPos.endColIndex; i++) {
|
|
3849
|
+
var _neighborX = i;
|
|
3850
|
+
var _neighborY = cellPos.startRowIndex - 1;
|
|
3851
|
+
if (_neighborY >= 0) {
|
|
3852
|
+
var _neighborCell = curGrid[_neighborX][_neighborY];
|
|
3853
|
+
if (_neighborCell && resultPlannerIds.indexOf(_neighborCell.plannerElementId) == -1) {
|
|
3854
|
+
resultPlannerIds.push(_neighborCell.plannerElementId);
|
|
3855
|
+
result.push(this.plannerElements.get(_neighborCell.plannerElementId));
|
|
3856
|
+
}
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3421
3859
|
break;
|
|
3422
3860
|
case 'LEFT':
|
|
3423
|
-
|
|
3861
|
+
for (var i = cellPos.startRowIndex; i <= cellPos.endRowIndex; i++) {
|
|
3862
|
+
var _neighborX2 = cellPos.startColIndex - 1;
|
|
3863
|
+
var _neighborY2 = i;
|
|
3864
|
+
if (_neighborX2 >= 0) {
|
|
3865
|
+
var _neighborCell2 = curGrid[_neighborX2][_neighborY2];
|
|
3866
|
+
if (_neighborCell2 && resultPlannerIds.indexOf(_neighborCell2.plannerElementId) == -1) {
|
|
3867
|
+
resultPlannerIds.push(_neighborCell2.plannerElementId);
|
|
3868
|
+
result.push(this.plannerElements.get(_neighborCell2.plannerElementId));
|
|
3869
|
+
}
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3424
3872
|
break;
|
|
3425
3873
|
case 'RIGHT':
|
|
3426
|
-
|
|
3874
|
+
for (var i = cellPos.startRowIndex; i <= cellPos.endRowIndex; i++) {
|
|
3875
|
+
var _neighborX3 = cellPos.startColIndex + 1;
|
|
3876
|
+
var _neighborY3 = i;
|
|
3877
|
+
if (curGrid.length > _neighborX3) {
|
|
3878
|
+
var _neighborCell3 = curGrid[_neighborX3][_neighborY3];
|
|
3879
|
+
if (_neighborCell3 && resultPlannerIds.indexOf(_neighborCell3.plannerElementId) == -1) {
|
|
3880
|
+
resultPlannerIds.push(_neighborCell3.plannerElementId);
|
|
3881
|
+
result.push(this.plannerElements.get(_neighborCell3.plannerElementId));
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3884
|
+
}
|
|
3427
3885
|
break;
|
|
3428
3886
|
case 'BACK':
|
|
3429
3887
|
if (this.hasActiveBackside) {
|
|
3430
|
-
|
|
3888
|
+
var plannerElement = this.getPlannerElementAtGridPos(cellPos.startColIndex, cellPos.startRowIndex, true);
|
|
3889
|
+
if (plannerElement != undefined) result = [plannerElement];
|
|
3431
3890
|
}
|
|
3432
3891
|
break;
|
|
3433
3892
|
}
|
|
3434
|
-
return
|
|
3893
|
+
return result;
|
|
3435
3894
|
}
|
|
3895
|
+
|
|
3896
|
+
/**
|
|
3897
|
+
* 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.
|
|
3898
|
+
* It always returns only one element or none
|
|
3899
|
+
* @param elementId
|
|
3900
|
+
* @returns
|
|
3901
|
+
*/
|
|
3436
3902
|
}, {
|
|
3437
3903
|
key: "getOppositeElement",
|
|
3438
3904
|
value: function getOppositeElement(elementId) {
|
|
3439
3905
|
if (this.hasActiveBackside) {
|
|
3440
|
-
var pos = this.
|
|
3906
|
+
var pos = this.getCellsInGridByElementId(elementId);
|
|
3441
3907
|
if (pos.backside) {
|
|
3442
|
-
return this.
|
|
3908
|
+
return this.getPlannerElementAtGridPos(pos.startColIndex, pos.startRowIndex, false);
|
|
3443
3909
|
} else {
|
|
3444
|
-
return this.
|
|
3910
|
+
return this.getPlannerElementAtGridPos(pos.startColIndex, pos.startRowIndex, true);
|
|
3445
3911
|
}
|
|
3446
3912
|
}
|
|
3447
3913
|
return undefined;
|
|
3448
3914
|
}
|
|
3915
|
+
/**
|
|
3916
|
+
* 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.
|
|
3917
|
+
* It always returns only one element or none
|
|
3918
|
+
* @param elementId
|
|
3919
|
+
* @returns
|
|
3920
|
+
*/
|
|
3449
3921
|
}, {
|
|
3450
|
-
key: "
|
|
3451
|
-
value: function
|
|
3922
|
+
key: "getOppositeElements",
|
|
3923
|
+
value: function getOppositeElements(elementIds) {
|
|
3452
3924
|
var oppositeElements = [];
|
|
3453
3925
|
if (this.hasActiveBackside) {
|
|
3454
3926
|
for (var i = 0; i < elementIds.length; i++) {
|
|
3455
|
-
var
|
|
3456
|
-
if (
|
|
3457
|
-
oppositeElements.push(
|
|
3458
|
-
} else {
|
|
3459
|
-
if (this.backModulPlannedElementGrid[pos.col][pos.row]) oppositeElements.push(this.backModulPlannedElementGrid[pos.col][pos.row].getElementId());
|
|
3927
|
+
var oppositeElement = this.getOppositeElement(elementIds[i]);
|
|
3928
|
+
if (oppositeElement != undefined) {
|
|
3929
|
+
oppositeElements.push(oppositeElement);
|
|
3460
3930
|
}
|
|
3461
3931
|
}
|
|
3462
3932
|
}
|
|
@@ -3469,20 +3939,23 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3469
3939
|
*/
|
|
3470
3940
|
}, {
|
|
3471
3941
|
key: "getSizeOfWholeSet",
|
|
3472
|
-
value: function getSizeOfWholeSet() {
|
|
3942
|
+
value: function getSizeOfWholeSet(correctSizeSystem4) {
|
|
3473
3943
|
var width = 0;
|
|
3474
3944
|
var depth = 0;
|
|
3475
3945
|
var height = 0;
|
|
3476
|
-
|
|
3946
|
+
var checkedElementIds = [];
|
|
3947
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
3477
3948
|
var curHeight = 0;
|
|
3478
|
-
for (var j = 0; j < this.
|
|
3479
|
-
var
|
|
3480
|
-
|
|
3481
|
-
|
|
3949
|
+
for (var j = 0; j < this.frontGrid[i].length; j++) {
|
|
3950
|
+
var cell = this.frontGrid[i][j];
|
|
3951
|
+
if (cell && checkedElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
3952
|
+
curHeight += this.plannerElements.get(cell.plannerElementId).getHeight();
|
|
3953
|
+
if (i == 0 && j == 0) depth = this.plannerElements.get(cell.plannerElementId).getDepth();
|
|
3954
|
+
}
|
|
3482
3955
|
}
|
|
3483
3956
|
if (curHeight > height) height = curHeight;
|
|
3484
|
-
var curWidth = this.getGridColumnWidth(i
|
|
3485
|
-
if (i > 0) {
|
|
3957
|
+
var curWidth = this.getGridColumnWidth(i);
|
|
3958
|
+
if (correctSizeSystem4 && i > 0) {
|
|
3486
3959
|
//Correct width
|
|
3487
3960
|
if (curWidth == 77.9) curWidth = 75;else if (curWidth == 40.4) curWidth = 37.5;else if (curWidth == 21.7) curWidth = 18.75;
|
|
3488
3961
|
}
|
|
@@ -3493,193 +3966,226 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3493
3966
|
}
|
|
3494
3967
|
|
|
3495
3968
|
/**
|
|
3496
|
-
* Returns all other elements in the grid that are in the same row as the elementId from the parameter
|
|
3969
|
+
* 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
|
|
3970
|
+
* Excample:
|
|
3971
|
+
* AAC
|
|
3972
|
+
* AAB
|
|
3973
|
+
* AABD
|
|
3974
|
+
* EEED
|
|
3975
|
+
* The elements that are in the same row as A are B and D
|
|
3497
3976
|
* @param elementId
|
|
3498
3977
|
*/
|
|
3499
3978
|
}, {
|
|
3500
3979
|
key: "getAllElementsInSameRowByElementId",
|
|
3501
3980
|
value: function getAllElementsInSameRowByElementId(elementId) {
|
|
3502
|
-
var
|
|
3503
|
-
var allElementsInRow = this.getAllElementsInRow(
|
|
3981
|
+
var curPos = this.getCellsInGridByElementId(elementId);
|
|
3982
|
+
var allElementsInRow = this.getAllElementsInRow(curPos.startRowIndex, false);
|
|
3504
3983
|
if (this.hasActiveBackside) {
|
|
3505
|
-
allElementsInRow = allElementsInRow.concat(this.getAllElementsInRow(
|
|
3984
|
+
allElementsInRow = allElementsInRow.concat(this.getAllElementsInRow(curPos.startRowIndex, true));
|
|
3506
3985
|
}
|
|
3507
3986
|
return {
|
|
3508
3987
|
elementIds: allElementsInRow.map(function (obj) {
|
|
3509
3988
|
return obj.ElementId;
|
|
3510
3989
|
}),
|
|
3511
3990
|
plannerElements: allElementsInRow,
|
|
3512
|
-
backside:
|
|
3991
|
+
backside: curPos.backside
|
|
3513
3992
|
};
|
|
3514
3993
|
}
|
|
3515
3994
|
|
|
3516
3995
|
/**
|
|
3517
3996
|
* Returns all Elements that are under the specified element
|
|
3997
|
+
* AAAE
|
|
3998
|
+
* BBCE
|
|
3999
|
+
* DDDD
|
|
4000
|
+
* DDDD
|
|
4001
|
+
* The Elements that are under A are B, C and D
|
|
3518
4002
|
*/
|
|
3519
4003
|
}, {
|
|
3520
4004
|
key: "getAllElementsDown",
|
|
3521
4005
|
value: function getAllElementsDown(elementId) {
|
|
3522
|
-
var
|
|
3523
|
-
if (
|
|
4006
|
+
var curPos = this.getCellsInGridByElementId(elementId);
|
|
4007
|
+
if (curPos.startRowIndex == 0) return {
|
|
3524
4008
|
elements: [],
|
|
3525
4009
|
backside: false
|
|
3526
4010
|
};
|
|
3527
|
-
var
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
4011
|
+
var curGrid = curPos.backside ? this.backGrid : this.frontGrid;
|
|
4012
|
+
var resultPlannerIds = [];
|
|
4013
|
+
for (var i = curPos.startColIndex; i <= curPos.endColIndex; i++) {
|
|
4014
|
+
for (var j = curPos.startRowIndex--; j >= 0; j--) {
|
|
4015
|
+
var neighborCell = curGrid[i][j];
|
|
4016
|
+
if (neighborCell && resultPlannerIds.indexOf(neighborCell.plannerElementId) == -1) {
|
|
4017
|
+
resultPlannerIds.push(neighborCell.plannerElementId);
|
|
4018
|
+
}
|
|
3532
4019
|
}
|
|
3533
4020
|
}
|
|
3534
4021
|
return {
|
|
3535
|
-
elements:
|
|
3536
|
-
backside:
|
|
4022
|
+
elements: resultPlannerIds,
|
|
4023
|
+
backside: curPos.backside
|
|
3537
4024
|
};
|
|
3538
4025
|
}
|
|
4026
|
+
/**
|
|
4027
|
+
* 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
|
|
4028
|
+
* Excample:
|
|
4029
|
+
* HHHH
|
|
4030
|
+
* FAAC
|
|
4031
|
+
* FAAB
|
|
4032
|
+
* FAABD
|
|
4033
|
+
* FEEED
|
|
4034
|
+
* GGGGG
|
|
4035
|
+
* The elements that are in the same col as A are E, G and H
|
|
4036
|
+
* @param elementId
|
|
4037
|
+
*/
|
|
3539
4038
|
}, {
|
|
3540
4039
|
key: "getAllElementsInSameCol",
|
|
3541
4040
|
value: function getAllElementsInSameCol(elementId) {
|
|
3542
|
-
var
|
|
3543
|
-
var allElements = this.getAllElementsInColumn(
|
|
4041
|
+
var curPos = this.getCellsInGridByElementId(elementId);
|
|
4042
|
+
var allElements = this.getAllElementsInColumn(curPos.startColIndex, curPos.backside);
|
|
3544
4043
|
if (allElements == undefined) allElements = [];
|
|
3545
4044
|
return {
|
|
3546
4045
|
elements: allElements.map(function (obj) {
|
|
3547
4046
|
return obj.ElementId;
|
|
3548
4047
|
}),
|
|
3549
|
-
backside:
|
|
4048
|
+
backside: curPos.backside
|
|
3550
4049
|
};
|
|
3551
4050
|
}
|
|
3552
4051
|
}, {
|
|
3553
|
-
key: "
|
|
3554
|
-
value: function
|
|
3555
|
-
|
|
3556
|
-
var
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
var
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
}
|
|
3571
|
-
for (var i = 0; i < this.plannedElementGrid.length; i++) {
|
|
3572
|
-
for (var j = 0; j < this.plannedElementGrid[i].length; j++) {
|
|
3573
|
-
if (i < colIndexToMove) {
|
|
3574
|
-
helperGrid[i][j] = this.plannedElementGrid[i][j];
|
|
3575
|
-
} else {
|
|
3576
|
-
helperGrid[i + 1][j] = this.plannedElementGrid[i][j];
|
|
3577
|
-
}
|
|
4052
|
+
key: "prepareGridForColCopy",
|
|
4053
|
+
value: function prepareGridForColCopy(elementId, copyDir) {
|
|
4054
|
+
if (copyDir == 'AVO') return;
|
|
4055
|
+
var elementToCopyPos = this.getCellsInGridByElementId(elementId);
|
|
4056
|
+
this.plannerElements.get(elementId);
|
|
4057
|
+
//Kopiere das Grid nach rechts abhängig von der Breite des aktuellen Elementes
|
|
4058
|
+
//now correct all indices in all cells:
|
|
4059
|
+
|
|
4060
|
+
var copyStartIndex = 0;
|
|
4061
|
+
if (copyDir == 'AVR') copyStartIndex = elementToCopyPos.endColIndex + 1;else if (copyDir == 'AVL') copyStartIndex = elementToCopyPos.startColIndex;
|
|
4062
|
+
var copyIndexCount = 1 + (elementToCopyPos.endColIndex - elementToCopyPos.startColIndex);
|
|
4063
|
+
var allUsedCellsFrontGrid = this.getAllUsedCellsInGrid(false);
|
|
4064
|
+
this.frontGrid = new Array();
|
|
4065
|
+
for (var i = 0; i < allUsedCellsFrontGrid.length; i++) {
|
|
4066
|
+
var curCellFrontGrid = allUsedCellsFrontGrid[i];
|
|
4067
|
+
if (curCellFrontGrid.index.x >= copyStartIndex) {
|
|
4068
|
+
curCellFrontGrid.index.x += copyIndexCount;
|
|
3578
4069
|
}
|
|
4070
|
+
if (!this.frontGrid[curCellFrontGrid.index.x]) {
|
|
4071
|
+
this.frontGrid[curCellFrontGrid.index.x] = [];
|
|
4072
|
+
}
|
|
4073
|
+
this.frontGrid[curCellFrontGrid.index.x][curCellFrontGrid.index.y] = curCellFrontGrid;
|
|
4074
|
+
}
|
|
4075
|
+
//Init empty cols
|
|
4076
|
+
for (var i = copyStartIndex; i < copyStartIndex + copyIndexCount; i++) {
|
|
4077
|
+
if (!this.frontGrid[i]) this.frontGrid[i] = [];
|
|
3579
4078
|
}
|
|
3580
|
-
this.plannedElementGrid = helperGrid;
|
|
3581
4079
|
if (this.hasActiveBackside) {
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
for (var i = 0; i <
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
for (var j = 0; j < this.backModulPlannedElementGrid[i].length; j++) {
|
|
3589
|
-
if (i < colIndexToMove) {
|
|
3590
|
-
helperGrid[i][j] = this.backModulPlannedElementGrid[i][j];
|
|
3591
|
-
} else {
|
|
3592
|
-
helperGrid[i + 1][j] = this.backModulPlannedElementGrid[i][j];
|
|
3593
|
-
}
|
|
4080
|
+
var allUsedCellsBackGrid = this.getAllUsedCellsInGrid(true);
|
|
4081
|
+
this.backGrid = new Array();
|
|
4082
|
+
for (var i = 0; i < allUsedCellsBackGrid.length; i++) {
|
|
4083
|
+
var curCellBackGrid = allUsedCellsBackGrid[i];
|
|
4084
|
+
if (curCellBackGrid.index.x >= copyStartIndex) {
|
|
4085
|
+
curCellBackGrid.index.x += copyIndexCount;
|
|
3594
4086
|
}
|
|
4087
|
+
if (!this.backGrid[curCellBackGrid.index.x]) {
|
|
4088
|
+
this.backGrid[curCellBackGrid.index.x] = [];
|
|
4089
|
+
}
|
|
4090
|
+
this.backGrid[curCellBackGrid.index.x][curCellBackGrid.index.y] = curCellBackGrid;
|
|
4091
|
+
}
|
|
4092
|
+
|
|
4093
|
+
//Init empty cols
|
|
4094
|
+
for (var i = copyStartIndex; i < copyStartIndex + copyIndexCount; i++) {
|
|
4095
|
+
if (!this.backGrid[i]) this.backGrid[i] = [];
|
|
3595
4096
|
}
|
|
3596
|
-
this.backModulPlannedElementGrid = helperGrid;
|
|
3597
4097
|
}
|
|
3598
4098
|
}
|
|
3599
4099
|
}, {
|
|
3600
4100
|
key: "prepareGridForBackSideCopy",
|
|
3601
4101
|
value: function prepareGridForBackSideCopy() {
|
|
3602
|
-
this.
|
|
3603
|
-
for (var i = 0; i < this.plannedElementGrid.length; i++) {
|
|
3604
|
-
this.backModulPlannedElementGrid.push(new Array());
|
|
3605
|
-
}
|
|
4102
|
+
this.backGrid = new Array();
|
|
3606
4103
|
this.hasActiveBackside = true;
|
|
3607
4104
|
}
|
|
4105
|
+
|
|
4106
|
+
/**
|
|
4107
|
+
* 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
|
|
4108
|
+
* @param newElement
|
|
4109
|
+
* @param col
|
|
4110
|
+
* @param row
|
|
4111
|
+
* @param fromBackmodul
|
|
4112
|
+
*/
|
|
3608
4113
|
}, {
|
|
3609
4114
|
key: "addElementAtGridPos",
|
|
3610
4115
|
value: function addElementAtGridPos(newElement, col, row, fromBackmodul) {
|
|
3611
|
-
var
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
this.hasActiveBackside = true;
|
|
3621
|
-
this.backModulPlannedElementGrid = curElementGrid;
|
|
3622
|
-
} else {
|
|
3623
|
-
this.plannedElementGrid = curElementGrid;
|
|
4116
|
+
var curGrid = fromBackmodul ? this.backGrid : this.frontGrid;
|
|
4117
|
+
var result = this.createNewCells(newElement, col, row, fromBackmodul);
|
|
4118
|
+
for (var i = 0; i < result.cells.length; i++) {
|
|
4119
|
+
var cell = result.cells[i];
|
|
4120
|
+
// Prüfen, ob das innere Array existiert, sonst erstellen
|
|
4121
|
+
if (!curGrid[cell.index.x]) {
|
|
4122
|
+
curGrid[cell.index.x] = [];
|
|
4123
|
+
}
|
|
4124
|
+
curGrid[cell.index.x][cell.index.y] = cell;
|
|
3624
4125
|
}
|
|
4126
|
+
this.plannerElements.set(newElement.getElementId(), newElement);
|
|
4127
|
+
if (fromBackmodul) this.hasActiveBackside = true;
|
|
3625
4128
|
}
|
|
4129
|
+
|
|
4130
|
+
/**
|
|
4131
|
+
* Assume that the grid is already prepared and there is enough empty space for the new element.
|
|
4132
|
+
* @param elementIDToCopy
|
|
4133
|
+
* @param newElement
|
|
4134
|
+
* @param copyInfo
|
|
4135
|
+
*/
|
|
3626
4136
|
}, {
|
|
3627
4137
|
key: "addElementAsCopy",
|
|
3628
4138
|
value: function addElementAsCopy(elementIDToCopy, newElement, copyDir) {
|
|
3629
|
-
var
|
|
3630
|
-
var
|
|
3631
|
-
var
|
|
4139
|
+
var curPos = this.getCellsInGridByElementId(elementIDToCopy);
|
|
4140
|
+
var startColIndexForCopy = -1;
|
|
4141
|
+
var startRowIndexForCopy = -1;
|
|
4142
|
+
var backsideForCopy = copyDir == 'BACKSIDE' ? !curPos.backside : curPos.backside;
|
|
4143
|
+
var cellCount = this.getCellCount(newElement);
|
|
3632
4144
|
switch (copyDir) {
|
|
3633
4145
|
case 'AVR':
|
|
3634
|
-
|
|
4146
|
+
startColIndexForCopy = curPos.endColIndex + 1;
|
|
4147
|
+
startRowIndexForCopy = curPos.startRowIndex;
|
|
3635
4148
|
break;
|
|
3636
4149
|
case 'AVL':
|
|
3637
|
-
|
|
4150
|
+
startColIndexForCopy = curPos.startColIndex - cellCount.colCount;
|
|
4151
|
+
startRowIndexForCopy = curPos.startRowIndex;
|
|
3638
4152
|
break;
|
|
3639
4153
|
case 'AVO':
|
|
3640
|
-
|
|
4154
|
+
startColIndexForCopy = curPos.startColIndex;
|
|
4155
|
+
startRowIndexForCopy = curPos.endRowIndex + 1;
|
|
3641
4156
|
break;
|
|
3642
4157
|
case 'BACKSIDE':
|
|
3643
|
-
|
|
3644
|
-
|
|
4158
|
+
startColIndexForCopy = curPos.startColIndex;
|
|
4159
|
+
startRowIndexForCopy = curPos.startRowIndex;
|
|
3645
4160
|
break;
|
|
3646
4161
|
}
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
}
|
|
4162
|
+
var newCellInfos = this.createNewCells(newElement, startColIndexForCopy, startRowIndexForCopy, backsideForCopy);
|
|
4163
|
+
var curGrid = backsideForCopy ? this.backGrid : this.frontGrid;
|
|
4164
|
+
for (var i = 0; i < newCellInfos.cells.length; i++) {
|
|
4165
|
+
if (!curGrid[newCellInfos.cells[i].index.x]) curGrid[newCellInfos.cells[i].index.x] = [];
|
|
4166
|
+
curGrid[newCellInfos.cells[i].index.x][newCellInfos.cells[i].index.y] = newCellInfos.cells[i];
|
|
3653
4167
|
}
|
|
4168
|
+
this.plannerElements.set(newElement.getElementId(), newElement);
|
|
3654
4169
|
}
|
|
3655
4170
|
|
|
3656
4171
|
/**
|
|
3657
4172
|
* This function deletes an Element from the grid.
|
|
3658
4173
|
* If backsideModule is active, than the oppsite Element is deleted as well
|
|
3659
4174
|
* If the boxPlanner_backside switch deletion type is set, do not delete the opposite element
|
|
4175
|
+
* If the last element in col was deleted, do delete whole col.
|
|
3660
4176
|
* @param elementId
|
|
3661
|
-
* @returns all elements that are deleted - it can happen that multiple elements get deleted
|
|
3662
4177
|
*/
|
|
3663
4178
|
}, {
|
|
3664
4179
|
key: "deleteElement",
|
|
3665
4180
|
value: function deleteElement(elementId, deletionType) {
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
for (var i = 0; i < elementsToDelete.length; i++) {
|
|
3675
|
-
dockingPointHandlerInst.removeDockingPointRelations(elementsToDelete[i]);
|
|
3676
|
-
if (!deletionType || deletionType != 'BoxPlanner_backside') this.deleteGridPos(this.getIndexInGridByElementId(elementsToDelete[i].ElementId));else if (deletionType && deletionType == 'BoxPlanner_backside') {
|
|
3677
|
-
//Do not delete gridPos - only delete element.
|
|
3678
|
-
this.backModulPlannedElementGrid[gridPos.col][gridPos.row] = undefined;
|
|
3679
|
-
}
|
|
3680
|
-
result.push(elementsToDelete[i].getElementId());
|
|
3681
|
-
}
|
|
3682
|
-
return result;
|
|
4181
|
+
if (!this.plannerElements.has(elementId)) {
|
|
4182
|
+
LOG$1.error(new DivaError('Try to delete an elementId that does not exist'));
|
|
4183
|
+
}
|
|
4184
|
+
this.getCellsInGridByElementId(elementId);
|
|
4185
|
+
dockingPointHandlerInst.removeDockingPointRelations(this.plannerElements.get(elementId));
|
|
4186
|
+
this.deleteElementByIdFromGrid(elementId);
|
|
4187
|
+
this.plannerElements["delete"](elementId);
|
|
4188
|
+
if (this.hasActiveBackside) ;
|
|
3683
4189
|
}
|
|
3684
4190
|
|
|
3685
4191
|
/**
|
|
@@ -3689,55 +4195,65 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3689
4195
|
}, {
|
|
3690
4196
|
key: "updateWorldPosOfElements",
|
|
3691
4197
|
value: function updateWorldPosOfElements() {
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
for (var i = 0; i < this.backModulPlannedElementGrid.length; i++) {
|
|
3700
|
-
for (var j = 0; j < this.backModulPlannedElementGrid[i].length; j++) {
|
|
3701
|
-
var _plannerElement = this.backModulPlannedElementGrid[i][j];
|
|
3702
|
-
if (_plannerElement) dockingPointHandlerInst.removeDockingPointRelations(_plannerElement);
|
|
3703
|
-
}
|
|
4198
|
+
//First remove all docking Point relation information
|
|
4199
|
+
var _iterator = _createForOfIteratorHelper(this.plannerElements.values()),
|
|
4200
|
+
_step;
|
|
4201
|
+
try {
|
|
4202
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
4203
|
+
var _element3 = _step.value;
|
|
4204
|
+
dockingPointHandlerInst.removeDockingPointRelations(_element3);
|
|
3704
4205
|
}
|
|
4206
|
+
} catch (err) {
|
|
4207
|
+
_iterator.e(err);
|
|
4208
|
+
} finally {
|
|
4209
|
+
_iterator.f();
|
|
3705
4210
|
}
|
|
3706
4211
|
var posNr = 1;
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
4212
|
+
//First remove all docking Point relation information
|
|
4213
|
+
|
|
4214
|
+
var allCheckedElementIds = [];
|
|
4215
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
4216
|
+
for (var j = 0; j < this.frontGrid[i].length; j++) {
|
|
4217
|
+
var cell = this.frontGrid[i][j];
|
|
4218
|
+
if (allCheckedElementIds.indexOf(cell.plannerElementId) == -1) {
|
|
4219
|
+
var element = this.plannerElements.get(cell.plannerElementId);
|
|
4220
|
+
allCheckedElementIds.push(cell.plannerElementId);
|
|
4221
|
+
var topNeighbors = this.getNeighborElements(cell.plannerElementId, 'TOP');
|
|
4222
|
+
var rightNeighbors = this.getNeighborElements(cell.plannerElementId, 'RIGHT');
|
|
4223
|
+
for (var n = 0; n < topNeighbors.length; n++) {
|
|
4224
|
+
dockingPointHandlerInst.tryDockElement(element, 'AVO', [topNeighbors[n]]);
|
|
4225
|
+
}
|
|
4226
|
+
for (var n = 0; n < rightNeighbors.length; n++) {
|
|
4227
|
+
dockingPointHandlerInst.tryDockElement(element, 'AVR', [rightNeighbors[n]]);
|
|
4228
|
+
}
|
|
4229
|
+
element.PosNr = posNr;
|
|
4230
|
+
posNr++;
|
|
3713
4231
|
}
|
|
3714
|
-
//correct PosNr
|
|
3715
|
-
_plannerElement2.PosNr = posNr;
|
|
3716
|
-
posNr++;
|
|
3717
|
-
}
|
|
3718
|
-
//check if Elements are on the right side and dock them
|
|
3719
|
-
if (this.plannedElementGrid[i + 1] && this.plannedElementGrid[i + 1][0]) {
|
|
3720
|
-
dockingPointHandlerInst.tryDockElement(this.plannedElementGrid[i][0], 'AVR', [this.plannedElementGrid[i + 1][0]]);
|
|
3721
4232
|
}
|
|
3722
4233
|
}
|
|
3723
|
-
|
|
3724
|
-
for (var
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
var
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
4234
|
+
for (var i = 0; i < this.backGrid.length; i++) {
|
|
4235
|
+
for (var j = 0; j < this.backGrid[i].length; j++) {
|
|
4236
|
+
var _cell4 = this.backGrid[i][j];
|
|
4237
|
+
if (allCheckedElementIds.indexOf(_cell4.plannerElementId) == -1) {
|
|
4238
|
+
var _element2 = this.plannerElements.get(_cell4.plannerElementId);
|
|
4239
|
+
allCheckedElementIds.push(_cell4.plannerElementId);
|
|
4240
|
+
var cellFrontGrid = this.frontGrid[i][j];
|
|
4241
|
+
var elementFrontGrid = this.plannerElements.get(cellFrontGrid.plannerElementId);
|
|
4242
|
+
if (elementFrontGrid) {
|
|
4243
|
+
var targetDPFrontGrid = elementFrontGrid === null || elementFrontGrid === void 0 ? void 0 : elementFrontGrid.getDockingPointById('AVO_AVO_2_IL');
|
|
4244
|
+
if (!targetDPFrontGrid) LOG$1.error(new DivaError('Error Loading DockingPoint AVO_2 for plannerElement'));else if (_element2) dockingPointHandlerInst.tryDockElementToDP(_element2, elementFrontGrid, targetDPFrontGrid);
|
|
4245
|
+
}
|
|
4246
|
+
var _topNeighbors = this.getNeighborElements(_cell4.plannerElementId, 'TOP');
|
|
4247
|
+
var _rightNeighbors = this.getNeighborElements(_cell4.plannerElementId, 'RIGHT');
|
|
4248
|
+
for (var n = 0; n < _topNeighbors.length; n++) {
|
|
4249
|
+
dockingPointHandlerInst.tryDockElement(_element2, 'AVO', [_topNeighbors[n]]);
|
|
3732
4250
|
}
|
|
3733
|
-
|
|
3734
|
-
|
|
4251
|
+
for (var n = 0; n < _rightNeighbors.length; n++) {
|
|
4252
|
+
dockingPointHandlerInst.tryDockElement(_element2, 'AVL', [_rightNeighbors[n]]);
|
|
4253
|
+
}
|
|
4254
|
+
_element2.PosNr = posNr;
|
|
3735
4255
|
posNr++;
|
|
3736
4256
|
}
|
|
3737
|
-
//check if Elements are on the right side and dock them
|
|
3738
|
-
if (this.backModulPlannedElementGrid[i + 1] && this.backModulPlannedElementGrid[i + 1][0] && this.backModulPlannedElementGrid[i][0]) {
|
|
3739
|
-
dockingPointHandlerInst.tryDockElement(this.backModulPlannedElementGrid[i][0], 'AVL', [this.backModulPlannedElementGrid[i + 1][0]]);
|
|
3740
|
-
}
|
|
3741
4257
|
}
|
|
3742
4258
|
}
|
|
3743
4259
|
}
|
|
@@ -3749,66 +4265,60 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3749
4265
|
}, {
|
|
3750
4266
|
key: "destroyBoxPlannerGrid",
|
|
3751
4267
|
value: function destroyBoxPlannerGrid() {
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
4268
|
+
var _iterator2 = _createForOfIteratorHelper(this.plannerElements.values()),
|
|
4269
|
+
_step2;
|
|
4270
|
+
try {
|
|
4271
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
4272
|
+
var element = _step2.value;
|
|
4273
|
+
element.destroy();
|
|
3756
4274
|
}
|
|
3757
|
-
|
|
4275
|
+
} catch (err) {
|
|
4276
|
+
_iterator2.e(err);
|
|
4277
|
+
} finally {
|
|
4278
|
+
_iterator2.f();
|
|
3758
4279
|
}
|
|
3759
|
-
this.
|
|
4280
|
+
this.plannerElements.clear();
|
|
4281
|
+
this.frontGrid = new Array();
|
|
3760
4282
|
if (this.hasActiveBackside) {
|
|
3761
4283
|
this.hasActiveBackside = false;
|
|
3762
|
-
|
|
3763
|
-
for (var j = 0; j < this.backModulPlannedElementGrid[i].length; j++) {
|
|
3764
|
-
var _plannerElement4 = this.backModulPlannedElementGrid[i][j];
|
|
3765
|
-
if (_plannerElement4) _plannerElement4.destroy();
|
|
3766
|
-
}
|
|
3767
|
-
this.backModulPlannedElementGrid[i] = [];
|
|
3768
|
-
}
|
|
3769
|
-
this.backModulPlannedElementGrid = [];
|
|
4284
|
+
this.backGrid = new Array();
|
|
3770
4285
|
}
|
|
3771
4286
|
}
|
|
3772
|
-
/**
|
|
3773
|
-
|
|
3774
|
-
*/
|
|
3775
|
-
}, {
|
|
3776
|
-
key: "getAllElementsInBacksideModuleGrid",
|
|
3777
|
-
value: function getAllElementsInBacksideModuleGrid() {
|
|
3778
|
-
var elementsInGrid = [];
|
|
3779
|
-
for (var i = 0; i < this.backModulPlannedElementGrid.length; i++) {
|
|
3780
|
-
for (var j = 0; j < this.backModulPlannedElementGrid[i].length; j++) {
|
|
3781
|
-
if (this.backModulPlannedElementGrid[i][j]) elementsInGrid.push(this.backModulPlannedElementGrid[i][j].ElementId);
|
|
3782
|
-
}
|
|
3783
|
-
}
|
|
3784
|
-
return elementsInGrid;
|
|
3785
|
-
}
|
|
3786
4287
|
|
|
3787
4288
|
/**
|
|
3788
|
-
* Destroys the backside module Grid
|
|
4289
|
+
* Destroys the backside module Grid
|
|
3789
4290
|
*/
|
|
3790
4291
|
}, {
|
|
3791
4292
|
key: "destroyBacksideModuleGrid",
|
|
3792
4293
|
value: function destroyBacksideModuleGrid() {
|
|
3793
4294
|
this.hasActiveBackside = false;
|
|
3794
|
-
var
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
4295
|
+
var allElements = this.getAllElementsInBackGrid();
|
|
4296
|
+
var _iterator3 = _createForOfIteratorHelper(allElements.values()),
|
|
4297
|
+
_step3;
|
|
4298
|
+
try {
|
|
4299
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
4300
|
+
var element = _step3.value;
|
|
4301
|
+
this.plannerElements["delete"](element.ElementId);
|
|
4302
|
+
element.destroy();
|
|
3802
4303
|
}
|
|
3803
|
-
|
|
4304
|
+
} catch (err) {
|
|
4305
|
+
_iterator3.e(err);
|
|
4306
|
+
} finally {
|
|
4307
|
+
_iterator3.f();
|
|
3804
4308
|
}
|
|
3805
|
-
|
|
4309
|
+
allElements = [];
|
|
4310
|
+
this.backGrid = new Array();
|
|
3806
4311
|
}
|
|
3807
4312
|
}, {
|
|
3808
4313
|
key: "getPlannerHasActiveBackside",
|
|
3809
4314
|
value: function getPlannerHasActiveBackside() {
|
|
3810
4315
|
return this.hasActiveBackside;
|
|
3811
4316
|
}
|
|
4317
|
+
}, {
|
|
4318
|
+
key: "getForceSingleCellPerElement",
|
|
4319
|
+
value: function getForceSingleCellPerElement() {
|
|
4320
|
+
return this.gridSetupParams.forceSingleCellPerElement;
|
|
4321
|
+
}
|
|
3812
4322
|
}, {
|
|
3813
4323
|
key: "getBoundingBox",
|
|
3814
4324
|
value: function getBoundingBox() {
|
|
@@ -3817,56 +4327,63 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3817
4327
|
var maxX = 0;
|
|
3818
4328
|
var curX = 0;
|
|
3819
4329
|
var minZ = 0;
|
|
3820
|
-
var curZ = this.
|
|
4330
|
+
var curZ = this.plannerElements.get(this.frontGrid[0][0].plannerElementId).getDepth();
|
|
3821
4331
|
var maxZ = 0;
|
|
3822
4332
|
var curDir;
|
|
3823
4333
|
curDir = 'RIGHT';
|
|
3824
|
-
|
|
3825
|
-
|
|
4334
|
+
var allCheckedElementIds = [];
|
|
4335
|
+
for (var i = 0; i < this.frontGrid.length; i++) {
|
|
4336
|
+
var groundCell = this.frontGrid[i][0];
|
|
4337
|
+
if (!groundCell) break; //if on the lowest position the cell is empty, the grid ist finished - no wholes are allowed
|
|
3826
4338
|
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
} else if (curDir == 'LEFT') {
|
|
3834
|
-
curX -= this.plannedElementGrid[i][0].getWidth();
|
|
3835
|
-
} else if (curDir == 'BACK') {
|
|
3836
|
-
curZ -= this.plannedElementGrid[i][0].getWidth();
|
|
3837
|
-
}
|
|
3838
|
-
if (elementOption == 'OPVECK_I') {
|
|
4339
|
+
if (allCheckedElementIds.indexOf(groundCell.plannerElementId) == -1) {
|
|
4340
|
+
allCheckedElementIds.push(groundCell.plannerElementId);
|
|
4341
|
+
var groundElement = this.plannerElements.get(groundCell.plannerElementId);
|
|
4342
|
+
if (!groundElement) continue;
|
|
4343
|
+
//Check if the col has a corner.
|
|
4344
|
+
var elementOption = this.getValueOfOptionOfArticle(groundCell.plannerElementId, 'OPTELEMENT');
|
|
3839
4345
|
if (curDir == 'RIGHT') {
|
|
3840
|
-
|
|
4346
|
+
curX += groundElement.getWidth();
|
|
3841
4347
|
} else if (curDir == 'FRONT') {
|
|
3842
|
-
|
|
4348
|
+
curZ += groundElement.getWidth();
|
|
3843
4349
|
} else if (curDir == 'LEFT') {
|
|
3844
|
-
|
|
4350
|
+
curX -= groundElement.getWidth();
|
|
3845
4351
|
} else if (curDir == 'BACK') {
|
|
3846
|
-
|
|
4352
|
+
curZ -= groundElement.getWidth();
|
|
3847
4353
|
}
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
4354
|
+
if (elementOption == 'OPVECK_I') {
|
|
4355
|
+
if (curDir == 'RIGHT') {
|
|
4356
|
+
curDir = 'FRONT';
|
|
4357
|
+
} else if (curDir == 'FRONT') {
|
|
4358
|
+
curDir = 'LEFT';
|
|
4359
|
+
} else if (curDir == 'LEFT') {
|
|
4360
|
+
curDir = 'BACK';
|
|
4361
|
+
} else if (curDir == 'BACK') {
|
|
4362
|
+
curDir = 'RIGHT';
|
|
4363
|
+
}
|
|
4364
|
+
} else if (elementOption == 'OPVECK_A') {
|
|
4365
|
+
if (curDir == 'RIGHT') {
|
|
4366
|
+
curDir = 'BACK';
|
|
4367
|
+
} else if (curDir == 'FRONT') {
|
|
4368
|
+
curDir = 'RIGHT';
|
|
4369
|
+
} else if (curDir == 'LEFT') {
|
|
4370
|
+
curDir = 'FRONT';
|
|
4371
|
+
} else if (curDir == 'BACK') {
|
|
4372
|
+
curDir = 'LEFT';
|
|
4373
|
+
}
|
|
3857
4374
|
}
|
|
4375
|
+
if (curX < minX) minX = curX;
|
|
4376
|
+
if (curX > maxX) maxX = curX;
|
|
4377
|
+
if (curZ < minZ) minZ = curZ;
|
|
4378
|
+
if (curZ > maxZ) maxZ = curZ;
|
|
4379
|
+
var colHeight = this.getGridColumnHeight(i);
|
|
4380
|
+
height = height < colHeight ? colHeight : height;
|
|
3858
4381
|
}
|
|
3859
|
-
if (curX < minX) minX = curX;
|
|
3860
|
-
if (curX > maxX) maxX = curX;
|
|
3861
|
-
if (curZ < minZ) minZ = curZ;
|
|
3862
|
-
if (curZ > maxZ) maxZ = curZ;
|
|
3863
|
-
var colHeight = this.getGridColumnHeight(i);
|
|
3864
|
-
height = height < colHeight ? colHeight : height;
|
|
3865
4382
|
}
|
|
3866
4383
|
var depth = maxZ - minZ;
|
|
3867
4384
|
var width = maxX - minX;
|
|
3868
4385
|
if (this.hasActiveBackside) {
|
|
3869
|
-
depth =
|
|
4386
|
+
depth = curZ * 2;
|
|
3870
4387
|
}
|
|
3871
4388
|
return {
|
|
3872
4389
|
width: Math.round(width * 1000) / 1000,
|
|
@@ -3874,6 +4391,304 @@ var BoxPlannerGrid = /*#__PURE__*/function () {
|
|
|
3874
4391
|
depth: Math.round(depth * 1000) / 1000
|
|
3875
4392
|
};
|
|
3876
4393
|
}
|
|
4394
|
+
|
|
4395
|
+
/**
|
|
4396
|
+
* This function returns all free cell locations to move a specific element
|
|
4397
|
+
* @param elementId
|
|
4398
|
+
* @returns
|
|
4399
|
+
*/
|
|
4400
|
+
}, {
|
|
4401
|
+
key: "getFreeMoveLocation",
|
|
4402
|
+
value: function getFreeMoveLocation(elementId) {
|
|
4403
|
+
var element = this.getElementById(elementId);
|
|
4404
|
+
if (!element) return [];
|
|
4405
|
+
var elementCells = this.getCellsInGridByElementId(elementId);
|
|
4406
|
+
if (elementCells.cells.length === 0) return [];
|
|
4407
|
+
var allFreeMoveLocations = [];
|
|
4408
|
+
// Helper function to check if a cell is valid and empty
|
|
4409
|
+
var isEmptyCell = function isEmptyCell(x, y) {
|
|
4410
|
+
var _curGrid$x;
|
|
4411
|
+
return ((_curGrid$x = curGrid[x]) === null || _curGrid$x === void 0 ? void 0 : _curGrid$x[y]) === undefined;
|
|
4412
|
+
};
|
|
4413
|
+
var curGrid = elementCells.backside ? this.backGrid : this.frontGrid;
|
|
4414
|
+
var _iterator4 = _createForOfIteratorHelper(this.plannerElements.keys()),
|
|
4415
|
+
_step4;
|
|
4416
|
+
try {
|
|
4417
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
4418
|
+
var otherElementId = _step4.value;
|
|
4419
|
+
if (otherElementId != elementId) {
|
|
4420
|
+
var otherElement = this.getElementById(otherElementId);
|
|
4421
|
+
if (this.gridSetupParams.forceSingleCellPerElement) {
|
|
4422
|
+
//Check if the with is ok and the height
|
|
4423
|
+
|
|
4424
|
+
if (!this.getElementHasTopElement(otherElementId) && otherElement.getWidth() == element.getWidth()) {
|
|
4425
|
+
//now check if there is another element for the correct height
|
|
4426
|
+
var otherElementCells = this.getCellsInGridByElementId(otherElementId);
|
|
4427
|
+
var allElementsInRowAbove = this.getAllElementsInRow(otherElementCells.endRowIndex + 1, otherElementCells.backside);
|
|
4428
|
+
if (allElementsInRowAbove.length > 0 && allElementsInRowAbove[0].getHeight() != element.getHeight()) continue;
|
|
4429
|
+
|
|
4430
|
+
//Now we found a possible place
|
|
4431
|
+
|
|
4432
|
+
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);
|
|
4433
|
+
allFreeMoveLocations.push(locationInformation);
|
|
4434
|
+
}
|
|
4435
|
+
} else {
|
|
4436
|
+
//In this case it is more complex
|
|
4437
|
+
|
|
4438
|
+
var _otherElementCells = this.getCellsInGridByElementId(otherElementId);
|
|
4439
|
+
var freeStartTopColIndex = -1;
|
|
4440
|
+
var freeEndTopColIndex = -1;
|
|
4441
|
+
var topRow = _otherElementCells.endRowIndex + 1;
|
|
4442
|
+
for (var x = _otherElementCells.startColIndex; x <= _otherElementCells.startColIndex + _otherElementCells.colCount - 1; x++) {
|
|
4443
|
+
var freeSpaceFound = false;
|
|
4444
|
+
if (isEmptyCell(x, topRow)) {
|
|
4445
|
+
if (freeStartTopColIndex == -1) {
|
|
4446
|
+
freeStartTopColIndex = x;
|
|
4447
|
+
freeEndTopColIndex = x;
|
|
4448
|
+
} else {
|
|
4449
|
+
freeEndTopColIndex = x;
|
|
4450
|
+
}
|
|
4451
|
+
if (x == _otherElementCells.startColIndex + _otherElementCells.colCount - 1) {
|
|
4452
|
+
if (elementCells.colCount <= freeEndTopColIndex - freeStartTopColIndex + 1) {
|
|
4453
|
+
freeSpaceFound = true;
|
|
4454
|
+
} else {
|
|
4455
|
+
//Check overstand
|
|
4456
|
+
freeSpaceFound = true;
|
|
4457
|
+
for (var i = 0; i < elementCells.colCount; i++) {
|
|
4458
|
+
if (isEmptyCell(freeStartTopColIndex + i, _otherElementCells.endRowIndex)) {
|
|
4459
|
+
freeSpaceFound = false; //invalid overstand found
|
|
4460
|
+
break;
|
|
4461
|
+
}
|
|
4462
|
+
}
|
|
4463
|
+
}
|
|
4464
|
+
}
|
|
4465
|
+
} else {
|
|
4466
|
+
//we found a obstacle
|
|
4467
|
+
if (elementCells.colCount <= freeEndTopColIndex - freeStartTopColIndex + 1) {
|
|
4468
|
+
//The element has place here
|
|
4469
|
+
freeSpaceFound = true;
|
|
4470
|
+
}
|
|
4471
|
+
}
|
|
4472
|
+
if (freeSpaceFound) {
|
|
4473
|
+
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);
|
|
4474
|
+
allFreeMoveLocations.push(_locationInformation);
|
|
4475
|
+
}
|
|
4476
|
+
}
|
|
4477
|
+
}
|
|
4478
|
+
}
|
|
4479
|
+
}
|
|
4480
|
+
|
|
4481
|
+
//now add most left and most right location
|
|
4482
|
+
} catch (err) {
|
|
4483
|
+
_iterator4.e(err);
|
|
4484
|
+
} finally {
|
|
4485
|
+
_iterator4.f();
|
|
4486
|
+
}
|
|
4487
|
+
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);
|
|
4488
|
+
allFreeMoveLocations.push(locationInformationLeft);
|
|
4489
|
+
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);
|
|
4490
|
+
allFreeMoveLocations.push(locationInformationRight);
|
|
4491
|
+
return allFreeMoveLocations;
|
|
4492
|
+
}
|
|
4493
|
+
|
|
4494
|
+
/**
|
|
4495
|
+
* This function returns free locations for an element when trying to copy it in LEFT TOP or RIGHT direction
|
|
4496
|
+
* @param elementId
|
|
4497
|
+
* @param direction
|
|
4498
|
+
* @returns
|
|
4499
|
+
*/
|
|
4500
|
+
}, {
|
|
4501
|
+
key: "getFreePlanningLocation",
|
|
4502
|
+
value: function getFreePlanningLocation(elementId, direction) {
|
|
4503
|
+
// Retrieve all cells associated with the element
|
|
4504
|
+
var element = this.getElementById(elementId);
|
|
4505
|
+
if (!element) return undefined;
|
|
4506
|
+
var elementCells = this.getCellsInGridByElementId(elementId);
|
|
4507
|
+
|
|
4508
|
+
// If no cells are found, return an empty array as the element cannot be copied
|
|
4509
|
+
if (elementCells.cells.length === 0) {
|
|
4510
|
+
return undefined;
|
|
4511
|
+
}
|
|
4512
|
+
|
|
4513
|
+
// Determine the grid to work with (front or back) based on the element's location
|
|
4514
|
+
var curGrid = elementCells.backside ? this.backGrid : this.frontGrid;
|
|
4515
|
+
|
|
4516
|
+
// Get the boundaries of the element in the grid
|
|
4517
|
+
var startColIndex = elementCells.startColIndex;
|
|
4518
|
+
var endColIndex = elementCells.endColIndex;
|
|
4519
|
+
var startRowIndex = elementCells.startRowIndex;
|
|
4520
|
+
var endRowIndex = elementCells.endRowIndex;
|
|
4521
|
+
var copyStartColIndex = -1;
|
|
4522
|
+
var copyStartRowIndex = -1;
|
|
4523
|
+
var copyEndColIndex = -1;
|
|
4524
|
+
var copyEndRowIndex = -1;
|
|
4525
|
+
|
|
4526
|
+
// Store potential free cells for copying
|
|
4527
|
+
var freeCells = [];
|
|
4528
|
+
|
|
4529
|
+
// Helper function to check if a cell is valid and empty
|
|
4530
|
+
var isValidCell = function isValidCell(x, y) {
|
|
4531
|
+
var _curGrid$x2;
|
|
4532
|
+
return ((_curGrid$x2 = curGrid[x]) === null || _curGrid$x2 === void 0 ? void 0 : _curGrid$x2[y]) === undefined;
|
|
4533
|
+
};
|
|
4534
|
+
|
|
4535
|
+
// Handle logic for each copy direction
|
|
4536
|
+
switch (direction) {
|
|
4537
|
+
case 'LEFT':
|
|
4538
|
+
{
|
|
4539
|
+
// Target column to the left of the element
|
|
4540
|
+
var targetColIndex = startColIndex - 1;
|
|
4541
|
+
var copyPossible = false;
|
|
4542
|
+
// Iterate through rows within the element's height
|
|
4543
|
+
for (var y = startRowIndex; y <= endRowIndex; y++) {
|
|
4544
|
+
if (isValidCell(targetColIndex, y)) {
|
|
4545
|
+
copyStartRowIndex = y;
|
|
4546
|
+
copyPossible = true;
|
|
4547
|
+
break;
|
|
4548
|
+
}
|
|
4549
|
+
}
|
|
4550
|
+
if (!copyPossible) return undefined;
|
|
4551
|
+
copyPossible = false;
|
|
4552
|
+
for (var x = startColIndex - 1; x >= startColIndex - elementCells.colCount; x--) {
|
|
4553
|
+
if (isValidCell(x, copyStartRowIndex) && (copyStartRowIndex == 0 || !isValidCell(x, copyStartRowIndex - 1))) {
|
|
4554
|
+
//check also for overhang
|
|
4555
|
+
copyPossible = true;
|
|
4556
|
+
copyStartColIndex = x;
|
|
4557
|
+
} else {
|
|
4558
|
+
break; //when you find one situation where it is not valid skip outside.
|
|
4559
|
+
}
|
|
4560
|
+
}
|
|
4561
|
+
if (!copyPossible) return undefined;
|
|
4562
|
+
copyEndColIndex = startColIndex - 1;
|
|
4563
|
+
copyEndRowIndex = endRowIndex;
|
|
4564
|
+
freeCells = this.createEmptyCells(copyStartColIndex, copyStartRowIndex, copyEndColIndex, copyEndRowIndex, element.getWidth(), element.getHeight());
|
|
4565
|
+
break;
|
|
4566
|
+
}
|
|
4567
|
+
case 'TOP':
|
|
4568
|
+
{
|
|
4569
|
+
// Target row above the element
|
|
4570
|
+
var targetRowIndex = endRowIndex + 1;
|
|
4571
|
+
var _copyPossible = false;
|
|
4572
|
+
// Iterate through columns within the element's width
|
|
4573
|
+
for (var _x = endColIndex; _x >= startColIndex; _x--) {
|
|
4574
|
+
if (isValidCell(_x, targetRowIndex)) {
|
|
4575
|
+
copyStartColIndex = _x;
|
|
4576
|
+
_copyPossible = true;
|
|
4577
|
+
}
|
|
4578
|
+
}
|
|
4579
|
+
if (!_copyPossible) return undefined;
|
|
4580
|
+
copyStartRowIndex = targetRowIndex;
|
|
4581
|
+
copyEndColIndex = endColIndex;
|
|
4582
|
+
copyEndRowIndex = targetRowIndex + elementCells.rowCount - 1;
|
|
4583
|
+
freeCells = this.createEmptyCells(copyStartColIndex, copyStartRowIndex, copyEndColIndex, copyEndRowIndex, element.getWidth(), element.getHeight());
|
|
4584
|
+
break;
|
|
4585
|
+
}
|
|
4586
|
+
case 'RIGHT':
|
|
4587
|
+
{
|
|
4588
|
+
// Target column to the left of the element
|
|
4589
|
+
var _targetColIndex = endColIndex + 1;
|
|
4590
|
+
var _copyPossible2 = false;
|
|
4591
|
+
// Iterate through rows within the element's height
|
|
4592
|
+
for (var _y = startRowIndex; _y <= endRowIndex; _y++) {
|
|
4593
|
+
if (isValidCell(_targetColIndex, _y)) {
|
|
4594
|
+
copyStartRowIndex = _y;
|
|
4595
|
+
_copyPossible2 = true;
|
|
4596
|
+
break;
|
|
4597
|
+
}
|
|
4598
|
+
}
|
|
4599
|
+
if (!_copyPossible2) return undefined;
|
|
4600
|
+
_copyPossible2 = false;
|
|
4601
|
+
for (var _x2 = endColIndex + 1; _x2 <= endColIndex + elementCells.colCount; _x2++) {
|
|
4602
|
+
if (isValidCell(_x2, copyStartRowIndex) && (copyStartRowIndex == 0 || !isValidCell(_x2, copyStartRowIndex - 1))) {
|
|
4603
|
+
//check also for overhang
|
|
4604
|
+
copyEndColIndex = _x2;
|
|
4605
|
+
_copyPossible2 = true;
|
|
4606
|
+
} else {
|
|
4607
|
+
break; //when you find one situation where it is not valid skip outside.
|
|
4608
|
+
}
|
|
4609
|
+
}
|
|
4610
|
+
if (!_copyPossible2) return undefined;
|
|
4611
|
+
copyStartColIndex = endColIndex + 1;
|
|
4612
|
+
copyEndRowIndex = endRowIndex;
|
|
4613
|
+
freeCells = this.createEmptyCells(copyStartColIndex, copyStartRowIndex, copyEndColIndex, copyEndRowIndex, element.getWidth(), element.getHeight());
|
|
4614
|
+
break;
|
|
4615
|
+
}
|
|
4616
|
+
default:
|
|
4617
|
+
// If direction is invalid, return an empty array
|
|
4618
|
+
return undefined;
|
|
4619
|
+
}
|
|
4620
|
+
|
|
4621
|
+
// Return the collected free cells for the given direction
|
|
4622
|
+
var locationInformation = this.createLocationInformation(element, elementCells.backside, freeCells, copyStartColIndex, copyStartRowIndex, copyEndColIndex - copyStartColIndex + 1, copyEndRowIndex - copyStartRowIndex + 1);
|
|
4623
|
+
return locationInformation;
|
|
4624
|
+
}
|
|
4625
|
+
}, {
|
|
4626
|
+
key: "createLocationInformation",
|
|
4627
|
+
value: function createLocationInformation(element, fromBackside, cells, cellsStartColIndex, cellsStartRowIndex, cellsColCount, cellsRowCount) {
|
|
4628
|
+
var curGrid = fromBackside ? this.backGrid : this.frontGrid;
|
|
4629
|
+
var elementLocation = {
|
|
4630
|
+
cells: cells,
|
|
4631
|
+
widthPerCell: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterWidth : element.getWidth(),
|
|
4632
|
+
heightPerCell: this.gridSetupParams.forceFixCellRasterSize ? this.gridSetupParams.fixCellRasterHeight : element.getHeight(),
|
|
4633
|
+
depthPerCell: element.getDepth(),
|
|
4634
|
+
width: this.gridSetupParams.forceFixCellRasterSize ? cellsColCount * this.gridSetupParams.fixCellRasterWidth : element.getWidth(),
|
|
4635
|
+
height: this.gridSetupParams.forceFixCellRasterSize ? cellsRowCount * this.gridSetupParams.fixCellRasterHeight : element.getHeight(),
|
|
4636
|
+
depth: element.getDepth(),
|
|
4637
|
+
startIndexWorldPos: new Vector2(0, 0)
|
|
4638
|
+
};
|
|
4639
|
+
if (this.gridSetupParams.forceFixCellRasterSize) {
|
|
4640
|
+
elementLocation.startIndexWorldPos = new Vector2(cellsStartColIndex * this.gridSetupParams.fixCellRasterWidth, cellsStartRowIndex * this.gridSetupParams.fixCellRasterHeight);
|
|
4641
|
+
} else {
|
|
4642
|
+
var distToOriginX = 0;
|
|
4643
|
+
for (var i = 0; i < cellsStartColIndex; i++) {
|
|
4644
|
+
distToOriginX += curGrid[i][0].width;
|
|
4645
|
+
}
|
|
4646
|
+
if (cellsStartColIndex < 0) {
|
|
4647
|
+
distToOriginX = -element.getWidth();
|
|
4648
|
+
}
|
|
4649
|
+
var distToOriginY = 0;
|
|
4650
|
+
for (var i = 0; i < cellsStartRowIndex; i++) {
|
|
4651
|
+
distToOriginY += curGrid[cellsStartColIndex][i].height;
|
|
4652
|
+
}
|
|
4653
|
+
elementLocation.startIndexWorldPos = new Vector2(distToOriginX, distToOriginY);
|
|
4654
|
+
}
|
|
4655
|
+
return elementLocation;
|
|
4656
|
+
}
|
|
4657
|
+
}, {
|
|
4658
|
+
key: "getPlannerInteractionInformation",
|
|
4659
|
+
value: function getPlannerInteractionInformation() {
|
|
4660
|
+
var allElements = this.getAllElementsInGridSortedbyGridPos();
|
|
4661
|
+
var plannerInteractionInfo = {
|
|
4662
|
+
boxPlannerInteractionInformationPerElement: new Map()
|
|
4663
|
+
};
|
|
4664
|
+
for (var i = 0; i < allElements.length; i++) {
|
|
4665
|
+
var element = allElements[i];
|
|
4666
|
+
var elementCells = this.getCellsInGridByElementId(element.getElementId());
|
|
4667
|
+
elementCells.backside ? this.backGrid : this.frontGrid;
|
|
4668
|
+
var elementLocation = this.createLocationInformation(element, elementCells.backside, elementCells.cells, elementCells.startColIndex, elementCells.startRowIndex, elementCells.colCount, elementCells.rowCount);
|
|
4669
|
+
var planningLeftLocation = this.getFreePlanningLocation(element.getElementId(), 'LEFT');
|
|
4670
|
+
var planningRighttLocation = this.getFreePlanningLocation(element.getElementId(), 'RIGHT');
|
|
4671
|
+
var planningTopLocation = this.getFreePlanningLocation(element.getElementId(), 'TOP');
|
|
4672
|
+
var hasTopElements = this.getElementHasTopElement(element.getElementId());
|
|
4673
|
+
var moveLocations = [];
|
|
4674
|
+
if (!hasTopElements && allElements.length > 1) {
|
|
4675
|
+
//Calculate positions where element can be moved.
|
|
4676
|
+
moveLocations = this.getFreeMoveLocation(element.getElementId());
|
|
4677
|
+
}
|
|
4678
|
+
var plannerInteractionInfoElement = {
|
|
4679
|
+
location: elementLocation,
|
|
4680
|
+
isDeletable: !hasTopElements && allElements.length > 1,
|
|
4681
|
+
availablePlanningLocations: {
|
|
4682
|
+
availableBoxPlannerCellsLeft: planningLeftLocation,
|
|
4683
|
+
availableBoxPlannerCellsTop: planningTopLocation,
|
|
4684
|
+
availableBoxPlannerCellsRight: planningRighttLocation
|
|
4685
|
+
},
|
|
4686
|
+
availableMovingLocations: moveLocations
|
|
4687
|
+
};
|
|
4688
|
+
plannerInteractionInfo.boxPlannerInteractionInformationPerElement.set(element.getElementId(), plannerInteractionInfoElement);
|
|
4689
|
+
}
|
|
4690
|
+
return plannerInteractionInfo;
|
|
4691
|
+
}
|
|
3877
4692
|
}]);
|
|
3878
4693
|
}();
|
|
3879
4694
|
|
|
@@ -3890,7 +4705,13 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
3890
4705
|
this.set = set;
|
|
3891
4706
|
this.plannerID = plannerId;
|
|
3892
4707
|
this.constructionRulesHandler = new ConstructionRulesHandler(this.set.getValueOfOptionOfArticle, this.set.checkArticleHasOption, this.set.updateCfgValuesByPlanner);
|
|
3893
|
-
|
|
4708
|
+
var gridSetupParams = {
|
|
4709
|
+
hasMaxGridRasterHeight: false,
|
|
4710
|
+
hasMaxGridRasterWidth: false,
|
|
4711
|
+
forceSingleCellPerElement: true,
|
|
4712
|
+
forceFixCellRasterSize: false
|
|
4713
|
+
};
|
|
4714
|
+
this.boxPlannerGrid = new BoxPlannerGrid(gridSetupParams, this.set.getValueOfOptionOfArticle);
|
|
3894
4715
|
}
|
|
3895
4716
|
return _createClass(DivaBoxPlanner, [{
|
|
3896
4717
|
key: "initPlanner",
|
|
@@ -3994,7 +4815,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
3994
4815
|
for (var i = 0; i < allElementIds.length; i++) {
|
|
3995
4816
|
var plannerElement = this.boxPlannerGrid.getElementById(allElementIds[i]);
|
|
3996
4817
|
if (!plannerElement) continue;
|
|
3997
|
-
var posInGrid = this.boxPlannerGrid.
|
|
4818
|
+
var posInGrid = this.boxPlannerGrid.getCellsInGridByElementId(allElementIds[i]);
|
|
3998
4819
|
var dockingDPs = plannerElement.getDockingDockingPoints();
|
|
3999
4820
|
var dpArr = [];
|
|
4000
4821
|
for (var j = 0; j < dockingDPs.length; j++) {
|
|
@@ -4021,8 +4842,8 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4021
4842
|
depth: plannerElement.Depth ? plannerElement.Depth : -1,
|
|
4022
4843
|
DP: dpArr,
|
|
4023
4844
|
boxPlannerInfo: {
|
|
4024
|
-
gridPosCol: posInGrid.
|
|
4025
|
-
gridPosRow: posInGrid.
|
|
4845
|
+
gridPosCol: posInGrid.startColIndex,
|
|
4846
|
+
gridPosRow: posInGrid.startRowIndex,
|
|
4026
4847
|
isOnBackside: posInGrid.backside
|
|
4027
4848
|
}
|
|
4028
4849
|
};
|
|
@@ -4123,7 +4944,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4123
4944
|
value: (function () {
|
|
4124
4945
|
var _copyPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(articleCopyRelation, copyInfo) {
|
|
4125
4946
|
var _this = this;
|
|
4126
|
-
var gridIsPrepared, plannerElementsToLoadSVG, that, copyType, i, allDPs, j;
|
|
4947
|
+
var gridIsPrepared, plannerElementsToLoadSVG, that, copyType, i, cellPos, allDPs, j;
|
|
4127
4948
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
4128
4949
|
while (1) switch (_context4.prev = _context4.next) {
|
|
4129
4950
|
case 0:
|
|
@@ -4145,7 +4966,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4145
4966
|
var _copyInfo$targetEleme;
|
|
4146
4967
|
if (!gridIsPrepared) {
|
|
4147
4968
|
if (copyInfo && (copyInfo.dpType == 'AVL' || copyInfo.dpType == 'AVR')) {
|
|
4148
|
-
_this.boxPlannerGrid.
|
|
4969
|
+
_this.boxPlannerGrid.prepareGridForColCopy(elementToCopyId, copyInfo.dpType);
|
|
4149
4970
|
} else if (copyInfo && copyInfo.copyType && copyInfo.copyType == 'BoxPlanner_backside') {
|
|
4150
4971
|
if (!_this.boxPlannerGrid.getPlannerHasActiveBackside()) _this.boxPlannerGrid.prepareGridForBackSideCopy();
|
|
4151
4972
|
}
|
|
@@ -4175,7 +4996,8 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4175
4996
|
//Check if we have to prevent to build even higher in this col
|
|
4176
4997
|
if (copyType == 'AVO' && this.constructionRulesHandler.getHasMaxElemCountPerColumn()) {
|
|
4177
4998
|
//The max height of col is reached
|
|
4178
|
-
|
|
4999
|
+
cellPos = this.boxPlannerGrid.getCellsInGridByElementId(plannerElementsToLoadSVG[i].ElementId);
|
|
5000
|
+
if (cellPos.endRowIndex + 1 == that.constructionRulesHandler.getMaxElemCountPerColumn()) {
|
|
4179
5001
|
allDPs = plannerElementsToLoadSVG[i].getFreeDockingPointsByType('AVO');
|
|
4180
5002
|
for (j = 0; j < allDPs.length; j++) {
|
|
4181
5003
|
allDPs[j].disableDP(true);
|
|
@@ -4214,15 +5036,27 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4214
5036
|
*/
|
|
4215
5037
|
}, {
|
|
4216
5038
|
key: "getPlannerElementsInfluencedByDeletion",
|
|
4217
|
-
value: function getPlannerElementsInfluencedByDeletion(elementId) {
|
|
5039
|
+
value: function getPlannerElementsInfluencedByDeletion(elementId, deletionType) {
|
|
4218
5040
|
if (this.constructionRulesHandler.getForceWholePlanningSameHeight()) {
|
|
4219
|
-
var
|
|
4220
|
-
if (
|
|
5041
|
+
var cellPos = this.boxPlannerGrid.getCellsInGridByElementId(elementId);
|
|
5042
|
+
if (cellPos.startRowIndex == 0) return []; //In the base row only delete the actual element, not the whole row
|
|
4221
5043
|
var result = this.boxPlannerGrid.getAllElementsInSameRowByElementId(elementId);
|
|
4222
5044
|
return result.elementIds.filter(function (eId) {
|
|
4223
5045
|
return eId != elementId;
|
|
4224
5046
|
});
|
|
4225
5047
|
} else {
|
|
5048
|
+
if (this.boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
5049
|
+
if (deletionType == 'BoxPlanner_backside') {
|
|
5050
|
+
return this.boxPlannerGrid.getAllElementsInBackGrid().map(function (element) {
|
|
5051
|
+
return element.ElementId;
|
|
5052
|
+
}).filter(function (eId) {
|
|
5053
|
+
return eId != elementId;
|
|
5054
|
+
});
|
|
5055
|
+
} else {
|
|
5056
|
+
var opposideElement = this.boxPlannerGrid.getOppositeElement(elementId);
|
|
5057
|
+
if (opposideElement) return [opposideElement.getElementId()];
|
|
5058
|
+
}
|
|
5059
|
+
}
|
|
4226
5060
|
return [];
|
|
4227
5061
|
}
|
|
4228
5062
|
}
|
|
@@ -4242,8 +5076,8 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4242
5076
|
return this.boxPlannerGrid.getAllElementIdsInGrid();
|
|
4243
5077
|
} else if (copyInfo && copyInfo.copyType == 'BoxPlanner_COL') {
|
|
4244
5078
|
//Copy all col
|
|
4245
|
-
var
|
|
4246
|
-
var allElementsInCol = this.boxPlannerGrid.getAllElementsInColumn(
|
|
5079
|
+
var cellPos = this.boxPlannerGrid.getCellsInGridByElementId(elementId);
|
|
5080
|
+
var allElementsInCol = this.boxPlannerGrid.getAllElementsInColumn(cellPos.startColIndex, cellPos.backside);
|
|
4247
5081
|
for (var i = 0; i < allElementsInCol.length; i++) {
|
|
4248
5082
|
allElementsToCopy.push(allElementsInCol[i].getElementId());
|
|
4249
5083
|
}
|
|
@@ -4272,11 +5106,14 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4272
5106
|
}
|
|
4273
5107
|
}
|
|
4274
5108
|
if (this.boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
4275
|
-
allElementsToCopy = allElementsToCopy.concat(this.boxPlannerGrid.
|
|
5109
|
+
allElementsToCopy = allElementsToCopy.concat(this.boxPlannerGrid.getOppositeElements(allElementsToCopy).map(function (element) {
|
|
5110
|
+
return element.ElementId;
|
|
5111
|
+
}));
|
|
4276
5112
|
}
|
|
4277
5113
|
}
|
|
4278
5114
|
}
|
|
4279
|
-
|
|
5115
|
+
//remove duplicate
|
|
5116
|
+
return Array.from(new Set(allElementsToCopy));
|
|
4280
5117
|
}
|
|
4281
5118
|
|
|
4282
5119
|
/**
|
|
@@ -4290,26 +5127,24 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4290
5127
|
key: "deletePlannerElement",
|
|
4291
5128
|
value: (function () {
|
|
4292
5129
|
var _deletePlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(elementId, autoCorrectAVL_AVR, deletionType) {
|
|
4293
|
-
var
|
|
5130
|
+
var cellPos, newSelectedPos, doUpdateWholeLogic, _this$boxPlannerGrid$;
|
|
4294
5131
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
4295
5132
|
while (1) switch (_context5.prev = _context5.next) {
|
|
4296
5133
|
case 0:
|
|
4297
|
-
|
|
5134
|
+
//TODO ÜBERLEGEN WIE MAN DAS JETZT RICHTET: BESSER WÄRE ES MAN GIBT DAS NÄCHSTE ZU SELECTIERENDE ELEMENT ID ZURÜCK
|
|
5135
|
+
//var pos = this.boxPlannerGrid.getIndexInGridByElementId(elementId);
|
|
5136
|
+
cellPos = this.boxPlannerGrid.getCellsInGridByElementId(elementId);
|
|
4298
5137
|
newSelectedPos = {
|
|
4299
|
-
row:
|
|
4300
|
-
col:
|
|
4301
|
-
backside:
|
|
5138
|
+
row: cellPos.startRowIndex,
|
|
5139
|
+
col: cellPos.startColIndex,
|
|
5140
|
+
backside: false
|
|
4302
5141
|
};
|
|
4303
5142
|
if (!deletionType || deletionType != 'BoxPlanner_backside') {
|
|
4304
|
-
if (
|
|
5143
|
+
if (cellPos.startRowIndex > 0) {
|
|
4305
5144
|
newSelectedPos.row--;
|
|
4306
5145
|
} else {
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
if (allElements && allElements.length > 0) {
|
|
4310
|
-
newSelectedPos.col = newSelectedCol;
|
|
4311
|
-
newSelectedPos.row = allElements.length - 1;
|
|
4312
|
-
}
|
|
5146
|
+
newSelectedPos.col = cellPos.startColIndex == 0 ? 0 : cellPos.startColIndex - 1;
|
|
5147
|
+
newSelectedPos.row = this.boxPlannerGrid.getRowCount(newSelectedPos.col, cellPos.backside) - 1;
|
|
4313
5148
|
}
|
|
4314
5149
|
} else {
|
|
4315
5150
|
newSelectedPos = {
|
|
@@ -4318,18 +5153,14 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4318
5153
|
backside: false
|
|
4319
5154
|
};
|
|
4320
5155
|
}
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
this.constructionRulesHandler.onElemDeleted(allElementsToDelete[i]);
|
|
4324
|
-
}
|
|
5156
|
+
this.boxPlannerGrid.deleteElement(elementId, deletionType);
|
|
5157
|
+
this.constructionRulesHandler.onElemDeleted(elementId);
|
|
4325
5158
|
doUpdateWholeLogic = true;
|
|
4326
|
-
if (deletionType
|
|
4327
|
-
if (
|
|
5159
|
+
if (deletionType) {
|
|
5160
|
+
if (deletionType == 'BoxPlanner_backside') {
|
|
4328
5161
|
this.boxPlannerGrid.destroyBacksideModuleGrid();
|
|
4329
5162
|
doUpdateWholeLogic = true;
|
|
4330
|
-
} else
|
|
4331
|
-
doUpdateWholeLogic = false;
|
|
4332
|
-
}
|
|
5163
|
+
} else if (deletionType == 'STD_DONTUPDATE') doUpdateWholeLogic = false;
|
|
4333
5164
|
}
|
|
4334
5165
|
if (!doUpdateWholeLogic) {
|
|
4335
5166
|
_context5.next = 11;
|
|
@@ -4366,7 +5197,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4366
5197
|
}, {
|
|
4367
5198
|
key: "getAllViewPlannerElements",
|
|
4368
5199
|
value: function getAllViewPlannerElements() {
|
|
4369
|
-
return this.boxPlannerGrid.
|
|
5200
|
+
return this.boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
4370
5201
|
}
|
|
4371
5202
|
}, {
|
|
4372
5203
|
key: "getNeighborElements",
|
|
@@ -4435,7 +5266,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4435
5266
|
key: "updatePlanner",
|
|
4436
5267
|
value: (function () {
|
|
4437
5268
|
var _updatePlanner = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(changedOPT, targetElements) {
|
|
4438
|
-
var message,
|
|
5269
|
+
var message, cellPos, elemToCheck, copyDir, allElementsToCopy, _allElementsToCopy, allElementsInBackGrid, _allElementsInBackGrid, _message;
|
|
4439
5270
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
4440
5271
|
while (1) switch (_context6.prev = _context6.next) {
|
|
4441
5272
|
case 0:
|
|
@@ -4457,19 +5288,21 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4457
5288
|
break;
|
|
4458
5289
|
}
|
|
4459
5290
|
return _context6.abrupt("return", {
|
|
5291
|
+
doDeleteBackGrid: false,
|
|
4460
5292
|
elemIdsToDelete: [],
|
|
4461
5293
|
viewMessageCodex: message
|
|
4462
5294
|
});
|
|
4463
5295
|
case 8:
|
|
4464
5296
|
return _context6.abrupt("return", {
|
|
5297
|
+
doDeleteBackGrid: false,
|
|
4465
5298
|
elemIdsToDelete: []
|
|
4466
5299
|
});
|
|
4467
5300
|
case 9:
|
|
4468
5301
|
//If the most bottom element has no neighbor right or left - copy element
|
|
4469
|
-
|
|
5302
|
+
cellPos = this.boxPlannerGrid.getCellsInGridByElementId(targetElements[0]);
|
|
4470
5303
|
elemToCheck = targetElements[0];
|
|
4471
|
-
if (
|
|
4472
|
-
elemToCheck = this.boxPlannerGrid.getPlannerElementAtGridPos(
|
|
5304
|
+
if (cellPos.startRowIndex > 0) {
|
|
5305
|
+
elemToCheck = this.boxPlannerGrid.getPlannerElementAtGridPos(cellPos.startColIndex, 0, false).getElementId();
|
|
4473
5306
|
}
|
|
4474
5307
|
if (!(!this.boxPlannerGrid.getElementHasLeftElement(elemToCheck) || !this.boxPlannerGrid.getElementHasRightElement(elemToCheck))) {
|
|
4475
5308
|
_context6.next = 18;
|
|
@@ -4490,6 +5323,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4490
5323
|
copyType: 'BoxPlanner_COL'
|
|
4491
5324
|
});
|
|
4492
5325
|
return _context6.abrupt("return", {
|
|
5326
|
+
doDeleteBackGrid: false,
|
|
4493
5327
|
elemIdsToDelete: [],
|
|
4494
5328
|
elementIdToCopy: allElementsToCopy,
|
|
4495
5329
|
copyDPType: copyDir,
|
|
@@ -4500,11 +5334,11 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4500
5334
|
});
|
|
4501
5335
|
case 18:
|
|
4502
5336
|
if (!(changedOPT && changedOPT['OPTDMOD'])) {
|
|
4503
|
-
_context6.next =
|
|
5337
|
+
_context6.next = 33;
|
|
4504
5338
|
break;
|
|
4505
5339
|
}
|
|
4506
5340
|
_context6.t0 = changedOPT['OPTDMOD'];
|
|
4507
|
-
_context6.next = _context6.t0 === 'OPVD_EIN' ? 22 : _context6.t0 === 'OPVD_AUS' ? 26 :
|
|
5341
|
+
_context6.next = _context6.t0 === 'OPVD_EIN' ? 22 : _context6.t0 === 'OPVD_AUS' ? 26 : 31;
|
|
4508
5342
|
break;
|
|
4509
5343
|
case 22:
|
|
4510
5344
|
if (this.boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
@@ -4516,65 +5350,86 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4516
5350
|
copyType: 'BoxPlanner_backside'
|
|
4517
5351
|
});
|
|
4518
5352
|
return _context6.abrupt("return", {
|
|
5353
|
+
doDeleteBackGrid: false,
|
|
4519
5354
|
elemIdsToDelete: [],
|
|
4520
5355
|
elementIdToCopy: _allElementsToCopy,
|
|
4521
5356
|
copyType: 'BoxPlanner_backside',
|
|
4522
5357
|
changedOPT: changedOPT
|
|
4523
5358
|
});
|
|
4524
5359
|
case 25:
|
|
4525
|
-
return _context6.abrupt("break",
|
|
5360
|
+
return _context6.abrupt("break", 31);
|
|
4526
5361
|
case 26:
|
|
4527
5362
|
if (!this.boxPlannerGrid.getPlannerHasActiveBackside()) {
|
|
4528
|
-
_context6.next =
|
|
5363
|
+
_context6.next = 30;
|
|
5364
|
+
break;
|
|
5365
|
+
}
|
|
5366
|
+
allElementsInBackGrid = this.boxPlannerGrid.getAllElementsInBackGrid();
|
|
5367
|
+
if (!(allElementsInBackGrid.length > 0)) {
|
|
5368
|
+
_context6.next = 30;
|
|
4529
5369
|
break;
|
|
4530
5370
|
}
|
|
4531
|
-
allElementsToDelete = this.boxPlannerGrid.getAllElementsInBacksideModuleGrid();
|
|
4532
5371
|
return _context6.abrupt("return", {
|
|
4533
|
-
|
|
5372
|
+
doDeleteBackGrid: true,
|
|
5373
|
+
elemIdsToDelete: allElementsInBackGrid.map(function (element) {
|
|
5374
|
+
return element.ElementId;
|
|
5375
|
+
}),
|
|
4534
5376
|
deletionType: 'BoxPlanner_backside',
|
|
4535
5377
|
changedOPT: changedOPT
|
|
4536
5378
|
});
|
|
4537
|
-
case 29:
|
|
4538
|
-
return _context6.abrupt("break", 30);
|
|
4539
5379
|
case 30:
|
|
4540
|
-
_context6.
|
|
5380
|
+
return _context6.abrupt("break", 31);
|
|
5381
|
+
case 31:
|
|
5382
|
+
_context6.next = 47;
|
|
4541
5383
|
break;
|
|
4542
|
-
case
|
|
5384
|
+
case 33:
|
|
4543
5385
|
if (!(changedOPT && changedOPT['OPTFARBE_RAHMEN'] && changedOPT['OPTFARBE_RAHMEN'] == 'OPVSCHWARZ_MATT' && this.boxPlannerGrid.getPlannerHasActiveBackside())) {
|
|
4544
|
-
_context6.next =
|
|
5386
|
+
_context6.next = 39;
|
|
4545
5387
|
break;
|
|
4546
5388
|
}
|
|
4547
5389
|
//If the double modul is active but the color is changed to black - disable double modul
|
|
4548
|
-
|
|
5390
|
+
_allElementsInBackGrid = this.boxPlannerGrid.getAllElementsInBackGrid();
|
|
5391
|
+
if (!(_allElementsInBackGrid.length > 0)) {
|
|
5392
|
+
_context6.next = 37;
|
|
5393
|
+
break;
|
|
5394
|
+
}
|
|
4549
5395
|
return _context6.abrupt("return", {
|
|
4550
|
-
|
|
5396
|
+
doDeleteBackGrid: true,
|
|
5397
|
+
elemIdsToDelete: _allElementsInBackGrid.map(function (element) {
|
|
5398
|
+
return element.ElementId;
|
|
5399
|
+
}),
|
|
4551
5400
|
deletionType: 'BoxPlanner_backside',
|
|
4552
5401
|
changedOPT: changedOPT,
|
|
4553
5402
|
targetElements: targetElements,
|
|
4554
5403
|
viewMessageCodex: 'BOXPLAN_BLACKFRAME_INCOMPATIBLE_ELEMENT_WARNING'
|
|
4555
5404
|
});
|
|
4556
5405
|
case 37:
|
|
4557
|
-
_context6.next =
|
|
4558
|
-
|
|
5406
|
+
_context6.next = 47;
|
|
5407
|
+
break;
|
|
4559
5408
|
case 39:
|
|
5409
|
+
_context6.next = 41;
|
|
5410
|
+
return this.constructionRulesHandler.updateOptionLogicBoxPlanner(this.boxPlannerGrid, changedOPT, targetElements);
|
|
5411
|
+
case 41:
|
|
4560
5412
|
_message = _context6.sent;
|
|
4561
5413
|
if (!_message) {
|
|
4562
|
-
_context6.next =
|
|
5414
|
+
_context6.next = 46;
|
|
4563
5415
|
break;
|
|
4564
5416
|
}
|
|
4565
5417
|
return _context6.abrupt("return", {
|
|
5418
|
+
doDeleteBackGrid: false,
|
|
4566
5419
|
elemIdsToDelete: [],
|
|
4567
5420
|
viewMessageCodex: _message
|
|
4568
5421
|
});
|
|
4569
|
-
case
|
|
5422
|
+
case 46:
|
|
4570
5423
|
return _context6.abrupt("return", {
|
|
5424
|
+
doDeleteBackGrid: false,
|
|
4571
5425
|
elemIdsToDelete: []
|
|
4572
5426
|
});
|
|
4573
|
-
case
|
|
5427
|
+
case 47:
|
|
4574
5428
|
return _context6.abrupt("return", {
|
|
5429
|
+
doDeleteBackGrid: false,
|
|
4575
5430
|
elemIdsToDelete: []
|
|
4576
5431
|
});
|
|
4577
|
-
case
|
|
5432
|
+
case 48:
|
|
4578
5433
|
case "end":
|
|
4579
5434
|
return _context6.stop();
|
|
4580
5435
|
}
|
|
@@ -4604,7 +5459,7 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4604
5459
|
Cat: this.set.getCatalogCodex(),
|
|
4605
5460
|
ShowDim: doShow3DDimensionLines
|
|
4606
5461
|
};
|
|
4607
|
-
var allPlannerElemnts = this.boxPlannerGrid.
|
|
5462
|
+
var allPlannerElemnts = this.boxPlannerGrid.getAllElementsInGridSortedbyGridPos();
|
|
4608
5463
|
for (var i = 0; i < allPlannerElemnts.length; i++) {
|
|
4609
5464
|
var elem = allPlannerElemnts[i];
|
|
4610
5465
|
var elemId = elem.ElementId;
|
|
@@ -4701,6 +5556,11 @@ var DivaBoxPlanner = /*#__PURE__*/function () {
|
|
|
4701
5556
|
clone.initPlanner(setData);
|
|
4702
5557
|
return clone;
|
|
4703
5558
|
}
|
|
5559
|
+
}, {
|
|
5560
|
+
key: "getPlannerInteractionInformation",
|
|
5561
|
+
value: function getPlannerInteractionInformation() {
|
|
5562
|
+
return this.boxPlannerGrid.getPlannerInteractionInformation();
|
|
5563
|
+
}
|
|
4704
5564
|
}]);
|
|
4705
5565
|
}();
|
|
4706
5566
|
_defineProperty(DivaBoxPlanner, "plannerType", 'BOX');
|