package leigh.astro.scheduler.ekos;

import leigh.mecha.lang.IdentifiedObject;

import java.time.Instant;
import java.util.HashMap;
import java.util.UUID;

/**
 * This class holds an Ekos execution plan, which may be published to an Ekos instance using the
 * {@link EkosController} class.
 * <p>
 * The user should avoid tasking the same object multiple times, as this can cause problems with Ekos. Include
 * a tasking only once, and then specify unique exposure sequences as required.
 * <p>
 * The <code>startTime</code>
 *
 * @author Alex Leigh
 */
public class EkosPlan implements IdentifiedObject {
    private final String schedule;
    private final HashMap<UUID, String> sequences;
    private final UUID id = UUID.randomUUID();
    private final Instant startTime;

    public EkosPlan(String schedule, HashMap<UUID, String> sequences, Instant startTime) {
        this.schedule = schedule;
        this.sequences = sequences;
        this.startTime = startTime;
    }

    @Override
    public UUID getId() {
        return id;
    }

    public Instant getStartTime() {
        return startTime;
    }

    public String getSchedule() {
        return schedule;
    }

    public HashMap<UUID, String> getSequences() {
        return sequences;
    }

    @Override
    public String toString() {
        return "EkosPlan{" +
                "schedule='" + schedule + '\'' +
                ", sequences=" + sequences +
                ", id=" + id +
                ", startTime=" + startTime +
                '}';
    }
}
