Android Open Source - 3DR-Services-Library Home






From Project

Back to project page 3DR-Services-Library.

License

The source code is released under:

Apache License

If you think the Android project 3DR-Services-Library listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ox3dr.services.android.lib.drone.property;
/*www. j a  v  a 2  s .  c  o m*/
import android.os.Parcel;
import android.os.Parcelable;

import com.ox3dr.services.android.lib.coordinate.LatLngAlt;

/**
 * Location from which the drone took off.
 */
public class Home implements Parcelable {

    /**
     * Lauch pad 3D coordinate.
     */
    private final LatLngAlt mCoordinate;

    public Home(float latitude, float longitude, float altitude){
        mCoordinate = new LatLngAlt(latitude, longitude, altitude);
    }

    public Home(LatLngAlt coordinate){
        mCoordinate = coordinate;
    }

    /**
     * @return the launch pad 3D coordinate.
     */
    public LatLngAlt getCoordinate(){
        return mCoordinate;
    }

    public boolean isValid(){
        return mCoordinate != null;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Home)) return false;

        Home home = (Home) o;

        return !(mCoordinate != null ? !mCoordinate.equals(home.mCoordinate) : home.mCoordinate != null);

    }

    @Override
    public int hashCode() {
        return mCoordinate != null ? mCoordinate.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "LaunchPad{" +
                "mCoordinate=" + mCoordinate +
                '}';
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.mCoordinate, 0);
    }

    private Home(Parcel in) {
        this.mCoordinate = in.readParcelable(LatLngAlt.class.getClassLoader());
    }

    public static final Parcelable.Creator<Home> CREATOR = new Parcelable.Creator<Home>() {
        public Home createFromParcel(Parcel source) {
            return new Home(source);
        }

        public Home[] newArray(int size) {
            return new Home[size];
        }
    };
}




Java Source Code List

com.ox3dr.services.android.lib.ApplicationTest.java
com.ox3dr.services.android.lib.coordinate.LatLngAlt.java
com.ox3dr.services.android.lib.coordinate.LatLng.java
com.ox3dr.services.android.lib.drone.connection.ConnectionParameter.java
com.ox3dr.services.android.lib.drone.connection.ConnectionResult.java
com.ox3dr.services.android.lib.drone.connection.ConnectionType.java
com.ox3dr.services.android.lib.drone.event.Event.java
com.ox3dr.services.android.lib.drone.event.Extra.java
com.ox3dr.services.android.lib.drone.property.Altitude.java
com.ox3dr.services.android.lib.drone.property.Attitude.java
com.ox3dr.services.android.lib.drone.property.Battery.java
com.ox3dr.services.android.lib.drone.property.Gps.java
com.ox3dr.services.android.lib.drone.property.Home.java
com.ox3dr.services.android.lib.drone.property.MissionItemMessage.java
com.ox3dr.services.android.lib.drone.property.Mission.java
com.ox3dr.services.android.lib.drone.property.Parameter.java
com.ox3dr.services.android.lib.drone.property.Parameters.java
com.ox3dr.services.android.lib.drone.property.Speed.java
com.ox3dr.services.android.lib.drone.property.State.java
com.ox3dr.services.android.lib.drone.property.Type.java
com.ox3dr.services.android.lib.drone.property.VehicleMode.java