File: get_view_data.ssc

package info (click to toggle)
stellarium 24.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 911,396 kB
  • sloc: ansic: 317,377; cpp: 204,602; xml: 48,590; javascript: 26,348; python: 1,254; perl: 1,108; sh: 207; makefile: 190; pascal: 169
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();