ato-water-lib 0.0.53 → 0.0.54
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2020/lib/constants/components-group-const.mjs +71 -1
- package/esm2020/lib/models/default-gojs-editor.model.mjs +401 -72
- package/fesm2015/ato-water-lib.mjs +455 -65
- package/fesm2015/ato-water-lib.mjs.map +1 -1
- package/fesm2020/ato-water-lib.mjs +469 -70
- package/fesm2020/ato-water-lib.mjs.map +1 -1
- package/package.json +1 -1
@@ -3366,13 +3366,15 @@ class AtoDefaultGojsEditor {
|
|
3366
3366
|
// Remove Node and Node Group
|
3367
3367
|
_.forEach((_b = this.myDiagram.nodeTemplateMap) === null || _b === void 0 ? void 0 : _b.Hb, (temp) => {
|
3368
3368
|
var _a, _b;
|
3369
|
-
if ((temp === null || temp === void 0 ? void 0 : temp.key) &&
|
3369
|
+
if ((temp === null || temp === void 0 ? void 0 : temp.key) &&
|
3370
|
+
!((_b = (_a = this.editor.data) === null || _a === void 0 ? void 0 : _a.nodeDataArray) === null || _b === void 0 ? void 0 : _b.some((node) => (node === null || node === void 0 ? void 0 : node.type) === (temp === null || temp === void 0 ? void 0 : temp.key)))) {
|
3370
3371
|
this.myDiagram.nodeTemplateMap.remove(temp === null || temp === void 0 ? void 0 : temp.key);
|
3371
3372
|
}
|
3372
3373
|
});
|
3373
3374
|
_.forEach((_c = this.myDiagram.groupTemplateMap) === null || _c === void 0 ? void 0 : _c.Hb, (temp) => {
|
3374
3375
|
var _a, _b;
|
3375
|
-
if ((temp === null || temp === void 0 ? void 0 : temp.key) &&
|
3376
|
+
if ((temp === null || temp === void 0 ? void 0 : temp.key) &&
|
3377
|
+
!((_b = (_a = this.editor.data) === null || _a === void 0 ? void 0 : _a.nodeDataArray) === null || _b === void 0 ? void 0 : _b.some((node) => (node === null || node === void 0 ? void 0 : node.type) === (temp === null || temp === void 0 ? void 0 : temp.key)))) {
|
3376
3378
|
this.myDiagram.groupTemplateMap.remove(temp === null || temp === void 0 ? void 0 : temp.key);
|
3377
3379
|
}
|
3378
3380
|
});
|
@@ -3403,7 +3405,8 @@ class AtoDefaultGojsEditor {
|
|
3403
3405
|
this.makeGroupZoneTemplate();
|
3404
3406
|
return;
|
3405
3407
|
}
|
3406
|
-
if ((node === null || node === void 0 ? void 0 : node.type) === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL &&
|
3408
|
+
if ((node === null || node === void 0 ? void 0 : node.type) === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL &&
|
3409
|
+
(node === null || node === void 0 ? void 0 : node.isGroup)) {
|
3407
3410
|
this.groupPlantCellTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node === null || node === void 0 ? void 0 : node.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node === null || node === void 0 ? void 0 : node.type].name);
|
3408
3411
|
return;
|
3409
3412
|
}
|
@@ -3428,11 +3431,13 @@ class AtoDefaultGojsEditor {
|
|
3428
3431
|
}
|
3429
3432
|
// Not Group
|
3430
3433
|
// Component Water Normal
|
3431
|
-
if (((_b = AtoGojsEditorModel.TYPE_TEMPLATE_WATER_NORMAL) === null || _b === void 0 ? void 0 : _b.includes(node === null || node === void 0 ? void 0 : node.type)) &&
|
3434
|
+
if (((_b = AtoGojsEditorModel.TYPE_TEMPLATE_WATER_NORMAL) === null || _b === void 0 ? void 0 : _b.includes(node === null || node === void 0 ? void 0 : node.type)) &&
|
3435
|
+
!(node === null || node === void 0 ? void 0 : node.isGroup)) {
|
3432
3436
|
this.makeEntityTemplate((_c = AtoGojsEditorModel.NODE_TEMPLATES[node === null || node === void 0 ? void 0 : node.type].icon) !== null && _c !== void 0 ? _c : '', (_d = AtoGojsEditorModel.NODE_TEMPLATES[node === null || node === void 0 ? void 0 : node.type].name) !== null && _d !== void 0 ? _d : '');
|
3433
3437
|
}
|
3434
3438
|
// Component Water Withdraw Or Discharge
|
3435
|
-
if (((_e = AtoGojsEditorModel.TYPE_TEMPLATE_WATER_WITHDRAW_OR_DISCHARGE) === null || _e === void 0 ? void 0 : _e.includes(node === null || node === void 0 ? void 0 : node.type)) &&
|
3439
|
+
if (((_e = AtoGojsEditorModel.TYPE_TEMPLATE_WATER_WITHDRAW_OR_DISCHARGE) === null || _e === void 0 ? void 0 : _e.includes(node === null || node === void 0 ? void 0 : node.type)) &&
|
3440
|
+
!(node === null || node === void 0 ? void 0 : node.isGroup)) {
|
3436
3441
|
this.makeEntityWithdrawOrDischarge((_f = AtoGojsEditorModel.NODE_TEMPLATES[node === null || node === void 0 ? void 0 : node.type].icon) !== null && _f !== void 0 ? _f : '', (_g = AtoGojsEditorModel.NODE_TEMPLATES[node === null || node === void 0 ? void 0 : node.type].name) !== null && _g !== void 0 ? _g : '');
|
3437
3442
|
}
|
3438
3443
|
// Component Energy Normal
|
@@ -3485,7 +3490,8 @@ class AtoDefaultGojsEditor {
|
|
3485
3490
|
this.makeSpecialTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node === null || node === void 0 ? void 0 : node.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node === null || node === void 0 ? void 0 : node.type].name);
|
3486
3491
|
}
|
3487
3492
|
// Plant Cell
|
3488
|
-
if ((node === null || node === void 0 ? void 0 : node.type) === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL &&
|
3493
|
+
if ((node === null || node === void 0 ? void 0 : node.type) === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL &&
|
3494
|
+
!(node === null || node === void 0 ? void 0 : node.isGroup)) {
|
3489
3495
|
this.plantCellTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node === null || node === void 0 ? void 0 : node.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node === null || node === void 0 ? void 0 : node.type].name);
|
3490
3496
|
}
|
3491
3497
|
}
|
@@ -3514,7 +3520,8 @@ class AtoDefaultGojsEditor {
|
|
3514
3520
|
this.myDiagram.dragSelectingTool = (_m = this.initialOptions) === null || _m === void 0 ? void 0 : _m.dragSelectingTool;
|
3515
3521
|
this.myDiagram.toolManager.draggingTool.isGridSnapEnabled =
|
3516
3522
|
(_p = (_o = this.initialOptions) === null || _o === void 0 ? void 0 : _o['draggingTool.isGridSnapEnabled']) !== null && _p !== void 0 ? _p : false;
|
3517
|
-
if (this.myDiagram.toolManager &&
|
3523
|
+
if (this.myDiagram.toolManager &&
|
3524
|
+
this.myDiagram.toolManager.draggingTool) {
|
3518
3525
|
if ((_q = this.initialOptions) === null || _q === void 0 ? void 0 : _q['draggingTool.gridSnapCellSize']) {
|
3519
3526
|
this.myDiagram.toolManager.draggingTool.gridSnapCellSize =
|
3520
3527
|
(_r = this.initialOptions) === null || _r === void 0 ? void 0 : _r['draggingTool.gridSnapCellSize'];
|
@@ -3532,7 +3539,8 @@ class AtoDefaultGojsEditor {
|
|
3532
3539
|
(_v = this.initialOptions) === null || _v === void 0 ? void 0 : _v['linkingTool.linkValidation'];
|
3533
3540
|
}
|
3534
3541
|
}
|
3535
|
-
this.myDiagram.contentAlignment =
|
3542
|
+
this.myDiagram.contentAlignment =
|
3543
|
+
(_x = (_w = this.initialOptions) === null || _w === void 0 ? void 0 : _w.contentAlignment) !== null && _x !== void 0 ? _x : go.Spot.Center;
|
3536
3544
|
this.myDiagram.layout = (_y = this.initialOptions) === null || _y === void 0 ? void 0 : _y.layout;
|
3537
3545
|
// this.myDiagram.minViewportBounds = new go.Rect(0, 0, 1200, 1200);
|
3538
3546
|
if (!!((_z = this.editor) === null || _z === void 0 ? void 0 : _z.data)) {
|
@@ -3557,7 +3565,8 @@ class AtoDefaultGojsEditor {
|
|
3557
3565
|
this.isAddedModelChangedListeners = true;
|
3558
3566
|
this.myDiagram.addModelChangedListener(function (e) {
|
3559
3567
|
var _a;
|
3560
|
-
if (e.change === go.ChangedEvent.Remove &&
|
3568
|
+
if (e.change === go.ChangedEvent.Remove &&
|
3569
|
+
e.propertyName === 'nodeDataArray') {
|
3561
3570
|
const data = e.oldValue;
|
3562
3571
|
self.onDeleteNode.emit(data);
|
3563
3572
|
}
|
@@ -3784,7 +3793,12 @@ class AtoDefaultGojsEditor {
|
|
3784
3793
|
}
|
3785
3794
|
initSolarDiagram() {
|
3786
3795
|
const { SOLAR_POWER, POWER_CONDITIONING_UNIT, BATTERIES: BATTERY, INVERTERS: INVERTER, } = AtoGojsEditorModel.ENUM_TEMPLATES;
|
3787
|
-
const ListItemsCreateEntityTemplate = [
|
3796
|
+
const ListItemsCreateEntityTemplate = [
|
3797
|
+
SOLAR_POWER,
|
3798
|
+
POWER_CONDITIONING_UNIT,
|
3799
|
+
BATTERY,
|
3800
|
+
INVERTER,
|
3801
|
+
];
|
3788
3802
|
ListItemsCreateEntityTemplate.map((e) => {
|
3789
3803
|
if (!!AtoGojsEditorModel.NODE_TEMPLATES[e]) {
|
3790
3804
|
this.makeEntityTemplateEnergy(AtoGojsEditorModel.NODE_TEMPLATES[e].icon, AtoGojsEditorModel.NODE_TEMPLATES[e].name);
|
@@ -3862,7 +3876,11 @@ class AtoDefaultGojsEditor {
|
|
3862
3876
|
toolTip: this.$('ToolTip', this.$(go.TextBlock, {
|
3863
3877
|
margin: 4,
|
3864
3878
|
}, new go.Binding('text', 'textComponent'))),
|
3865
|
-
}, new go.Binding('text', 'textComponent'), new go.Binding('background', 'textComponent', (x) =>
|
3879
|
+
}, new go.Binding('text', 'textComponent'), new go.Binding('background', 'textComponent', (x) => x ? 'white' : 'transparent')
|
3880
|
+
// new go.Binding('margin', 'isFormat', (x) =>
|
3881
|
+
// x ? new go.Margin(5, 0, 5, 5) : new go.Margin(5, 5, 5, 5),
|
3882
|
+
// ),
|
3883
|
+
)));
|
3866
3884
|
// arrow
|
3867
3885
|
elements.push(this.$(go.Shape, Object.assign({}, (_c = AtoGojsEditorModel.LINK_TEMPLATES[AtoGojsEditorModel.ENUM_LINK_TYPES.SIMPLE]) === null || _c === void 0 ? void 0 : _c.arrow), new go.Binding('visible', 'type', (x) => ![
|
3868
3886
|
AtoGojsEditorModel.ENUM_LINK_TYPES.PIPE_ANIMATION,
|
@@ -3883,7 +3901,7 @@ class AtoDefaultGojsEditor {
|
|
3883
3901
|
toShortLength: AtoGojsEditorModel.LINK_TEMPLATES[AtoGojsEditorModel.ENUM_LINK_TYPES.SIMPLE].toShortLength, // assume arrowhead at "to" end, need to avoid bad appearance when path is thick
|
3884
3902
|
}, new go.Binding('layerName', '', (data) => {
|
3885
3903
|
return (data === null || data === void 0 ? void 0 : data.textComponent) ? 'Background' : '';
|
3886
|
-
}), new go.Binding('zOrder', 'type', (x) =>
|
3904
|
+
}), new go.Binding('zOrder', 'type', (x) => x === AtoGojsEditorModel.ENUM_LINK_TYPES.PIPE_ANIMATION ? 11 : 10), new go.Binding('toShortLength', 'type', (x) => AtoGojsEditorModel.LINK_TEMPLATES[x].toShortLength || 0), new go.Binding('selectable', 'selectable'), new go.Binding('visible', 'visible'),
|
3887
3905
|
// make sure links come in from the proper direction and go out appropriately
|
3888
3906
|
...elements);
|
3889
3907
|
}
|
@@ -3964,7 +3982,10 @@ class AtoDefaultGojsEditor {
|
|
3964
3982
|
}, new go.Binding('stroke', 'color'), new go.Binding('text', 'name'), new go.Binding('visible', 'visible')))));
|
3965
3983
|
this.myDiagram.nodeTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL, node);
|
3966
3984
|
}
|
3967
|
-
makeTextTemplate(size = {
|
3985
|
+
makeTextTemplate(size = {
|
3986
|
+
w: AtoGojsEditorModel.GRID_SIZE * 5,
|
3987
|
+
h: AtoGojsEditorModel.GRID_SIZE * 2,
|
3988
|
+
}) {
|
3968
3989
|
const self = this;
|
3969
3990
|
const contextMenu = this.$(go.Adornment, 'Vertical', this.$('ContextMenuButton', this.$(go.TextBlock, 'Option 1'), {
|
3970
3991
|
click: function (e, obj) {
|
@@ -3974,7 +3995,9 @@ class AtoDefaultGojsEditor {
|
|
3974
3995
|
click: function (e, obj) {
|
3975
3996
|
alert('Option 2 clicked!');
|
3976
3997
|
},
|
3977
|
-
})
|
3998
|
+
})
|
3999
|
+
// ... add more options as needed ...
|
4000
|
+
);
|
3978
4001
|
const node = this.$(go.Node, 'Spot', {
|
3979
4002
|
// fromSpot: go.Spot.RightSide,
|
3980
4003
|
// toSpot: go.Spot.LeftSide,
|
@@ -4027,7 +4050,8 @@ class AtoDefaultGojsEditor {
|
|
4027
4050
|
doubleClick: (e, obj) => {
|
4028
4051
|
var _a, _b, _c, _d, _e;
|
4029
4052
|
const node = obj.part;
|
4030
|
-
if (((_a = node === null || node === void 0 ? void 0 : node.ob) === null || _a === void 0 ? void 0 : _a.isTypeInflowOfPlantCell) &&
|
4053
|
+
if (((_a = node === null || node === void 0 ? void 0 : node.ob) === null || _a === void 0 ? void 0 : _a.isTypeInflowOfPlantCell) &&
|
4054
|
+
!((_b = this._initialOptions) === null || _b === void 0 ? void 0 : _b.isReadOnly)) {
|
4031
4055
|
// obj?.data?.onSelected(node?.ob?.nodePlantCellParent);
|
4032
4056
|
// this.isShowNodeInfo
|
4033
4057
|
// ? self.onDoubleClickNode.emit({
|
@@ -4052,7 +4076,11 @@ class AtoDefaultGojsEditor {
|
|
4052
4076
|
},
|
4053
4077
|
selectionAdornmentTemplate: this.$(go.Adornment, 'Spot', this.$(go.Panel, 'Auto',
|
4054
4078
|
// { height: 62 },
|
4055
|
-
this.$(go.Shape, {
|
4079
|
+
this.$(go.Shape, {
|
4080
|
+
fill: null,
|
4081
|
+
stroke: 'dodgerblue',
|
4082
|
+
strokeWidth: 4,
|
4083
|
+
}), this.$(go.Placeholder,
|
4056
4084
|
// { padding: new go.Margin(8, 3, 0, 3) },
|
4057
4085
|
new go.Binding('padding', '', (x) => {
|
4058
4086
|
return (x === null || x === void 0 ? void 0 : x.isTypeInflowOfPlantCell)
|
@@ -4190,7 +4218,10 @@ class AtoDefaultGojsEditor {
|
|
4190
4218
|
}
|
4191
4219
|
return `${data === null || data === void 0 ? void 0 : data.shortenedNumber}${(data === null || data === void 0 ? void 0 : data.unitPrefixes) ? ' ' + (data === null || data === void 0 ? void 0 : data.unitPrefixes) : ''}`;
|
4192
4220
|
}
|
4193
|
-
makeDataBoxTemplate(size = {
|
4221
|
+
makeDataBoxTemplate(size = {
|
4222
|
+
w: AtoGojsEditorModel.GRID_SIZE * 5,
|
4223
|
+
h: AtoGojsEditorModel.GRID_SIZE * 5,
|
4224
|
+
}) {
|
4194
4225
|
const self = this;
|
4195
4226
|
let node = this.$(go.Node, 'Spot', {
|
4196
4227
|
locationSpot: go.Spot.Center,
|
@@ -4287,7 +4318,10 @@ class AtoDefaultGojsEditor {
|
|
4287
4318
|
showPoint(loc) {
|
4288
4319
|
const docLoc = this.myDiagram.transformDocToView(loc);
|
4289
4320
|
}
|
4290
|
-
makeEntityTemplate(icon, title, size = {
|
4321
|
+
makeEntityTemplate(icon, title, size = {
|
4322
|
+
w: AtoGojsEditorModel.GRID_SIZE * 5,
|
4323
|
+
h: AtoGojsEditorModel.GRID_SIZE * 5,
|
4324
|
+
}) {
|
4291
4325
|
const self = this;
|
4292
4326
|
let node = this.$(go.Node, 'Spot', {
|
4293
4327
|
locationSpot: go.Spot.Center,
|
@@ -4319,7 +4353,11 @@ class AtoDefaultGojsEditor {
|
|
4319
4353
|
shadowBlur: 6,
|
4320
4354
|
shadowOffset: new go.Point(0, 2),
|
4321
4355
|
shadowColor: '#00000029',
|
4322
|
-
}, this.$(go.Panel, 'Auto', this.$(go.Shape, {
|
4356
|
+
}, this.$(go.Panel, 'Auto', this.$(go.Shape, {
|
4357
|
+
fill: null,
|
4358
|
+
stroke: 'dodgerblue',
|
4359
|
+
strokeWidth: 4,
|
4360
|
+
}), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', {
|
4323
4361
|
alignment: go.Spot.TopRight,
|
4324
4362
|
alignmentFocus: go.Spot.Bottom,
|
4325
4363
|
background: 'white',
|
@@ -4328,8 +4366,8 @@ class AtoDefaultGojsEditor {
|
|
4328
4366
|
!this._initialOptions.isReadOnly
|
4329
4367
|
? this.generateActionGroup([
|
4330
4368
|
AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.RO_WATER_TREATMENT].name,
|
4331
|
-
AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.COOLING_TOWER]
|
4332
|
-
|
4369
|
+
AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.COOLING_TOWER].name,
|
4370
|
+
AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.BOILER].name,
|
4333
4371
|
].includes(title)
|
4334
4372
|
? [
|
4335
4373
|
AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME,
|
@@ -4377,7 +4415,8 @@ class AtoDefaultGojsEditor {
|
|
4377
4415
|
var _a;
|
4378
4416
|
return !(((_a = AtoGojsEditorModel.TYPE_COMPONENT_WATER) === null || _a === void 0 ? void 0 : _a.includes(data === null || data === void 0 ? void 0 : data.systemType)) &&
|
4379
4417
|
(data === null || data === void 0 ? void 0 : data.topologyType) !== ATO_ECOMPONENT_PLANT_TYPE.WATER &&
|
4380
|
-
(data === null || data === void 0 ? void 0 : data.topologyType) !==
|
4418
|
+
(data === null || data === void 0 ? void 0 : data.topologyType) !==
|
4419
|
+
ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL);
|
4381
4420
|
})))), this.$(go.Panel, 'Vertical', {
|
4382
4421
|
alignment: go.Spot.Left,
|
4383
4422
|
alignmentFocus: new go.Spot(0, 0.5, 8, 0),
|
@@ -4387,7 +4426,10 @@ class AtoDefaultGojsEditor {
|
|
4387
4426
|
}), this.makePort('T', go.Spot.Top, go.Spot.TopSide, false, true), this.makePort('L', go.Spot.Left, go.Spot.LeftSide, false, true), this.makePort('R', go.Spot.Right, go.Spot.RightSide, true, false), this.makePort('B', go.Spot.Bottom, go.Spot.BottomSide, true, false));
|
4388
4427
|
this.myDiagram.nodeTemplateMap.set(title, node);
|
4389
4428
|
}
|
4390
|
-
makeEntityTemplateEnergy(icon, title, size = {
|
4429
|
+
makeEntityTemplateEnergy(icon, title, size = {
|
4430
|
+
w: AtoGojsEditorModel.GRID_SIZE * 5,
|
4431
|
+
h: AtoGojsEditorModel.GRID_SIZE * 5,
|
4432
|
+
}) {
|
4391
4433
|
var _a;
|
4392
4434
|
const self = this;
|
4393
4435
|
let node = this.$(go.Node, 'Spot', {
|
@@ -4414,7 +4456,11 @@ class AtoDefaultGojsEditor {
|
|
4414
4456
|
shadowBlur: 6,
|
4415
4457
|
shadowOffset: new go.Point(0, 2),
|
4416
4458
|
shadowColor: '#00000029',
|
4417
|
-
}, this.$(go.Panel, 'Auto', this.$(go.Shape, {
|
4459
|
+
}, this.$(go.Panel, 'Auto', this.$(go.Shape, {
|
4460
|
+
fill: null,
|
4461
|
+
stroke: 'dodgerblue',
|
4462
|
+
strokeWidth: 4,
|
4463
|
+
}), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', {
|
4418
4464
|
alignment: go.Spot.TopRight,
|
4419
4465
|
alignmentFocus: go.Spot.Bottom,
|
4420
4466
|
background: 'white',
|
@@ -4471,7 +4517,10 @@ class AtoDefaultGojsEditor {
|
|
4471
4517
|
this.myDiagram.nodeTemplateMap.set(title, node);
|
4472
4518
|
}
|
4473
4519
|
// Plant Cell
|
4474
|
-
plantCellTemplate(icon, title, size = {
|
4520
|
+
plantCellTemplate(icon, title, size = {
|
4521
|
+
w: 260,
|
4522
|
+
h: AtoGojsEditorModel.PLANT_CELL_HEIGHT,
|
4523
|
+
}) {
|
4475
4524
|
const self = this;
|
4476
4525
|
let node = this.$(go.Group, 'Spot', {
|
4477
4526
|
locationSpot: go.Spot.Center,
|
@@ -4540,7 +4589,11 @@ class AtoDefaultGojsEditor {
|
|
4540
4589
|
shadowBlur: 6,
|
4541
4590
|
shadowOffset: new go.Point(0, 2),
|
4542
4591
|
shadowColor: '#00000029',
|
4543
|
-
}, this.$(go.Panel, 'Auto', { width: 170 }, this.$(go.Shape, {
|
4592
|
+
}, this.$(go.Panel, 'Auto', { width: 170 }, this.$(go.Shape, {
|
4593
|
+
fill: null,
|
4594
|
+
stroke: 'dodgerblue',
|
4595
|
+
strokeWidth: 4,
|
4596
|
+
}), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', { alignment: go.Spot.TopRight, alignmentFocus: go.Spot.Bottom },
|
4544
4597
|
// more
|
4545
4598
|
this.generateActionGroup([
|
4546
4599
|
AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME,
|
@@ -4548,7 +4601,19 @@ class AtoDefaultGojsEditor {
|
|
4548
4601
|
AtoDefaultGojsEditor.ENUM_ACTIONS.ONLY_DETAILS,
|
4549
4602
|
// DefaultGojsEditor.ENUM_ACTIONS.OUTFLOW,
|
4550
4603
|
AtoDefaultGojsEditor.ENUM_ACTIONS.DELETE,
|
4551
|
-
])
|
4604
|
+
])
|
4605
|
+
// new go.Binding('visible', 'isNotAction', (x) => !x),
|
4606
|
+
)
|
4607
|
+
// this.$(
|
4608
|
+
// go.Panel,
|
4609
|
+
// 'Horizontal',
|
4610
|
+
// { alignment: go.Spot.TopRight, alignmentFocus: go.Spot.Bottom },
|
4611
|
+
// this.generateActionGroup([DefaultGojsEditor.ENUM_ACTIONS.ONLY_DETAILS]),
|
4612
|
+
// new go.Binding('visible', '', (x) => {
|
4613
|
+
// return x?.isOnlyDetails && !x?.isNotAction ? true : false;
|
4614
|
+
// }),
|
4615
|
+
// ),
|
4616
|
+
),
|
4552
4617
|
}, new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify), this.$(go.Panel, 'Auto', { width: size.w, height: size.h },
|
4553
4618
|
// this.$(go.Shape, 'RoundedRectangle', {
|
4554
4619
|
// fill: 'white',
|
@@ -4598,10 +4663,18 @@ class AtoDefaultGojsEditor {
|
|
4598
4663
|
}), this.$(go.Panel, 'Vertical', {
|
4599
4664
|
alignment: go.Spot.Right,
|
4600
4665
|
alignmentFocus: new go.Spot(1, 0.5, -8, 0),
|
4601
|
-
})
|
4666
|
+
})
|
4667
|
+
// this.makePort('T', go.Spot.Top, go.Spot.TopSide, false, true),
|
4668
|
+
// this.makePort('L', go.Spot.Left, go.Spot.LeftSide, false, true),
|
4669
|
+
// this.makePort('R', go.Spot.Right, go.Spot.RightSide, true, false),
|
4670
|
+
// this.makePort('B', go.Spot.Bottom, go.Spot.BottomSide, true, false),
|
4671
|
+
);
|
4602
4672
|
this.myDiagram.nodeTemplateMap.set(title, node);
|
4603
4673
|
}
|
4604
|
-
makeEntityWithdrawOrDischarge(icon, title, size = {
|
4674
|
+
makeEntityWithdrawOrDischarge(icon, title, size = {
|
4675
|
+
w: AtoGojsEditorModel.GRID_SIZE * 5,
|
4676
|
+
h: AtoGojsEditorModel.GRID_SIZE * 5,
|
4677
|
+
}) {
|
4605
4678
|
const self = this;
|
4606
4679
|
let node = this.$(go.Node, 'Spot', {
|
4607
4680
|
locationSpot: go.Spot.Center,
|
@@ -4622,7 +4695,11 @@ class AtoDefaultGojsEditor {
|
|
4622
4695
|
},
|
4623
4696
|
selectionAdornmentTemplate: this._initialOptions.isReadOnly
|
4624
4697
|
? null
|
4625
|
-
: this.$(go.Adornment, 'Spot', this.$(go.Panel, 'Auto', this.$(go.Shape, {
|
4698
|
+
: this.$(go.Adornment, 'Spot', this.$(go.Panel, 'Auto', this.$(go.Shape, {
|
4699
|
+
fill: null,
|
4700
|
+
stroke: 'dodgerblue',
|
4701
|
+
strokeWidth: 4,
|
4702
|
+
}), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', { alignment: go.Spot.TopRight, alignmentFocus: go.Spot.Bottom }, this.generateActionGroup([
|
4626
4703
|
AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME,
|
4627
4704
|
AtoDefaultGojsEditor.ENUM_ACTIONS.DETAILS,
|
4628
4705
|
AtoDefaultGojsEditor.ENUM_ACTIONS.OUTFLOW,
|
@@ -4661,7 +4738,15 @@ class AtoDefaultGojsEditor {
|
|
4661
4738
|
toolTip: this.$('ToolTip', this.$(go.TextBlock, {
|
4662
4739
|
margin: 4,
|
4663
4740
|
}, new go.Binding('text', 'name').makeTwoWay())),
|
4664
|
-
}, new go.Binding('text', 'name').makeTwoWay()
|
4741
|
+
}, new go.Binding('text', 'name').makeTwoWay()
|
4742
|
+
// {
|
4743
|
+
// // define a tooltip for each node that displays the color as text
|
4744
|
+
// toolTip: this.$(
|
4745
|
+
// 'ToolTip',
|
4746
|
+
// this.$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'name')),
|
4747
|
+
// ), // end of Adornment
|
4748
|
+
// },
|
4749
|
+
))), this.$(go.Panel, 'Vertical', {
|
4665
4750
|
alignment: go.Spot.Left,
|
4666
4751
|
alignmentFocus: new go.Spot(0, 0.5, 8, 0),
|
4667
4752
|
}), this.$(go.Panel, 'Vertical', {
|
@@ -4745,26 +4830,32 @@ class AtoDefaultGojsEditor {
|
|
4745
4830
|
return !!((_b = (_a = obj.part) === null || _a === void 0 ? void 0 : _a['ob']) === null || _b === void 0 ? void 0 : _b.id);
|
4746
4831
|
}
|
4747
4832
|
if (action === AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME &&
|
4748
|
-
((_d = (_c = obj.part) === null || _c === void 0 ? void 0 : _c['ob']) === null || _d === void 0 ? void 0 : _d.type) !==
|
4833
|
+
((_d = (_c = obj.part) === null || _c === void 0 ? void 0 : _c['ob']) === null || _d === void 0 ? void 0 : _d.type) !==
|
4834
|
+
AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE &&
|
4749
4835
|
((_e = AtoGojsEditorModel.TYPE_COMPONENT_WATER) === null || _e === void 0 ? void 0 : _e.includes((_g = (_f = obj.part) === null || _f === void 0 ? void 0 : _f['ob']) === null || _g === void 0 ? void 0 : _g.systemType)) &&
|
4750
|
-
((_j = (_h = obj.part) === null || _h === void 0 ? void 0 : _h['ob']) === null || _j === void 0 ? void 0 : _j.topologyType) !==
|
4751
|
-
|
4836
|
+
((_j = (_h = obj.part) === null || _h === void 0 ? void 0 : _h['ob']) === null || _j === void 0 ? void 0 : _j.topologyType) !==
|
4837
|
+
ATO_ECOMPONENT_PLANT_TYPE.WATER &&
|
4838
|
+
((_l = (_k = obj.part) === null || _k === void 0 ? void 0 : _k['ob']) === null || _l === void 0 ? void 0 : _l.topologyType) !==
|
4839
|
+
ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL) {
|
4752
4840
|
return false;
|
4753
4841
|
}
|
4754
4842
|
if (action === AtoDefaultGojsEditor.ENUM_ACTIONS.OUTFLOW &&
|
4755
4843
|
self.plantSatus === ATO_EPlantType.BASIC_PLANT &&
|
4756
|
-
((_o = (_m = obj.part) === null || _m === void 0 ? void 0 : _m.data) === null || _o === void 0 ? void 0 : _o.type) ===
|
4844
|
+
((_o = (_m = obj.part) === null || _m === void 0 ? void 0 : _m.data) === null || _o === void 0 ? void 0 : _o.type) ===
|
4845
|
+
AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE) {
|
4757
4846
|
return false;
|
4758
4847
|
}
|
4759
4848
|
return true;
|
4760
4849
|
}).map((e) => {
|
4761
4850
|
var _a, _b, _c, _d;
|
4762
|
-
if (ATO_ECOMPONENT_PLANT_TYPE.STEAM ===
|
4851
|
+
if (ATO_ECOMPONENT_PLANT_TYPE.STEAM ===
|
4852
|
+
((_b = (_a = obj.part) === null || _a === void 0 ? void 0 : _a['ob']) === null || _b === void 0 ? void 0 : _b.topologyType) &&
|
4763
4853
|
e === AtoDefaultGojsEditor.ENUM_ACTIONS.INSIGHT) {
|
4764
4854
|
return AtoDefaultGojsEditor.ENUM_ACTIONS.DATA_MAPPING;
|
4765
4855
|
}
|
4766
4856
|
if (e === AtoDefaultGojsEditor.ENUM_ACTIONS.FLOW_DETAILS &&
|
4767
|
-
((_d = (_c = obj === null || obj === void 0 ? void 0 : obj.part) === null || _c === void 0 ? void 0 : _c['ob']) === null || _d === void 0 ? void 0 : _d.systemType) ===
|
4857
|
+
((_d = (_c = obj === null || obj === void 0 ? void 0 : obj.part) === null || _c === void 0 ? void 0 : _c['ob']) === null || _d === void 0 ? void 0 : _d.systemType) ===
|
4858
|
+
AtoGojsEditorModel.ENUM_TYPES.COOLING_TOWER) {
|
4768
4859
|
return AtoDefaultGojsEditor.ENUM_ACTIONS.FLOW_DETAILS_AND_WIZARD;
|
4769
4860
|
}
|
4770
4861
|
return e;
|
@@ -4806,7 +4897,8 @@ class AtoDefaultGojsEditor {
|
|
4806
4897
|
case AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME:
|
4807
4898
|
onClickFn = () => {
|
4808
4899
|
var _a, _b, _c, _d, _e;
|
4809
|
-
if (((_b = (_a = obj.part) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.type) ===
|
4900
|
+
if (((_b = (_a = obj.part) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.type) ===
|
4901
|
+
AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE) {
|
4810
4902
|
self.onRename.emit(Object.assign({ left: ((_c = e === null || e === void 0 ? void 0 : e['Wr']) === null || _c === void 0 ? void 0 : _c.x) - 50, top: (_d = e === null || e === void 0 ? void 0 : e['Wr']) === null || _d === void 0 ? void 0 : _d.y }, (_e = obj.part) === null || _e === void 0 ? void 0 : _e.data));
|
4811
4903
|
// LayoutService.setToolTipComponentDataStatic({
|
4812
4904
|
// component: RenameBoxComponent,
|
@@ -4898,7 +4990,8 @@ class AtoDefaultGojsEditor {
|
|
4898
4990
|
if ((nodedata === null || nodedata === void 0 ? void 0 : nodedata.movable) !== undefined && (nodedata === null || nodedata === void 0 ? void 0 : nodedata.movable) !== null) {
|
4899
4991
|
newnode.movable = nodedata === null || nodedata === void 0 ? void 0 : nodedata.movable;
|
4900
4992
|
}
|
4901
|
-
newnode.location = new go.Point(fromnode.location.x + 160, fromnode.location.y +
|
4993
|
+
newnode.location = new go.Point(fromnode.location.x + 160, fromnode.location.y +
|
4994
|
+
this.findLocYFromnode(fromnode) * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT);
|
4902
4995
|
e.diagram.commitTransaction('Create Node and Link');
|
4903
4996
|
});
|
4904
4997
|
}
|
@@ -4921,12 +5014,20 @@ class AtoDefaultGojsEditor {
|
|
4921
5014
|
return this.isEmptyYLoc(locYAlreadyExist, i);
|
4922
5015
|
}
|
4923
5016
|
isEmptyYLoc(locYAlreadyExist, i) {
|
4924
|
-
if (!_.some(locYAlreadyExist, (x) => x <
|
4925
|
-
|
5017
|
+
if (!_.some(locYAlreadyExist, (x) => x <
|
5018
|
+
i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT +
|
5019
|
+
AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2 &&
|
5020
|
+
x >
|
5021
|
+
i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT -
|
5022
|
+
AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2)) {
|
4926
5023
|
return i;
|
4927
5024
|
}
|
4928
|
-
if (!_.some(locYAlreadyExist, (x) => x <
|
4929
|
-
|
5025
|
+
if (!_.some(locYAlreadyExist, (x) => x <
|
5026
|
+
-i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT +
|
5027
|
+
AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2 &&
|
5028
|
+
x >
|
5029
|
+
-i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT -
|
5030
|
+
AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2)) {
|
4930
5031
|
return -i;
|
4931
5032
|
}
|
4932
5033
|
return null;
|
@@ -4962,7 +5063,9 @@ class AtoDefaultGojsEditor {
|
|
4962
5063
|
width: 40,
|
4963
5064
|
height: 40,
|
4964
5065
|
alignment: align,
|
4965
|
-
stretch: horizontal
|
5066
|
+
stretch: horizontal
|
5067
|
+
? go.GraphObject.Horizontal
|
5068
|
+
: go.GraphObject.Vertical,
|
4966
5069
|
portId: name,
|
4967
5070
|
fromSpot: spot,
|
4968
5071
|
fromLinkable: output,
|
@@ -5009,7 +5112,35 @@ class AtoDefaultGojsEditor {
|
|
5009
5112
|
stroke: '#919CA5',
|
5010
5113
|
width: 40,
|
5011
5114
|
height: 40, // Match the panel's height
|
5012
|
-
})
|
5115
|
+
})
|
5116
|
+
// this.$(
|
5117
|
+
// go.TextBlock,
|
5118
|
+
// {
|
5119
|
+
// name: 'textBlock',
|
5120
|
+
// margin: 4,
|
5121
|
+
// text: '\uf0da', // Mã Unicode tương ứng với fa-caret-left
|
5122
|
+
// font: '900 12px "Font Awesome 6 Pro"',
|
5123
|
+
// stroke: 'white', // Đặt màu chữ thành màu trắng
|
5124
|
+
// cursor: 'pointer',
|
5125
|
+
// visible: false,
|
5126
|
+
// },
|
5127
|
+
// new go.Binding('text', 'name', (_) => {
|
5128
|
+
// switch (name) {
|
5129
|
+
// case 'T':
|
5130
|
+
// case 'B': {
|
5131
|
+
// return '\uf0d7';
|
5132
|
+
// }
|
5133
|
+
// case 'L':
|
5134
|
+
// case 'R': {
|
5135
|
+
// return '\uf0da';
|
5136
|
+
// }
|
5137
|
+
// default: {
|
5138
|
+
// return '\uf0d7';
|
5139
|
+
// }
|
5140
|
+
// }
|
5141
|
+
// }),
|
5142
|
+
// ),
|
5143
|
+
);
|
5013
5144
|
}
|
5014
5145
|
makePort(name, align, spot, output, input) {
|
5015
5146
|
// if (this._initialOptions.isReadOnly) {
|
@@ -5024,7 +5155,9 @@ class AtoDefaultGojsEditor {
|
|
5024
5155
|
width: horizontal ? NaN : 8,
|
5025
5156
|
height: !horizontal ? NaN : 8,
|
5026
5157
|
alignment: align,
|
5027
|
-
stretch: horizontal
|
5158
|
+
stretch: horizontal
|
5159
|
+
? go.GraphObject.Horizontal
|
5160
|
+
: go.GraphObject.Vertical,
|
5028
5161
|
portId: name,
|
5029
5162
|
fromSpot: spot,
|
5030
5163
|
fromLinkable: output,
|
@@ -5073,10 +5206,12 @@ class AtoDefaultGojsEditor {
|
|
5073
5206
|
return false;
|
5074
5207
|
}
|
5075
5208
|
if (data === null || data === void 0 ? void 0 : data.flowOfPlantCell) {
|
5076
|
-
if ((data === null || data === void 0 ? void 0 : data.flowOfPlantCell) === ATO_ENUM_FLOW_DIRECTION.INFLOW &&
|
5209
|
+
if ((data === null || data === void 0 ? void 0 : data.flowOfPlantCell) === ATO_ENUM_FLOW_DIRECTION.INFLOW &&
|
5210
|
+
name === 'L') {
|
5077
5211
|
return true;
|
5078
5212
|
}
|
5079
|
-
if ((data === null || data === void 0 ? void 0 : data.flowOfPlantCell) === ATO_ENUM_FLOW_DIRECTION.OUTFLOW &&
|
5213
|
+
if ((data === null || data === void 0 ? void 0 : data.flowOfPlantCell) === ATO_ENUM_FLOW_DIRECTION.OUTFLOW &&
|
5214
|
+
name === 'R') {
|
5080
5215
|
return true;
|
5081
5216
|
}
|
5082
5217
|
return false;
|
@@ -5170,7 +5305,84 @@ class AtoDefaultGojsEditor {
|
|
5170
5305
|
// stroke: AtoGojsEditorModel.ENUM_COLORS.RESOLUTION_BLUE,
|
5171
5306
|
strokeWidth: 2,
|
5172
5307
|
// strokeDashArray: [5, 5],
|
5173
|
-
})
|
5308
|
+
})
|
5309
|
+
// this.$(go.Placeholder),
|
5310
|
+
// this.$(go.Placeholder, { padding: new go.Margin(0, 0, 0, 0) }),
|
5311
|
+
)
|
5312
|
+
// this.$(go.TextBlock, title, {
|
5313
|
+
// row: 0,
|
5314
|
+
// margin: new go.Margin(0, 0, 0, 0),
|
5315
|
+
// stroke: '#444444',
|
5316
|
+
// font: 'normal 10pt Arial',
|
5317
|
+
// textAlign: 'center',
|
5318
|
+
// alignment: go.Spot.Left,
|
5319
|
+
// },
|
5320
|
+
// new go.Binding('text', 'key').makeTwoWay(),),
|
5321
|
+
// this.$(
|
5322
|
+
// go.Panel,
|
5323
|
+
// 'Table',
|
5324
|
+
// {
|
5325
|
+
// alignment: go.Spot.TopLeft,
|
5326
|
+
// alignmentFocus: new go.Spot(0, 0, -10, -10),
|
5327
|
+
// // padding: new go.Margin(0, 0, 50, 0),
|
5328
|
+
// },
|
5329
|
+
// this.$(
|
5330
|
+
// go.Panel,
|
5331
|
+
// 'Horizontal',
|
5332
|
+
// {
|
5333
|
+
// row: 0,
|
5334
|
+
// alignment: go.Spot.Left,
|
5335
|
+
// },
|
5336
|
+
// this.$(go.Picture, icon, {
|
5337
|
+
// row: 0,
|
5338
|
+
// // alignment: go.Spot.Center,
|
5339
|
+
// alignment: go.Spot.Left,
|
5340
|
+
// maxSize: new go.Size(40, 40),
|
5341
|
+
// imageStretch: go.GraphObject.Uniform,
|
5342
|
+
// }),
|
5343
|
+
// this.$(
|
5344
|
+
// go.Panel,
|
5345
|
+
// 'Table',
|
5346
|
+
// {
|
5347
|
+
// column: 1,
|
5348
|
+
// defaultAlignment: go.Spot.Left,
|
5349
|
+
// alignmentFocus: new go.Spot(0, 0, 0, 20),
|
5350
|
+
// },
|
5351
|
+
// this.$(go.TextBlock, title, {
|
5352
|
+
// row: 0,
|
5353
|
+
// margin: new go.Margin(3, 3, 5, 10),
|
5354
|
+
// // maxSize: new go.Size(size.w - 20, NaN),
|
5355
|
+
// stroke: '#444444',
|
5356
|
+
// font: 'normal 10pt Arial',
|
5357
|
+
// textAlign: 'center',
|
5358
|
+
// alignment: go.Spot.Left,
|
5359
|
+
// }),
|
5360
|
+
// this.$(
|
5361
|
+
// go.TextBlock,
|
5362
|
+
// {
|
5363
|
+
// row: 1,
|
5364
|
+
// margin: new go.Margin(0, 3, 3, 10),
|
5365
|
+
// editable: true,
|
5366
|
+
// // maxSize: new go.Size(size.w - 20, 40),
|
5367
|
+
// stroke: '#000D42',
|
5368
|
+
// font: 'bold 10pt Arial',
|
5369
|
+
// textAlign: 'center',
|
5370
|
+
// wrap: go.TextBlock.None,
|
5371
|
+
// overflow: go.TextBlock.OverflowEllipsis,
|
5372
|
+
// },
|
5373
|
+
// new go.Binding('text', 'name').makeTwoWay(),
|
5374
|
+
// {
|
5375
|
+
// // define a tooltip for each node that displays the color as text
|
5376
|
+
// toolTip: this.$(
|
5377
|
+
// 'ToolTip',
|
5378
|
+
// this.$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'name')),
|
5379
|
+
// ), // end of Adornment
|
5380
|
+
// },
|
5381
|
+
// ),
|
5382
|
+
// ),
|
5383
|
+
// ),
|
5384
|
+
// ),
|
5385
|
+
);
|
5174
5386
|
this.myDiagram.groupTemplateMap.set(title, node);
|
5175
5387
|
}
|
5176
5388
|
makeGroupTemplate(icon, title, size = { w: 80, h: 80 }) {
|
@@ -5305,7 +5517,9 @@ class AtoDefaultGojsEditor {
|
|
5305
5517
|
// imageStretch: go.GraphObject.Uniform,
|
5306
5518
|
// margin: new go.Margin(130, 0, 0, 0),
|
5307
5519
|
}, new go.Binding('margin', 'margin'), new go.Binding('width', 'width'), new go.Binding('height', 'height'), new go.Binding('source', '', (data) => {
|
5308
|
-
return (data === null || data === void 0 ? void 0 : data.source)
|
5520
|
+
return (data === null || data === void 0 ? void 0 : data.source)
|
5521
|
+
? data === null || data === void 0 ? void 0 : data.source
|
5522
|
+
: AtoGojsEditorModel.IMAGE_RO_WATER_TREATMENT_PATH;
|
5309
5523
|
}))));
|
5310
5524
|
this.myDiagram.nodeTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.IMAGE_TEMPLATE, node);
|
5311
5525
|
}
|
@@ -5390,13 +5604,19 @@ class AtoDefaultGojsEditor {
|
|
5390
5604
|
cursor: 'pointer',
|
5391
5605
|
click: (e, obj) => {
|
5392
5606
|
var _a, _b, _c;
|
5393
|
-
if (((_b = (_a = obj.panel.part.data) === null || _a === void 0 ? void 0 : _a.dataTable[obj.row]) === null || _b === void 0 ? void 0 : _b.isEditable) ===
|
5607
|
+
if (((_b = (_a = obj.panel.part.data) === null || _a === void 0 ? void 0 : _a.dataTable[obj.row]) === null || _b === void 0 ? void 0 : _b.isEditable) ===
|
5608
|
+
false) {
|
5394
5609
|
return;
|
5395
5610
|
}
|
5396
5611
|
self.onClikParamOfTable.emit(Object.assign({}, (_c = obj.panel.part.data) === null || _c === void 0 ? void 0 : _c.dataTable[obj.row]));
|
5397
5612
|
},
|
5398
5613
|
background: 'transparent',
|
5399
|
-
}, this.$(go.TextBlock, '', {
|
5614
|
+
}, this.$(go.TextBlock, '', {
|
5615
|
+
column: 0,
|
5616
|
+
margin: 2,
|
5617
|
+
textAlign: 'left',
|
5618
|
+
alignment: go.Spot.Left,
|
5619
|
+
}, new go.Binding('text', '', (data, panel) => {
|
5400
5620
|
return data === null || data === void 0 ? void 0 : data.name;
|
5401
5621
|
})), this.$(go.Panel, 'Table', {
|
5402
5622
|
column: 1,
|
@@ -5421,7 +5641,8 @@ class AtoDefaultGojsEditor {
|
|
5421
5641
|
? `${(data === null || data === void 0 ? void 0 : data.tagName) || ''} `
|
5422
5642
|
: ''}${data === null || data === void 0 ? void 0 : data.value}`;
|
5423
5643
|
}), new go.Binding('visible', '', (data) => {
|
5424
|
-
if (!!this._initialOptions.isReadOnly &&
|
5644
|
+
if (!!this._initialOptions.isReadOnly &&
|
5645
|
+
(data === null || data === void 0 ? void 0 : data.tagName)) {
|
5425
5646
|
return true;
|
5426
5647
|
}
|
5427
5648
|
return !!(data === null || data === void 0 ? void 0 : data.value);
|
@@ -5439,7 +5660,7 @@ class AtoDefaultGojsEditor {
|
|
5439
5660
|
alignment: go.Spot.Right,
|
5440
5661
|
column: 1,
|
5441
5662
|
margin: new go.Margin(0, 0, 0, 5),
|
5442
|
-
source: ICONS_BASE64[
|
5663
|
+
source: ICONS_BASE64['uf044'],
|
5443
5664
|
cursor: 'pointer',
|
5444
5665
|
visible: false,
|
5445
5666
|
toolTip: this.$('ToolTip', this.$(go.TextBlock, {
|
@@ -5454,7 +5675,9 @@ class AtoDefaultGojsEditor {
|
|
5454
5675
|
}), new go.Binding('opacity', '', (data, panel) => {
|
5455
5676
|
return (data === null || data === void 0 ? void 0 : data.isEditable) === false ? 0.6 : 1;
|
5456
5677
|
})))),
|
5457
|
-
}
|
5678
|
+
}
|
5679
|
+
// new go.Binding('text', 'name')
|
5680
|
+
)));
|
5458
5681
|
this.myDiagram.nodeTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.PARAM_TABLE, node);
|
5459
5682
|
}
|
5460
5683
|
makeMassBalance() {
|
@@ -5719,7 +5942,8 @@ class AtoDefaultGojsEditor {
|
|
5719
5942
|
// : node?.layout;
|
5720
5943
|
if ((data === null || data === void 0 ? void 0 : data.layoutValue) !== (data === null || data === void 0 ? void 0 : data.layoutValueClone)) {
|
5721
5944
|
data.layoutValueClone = data === null || data === void 0 ? void 0 : data.layoutValue;
|
5722
|
-
return (data === null || data === void 0 ? void 0 : data.layoutValue) ===
|
5945
|
+
return (data === null || data === void 0 ? void 0 : data.layoutValue) ===
|
5946
|
+
AtoGojsEditorModel.ENUM_LAYOUT_EDITOR.AUTO
|
5723
5947
|
? self.$(go.LayeredDigraphLayout, { direction: 0 })
|
5724
5948
|
: self.$(go.Layout);
|
5725
5949
|
}
|
@@ -5819,10 +6043,16 @@ class AtoDefaultGojsEditor {
|
|
5819
6043
|
})));
|
5820
6044
|
this.myDiagram.groupTemplateMap.set(title, node);
|
5821
6045
|
}
|
5822
|
-
makeGroupZoneTemplate(size = {
|
6046
|
+
makeGroupZoneTemplate(size = {
|
6047
|
+
w: AtoGojsEditorModel.GRID_SIZE * 14,
|
6048
|
+
h: AtoGojsEditorModel.GRID_SIZE * 5,
|
6049
|
+
}) {
|
5823
6050
|
const self = this;
|
5824
6051
|
let node = this.$(go.Group, 'Vertical', {
|
5825
|
-
layout: this.$(go.GridLayout, {
|
6052
|
+
layout: this.$(go.GridLayout, {
|
6053
|
+
wrappingColumn: 1,
|
6054
|
+
spacing: new go.Size(0, 0),
|
6055
|
+
}),
|
5826
6056
|
}, {
|
5827
6057
|
locationSpot: go.Spot.Center,
|
5828
6058
|
mouseOver: function (e, obj) {
|
@@ -5847,7 +6077,11 @@ class AtoDefaultGojsEditor {
|
|
5847
6077
|
shadowBlur: 6,
|
5848
6078
|
shadowOffset: new go.Point(0, 2),
|
5849
6079
|
shadowColor: '#00000029',
|
5850
|
-
}, this.$(go.Panel, 'Auto', this.$(go.Shape, {
|
6080
|
+
}, this.$(go.Panel, 'Auto', this.$(go.Shape, {
|
6081
|
+
fill: null,
|
6082
|
+
stroke: 'dodgerblue',
|
6083
|
+
strokeWidth: 4,
|
6084
|
+
}), this.$(go.Placeholder, { padding: 3 })), this.$(go.Panel, 'Horizontal', {
|
5851
6085
|
alignment: go.Spot.TopRight,
|
5852
6086
|
alignmentFocus: go.Spot.Bottom,
|
5853
6087
|
background: 'white',
|
@@ -5873,7 +6107,82 @@ class AtoDefaultGojsEditor {
|
|
5873
6107
|
AtoDefaultGojsEditor.ENUM_ACTIONS.DETAILS,
|
5874
6108
|
AtoDefaultGojsEditor.ENUM_ACTIONS.OUTFLOW,
|
5875
6109
|
AtoDefaultGojsEditor.ENUM_ACTIONS.DELETE,
|
5876
|
-
])
|
6110
|
+
])
|
6111
|
+
// this.$(
|
6112
|
+
// // Edit Text
|
6113
|
+
// 'Button',
|
6114
|
+
// {
|
6115
|
+
// click: self.editTextGroupZone,
|
6116
|
+
// 'ButtonBorder.strokeWidth': 0,
|
6117
|
+
// 'ButtonBorder.fill': 'white',
|
6118
|
+
// },
|
6119
|
+
// this.$(go.TextBlock, {
|
6120
|
+
// margin: 4,
|
6121
|
+
// text: '\ue1bf',
|
6122
|
+
// font: '20px "Font Awesome 6 Pro"',
|
6123
|
+
// cursor: 'pointer',
|
6124
|
+
// stroke: '#2c2c2c',
|
6125
|
+
// }),
|
6126
|
+
// ),
|
6127
|
+
// this.$(
|
6128
|
+
// // Open Detail
|
6129
|
+
// 'Button',
|
6130
|
+
// {
|
6131
|
+
// click: (e, obj: any) => {
|
6132
|
+
// const node = obj.part;
|
6133
|
+
// self.onOpenDetail.emit({
|
6134
|
+
// node,
|
6135
|
+
// });
|
6136
|
+
// },
|
6137
|
+
// 'ButtonBorder.strokeWidth': 0,
|
6138
|
+
// 'ButtonBorder.fill': 'white',
|
6139
|
+
// },
|
6140
|
+
//
|
6141
|
+
// this.$(go.TextBlock, {
|
6142
|
+
// margin: 4,
|
6143
|
+
// text: '\ue49a',
|
6144
|
+
// font: '20px "Font Awesome 6 Pro"',
|
6145
|
+
// cursor: 'pointer',
|
6146
|
+
// }),
|
6147
|
+
// ),
|
6148
|
+
// !this._initialOptions.isReadOnly
|
6149
|
+
// ? this.$(
|
6150
|
+
// 'Button',
|
6151
|
+
// {
|
6152
|
+
// actionMove: self.dragNewNode, // defined below, to support dragging from the button
|
6153
|
+
// _dragData: {
|
6154
|
+
// type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE,
|
6155
|
+
// name: 0,
|
6156
|
+
// color: AtoGojsEditorModel.ENUM_COLORS.BLUE,
|
6157
|
+
// },
|
6158
|
+
// click: self.clickNewNode, // defined below, to support a click on the button
|
6159
|
+
// 'ButtonBorder.strokeWidth': 0,
|
6160
|
+
// 'ButtonBorder.fill': 'white',
|
6161
|
+
// },
|
6162
|
+
// this.$(go.TextBlock, {
|
6163
|
+
// margin: 4,
|
6164
|
+
// text: '\ue157',
|
6165
|
+
// font: '20px "Font Awesome 6 Pro"',
|
6166
|
+
// cursor: 'pointer',
|
6167
|
+
// stroke: '#2c2c2c',
|
6168
|
+
// }),
|
6169
|
+
// )
|
6170
|
+
// : {},
|
6171
|
+
// this.$(
|
6172
|
+
// 'Button',
|
6173
|
+
// {
|
6174
|
+
// click: self.deleteNode,
|
6175
|
+
// 'ButtonBorder.strokeWidth': 0,
|
6176
|
+
// 'ButtonBorder.fill': 'white',
|
6177
|
+
// },
|
6178
|
+
// this.$(go.TextBlock, {
|
6179
|
+
// margin: 4,
|
6180
|
+
// text: '\uf2ed',
|
6181
|
+
// font: '20px "Font Awesome 6 Pro"',
|
6182
|
+
// cursor: 'pointer',
|
6183
|
+
// }),
|
6184
|
+
// ),
|
6185
|
+
)),
|
5877
6186
|
}, this.$(go.Panel, 'Auto', this.$(go.Shape, 'RoundedRectangle', {
|
5878
6187
|
fill: 'transparent',
|
5879
6188
|
stroke: AtoGojsEditorModel.ENUM_COLORS.RESOLUTION_BLUE,
|
@@ -5901,7 +6210,10 @@ class AtoDefaultGojsEditor {
|
|
5901
6210
|
})), this.makePort('T', go.Spot.Top, go.Spot.TopSide, false, true), this.makePort('L', go.Spot.Left, go.Spot.LeftSide, true, true), this.makePort('R', go.Spot.Right, go.Spot.RightSide, true, true), this.makePort('B', go.Spot.Bottom, go.Spot.BottomSide, true, false)), new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify));
|
5902
6211
|
this.myDiagram.groupTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.ZONE, node);
|
5903
6212
|
}
|
5904
|
-
makeZoneItemTemplate(size = {
|
6213
|
+
makeZoneItemTemplate(size = {
|
6214
|
+
w: AtoGojsEditorModel.GRID_SIZE * 12,
|
6215
|
+
h: AtoGojsEditorModel.GRID_SIZE * 2,
|
6216
|
+
}) {
|
5905
6217
|
const self = this;
|
5906
6218
|
const node = this.$(go.Node, 'Auto',
|
5907
6219
|
// {
|
@@ -5985,7 +6297,10 @@ class AtoDefaultGojsEditor {
|
|
5985
6297
|
value: x === null || x === void 0 ? void 0 : x.quantity,
|
5986
6298
|
unit: x === null || x === void 0 ? void 0 : x.unit,
|
5987
6299
|
});
|
5988
|
-
return (_a = formatted.shortenedNumber +
|
6300
|
+
return ((_a = formatted.shortenedNumber +
|
6301
|
+
' ' +
|
6302
|
+
formatted.unitPrefixes +
|
6303
|
+
(x === null || x === void 0 ? void 0 : x.unit)) !== null && _a !== void 0 ? _a : '');
|
5989
6304
|
}), new go.Binding('visible', 'data', (x) => typeof (x === null || x === void 0 ? void 0 : x.quantity) === 'number')), this.$(go.TextBlock, {
|
5990
6305
|
margin: new go.Margin(0, 5, 10, 0),
|
5991
6306
|
textAlign: 'center',
|
@@ -5996,7 +6311,10 @@ class AtoDefaultGojsEditor {
|
|
5996
6311
|
}, new go.Binding('visible', 'data', (x) => typeof (x === null || x === void 0 ? void 0 : x.quantity) === 'number'))))));
|
5997
6312
|
this.myDiagram.nodeTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.ZONE_ENERGY_ITEM, node);
|
5998
6313
|
}
|
5999
|
-
makeSpecialTemplate(icon, title, size = {
|
6314
|
+
makeSpecialTemplate(icon, title, size = {
|
6315
|
+
w: AtoGojsEditorModel.GRID_SIZE * 5,
|
6316
|
+
h: AtoGojsEditorModel.GRID_SIZE * 5,
|
6317
|
+
}) {
|
6000
6318
|
let node = null;
|
6001
6319
|
switch (title) {
|
6002
6320
|
case AtoGojsEditorModel.ENUM_TEMPLATES.SPECIAL_PROCESS:
|
@@ -6248,7 +6566,8 @@ class AtoDefaultGojsEditor {
|
|
6248
6566
|
// return;
|
6249
6567
|
// }
|
6250
6568
|
// const newDocument = newWindow?.document;
|
6251
|
-
if (!((_c = (_b = (_a = this.myDiagram) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.nodeDataArray) === null || _c === void 0 ? void 0 : _c.length) &&
|
6569
|
+
if (!((_c = (_b = (_a = this.myDiagram) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.nodeDataArray) === null || _c === void 0 ? void 0 : _c.length) &&
|
6570
|
+
!((_f = (_e = (_d = this.myDiagram) === null || _d === void 0 ? void 0 : _d.model) === null || _e === void 0 ? void 0 : _e.linkDataArray) === null || _f === void 0 ? void 0 : _f.length)) {
|
6252
6571
|
return;
|
6253
6572
|
}
|
6254
6573
|
const svg = this.myDiagram.makeSvg({
|
@@ -6269,7 +6588,8 @@ class AtoDefaultGojsEditor {
|
|
6269
6588
|
svgElement.setAttribute('stroke', 'rgba(64, 181, 206, 0.6)');
|
6270
6589
|
}
|
6271
6590
|
// Empty Value
|
6272
|
-
if ((graphObject === null || graphObject === void 0 ? void 0 : graphObject.name) === 'textBlockValue' ||
|
6591
|
+
if ((graphObject === null || graphObject === void 0 ? void 0 : graphObject.name) === 'textBlockValue' ||
|
6592
|
+
(graphObject === null || graphObject === void 0 ? void 0 : graphObject.name) === 'textBlockUnitPrefixes') {
|
6273
6593
|
svgElement.textContent = '';
|
6274
6594
|
}
|
6275
6595
|
if (svgElement.clipPath) {
|
@@ -8026,6 +8346,76 @@ const ATO_COMPONENTS_GROUP_DATA = {
|
|
8026
8346
|
}, extendedDataResponsive: {
|
8027
8347
|
visible: false,
|
8028
8348
|
} }),
|
8349
|
+
{
|
8350
|
+
type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL,
|
8351
|
+
group: 100,
|
8352
|
+
loc: '80 280',
|
8353
|
+
name: WATER_SYSTEMS_NAME.MAKEUP_WATER,
|
8354
|
+
color: AtoGojsEditorModel.ENUM_COLORS.CERULEAN,
|
8355
|
+
assetLayers: ATO_ASSET_LAYERS.FLOW,
|
8356
|
+
extendedData: {
|
8357
|
+
visible: false,
|
8358
|
+
},
|
8359
|
+
extendedDataResponsive: {
|
8360
|
+
visible: true,
|
8361
|
+
}
|
8362
|
+
},
|
8363
|
+
{
|
8364
|
+
type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL,
|
8365
|
+
group: 100,
|
8366
|
+
loc: '300 17',
|
8367
|
+
name: WATER_SYSTEMS_NAME.CONDENSATE_RETURN,
|
8368
|
+
color: AtoGojsEditorModel.ENUM_COLORS.FOUNTAIN_BLUE,
|
8369
|
+
assetLayers: ATO_ASSET_LAYERS.FLOW,
|
8370
|
+
extendedData: {
|
8371
|
+
visible: false,
|
8372
|
+
},
|
8373
|
+
extendedDataResponsive: {
|
8374
|
+
visible: true,
|
8375
|
+
}
|
8376
|
+
},
|
8377
|
+
{
|
8378
|
+
type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL,
|
8379
|
+
group: 100,
|
8380
|
+
loc: '760 17',
|
8381
|
+
name: WATER_SYSTEMS_NAME.STEAM,
|
8382
|
+
color: AtoGojsEditorModel.ENUM_COLORS.FLAMINGO,
|
8383
|
+
assetLayers: ATO_ASSET_LAYERS.FLOW,
|
8384
|
+
extendedData: {
|
8385
|
+
visible: false,
|
8386
|
+
},
|
8387
|
+
extendedDataResponsive: {
|
8388
|
+
visible: true,
|
8389
|
+
}
|
8390
|
+
},
|
8391
|
+
{
|
8392
|
+
type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL,
|
8393
|
+
group: 100,
|
8394
|
+
loc: '460 400',
|
8395
|
+
name: WATER_SYSTEMS_NAME.BOILER_FEED_WATER,
|
8396
|
+
color: AtoGojsEditorModel.ENUM_COLORS.LIGHT_SKY_BLUE_2,
|
8397
|
+
assetLayers: ATO_ASSET_LAYERS.FLOW,
|
8398
|
+
extendedData: {
|
8399
|
+
visible: false,
|
8400
|
+
},
|
8401
|
+
extendedDataResponsive: {
|
8402
|
+
visible: true,
|
8403
|
+
}
|
8404
|
+
},
|
8405
|
+
{
|
8406
|
+
type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_LABEL,
|
8407
|
+
group: 100,
|
8408
|
+
loc: '325 190',
|
8409
|
+
name: WATER_SYSTEMS_NAME.STEAM_LOSS,
|
8410
|
+
color: AtoGojsEditorModel.ENUM_COLORS.FLAMINGO,
|
8411
|
+
assetLayers: ATO_ASSET_LAYERS.FLOW,
|
8412
|
+
extendedData: {
|
8413
|
+
visible: false,
|
8414
|
+
},
|
8415
|
+
extendedDataResponsive: {
|
8416
|
+
visible: true,
|
8417
|
+
}
|
8418
|
+
},
|
8029
8419
|
{ key: 100, type: AtoGojsEditorModel.ENUM_TEMPLATES.BOILER, isGroup: true, name: 'Group' },
|
8030
8420
|
],
|
8031
8421
|
linkDataArray: [],
|