/* ----------------------------------------
 * Origin  : Akkodis
 * Project : CDPP Propagation Tool 
 * ----------------------------------------
 * History 
 * Version : V2.12
 * DM-ID : Redmine#11103 : 25/03/2025 : LBE : Radio spectro interface added
 * Version : V2.13
 * DM-ID : redmine#12153 : 09/09/2025 : LBE : added WIND radio spectro
 * ----------------------------------------
 */
package fr.tlse.irap.pt.client.controller.tools.radio;

import fr.tlse.irap.pt.client.controller.tools.IToolController;
import java.util.Date;

public class RadioRadialModel {

    private static double deltaDays = 2;
    private IToolController.JMapTool jMapTool = IToolController.JMapTool.INSITU;
    public static enum eDensityModel {LEBLANC,MANN};
    

    private Date startDate = new Date();
    private Date endDate = new Date();
    private Date date;
    /**
     * date of CME, init at start Date or computed by click to fit
     */
    private Date cmeDate;
    private double speed;
    private boolean valid = true;

    private eDensityModel densityModel = eDensityModel.MANN;
    
    public static enum Instrument {
        STA_WAVES("WAVES", "STEREO-A"),
        WIND_WAVES("WAVES", "WIND"),
        PSP_FIELDS("FIELDS", "PSP");

        private String name;
        private String obs;

        Instrument(String name, String obs) {
            this.name = name;
            this.obs = obs;
        }

        public String getName() {
            return name;
        }

        public String getObs() {
            return obs;
        }
    }
    //public static enum SourceType {REAL, ENLIL;}

    
    /**
     * update dates
     */
    public void setDates(Date selectedDate) {
        date = selectedDate;
        startDate.setTime((long) (date.getTime() - deltaDays * 86400000l));
        endDate.setTime((long) (date.getTime() + deltaDays * 86400000l));
    }

    public Date getStartDate() {
        return startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public Date getDate() {
        return date;
    }

    public long getT1() {
        return startDate.getTime();
    }

    public long getT2() {
        return endDate.getTime();
    }

    public long getTime() {
        return date.getTime();
    }

    public void setTime(long time) {
        // create a new date, so that property will be invalidated
        date = new Date();
        date.setTime(time);
    }

    public IToolController.JMapTool getJMapTool() {
        return jMapTool;
    }

    public void setJMapTool(IToolController.JMapTool jMapTool) {
        this.jMapTool = jMapTool;
    }

    public boolean isValid() {
        return valid;
    }

    public void setValid(boolean valid) {
        this.valid = valid;
    }

    /**
     * CME speed in km/s
     * @return the speed
     */
    public double getSpeed() {
        return speed;
    }

    /**
     * CME speed in km/s
     * @param speed the speed to set
     */
    public void setSpeed(double speed) {
        this.speed = speed;
    }

    /**
     * date of CME, init at start Date or computed by click to fit
     * @return the cmeDate
     */
    public Date getCmeDate() {
        return cmeDate;
    }

    /**
     * date of CME, init at start Date or computed by click to fit
     * @param cmeDate the cmeDate to set
     */
    public void setCmeDate(Date cmeDate) {
        this.cmeDate = cmeDate;
    }

    /**
     * @return the algo
     */
    public eDensityModel getDensityModel() {
        return densityModel;
    }

    /**
     * @param pModel the algo to set
     */
    public void setDensityModel(eDensityModel pModel) {
        this.densityModel = pModel;
    }

}
