package leigh.astro.app;

import leigh.astro.scheduler.Planner;
import leigh.mecha.log.MechaLogger;
import leigh.mecha.log.MechaLoggerFactory;

/**
 * This application controls a telescope deployment for the purposes of automated observation.
 * <p>
 * Limitations: The application does not understand twilight, and will schedule jobs to run after sundown but before
 * twilight ends. This will cause the job to pause in Ekos if the twilight constraint is set, so it winds up
 * working in the end.
 * <p>
 * If the Ekos job stalls due to lack of observational quality (clouds, obstructions, etc) that prevent guiding
 * or aligning, Ekos will leave the mount in tracking mode, which could (unverified) lead to a mount crash.
 * If the job does eventually resume due to conditions improving, it will complete but will run "long"
 * which in turn can stall the job since Ekos will not abort it when the object sets (or descends past the minimum
 * elevation). This will result in observations being stalled until the next night, or human intervention.
 *
 * @author Alex Leigh
 */
public class TelescopeControllerApp {
    private static final MechaLogger logger = MechaLoggerFactory.getLogger(TelescopeControllerApp.class);

    public static void main(String[] args) throws Exception {
        String ver = TelescopeControllerApp.class.getPackage().getImplementationVersion();
        logger.info("Ver: {}", ver);

        Planner s = new Planner();
        s.run();
    }
}
