forked from kenneth-sturrock/JavaScript_Code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetTargData.js
More file actions
63 lines (45 loc) · 1.16 KB
/
Copy pathgetTargData.js
File metadata and controls
63 lines (45 loc) · 1.16 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
/* Java Script */
/* Socket Start Packet */
var TargetList = [];
var parameterString = "$000";
var FindStatus = "Success";
var targetRA = 0;
var targetDEC = 0;
var altitude = "0";
var out = "";
var cr = "\n";
TargetList = parameterString.split(",");
TargetList.forEach(function(Target)
{
try
//
// Try to find the target and catch the error if it fails.
//
{
sky6StarChart.Find(Target);
}
catch (repErr)
//
// If error, report it.
//
{
FindStatus = "fail";
}
if ( FindStatus == "fail" )
{
out += Target + " cannot be found." + cr;
} else {
// Pull the RA value
sky6ObjectInformation.Property(54);
targetRA = sky6ObjectInformation.ObjInfoPropOut.toFixed(2);
// Pull the DEC value
sky6ObjectInformation.Property(55);
targetDEC = sky6ObjectInformation.ObjInfoPropOut.toFixed(2);
// Pull the Altitude value
sky6ObjectInformation.Property(59);
altitude = sky6ObjectInformation.ObjInfoPropOut.toFixed(2);
out += Target + ", " + targetRA + ", " + targetDEC + ", " + altitude + cr;
}
});
out;
/* Socket End Packet */