/* ----------------------------------------
 * Origin  : GFI INFORMATIQUE 
 * Project : CDPP Propagation Tool 
 * ----------------------------------------
 * History 
 * Version : 01/05/2015 : SCA : V2.1
 * ----------------------------------------
 */
package fr.tlse.irap.flare;

import java.io.Serializable;
import java.util.Date;

public class Flare implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/* Event date */
	private Date eventTime;
	private Date dayDate; 

	/* Position on Carrington map */
	private Double centralLongitude;
	private Double relativeLongitude;
	private Double displayLongitude;
	private Double latitude;
	
	/* Flare category */
	private FlareType category;

	/* Intensity inside flare category */
	private Float intensity;
	
	/* NOAA region number */
	private int numberNOAA;

	/*
	 * Flare classes or categories (1='A' 2='B' 3='C' 4='M' 5='X')
	 */
	public enum FlareType {
		A, B, C, M, X;
	}

	public Date getEventTime() {
		return eventTime;
	}

	public void setEventTime(Date eventTime) {
		this.eventTime = eventTime;
	}

	public void setCentralLongitude(Double centralLongitude) {
		this.centralLongitude = centralLongitude;
	}

	public Double getRelativeLongitude() {
		return relativeLongitude;
	}

	public void setRelativeLongitude(Double relativeLongitude) {
		this.relativeLongitude = relativeLongitude;
	}

	public Double getDisplayLongitude() {
		return displayLongitude;
	}

	public void setDisplayLongitude(Double displayLongitude) {
		this.displayLongitude = displayLongitude;
	}

	public Double getLatitude() {
		return latitude;
	}

	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}

	public FlareType getCategory() {
		return category;
	}

	public void setCategory(FlareType category) {
		this.category = category;
	}

	public Float getIntensity() {
		return intensity;
	}

	public Float getRealIntensity() {
		switch (category) {
			case A:
				return intensity * 1E-8f;
			case B:
				return intensity * 1E-7f;
			case C:
				return intensity * 1E-6f;
			case M:
				return intensity * 1E-5f;
			case X:
				return intensity * 1E-4f;
			default:
				return null;
		}
	}
	
	public void setIntensity(Float intensity) {
		this.intensity = intensity;
	}

	public int getNumberNOAA() {
		return numberNOAA;
	}

	public void setNumberNOAA(int numberNOAA) {
		this.numberNOAA = numberNOAA;
	}

	public Double getCentralLongitude() {
		return centralLongitude;
	}

	public Date getDayDate() {
		return dayDate;
	}

	public void setDayDate(Date dayDate) {
		this.dayDate = dayDate;
	}
}
