@packtrack/layout 1.6.6 → 1.6.8
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/.built/source/layout.d.ts +1 -1
- package/.built/source/layout.js +4 -2
- package/package.json +1 -1
- package/source/layout.ts +5 -3
- package/source/section.ts +0 -1
|
@@ -15,7 +15,7 @@ export declare class Layout {
|
|
|
15
15
|
monitors: Monitor[];
|
|
16
16
|
throttles: Throttle[];
|
|
17
17
|
get allDistricts(): District[];
|
|
18
|
-
static from(
|
|
18
|
+
static from(railway: any): Layout;
|
|
19
19
|
loadMonitor(source: any, parent: District | Layout): Monitor;
|
|
20
20
|
loadThrottle(source: any, parent: District | Layout): Throttle;
|
|
21
21
|
loadDistrict(source: any, parent: District | Layout): District;
|
package/.built/source/layout.js
CHANGED
|
@@ -35,9 +35,8 @@ export class Layout {
|
|
|
35
35
|
}
|
|
36
36
|
return districts;
|
|
37
37
|
}
|
|
38
|
-
static from(
|
|
38
|
+
static from(railway) {
|
|
39
39
|
const layout = new Layout();
|
|
40
|
-
const railway = document.firstChild;
|
|
41
40
|
layout.name = railway.getAttribute('name');
|
|
42
41
|
const version = railway.getAttribute('version');
|
|
43
42
|
if (version == '1') {
|
|
@@ -128,6 +127,9 @@ export class Layout {
|
|
|
128
127
|
loadSection(source, district) {
|
|
129
128
|
const section = new Section(source.getAttribute('name'), district);
|
|
130
129
|
district.sections.push(section);
|
|
130
|
+
if (source.hasAttribute('power-district')) {
|
|
131
|
+
section.powerDistrict = district.powerDistricts.find(district => district.name == source.hasAttribute('power-district'));
|
|
132
|
+
}
|
|
131
133
|
let child = source.firstChild;
|
|
132
134
|
while (child) {
|
|
133
135
|
if (child.tagName == 'tracks') {
|
package/package.json
CHANGED
package/source/layout.ts
CHANGED
|
@@ -45,10 +45,8 @@ export class Layout {
|
|
|
45
45
|
return districts;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
static from(
|
|
48
|
+
static from(railway: any) {
|
|
49
49
|
const layout = new Layout();
|
|
50
|
-
|
|
51
|
-
const railway = document.firstChild!;
|
|
52
50
|
layout.name = railway.getAttribute('name');
|
|
53
51
|
|
|
54
52
|
const version = railway.getAttribute('version');
|
|
@@ -174,6 +172,10 @@ export class Layout {
|
|
|
174
172
|
const section = new Section(source.getAttribute('name'), district);
|
|
175
173
|
district.sections.push(section);
|
|
176
174
|
|
|
175
|
+
if (source.hasAttribute('power-district')) {
|
|
176
|
+
section.powerDistrict = district.powerDistricts.find(district => district.name == source.hasAttribute('power-district'));
|
|
177
|
+
}
|
|
178
|
+
|
|
177
179
|
let child = source.firstChild;
|
|
178
180
|
|
|
179
181
|
while (child) {
|