//
// Name: Sun from different planets
// Author: Alexander Wolf
// License: Public Domain
// Version: 1.0
// Description: Look at the Sun from big planets of Solar System and Pluto.
//

var planets = new Array("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto");
var atm = new Array(false, true, true, true, true, true, true, true, false);
var landscapes = new Array("moon", "moon", "garching", "mars", "saturn", "saturn", "saturn", "saturn", "moon");
var dates = new Array("2012-04-01T12:00:00","2012-10-01T12:00:00","2012-04-01T08:30:00","2012-01-01T11:30:00","2012-10-01T18:30:00","2012-04-01T12:50:00","2012-04-01T11:50:00","2012-10-01T12:00:00","2012-12-01T12:00:00");
var psizes = new Array("1°12′33″","0°44′25″","0°32′00″","0°19′19″","0°6′21″","0°3′18″","0°1′36″","0°1′4″","0°0′59″");

var atmosphere = LandscapeMgr.getFlagAtmosphere();
var fog = LandscapeMgr.getFlagFog();
var location = core.getObserverLocation();

core.wait(1);
SolarSystem.setFlagLabels(false);
LabelMgr.deleteAllLabels();
core.clear("natural");
core.setGuiVisible(false);
core.wait(3);

for (i=0; i<planets.length; i++)
{
	core.setObserverLocation(0, 0, 1, 5, "", planets[i]);
	core.setDate(dates[i], "utc");

	LandscapeMgr.setFlagAtmosphere(atm[i]);
	LandscapeMgr.setFlagFog(atm[i]);
	LandscapeMgr.setCurrentLandscapeID(landscapes[i]);

	core.selectObjectByName("Sun", false);

	var pname = LabelMgr.labelScreen("Sun from " + planets[i], 20, 20, false, 20, "#AA0000");
	var psize = LabelMgr.labelScreen("Angular size of Sun is " + psizes[i], 20, 50, false, 20, "#AA0000");
	LabelMgr.setLabelShow(pname, true);
	LabelMgr.setLabelShow(psize, true);

	StelMovementMgr.setFlagTracking(true);

	core.wait(5);
	LabelMgr.setLabelShow(pname, false);
	LabelMgr.setLabelShow(psize, false);
}

core.clear("natural");
core.setGuiVisible(true);
core.goHome();
