-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTrkData.TB3.VBScript.wsc
1934 lines (1402 loc) · 63.8 KB
/
TrkData.TB3.VBScript.wsc
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
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<component>
<?component error="true" debug="true"?>
<registration
progid="AGI.TrkData.TB3.VBScript.Example"
classid="{E159ADA5-247A-4d4a-B43B-B254ADF5C506}"
description="TrkData.TB3TrackingDataPrv"
version="1.00"
>
</registration>
<public>
<!-- Properties -->
<property name="FileName">
<get internalName="GetFileName"/>
</property>
<property name="SupportsMultipleTrackers">
<get internalName="GetSupportsMultipleTrackers"/>
</property>
<property name="SupportsSave">
<get internalName="GetSupportsSave"/>
</property>
<property name="ReferenceYear">
<get internalName="GetRefYear"/>
<put internalName="SetRefYear"/>
</property>
<property name="DefaultClassification">
<get internalName="GetClassification"/>
<put internalName="SetClassification"/>
</property>
<!-- Methods -->
<method name="Reset"/>
<method name="OpenFile">
<parameter name="newVal"/>
<parameter name="newFile"/>
</method>
<method name="GetObsSet">
<parameter name="setColl"/>
</method>
<method name="GetSupportedObsSet">
<parameter name="setColl"/>
</method>
<method name="SaveObs">
<parameter name="pEnum"/>
<parameter name="bAppend"/>
</method>
<method name="GetAppConfig"/>
<!-- New method added to support ODTK 6.1.1 -->
<method name="CloseFile"/>
</public>
<script language="VBScript">
<![CDATA[
'-------------------------------------------------------------------------
' Member variables
'-------------------------------------------------------------------------
Option explicit
Dim m_sFileName ' File name
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Const eMTRange = 1
Const eMTDoppler = 2
Const eMTAzimuth = 11
Const eMTElevation = 12
Const eMTRightAscension = 18
Const eMTDeclination = 19
Const eMTSBRightAscension = 31
Const eMTSBDeclination = 32
Const eMTSBRange = 33
Const eMTSBAzimuth = 34
Const eMTSBElevation = 35
Const eGroundReceiveTime = 0
Const eSatelliteTransmitTime = 1
Const eGroundTransmitTime = 2
Const eSatelliteReceiveTime = 3
Dim m_sfileSysObj
Dim m_Stream
Set m_sfileSysObj = CreateObject("Scripting.FileSystemObject")
m_sFileName = ""
Dim version
version = "6.0"
Dim textFile, ObjectStr, versionStr, regValue, ODDBObjectFile
versionStr = "HKEY_LOCAL_MACHINE\SOFTWARE\AGI\ODTK\" & version & "\InstallHome"
GetRegKey(versionStr)
ODDBObjectFile = m_sfileSysObj.Buildpath(regValue, "\CodeSamples\Extend\ODTK\" & "AGI.ODTK.ProgIDs.txt")
Set textFile = m_sfileSysObj.OpenTextFile(ODDBObjectFile, ForReading)
Dim pObsSet
ObjectStr = textFile.ReadLine ' ObjectStr = "AgMach10_*.AgODObsSet"
Set pObsSet = CreateObject(ObjectStr)
pObsSet.Date.Unit = "UTCG"
Dim pObs
ObjectStr = textFile.ReadLine ' ObjectStr = "IAgODProvideTrackingData*.AgODGenericObs"
Set pObs = CreateObject(ObjectStr)
pObs.Date.Unit = "UTCG"
Dim m_RefYr
m_RefYr = 2011
Dim m_classification
m_classification = "U"
Dim pAttrBuilder
ObjectStr = textFile.ReadLine ' ObjectStr = "AgAttrAutomation*.AgAttrBuilder"
Set pAttrBuilder = CreateObject(ObjectStr)
Dim m_scope
Set m_scope = pAttrBuilder.NewScope()
pAttrBuilder.AddIntDispatchProperty _
m_scope, _
"ReferenceYear", _
"Reference Year", _
"ReferenceYear", _
0
pAttrBuilder.AddStringDispatchProperty _
m_scope, _
"DefaultClassification", _
"Security Classification", _
"DefaultClassification", _
0
Set pAttrBuilder = Nothing
'-------------------------------------------------------------------------
' Following supports "SaveObs"
'-------------------------------------------------------------------------
Dim bHaveRange, bHaveDop, bHaveAz, bHaveEl, bHaveDec, bHaveRA, bHaveSBDec, bHaveSBRA
Dim bHaveSBAz, bHaveSBEl, bHaveSBRange
Dim bNewLine
bNewLine = False
Dim ObsDateStr
Dim RangeValue, ElValue, AzValue, DopValue, DecValue, RAValue, SBDecValue, SBRAValue, SBAzValue, SBElValue, SBRangeValue
Dim RgD_Sign, RRD_Sign, ElD_Sign, DecD_Sign, AzD_Sign, SBDecD_Sign, RAD_Sign
Dim SBAzD_Sign, SBElD_Sign
Dim YearOfEquinox, EquinoxEpoch
'-------------------------------------------------------------------------
' Define equinox epoch constants
'-------------------------------------------------------------------------
const eDefaultEquinoxEpoch = -1
const eJ2000Epoch = 0
const eB1950Epoch = 1
const eOfDate = 2
const eYearOfObsJan0 = 3
'-------------------------------------------------------------------------
' Define equinox type constants
'-------------------------------------------------------------------------
const eDefaultEquinoxType = -1
const eMeanEquatorAndEquinox = 0
const eTrueEquatorAndEquinox = 1
'-------------------------------------------------------------------------
' Define tracking vector type constants
'-------------------------------------------------------------------------
const eNotUsed = -1
const ePosOnly = 0
const eVelOnly = 1
const ePosVel = 2
'-------------------------------------------------------------------------
' Define tracking vector coordinate type constants
'-------------------------------------------------------------------------
const eCBI = 0
const eCBF = 1
Dim vehOut
Dim stnAnt
Dim stnOut
Dim antOut
Dim jday
Dim mam
Dim vehOutNext
Dim stnAntNext
Dim jdayNext
Dim mamNext
Dim foundBadVeh
foundBadVeh = False
Dim foundBadStn
foundBadStn = False
Dim logValue
Dim facID, satID
Dim RgScaleD, SBRgScaleD
Dim recType
Dim recTypes(9)
Dim nRecTypes
Dim XPos, XPos_Sign, XPosScaleD
Dim YPos, YPos_Sign, YPosScaleD
Dim ZPos, ZPos_Sign, ZPosScaleD
'-------------------------------------------------------------------------
Function GetFileName()
'-------------------------------------------------------------------------
GetFileName = m_sFileName
End Function
'-------------------------------------------------------------------------
' SupportsSave property [read-only]
'-------------------------------------------------------------------------
Function GetSupportsSave()
GetSupportsSave = True
End Function
'-------------------------------------------------------------------------
' SupportsMultipleTrackers property [read-only]
'-------------------------------------------------------------------------
Function GetSupportsMultipleTrackers()
GetSupportsMultipleTrackers = True
End Function
'-------------------------------------------------------------------------
' Classification property
'-------------------------------------------------------------------------
Function GetClassification()
GetClassification = m_classification
End Function
Function SetClassification(classification)
m_classification = classification
End Function
'-------------------------------------------------------------------------
' ReferenceYear property
'-------------------------------------------------------------------------
Function GetRefYear()
GetRefYear = m_RefYr
End Function
Function SetRefYear(year)
m_RefYr = year
End Function
'-------------------------------------------------------------------------
' Reset method
'-------------------------------------------------------------------------
Function Reset()
if m_sFileName <> "" Then
Dim newVal
newVal = m_sFileName
OpenFile newVal, False
End if
End Function
'-------------------------------------------------------------------------
' OpenFile method
'-------------------------------------------------------------------------
Function OpenFile(newVal, newFile)
If m_sFileName <> "" Then
m_Stream.Close
m_sFileName = ""
End If
m_sFileName = newVal
If newFile Then
Set m_Stream = m_sfileSysObj.OpenTextFile(m_sFileName, ForWriting, True)
Else
Set m_Stream = m_sfileSysObj.OpenTextFile(m_sFileName, ForReading)
End If
End Function
'-------------------------------------------------------------------------
' GetObsSet method
'-------------------------------------------------------------------------
Function GetObsSet(setColl)
Dim numSets
Dim line
Dim recType
Dim satID, facID, Hr, Mi, ddd
Dim SeD, ElD, AzD, RgD, RRD, RAD, DecD, RgScaleD
Dim RA_HH, RA_MM, RA_SSS
Dim ValidAz, ValidEl, ValidRng, ValidRR, ValidDec, ValidRA
Dim ValidSBDec, ValidSBRA, ValidSBAz, ValidSBEl, ValidSBRng
Dim dateStr
numSets = 0
pObsSet.Clear
Do Until m_Stream.AtEndOfStream Or numSets > 0
line = m_Stream.ReadLine
' check for valid line, otherwise skip it
if (left(line,2) = "))") then
recType = Mid(line, 8, 1)
facID = Mid(line, 9, 3)
satID = Mid(line, 12, 5)
'-------------------------------------------------------------------------
' Grab the time stamp. This is common to many record types.
'-------------------------------------------------------------------------
if (recType <> 4 and recType <> 8 and recType <> 9) Then
ddd = Mid(line, 17, 3)
Hr = Mid(line, 20, 2)
Mi = Mid(line, 22, 2)
SeD = Mid(line, 24, 5)
End If
ValidAz = False
ValidEl = False
ValidRng = False
ValidRR = False
ValidDec = False
ValidRA = False
ValidSBDec = False
ValidSBRA = False
ValidSBAz = False
ValidSBEl = False
ValidSBRng = False
RgD = 0
RRD = 0
RA_HH = 0
RA_MM = 0
RA_SSS = 0
DecD = 0
AzD = 0
ElD = 0
RgScaleD = 0
EquinoxEpoch = eDefaultEquinoxEpoch
'-------------------------------------------------------------------------
' Start processing measurements based on record type. Note that the
' measurement weights are ignored since they are not relevant to ODTK
'-------------------------------------------------------------------------
Select Case recType
Case 0 ' Range Rate
ValidRR = True
RRD_Sign = Mid(line, 29, 1)
RRD = Mid(line, 30, 7)
If (RRD_Sign = 1) Then
RRD = - RRD
End If
Case 1 ' Az & El
ValidAz = True
ValidEl = True
ElD_Sign = Mid(line, 29, 1)
ElD = Mid(line, 30, 6)
If (ElD_Sign = 1) Then
ElD = - ElD
End If
AzD = Mid(line, 37, 7)
Case 2 'Az, El, & Range
ValidAz = True
ValidEl = True
ValidRng = True
ElD_Sign = Mid(line, 29, 1)
ElD = Mid(line, 30, 6)
If (ElD_Sign = 1) Then
ElD = - ElD
End If
AzD = Mid(line, 37, 7)
RgD = Mid(line, 45, 7)
RgScaleD = Mid(line, 52, 1)
Case 3 'Az, El, Range, & Doppler
ValidAz = True
ValidEl = True
ValidRng = True
ValidRR = True
ElD_Sign = Mid(line, 29, 1)
ElD = Mid(line, 30, 6)
If (ElD_Sign = 1) Then
ElD = - ElD
End If
AzD = Mid(line, 37, 7)
RgD = Mid(line, 45, 7)
RgScaleD = Mid(line, 52, 1)
RRD_Sign = Mid(line, 54, 1)
RRD = Mid(line, 55, 7)
If (RRD_Sign = 1) Then
RRD = - RRD
End If
Case 4 'Az, El, Range, & Doppler and all 4 rates of change
ValidAz = True
ValidEl = True
ValidRng = True
ValidRR = True
'-------------------------------------------------------------------------
' read and parse the second line in this record
'-------------------------------------------------------------------------
line = m_Stream.ReadLine
ddd = Mid(line, 1, 3)
Hr = Mid(line, 4, 2)
Mi = Mid(line, 6, 2)
SeD = Mid(line, 8, 5)
ElD_Sign = Mid(line, 13, 1)
ElD = Mid(line, 14, 6)
If (ElD_Sign = 1) Then
ElD = - ElD
End If
AzD = Mid(line, 21, 7)
RgD = Mid(line, 29, 7)
RgScaleD = Mid(line, 36, 1)
RRD_Sign = Mid(line, 38, 1)
RRD = Mid(line, 39, 7)
If (RRD_Sign = 1) Then
RRD = - RRD
End If
Case 5 ' (Ground) Right Ascension and Declination
ValidDec = True
ValidRA = True
DecD_Sign = Mid(line, 29, 1)
DecD = Mid(line, 30, 6)
If (DecD_Sign) = 1 Then
DecD = - DecD
End If
RA_HH = Mid(line, 37, 2)
RA_MM = Mid(line, 39, 2)
RA_SSS = Mid(line, 41, 3)
YearOfEquinox = Mid(line, 45, 1)
Select Case YearOfEquinox
Case 0
EquinoxEpoch = eOfDate
Case 1
EquinoxEpoch = eYearOfObsJan0
Case 2
EquinoxEpoch = eJ2000Epoch
Case 3
EquinoxEpoch = eB1950Epoch
Case Else
EquinoxEpoch = eJ2000Epoch
End Select
Case 6 ' Range
ValidRng = True
' Ignore the first character in column 29
RgD = Mid(line, 30, 7)
RgScaleD = Mid(line, 37, 1)
Case 7 ' ECF Cartesian Position and Velocity Vectors
' Not currently supported
Case 8 ' Space Based Azimuth, Elevation, and maybe Range
ValidSBAz = True
ValidSBEl = True
'-------------------------------------------------------------------------
' read and parse the second line in this record
'-------------------------------------------------------------------------
line = m_Stream.ReadLine
ddd = Mid(line, 1, 3)
Hr = Mid(line, 4, 2)
Mi = Mid(line, 6, 2)
SeD = Mid(line, 8, 5)
ElD_Sign = Mid(line, 13, 1)
ElD = Mid(line, 14, 6)
If (ElD_Sign = 1) Then
ElD = - ElD
End If
AzD = Mid(line, 21, 7)
' Space based range values may be zero or blank as many sources don't
' populate this field. In which case the scale term is often blank.
RgD = Mid(line, 29, 7)
' Check for blank values first so we don't throw an error trying to
' convert them to a double.
If (RgD <> " ") Then
If (RgD <> 0) Then
RgScaleD = Mid(line, 36, 1)
ValidSBRng = True
Else
RgScaleD = 0
End If
Else
RgD = 0
RgScaleD = 0
End IF
XPos_Sign = Mid(line, 39, 1)
XPos = Mid(line, 40, 8)
XPosScaleD = Mid(line, 48, 1)
If (XPos_Sign = 1) Then
XPos = - XPos
End If
YPos_Sign = Mid(line, 49, 1)
YPos = Mid(line, 50, 8)
YPosScaleD = Mid(line, 58, 1)
If (YPos_Sign = 1) Then
YPos = - YPos
End If
ZPos_Sign = Mid(line, 59, 1)
ZPos = Mid(line, 60, 8)
ZPosScaleD = Mid(line, 68, 1)
If (ZPos_Sign = 1) Then
ZPos = - ZPos
End If
Case 9 ' Space Based Right Ascension, Declination, and maybe Range
ValidSBDec = True
ValidSBRA = True
'-------------------------------------------------------------------------
' read and parse the second line in this record
'-------------------------------------------------------------------------
line = m_Stream.ReadLine
ddd = Mid(line, 1, 3)
Hr = Mid(line, 4, 2)
Mi = Mid(line, 6, 2)
SeD = Mid(line, 8, 5)
DecD_Sign = Mid(line, 13, 1)
DecD = Mid(line, 14, 6)
If (DecD_Sign = 1) Then
DecD = - DecD
End If
RA_HH = Mid(line, 21, 2)
RA_MM = Mid(line, 23, 2)
RA_SSS = Mid(line, 25, 3)
YearOfEquinox = Mid(line, 29, 1)
Select Case YearOfEquinox
Case 0
EquinoxEpoch = eOfDate
Case 1
EquinoxEpoch = eYearOfObsJan0
Case 2
EquinoxEpoch = eJ2000Epoch
Case 3
EquinoxEpoch = eB1950Epoch
Case Else
EquinoxEpoch = eJ2000Epoch
End Select
' Space based range values may be zero or blank as many sources don't
' populate this field. In which case the scale term is often blank.
RgD = Mid(line, 30, 7)
' Check for blank values first so we don't throw an error trying to
' convert them to a double.
If (RgD <> " ") Then
If (RgD <> 0) Then
RgScaleD = Mid(line, 37, 1)
ValidSBRng = True
Else
RgScaleD = 0
End If
Else
RgD = 0
RgScaleD = 0
End IF
XPos_Sign = Mid(line, 39, 1)
XPos = Mid(line, 40, 8)
XPosScaleD = Mid(line, 48, 1)
If (XPos_Sign = 1) Then
XPos = - XPos
End If
YPos_Sign = Mid(line, 49, 1)
YPos = Mid(line, 50, 8)
YPosScaleD = Mid(line, 58, 1)
If (YPos_Sign = 1) Then
YPos = - YPos
End If
ZPos_Sign = Mid(line, 59, 1)
ZPos = Mid(line, 60, 8)
ZPosScaleD = Mid(line, 68, 1)
If (ZPos_Sign = 1) Then
ZPos = - ZPos
End If
Case Else
' Msgbox "Invalid recType = " & recType
End Select
'-------------------------------------------------------------------------
' Convert measurements to engineering units
'-------------------------------------------------------------------------
AzD = AzD / 10000.0 ' convert to degrees
ElD = ElD / 10000.0 ' convert to degrees
DecD = DecD / 10000.0 ' convert to degrees
RgD = RgD * 10^(RgScaleD - 5) ' convert to km
RRD = RRD / 100 ' convert to m/sec
RAD = 15 * ( RA_HH + RA_MM/60.0 + RA_SSS/36000.0) ' convert to deg
'-------------------------------------------------------------------------
' Format date in UTCJFOUR format. This is the closest
' representation to what was input and avoids messy date
' conversion code. Let ODTK do the work!
'-------------------------------------------------------------------------
SeD = SeD / 1000.0 ' Convert millisec to seconds
dateStr = ddd & "/" & m_RefYr & " " & Hr & ":" & Mi & ":" & SeD
'-------------------------------------------------------------------------
' Initialize observation and obs set
'-------------------------------------------------------------------------
pObs.date.unit = "UTCJFOUR"
pObs.date = dateStr
pObs.timeOrigin = eGroundReceiveTime
pObs.TrackerIDs.Clear
pObs.TrackerIDs.Insert 0, facID ' Facility must be first item
pObs.TrackerIDs.Insert 1, satID ' Satellites follow Facility
'-------------------------------------------------------------------------
' Initialize tracker vector as well. It won't be used unless we have space
' based measurements. But don't populate it if it contains zeros, ODTK
' should use it's reference ephemeris instead.
'-------------------------------------------------------------------------
If ((ValidSBAz or ValidSBEl or ValidSBRng or ValidSBRA or ValidSBDec) and _
(XPos <> 0 and YPos <> 0 and ZPos <> 0)) Then
XPos = XPos * 10^(XPosScaleD - 8) ' convert to meters
YPos = YPos * 10^(YPosScaleD - 8) ' convert to meters
ZPos = ZPos * 10^(ZPosScaleD - 8) ' convert to meters
pObs.TrackerVector.CoordSystem = eCBF
pObs.TrackerVector.ElmType = ePosOnly
pObs.TrackerVector.X.Unit = "m"
pObs.TrackerVector.X.Value = Xpos
pObs.TrackerVector.Y.Unit = "m"
pObs.TrackerVector.Y.Value = Ypos
pObs.TrackerVector.Z.Unit = "m"
pObs.TrackerVector.Z.Value = Zpos
End If
' let the facilities decide what these values are
pObs.EquinoxType = eDefaultEquinoxType
pObs.EquinoxEpoch = EquinoxEpoch
pObsSet.Clear()
pObsSet.date.unit = "UTCJFOUR"
pObsSet.date = dateStr
'/////////////////////////////////////////////////////////////
'/////////////////////////// RANGE ///////////////////////////
'/////////////////////////////////////////////////////////////
If ValidRng Then
pObs.MeasureType = eMTRange
pObs.value.Unit = "km"
pObs.value = RgD
pObsSet.Add pObs
End If
'/////////////////////////////////////////////////////////////
'/////////////////////////// DOPPLER /////////////////////////
'/////////////////////////////////////////////////////////////
If ValidRR Then
pObs.MeasureType = eMTDoppler
pObs.value.Unit = "m/sec"
pObs.value = RRD
pObsSet.Add pObs
End If
'/////////////////////////////////////////////////////////////
'/////////////////////////// AZIMUTH /////////////////////////
'/////////////////////////////////////////////////////////////
If ValidAz Then
pObs.MeasureType = eMTAzimuth
pObs.value.Unit = "deg"
pObs.value = AzD
pObsSet.Add pObs
End If
'/////////////////////////////////////////////////////////////
'/////////////////////////// ELEVATION ///////////////////////
'/////////////////////////////////////////////////////////////
If ValidEl Then
pObs.MeasureType = eMTElevation
pObs.value.Unit = "deg"
pObs.value = ElD
pObsSet.Add pObs
End If
'/////////////////////////////////////////////////////////////
'////////////////////// RIGHT ASCENSION ///////////////////////
'/////////////////////////////////////////////////////////////
If ValidRA Then
pObs.MeasureType = eMTRightAscension
pObs.value.Unit = "deg"
pObs.value = RAD
pObsSet.Add pObs
End If
'/////////////////////////////////////////////////////////////
'/////////////////////////// DECLINATION /////////////////////
'/////////////////////////////////////////////////////////////
If ValidDec Then
pObs.MeasureType = eMTDeclination
pObs.value.Unit = "deg"
pObs.value = DecD
pObsSet.Add pObs
End If
'/////////////////////////////////////////////////////////////
'////////////////////SB RIGHT ASCENSION //////////////////////
'/////////////////////////////////////////////////////////////
If ValidSBRA Then
pObs.MeasureType = eMTSBRightAscension
pObs.value.Unit = "deg"
pObs.value = RAD
pObsSet.Add pObs
End If
'/////////////////////////////////////////////////////////////
'///////////////////////SB DECLINATION ///////////////////////
'/////////////////////////////////////////////////////////////
If ValidSBDec Then
pObs.MeasureType = eMTSBDeclination
pObs.value.Unit = "deg"
pObs.value = DecD
pObsSet.Add pObs
End If
'/////////////////////////////////////////////////////////////
'/////////////////////////// SB AZIMUTH //////////////////////
'/////////////////////////////////////////////////////////////
If ValidSBAz Then
pObs.MeasureType = eMTSBAzimuth
pObs.value.Unit = "deg"
pObs.value = AzD
pObsSet.Add pObs
End If
'/////////////////////////////////////////////////////////////
'/////////////////////////// SB ELEVATION ////////////////////
'/////////////////////////////////////////////////////////////
If ValidSBEl Then
pObs.MeasureType = eMTSBElevation
pObs.value.Unit = "deg"
pObs.value = ElD
pObsSet.Add pObs
End If
'/////////////////////////////////////////////////////////////
'///////////////////////SB Range /////////////////////////////
'/////////////////////////////////////////////////////////////
If ValidSBRng Then
pObs.MeasureType = eMTSBRange
pObs.value.Unit = "km"
pObs.value = RgD
pObsSet.Add pObs
End If
'/// Any Valid Meas? ////
If pObsSet.Count > 0 Then
numSets = numSets + 1
setColl.Add pObsSet
End If
End if
Loop
GetObsSet = numSets
End Function
'-------------------------------------------------------------------------
' GetSupportedObsSet method
'-------------------------------------------------------------------------
Function GetSupportedObsSet(setColl)
Dim numSets
numSets = 0
'Set Defaults
pObs.Date.Unit = "UTCJFOUR"
pObs.Date = "153/2003 00:00:00.000"
pObs.TrackerIDs.Clear
'File supports range & Doppler independently, angles are saved as pairs,
'angles may also be saved with range and Doppler included
'-------------------------------------------------------------------------
' Range
'-------------------------------------------------------------------------
pObs.MeasureType = eMTRange
pObs.value.Unit = "m"
pObs.value = 0.0
pObsSet.Clear
pObsSet.Add pObs
numSets = numSets + 1
setColl.Add pObsSet
'-------------------------------------------------------------------------
' Doppler