package com.qiyou.mb.android.beans.basic;

import java.util.ArrayList;

import android.text.TextUtils;

import com.qiyou.mb.android.QiYouConstant;
import com.qiyou.mb.android.utils.enums.wpFlag;

 
public class Waypoint_bean {
	public Waypoint_bean() {
		 
	} 
	private float latitude;
	private float longitude;   
	private float elevation;    
	private float eled;  
	private long time;    
	private float speed ;  
	private float distance;  
	private long pauseTime ;  
	private float bearing;
	private float accuracy;
	private long offtime;
 	private ArrayList<Media>  medias;  
 	private int kmflag; //1,2,3.。。
 	private float sumDist;
	private long sportTime; 
//	private float roadBear=0f; 
	private float sumBear;
	private float avb;
	private float bearDist;
	private String roadBook;	
//	private int turnFlag =-2;
	private wpFlag turnFlag =wpFlag.NORMAL;
    private GEOaddress geo;
    private String comment;
    private String name;
    private String desc;
    private float upDist;
    private float downDist;
    private float maxEle=-1*QiYouConstant.MAX_ELE;
    private float minEle=QiYouConstant.MAX_ELE;
    
	public GEOaddress getGeo() {
		return geo;
	}

	public void setGeo(GEOaddress Geo) {
		if(geo==null)geo = Geo;
	}

	/**
	 * Returns the latitude of this waypoint.
	 * @return a float value representing the latitude of this waypoint.
	 */
	public float getLatitude() {
		return latitude;
	}
	
	/**
	 * Setter for waypoint latitude property. This maps to "latitude" attribute value.
	 * @param latitude a Doube value representing the latitude of this waypoint.
	 */
	public void setLatitude(float latitude) {
		this.latitude = latitude;
	}
	
	/**
	 * Returns the longitude of this waypoint.
	 * @return a float value representing the longitude of this waypoint.
	 */
	public float getLongitude() {
		return longitude;
	}
	
	/**
	 * Setter for waypoint longitude property. This maps to "long" attribute value.
	 * @param longitude a Doube value representing the longitude of this waypoint.
	 */
	public void setLongitude(float longitude) {
		this.longitude = longitude;
	}
	
	/**
	 * Returns the elevation of this waypoint.
	 * @return A float representing the elevation of this waypoint.
	 */
	public float getElevation() {
		return elevation;
	}
	
	/**
	 * Setter for waypoint elevation property. This maps to &lt;elevation&gt; tag value.
	 * @param elevation a float value representing the elevation of this waypoint.
	 */
	public void setElevation(float elevation) {
		this.elevation = elevation;
	}
	
	/**
	 * Returns the time of this waypoint.
	 * @return a Date representing the name of this waypoint.
	 */
	public long getTime() {		
		return time;
	}
	
	/**
	 * Setter for waypoint time property. This maps to &lt;time&gt; tag value.
	 * @param time a Date representing the time of this waypoint.
	 */
	public void setTime(long time) {
		this.time = time;
	}
	/**
	 * @return the speed km/h
	 */
	public float getSpeed() {
		return speed;
	}

	/**
	 * @param speed the speed to set,km/h
	 */
	public void setSpeed(float speed) {
		this.speed = speed;
	}

	/**
	 * @return the distance
	 */
	public float getDistance() {
		return distance;
	}

	/**
	 * @param distance the distance to set
	 */
	public void setDistance(float distance) {
		this.distance = distance;
	}

	/**
	 * @return the pauseTime
	 */
	public long getPauseTime() {
		return pauseTime;
	}

	/**
	 * @param pauseTime the pauseTime to set
	 */
	public void setPauseTime(long pauseTime) {
		this.pauseTime = pauseTime;
	}

	 /*
	 * @return the media
	 */
	public ArrayList<Media> getMedias() {
		if(null == medias) medias = new ArrayList<Media>();
		
		return medias;
	}

	 /**
	 * @param media the media to set
	 */ 
	public void setMedias(ArrayList<Media> medias) {
		this.medias = medias;
	}

	public float getEled() {
	
		/*float factor=distance*QiYouConstant.ELED_FACTOR;
		return  (float) (eled>0?
				eled> factor?eled-factor :0
				 : eled<-1*factor? eled - -1*factor:0);	 */
 		return eled;
	}

	public void setEled(float eled) {
		this.eled = eled;
	}

	public float getAccuracy() {
		return accuracy;
	}

	public void setAccuracy(float accuracy) {
		this.accuracy = accuracy;
	}

	public float getBearing() {
		return bearing;
	}

	public void setBearing(float bearing) {
		this.bearing = bearing;
	}

	public long getOfftime() {
		return offtime;
	}

	public void setOfftime(long offtime) {
		this.offtime = offtime;
	}

	public int getKmflag() {
		return kmflag;
	}

	public void setKmflag(int kmflag) {
		this.kmflag = kmflag;
	}

	public float getSumDist() {
		return sumDist;
	}

	public void setSumDist(float sumDist) {
		this.sumDist = sumDist;
	}

	public long getSportTime() {
		return sportTime;
	}

	public void setSportTime(long sportTime) {
		this.sportTime = sportTime;
	}

/*	public float getRoadBear() {
		return roadBear;
	}

	public void setRoadBear(float roadBear) {
		this.roadBear = roadBear;
	}
*/
	public float getSumBear() {
		return sumBear;
	}

	public void setSumBear(float sumBear) {
		this.sumBear = sumBear;
	}

	public float getAvb() {
		return avb;
	}

	public void setAvb(float avb) {
		this.avb = avb;
	}

	public float getBearDist() {
		return bearDist;
	}

	public void setBearDist(float bearDist) {
		this.bearDist = bearDist;
	}

	public String getRoadBook() {
		if(TextUtils.isEmpty(roadBook)) return "";
		return roadBook.replace("\"", "");
	}

	public void setRoadBook(String roadBook) {
		this.roadBook = roadBook;
	}

	/*public String getTargetBear() {
		return targetBear;
	}

	public void setTargetBear(String targetBear) {
		this.targetBear = targetBear;
	}
*/
	 

	public wpFlag getTurnFlag() {
		return turnFlag;
	}

	public void setTurnFlag(wpFlag turnFlag) {
		this.turnFlag = turnFlag;
	}

	public String getComment() {
		if(TextUtils.isEmpty(comment)) return "";
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getName() {
		if(TextUtils.isEmpty(name)) return "";
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesc() {
		if(TextUtils.isEmpty(desc)) return "";
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public float getUpDist() { 
		return upDist;
	}

	public void setUpDist(float upDist) {
		this.upDist = upDist;
	}

	public float getDownDist() {
//		return downDist<-1*distance*0.07f? downDist - -1*distance*0.07f:0f;
		return downDist;
	}

	public void setDownDist(float downDist) {
		this.downDist = downDist;
	}

	public float getMaxEle() {
		return maxEle;
	}

	public void setMaxEle(float maxEle) {
		this.maxEle = maxEle;
	}

	public float getMinEle() {
		return minEle;
	}

	public void setMinEle(float minEle) {
		this.minEle = minEle;
	} 
}
