-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.go
720 lines (711 loc) · 16.6 KB
/
constants.go
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
// Copyright 2021 readpe All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package goolx
// Equipment Types
//
// OlxAPI equipment type codes are used to accessing equipment data from Oneliner.
const (
TCNothing = 0
TCBus = 1
TCLoad = 2
TCLoadUnit = 3
TCShunt = 4
TCShuntUnit = 5
TCGen = 6
TCGenUnit = 7
TCSVD = 8
TCBranch = 9
TCLine = 10
TCXFMR = 11
TCXFMR3 = 12
TCPS = 13
TCSCAP = 14
TCMU = 15
TCArea = 16
TCZone = 17
TCNote = 18
TCSYS = 19
TCRLYGroup = 20
TCRLYOC = 21
TCRLYOCG = 21
TCRLYOCP = 22
TCRLYDS = 23
TCRLYDSG = 23
TCRLYDSP = 24
TCFuse = 25
TCPF = 26
TCSC = 27
TCSwitch = 28
TCRECLSR = 29
TCRECLSRP = 29
TCRECLSRG = 30
TCScheme = 31
TCBreaker = 32
TCCCGEN = 33
TCRLYD = 34
TCRLYV = 35
TCPILOT = 36
TCZCorrect = 37
TCBlob = 38
TCDCLine2 = 39
TCLineKink = 40
TCRLYLink = 41
TCLTC = 42
TCLTC3 = 43
TCSettings = 44
TCCount = 44
TCPicked = 100
TCPicked1 = 100
TCPicked2 = 101
TCPicked3 = 102
// Special obj handles
HNDSYS = 1
HNDPF = 2
HNDSC = 3
OLXAPIFailure = 0
OLXAPIOk = 1
// Fault browser code
SFLast = -1
SFNext = -2
SFFirst = 1
SFPrevious = -4
// Array size
MXMSGLEN = 512
MAXPATH = 260
MXDSPARAMS = 255
MXZONE = 8
MAXCCV = 10
MXSBKF = 10
)
// Parameter tokens
//
// Used for data parameter access in olxapi. Returned data type depends on token provided.
//
// Type categories:
// - 100s: string
// - 200s: double
// - 300s: integers
// - 400s: arrays of strings (tab delimited)
// - 500s: arrays of doubles
// - 600s: arrays of integers
const (
VTSTRING = 1
VTDOUBLE = 2
VTINTEGER = 3
VTARRAYSTRING = 4
VTARRAYDOUBLE = 5
VTARRAYINT = 6
BUSsName = 101
BUSsLocation = 102
BUSsComment = 103
GUsID = 104
GUsOnDate = 105
GUsOffDate = 106
SUsID = 107
SUsOnDate = 108
SUsOffDate = 109
LUsID = 110
LUsOnDate = 111
LUsOffDate = 112
BUSdKVnominal = 201
BUSdKVP = 202
BUSdAngleP = 203
BUSdSPCx = 204
BUSdSPCy = 205
LDdPload = 206
LDdQload = 207
GEdScheduledV = 208
GEdRefAngle = 209
GEdScheduledP = 210
GEdScheduledQ = 211
GEdPgen = 212
GEdQgen = 213
GEdVSourcePU = 214
GEdCurrLimit1 = 215
GEdCurrLimit2 = 216
SVdVmax = 217
SVdVmin = 218
SVdB = 219
GUdMVArating = 220
GUdRz = 221
GUdXz = 222
GUdMVA = 223
GUdPmin = 224
GUdPmax = 225
GUdQmin = 226
GUdQmax = 227
GUdSchedP = 228
GUdSchedQ = 229
SUdG = 230
SUdB = 231
SUdG0 = 232
SUdB0 = 233
LUdPload = 234
LUdQload = 235
BUSnNumber = 301
BUSnArea = 302
BUSnZone = 303
BUSnTapBus = 304
BUSnSubGroup = 305
BUSnSlack = 306
BUSnVisible = 307
LDnActive = 308
LDnBusHnd = 309
GEnCtrlBusHnd = 310
GEnSlack = 311
GEnActive = 312
GEnFixedPQ = 313
GEnBusHnd = 314
GUnOnline = 315
SVnActive = 316
SVnCtrlBusHnd = 317
SVnCtrlMode = 318
SVvnNoStep = 619
SVnBusHnd = 320
SHnBusHnd = 321
SUnOnline = 322
SUn3WX = 323
LUnOnline = 324
LUvdMW = 501
LUvdMVAR = 502
GUvdR = 503
GUvdX = 504
SVvdBinc = 505
SVvdB0inc = 506
BRnType = 301
BRnHandle = 302
BRnBus1Hnd = 303
BRnBus2Hnd = 304
BRnBus3Hnd = 305
BRnRlyGrp1Hnd = 306
BRnRlyGrp2Hnd = 307
BRnRlyGrp3Hnd = 308
BRnInService = 309
SYsFComment = 101
SYdBaseMVA = 202
SYnNObus = 303
SYnNOgen = 304
SYnNOload = 305
SYnNOshunt = 306
SYnNOline = 307
SYnNOseriescap = 308
SYnNOxfmr = 309
SYnNOxfmr3 = 310
SYnNOps = 311
SYnNOmutual = 312
SYnNODSRly = 313
SYnNOOCRly = 314
SYnNORclsr = 315
SYnNODiffRly = 316
SYnNOVRly = 317
SYnNOIED = 318
LNsName = 101
LNsID = 102
LNsLengthUnit = 103
LNsType = 104
LNsOnDate = 105
LNsOffDate = 106
LNdR = 201
LNdX = 202
LNdR0 = 203
LNdX0 = 204
LNdG1 = 205
LNdB1 = 206
LNdG2 = 207
LNdB2 = 208
LNdG10 = 209
LNdB10 = 210
LNdG20 = 211
LNdB20 = 212
LNdLength = 213
LNnBus1Hnd = 301
LNnBus2Hnd = 302
LNnRlyGr1Hnd = 303
LNnRlyGr2Hnd = 304
LNnInService = 305
LNnMuPairHnd = 306
LNvdRating = 501
XRsName = 101
XRsID = 102
XRsCfgP = 103
XRsCfgS = 104
XRsCfgST = 105
XRsCfg1 = 103
XRsCfg2 = 104
XRsCfg2T = 105
XRsOnDate = 106
XRsOffDate = 107
XRdRG1 = 201
XRdXG1 = 202
XRdRG2 = 203
XRdXG2 = 204
XRdRGN = 205
XRdXGN = 206
XRdMVA = 207
XRdPriTap = 208
XRdSecTap = 209
XRdTap1 = 210
XRdTap2 = 211
XRdR = 212
XRdX = 213
XRdB = 214
XRdR0 = 215
XRdX0 = 216
XRdB0 = 217
XRdMinTap = 218
XRdMaxTap = 219
XRdMaxVW = 220
XRdMinVW = 221
XRdLTCstep = 222
XRdG1 = 223
XRdB1 = 224
XRdG2 = 225
XRdB2 = 226
XRdG10 = 227
XRdB10 = 228
XRdG20 = 229
XRdB20 = 230
XRdMVA1 = 231
XRdMVA2 = 232
XRdMVA3 = 233
XRdBaseMVA = 234
XRdLTCCenterTap = 235
XRnBus1Hnd = 301
XRnBus2Hnd = 302
XRnLTCCtrlBusHnd = 303
XRnMetered = 304
XRnInService = 305
XRnLTCside = 306
XRnLTCtype = 307
XRnAuto = 308
XRnRlyGr1Hnd = 309
XRnRlyGr2Hnd = 310
XRnLTCPriority = 311
XRnLTCGanged = 312
X3sName = 101
X3sID = 102
X3sCfgP = 103
X3sCfgS = 104
X3sCfgT = 105
X3sCfgST = 106
X3sCfgTT = 107
X3sCfg1 = 103
X3sCfg2 = 104
X3sCfg3 = 105
X3sCfg2T = 106
X3sCfg3T = 107
X3sOnDate = 108
X3sOffDate = 109
X3dPriTap = 201
X3dSecTap = 202
X3dTerTap = 203
X3dTap1 = 204
X3dTap2 = 205
X3dTap3 = 206
X3dRps = 207
X3dXps = 208
X3dR0ps = 209
X3dX0ps = 210
X3dRpt = 211
X3dXpt = 212
X3dR0pt = 213
X3dX0pt = 214
X3dRst = 215
X3dXst = 216
X3dR0st = 217
X3dX0st = 218
X3dB = 219
X3dB0 = 220
X3dRG1 = 221
X3dRG2 = 222
X3dRG3 = 223
X3dXG1 = 224
X3dXG2 = 225
X3dXG3 = 226
X3dRGN = 227
X3dXGN = 228
X3dMVA1 = 229
X3dMVA2 = 230
X3dMVA3 = 231
X3dBaseMVA = 232
X3dLTCCenterTap = 233
X3dMinVW = 234
X3dMaxVW = 235
X3dMinTap = 236
X3dMaxTap = 237
X3dLTCstep = 238
X3nInService = 301
X3nBus1Hnd = 302
X3nBus2Hnd = 303
X3nBus3Hnd = 304
X3nAuto = 305
X3nFictBusNo = 306
X3nRlyGr1Hnd = 307
X3nRlyGr2Hnd = 308
X3nRlyGr3Hnd = 309
X3nLTCPriority = 310
X3nLTCGanged = 311
XR3nLTCCtrlBusHnd = 312
PSsName = 101
PSsID = 102
PSsOnDate = 103
PSsOffDate = 104
PSdAngle = 201
PSdR = 202
PSdX = 203
PSdB = 204
PSdR0 = 205
PSdX0 = 206
PSdB0 = 207
PSdR2 = 208
PSdX2 = 209
PSdB2 = 210
PSdAngleMax = 211
PSdAngleMin = 212
PSdMWmax = 213
PSdMWmin = 214
PSdMVA1 = 215
PSdMVA2 = 216
PSdMVA3 = 217
PSnInService = 318
PSnBus1Hnd = 319
PSnBus2Hnd = 320
PSnControlMode = 321
PSnRlyGr1Hnd = 322
PSnRlyGr2Hnd = 323
SCsName = 101
SCsID = 102
SCsOnDate = 103
SCsOffDate = 104
SCdX = 201
SCdR = 202
SCdX0 = 203
SCdR0 = 204
SCdIpr = 205
SCnBus1Hnd = 306
SCnBus2Hnd = 307
SCnInService = 308
SCnSComp = 309
SCnRlyGr1Hnd = 310
SCnRlyGr2Hnd = 311
MUdFrom1 = 201
MUdFrom2 = 202
MUdTo1 = 203
MUdTo2 = 204
MUdX = 205
MUdR = 206
MUnHndLine1 = 307
MUnHndLine2 = 308
MUnOrient1 = 309
MUnOrient2 = 310
MUvdX = 511
MUvdR = 512
MUvdFrom1 = 513
MUvdFrom2 = 514
MUvdTo1 = 515
MUvdTo2 = 516
RGsNote = 101
RGdBreakerTime = 201
RGnInService = 302
RGnBranchHnd = 303
RGnPrimaryHnd = 304
RGnBackupHnd = 305
RGnTripLogicHnd = 306
RGnReclLogicHnd = 307
RGnOps = 308
RGvdRecloseInt = 501
OGsID = 101
OGsAssetID = 102
OGsType = 103
OGsComment = 104
OGsLibrary = 105
OPsID = 106
OPsAssetID = 107
OPsType = 108
OPsComment = 109
OPsLibrary = 110
FSsID = 111
FSsAssetID = 112
FSsType = 113
FSsComment = 114
FSsLibrary = 115
OGdCT = 201
OGdTap = 202
OGdTDial = 203
OGdInst = 204
OGdInstDelay = 205
OGdTimeAdd = 206
OGdTimeMult = 207
OGdTimeAdd2 = 208
OGdTimeMult2 = 209
OGdResetTime = 210
OPdCT = 211
OPdTap = 212
OPdTDial = 213
OPdInst = 214
OPdInstDelay = 215
OPdTimeAdd = 216
OPdTimeMult = 217
OPdTimeAdd2 = 218
OPdTimeMult2 = 219
OPdVCtrlRestPcnt = 220
OPdResetTime = 221
OPnRlyGrHnd = 301
OGnRlyGrHnd = 302
OGnInService = 303
OGnDirectional = 304
OGnIDirectional = 305
OGnPolar = 306
OGnFlatDelay = 307
OGnDCOffset = 308
OGnSignalOnly = 309
OPnInService = 310
OPnDirectional = 311
OPnIDirectional = 312
OPnPolar = 313
OPnByCTConnect = 314
OPnFlatDelay = 315
OPnDCOffset = 316
OPnSignalOnly = 317
OPnVoltControl = 318
FSnRlyGrHnd = 319
FSnInService = 320
FSnCurve = 321
OGvdDirSetting = 501
OPvdDirSetting = 502
DGsID = 101
DGsAssetID = 102
DGsType = 103
DGsDSType = 104
DGsComment = 105
DGsLibrary = 106
DGsParam = 107
DPsID = 108
DPsAssetID = 109
DPsType = 110
DPsDSType = 111
DPsComment = 112
DPsLibrary = 113
DPsParam = 114
DGdCT = 201
DGdVT = 202
DGdKmag = 203
DGdKang = 204
DGdMinI = 205
DPdCT = 206
DPdVT = 207
DPdMinI = 208
DGnInService = 301
DGnRlyGrHnd = 302
DGnParamCount = 303
DGnSignalOnly = 304
DPnInService = 305
DPnRlyGrHnd = 306
DPnParamCount = 307
DPnSignalOnly = 308
DGvdParams = 501
DGvParams = 402
DGvParamLabels = 403
DGvdDelay = 504
DGvdReach = 505
DGvdReach1 = 506
DPvdParams = 507
DPvParams = 408
DPvParamLabels = 409
DPvdDelay = 510
DPvdReach = 511
DPvdReach1 = 512
CPsID = 101
CPsAssetID = 102
CPsTypeFast = 103
CPsTypeSlow = 104
CPsComment = 105
CPsLibrary = 106
CGsID = 107
CGsAssetID = 108
CGsTypeFast = 109
CGsTypeSlow = 110
CGsComment = 111
CGsLibrary = 112
CPdPickupF = 201
CPdPickupS = 202
CPdTimeAddF = 203
CPdTimeAddS = 204
CPdTimeMultF = 205
CPdTimeMultS = 206
CPdMinTF = 207
CPdMinTS = 208
CPdHiAmps = 209
CPdHiAmpsDelay = 210
CPdRecIntvl1 = 211
CPdRecIntvl2 = 212
CPdRecIntvl3 = 213
CPdIntrTime = 214
CGdPickupF = 215
CGdPickupS = 216
CGdTimeAddF = 217
CGdTimeAddS = 218
CGdTimeMultF = 219
CGdTimeMultS = 220
CGdMinTF = 221
CGdMinTS = 222
CGdHiAmps = 223
CGdHiAmpsDelay = 224
CGdRecIntvl1 = 225
CGdRecIntvl2 = 226
CGdRecIntvl3 = 227
CGdIntrTime = 228
CPnInService = 301
CPnTotalOps = 302
CPnFastOps = 303
CPnCurveInUse = 304
CPnTAddAppl = 305
CPnTMultAppl = 306
CPnRlyGrHnd = 307
CGnInService = 308
CGnTotalOps = 309
CGnFastOps = 310
CGnCurveInUse = 311
CGnTAddAppl = 312
CGnTMultAppl = 313
CGnRlyGrHnd = 314
FTdXPt = 201
FTdRPt = 202
FTdXNt = 203
FTdRNt = 204
FTdXZt = 205
FTdRZt = 206
FTdRt = 207
FTdXt = 208
FTdXR = 209
FTdMVA = 210
FTdXRANSI = 211
FTnNOfaults = 301
SWsID = 101
SWsName = 102
SWsOnDate = 103
SWsOffDate = 104
SWdRating = 201
SWnBus1Hnd = 301
SWnBus2Hnd = 302
SWnRlyGrHnd1 = 303
SWnRlyGrHnd2 = 304
SWnInService = 305
SWnStatus = 306
SWnDefault = 307
CCsOnDate = 101
CCsOffDate = 102
CCdMVArating = 201
CCdVmax = 202
CCdVmin = 203
CCnVloc = 301
CCnInService = 302
CCvdV = 501
CCvdI = 502
CCvdAng = 503
RDsID = 101
RDsAssetID = 102
RDsTLCCurvePh = 103
RDsTLCCurveI0 = 104
RDsTLCCurveI2 = 105
RVsID = 106
RVsAssetID = 107
RVsOVCurve = 108
RVsUVCurve = 109
RDdCTR1 = 201
RDdPickupPh = 202
RDdPickup3I0 = 203
RDdPickup3I2 = 204
RDdTLCTDDelayPh = 205
RDdTLCTDDelayI0 = 206
RDdTLCTDDelayI2 = 207
RVdCTR = 208
RVdOVTPickup = 209
RVdOVTDelay = 210
RVdOVIPickup = 211
RVdUVTPickup = 212
RVdUVTDelay = 213
RVdUVIPickup = 214
RDnRlyGrpHnd = 301
RDnLocalCTHnd1 = 302
RDnRmeDevHnd1 = 303
RDnRmeDevHnd2 = 304
RDnSignalOnly = 305
RDnInService = 306
RVnRlyGrpHnd = 307
RVnSignalOnly = 308
RVnVoltOperate = 309
RVnInService = 310
BKsID = 101
BKsEquipGrp1 = 102
BKsEquipGrp2 = 103
BKdRating1 = 201
BKdRating2 = 202
BKdCPT1 = 203
BKdCPT2 = 204
BKdCycles = 205
BKdOperatingKV = 206
BKdRatedKV = 207
BKdK = 208
BKdNACD = 209
BKnRatingType = 301
BKnTotalOps1 = 302
BKnTotalOps2 = 303
BKnDontDerate = 304
BKnInService = 305
BKnInterrupt1 = 306
BKnInterrupt2 = 307
BKnBusHnd = 308
BKvdRecloseInt1 = 501
BKvdRecloseInt2 = 502
BKvnG1DevHnd = 603
BKvnG1OutageHnd = 604
BKvnG2DevHnd = 605
BKvnG2OutageHnd = 606
LSsID = 101
LSsAssetID = 102
LSsScheme = 103
LSsEquation = 104
LSsVariables = 105
LSnSignalOnly = 301
LSnInService = 302
LSnRlyGrpHnd = 303
)
// ArrayLengths map for GetData function
var ArrayLengths = map[int]map[int]int{
TCBreaker: {
BKvnG1DevHnd: MXSBKF,
BKvnG2DevHnd: MXSBKF,
BKvnG1OutageHnd: MXSBKF,
BKvnG2OutageHnd: MXSBKF,
},
TCGenUnit: {
GUvdR: 5,
GUvdX: 5,
},
TCLoadUnit: {
LUvdMW: 3,
LUvdMVAR: 3,
},
TCSVD: {
SVvdBinc: 3,
SVvdB0inc: 3,
},
TCLine: {LNvdRating: 4},
TCRLYGroup: {RGvdRecloseInt: 3},
TCRLYOCG: {OGvdDirSetting: 2},
TCRLYOCP: {OPvdDirSetting: 2},
TCRLYDSG: {
DGvdParams: MXDSPARAMS,
DGvdDelay: MXZONE,
DGvdReach: MXZONE,
DGvdReach1: MXZONE,
},
TCRLYDSP: {
DPvdParams: MXDSPARAMS,
DPvdDelay: MXZONE,
DPvdReach: MXZONE,
DPvdReach1: MXZONE,
},
}