-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMinMaxValues.mc2
More file actions
146 lines (119 loc) · 5.25 KB
/
MinMaxValues.mc2
File metadata and controls
146 lines (119 loc) · 5.25 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// @endpoint https://resverianaliz.aydemyenilenebilir.com.tr:8889/api/v0/exec
// @theme dark-blue
{
'title' 'Min-Max Values'
'cellHeight' 100
'options' {
'showErrors' true 'eventHandler' 'type=popup,tag=dashboard'
'scheme' 'CHARTANA'
'timeZone' 'AUTO'
}
'vars' {
'plant' 'Yalova'
'TurbineId' '1'
'startDate' [ NOW 1 d - ISO8601 'T' SPLIT 0 GET '21:00:00Z' ] 'T' JOIN TOTIMESTAMP //NOW 7 d - // 1658308294000000 // NOW
'endDate' [ NOW ISO8601 'T' SPLIT 0 GET '20:59:59Z' ] 'T' JOIN TOTIMESTAMP // NOW //1658913094000000 //604800000000
'myreadtoken' '4vM.a2aMxhl2qCB88Gutar8jXe4R4cqp.QaYYHtumjJg9DCHgXXY1_qIoBhzeh6PIdfX9KLtgeK1O0YHXcr0qA2ZPQrLAurl_PbQAkNjvy3WNq4fNEv434rOXWMsGq55X4qYtTOCtx53bqFwUXsRr6.B3sKF1YE1At8iEE2RyxC9RYOnS7UT4F'
}
'tiles' [
{
'title' 'Plant'
'x' 0 'y' 0 'w' 2 'h' 1
'type' 'input:list'
'macro' <%
[ $myreadtoken '~.*' { 'type' 'Wind' } ] FINDSETS STACKTOLIST 1 GET 'plant' GET LSORT 'listOfPlants' STORE
{
'data' $listOfPlants
'globalParams' { 'input' { 'value' $plant } } // the initial selected value coming from global vars
'events' [ { 'type' 'variable' 'tags' [ 'plant' 'TurbineId' ] 'selector' 'plant' } ] // Event definition
}
%>
}
{
'title' 'Turbine'
'options' { 'eventHandler' 'type=(variable),tag=(startDate|endDate|TurbineId|TurbineId2|plant|plant2)' }
'x' 2 'y' 0 'w' 2 'h' 1
'type' 'input:list'
'macro' <%
[ $myreadtoken '~.*' { 'plant' $plant } ] FINDSETS STACKTOLIST 1 GET 'TurbineId' GET <% TOLONG %> SORTBY 'listOfTurbines' STORE
{
'data' $listOfTurbines
'globalParams' { 'input' { 'value' $TurbineId } } // the initial selected value coming from global vars
'events' [ { 'type' 'variable' 'tags' [ 'TurbineId' 'plant' ] 'selector' 'TurbineId' } ] // Event definition
}
%>
}
{
'title' 'Start Date'
'x' 4 'y' 0 'w' 3 'h' 1
'options' { 'input' { 'showButton' true } }
'type' 'input:date'
'macro' <%
{
'data' $startDate //[ NOW 1 w - NOW ]
'events' [
{ 'type' 'variable' 'tags' [ 'startDate' 'plant' 'TurbineId' ] 'selector' 'startDate' }
]
}
%>
}
{
'title' 'End Date'
'x' 7 'y' 0 'w' 3 'h' 1
'options' { 'input' { 'showButton' true } }
'type' 'input:date'
'macro' <%
{
'data' $endDate // [ NOW ]
'events' [
{ 'type' 'variable' 'tags' [ 'endDate' 'plant' 'TurbineId' ] 'selector' 'endDate' }
]
}
%>
}
{
'type' 'tabular' 'x' 0 'y' 1 'w' 12 'h' 8
'title' 'Min-Max Values Table'
'options' { 'eventHandler' 'type=(variable),tag=(startDate|endDate|TurbineId|TurbineId2|plant|plant2)'
// suscribe to events
'showLoader' true
'tabular' { 'fixedWidth' true }
}
'macro' <%
[ $myreadtoken '~.*' { 'plant' $plant 'TurbineId' $TurbineId }
$startDate TOSTRING
$endDate TOSTRING
] FETCH 'data' STORE
$data { '.app' '' '.uuid' '' } RELABEL 'data' STORE //relabel the atributes --- this is the data to train on
//bucketize so all signals are aligned
[ $data bucketizer.max 0 0 1 ] BUCKETIZE FILLPREVIOUS FILLNEXT 'lastbucket' STORE
[ $data bucketizer.min 0 0 1 ] BUCKETIZE FILLPREVIOUS FILLNEXT 'firstbucket' STORE
$firstbucket SIZE 1 - 'length_of_variables' STORE
{
'columns' [ 'Variable' 'Min Value' 'Max Value' ]
'rows' [
0 $length_of_variables
<%
'i' STORE
$lastbucket $i GET NAME 'variableName' STORE
$firstbucket $i GET 100.0 * RINT 100.0 / VALUES 0 GET 'firstvalue' STORE
$lastbucket $i GET 100.0 * RINT 100.0 / VALUES 0 GET 'lastvalue' STORE
//$lastvalue $firstvalue - 'diff' STORE
[ $variableName $firstvalue $lastvalue ] //$diff ]
%> FOR
]
}
'values' STORE
{ 'data' $values
'globalParams' {
'tabular' {
'fixedWidth' true
'sortable' true
'filterable' true
}
}
} // data can also be a gts or a list thereof
%>
}
]
}