@@ -6,124 +6,29 @@ import buildOpSearchQuery from 'modules/operationalPoint/helpers/buildOpSearchQu
6
6
import type { AppDispatch } from 'store' ;
7
7
import { Duration , addDurationToDate } from 'utils/duration' ;
8
8
9
+ import {
10
+ TRAINRUN_CATEGORY_HALTEZEITEN ,
11
+ NODE_LABEL_GROUP ,
12
+ DEFAULT_TRAINRUN_FREQUENCIES ,
13
+ DEFAULT_TRAINRUN_CATEGORY ,
14
+ DEFAULT_TRAINRUN_FREQUENCY ,
15
+ DEFAULT_TRAINRUN_TIME_CATEGORY ,
16
+ TRAINRUN_LABEL_GROUP ,
17
+ DEFAULT_TIME_LOCK ,
18
+ DEFAULT_DTO ,
19
+ } from './consts' ;
9
20
import MacroEditorState , { type NodeIndexed } from './MacroEditorState' ;
10
21
import { deleteMacroNodeByDbId , getSavedMacroNodes } from './utils' ;
11
22
import {
12
23
type PortDto ,
13
24
type TimeLockDto ,
14
25
type TrainrunSectionDto ,
15
- type TrainrunCategory ,
16
- type TrainrunTimeCategory ,
17
26
type TrainrunFrequency ,
18
27
type NetzgrafikDto ,
19
- type LabelGroupDto ,
20
28
PortAlignment ,
21
29
type LabelDto ,
22
30
} from '../NGE/types' ;
23
31
24
- const TRAINRUN_CATEGORY_HALTEZEITEN = {
25
- HaltezeitIPV : { haltezeit : 0 , no_halt : false } ,
26
- HaltezeitA : { haltezeit : 0 , no_halt : false } ,
27
- HaltezeitB : { haltezeit : 0 , no_halt : false } ,
28
- HaltezeitC : { haltezeit : 0 , no_halt : false } ,
29
- HaltezeitD : { haltezeit : 0 , no_halt : false } ,
30
- HaltezeitUncategorized : { haltezeit : 0 , no_halt : false } ,
31
- } ;
32
-
33
- const TRAINRUN_LABEL_GROUP : LabelGroupDto = {
34
- id : 1 ,
35
- name : 'Default' ,
36
- labelRef : 'Trainrun' ,
37
- } ;
38
- const NODE_LABEL_GROUP : LabelGroupDto = {
39
- id : 2 ,
40
- name : 'Node' ,
41
- labelRef : 'Node' ,
42
- } ;
43
-
44
- const DEFAULT_TRAINRUN_CATEGORY : TrainrunCategory = {
45
- id : 1 , // In NGE, Trainrun.DEFAULT_TRAINRUN_CATEGORY
46
- order : 0 ,
47
- name : 'Default' ,
48
- shortName : '' , // TODO: find a better way to hide this in the graph
49
- fachCategory : 'HaltezeitUncategorized' ,
50
- colorRef : 'EC' ,
51
- minimalTurnaroundTime : 0 ,
52
- nodeHeadwayStop : 0 ,
53
- nodeHeadwayNonStop : 0 ,
54
- sectionHeadway : 0 ,
55
- } ;
56
-
57
- export const DEFAULT_TRAINRUN_FREQUENCIES : TrainrunFrequency [ ] = [
58
- {
59
- id : 2 ,
60
- order : 0 ,
61
- frequency : 30 ,
62
- offset : 0 ,
63
- name : 'Half-hourly' ,
64
- shortName : '30' ,
65
- linePatternRef : '30' ,
66
- } ,
67
- {
68
- id : 3 , // default NGE frequency takes id 3
69
- order : 1 ,
70
- frequency : 60 ,
71
- offset : 0 ,
72
- name : 'Hourly' ,
73
- /** Short name, needs to be unique */
74
- shortName : '60' ,
75
- linePatternRef : '60' ,
76
- } ,
77
- {
78
- id : 4 ,
79
- order : 2 ,
80
- frequency : 120 ,
81
- offset : 0 ,
82
- name : 'Two-hourly' ,
83
- shortName : '120' ,
84
- linePatternRef : '120' ,
85
- } ,
86
- ] ;
87
-
88
- export const DEFAULT_TRAINRUN_FREQUENCY : TrainrunFrequency = DEFAULT_TRAINRUN_FREQUENCIES [ 1 ] ;
89
-
90
- const DEFAULT_TRAINRUN_TIME_CATEGORY : TrainrunTimeCategory = {
91
- id : 0 , // In NGE, Trainrun.DEFAULT_TRAINRUN_TIME_CATEGORY
92
- order : 0 ,
93
- name : 'Default' ,
94
- shortName : '7/24' ,
95
- dayTimeInterval : [ ] ,
96
- weekday : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 ] ,
97
- linePatternRef : '7/24' ,
98
- } ;
99
-
100
- const DEFAULT_DTO : NetzgrafikDto = {
101
- resources : [ ] ,
102
- nodes : [ ] ,
103
- trainruns : [ ] ,
104
- trainrunSections : [ ] ,
105
- metadata : {
106
- netzgrafikColors : [ ] ,
107
- trainrunCategories : [ DEFAULT_TRAINRUN_CATEGORY ] ,
108
- trainrunFrequencies : [ ...DEFAULT_TRAINRUN_FREQUENCIES ] ,
109
- trainrunTimeCategories : [ DEFAULT_TRAINRUN_TIME_CATEGORY ] ,
110
- } ,
111
- freeFloatingTexts : [ ] ,
112
- labels : [ ] ,
113
- labelGroups : [ ] ,
114
- filterData : {
115
- filterSettings : [ ] ,
116
- } ,
117
- } ;
118
-
119
- const DEFAULT_TIME_LOCK : TimeLockDto = {
120
- time : null ,
121
- consecutiveTime : null ,
122
- lock : false ,
123
- warning : null ,
124
- timeFormatter : null ,
125
- } ;
126
-
127
32
/**
128
33
* Execute the search payload and collect all result pages.
129
34
*/
0 commit comments