File: get_view_data.ssc

package info (click to toggle)
stellarium 0.10.5-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 57,884 kB
  • ctags: 26,597
  • sloc: ansic: 347,123; cpp: 56,161; perl: 995; python: 427; sh: 151; pascal: 140; sql: 131; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 1,460 bytes parent folder | download | duplicates (8)
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
//
// Name: View Data Test
// License: Public Domain
// Author: Matthew Gates
// Description: Gets alt/azi and ra/dec coordinates for centre of view and displays them
//

LabelMgr.deleteAllLabels();

var altLabId      = LabelMgr.labelScreen("alt=xxxxx",      20,  core.getScreenHeight()-150, true, 15, "#aaaaaa");
var aziLabId      = LabelMgr.labelScreen("azi=xxxxx",      200, core.getScreenHeight()-150, true, 15, "#aaaaaa");
var raLabId       = LabelMgr.labelScreen("ra=xxxxx",       20,  core.getScreenHeight()-180, true, 15, "#aaaaaa");
var decLabId      = LabelMgr.labelScreen("dec=xxxxx",      200, core.getScreenHeight()-180, true, 15, "#aaaaaa");
var raJ2000LabId  = LabelMgr.labelScreen("raJ2000=xxxxx",  20,  core.getScreenHeight()-210, true, 15, "#aaaaaa");
var decJ2000LabId = LabelMgr.labelScreen("decJ2000=xxxxx", 200, core.getScreenHeight()-210, true, 15, "#aaaaaa");

for(i=0; i<100; i+=0.2)
{
	LabelMgr.setLabelText(altLabId, "alt=" + core.getViewAltitudeAngle().toFixed(4));
	LabelMgr.setLabelText(aziLabId, "azi=" + core.getViewAzimuthAngle().toFixed(4));
	LabelMgr.setLabelText(raLabId, "ra=" + core.getViewRaAngle().toFixed(4));
	LabelMgr.setLabelText(decLabId, "dec=" + core.getViewDecAngle().toFixed(4));
	LabelMgr.setLabelText(raJ2000LabId, "raJ2000=" + core.getViewRaJ2000Angle().toFixed(4));
	LabelMgr.setLabelText(decJ2000LabId, "decJ2000=" + core.getViewDecJ2000Angle().toFixed(4));
	core.wait(0.2);
}

LabelMgr.deleteAllLabels();