-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathconnectionViewObject.ts
More file actions
66 lines (62 loc) · 1.54 KB
/
connectionViewObject.ts
File metadata and controls
66 lines (62 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import {Connection} from "../../../models/connection.model";
import {Node} from "../../../models/node.model";
import {EditorView} from "./editor.view";
export class ConnectionsViewObject {
key: string;
constructor(
private editorView: EditorView,
public connection: Connection,
public node: Node,
displayConnectionPin1: boolean,
displayConnectionPin2: boolean,
) {
this.key = ConnectionsViewObject.generateKey(
editorView,
connection,
displayConnectionPin1,
displayConnectionPin2,
);
}
static generateKey(
editorView: EditorView,
connection: Connection,
displayConnectionPin1: boolean,
displayConnectionPin2: boolean,
): string {
let key =
"LC" +
editorView.getNetzgrafikLoadCounter() +
"#" +
connection.getId() +
"@" +
connection.hasWarning() +
"_" +
connection.getPortId1() +
"_" +
connection.getPortId2() +
"_" +
connection.selected() +
"_" +
connection.getPath()[0] +
"_" +
connection.getPath()[1] +
"_" +
connection.getPath()[2] +
"_" +
connection.getPath()[3] +
"_" +
displayConnectionPin1 +
"_" +
displayConnectionPin2 +
"_" +
editorView.isTemporaryDisableFilteringOfItemsInViewEnabled() +
"_" +
editorView.getLevelOfDetail() +
"_" +
editorView.trainrunSectionPreviewLineView.getVariantIsWritable();
connection.getPath().forEach((p) => {
key += p.toString();
});
return key;
}
}