package com.dowse.base.data;

import android.location.Location;
import com.dowse.base.log.DSLog;
import java.math.BigDecimal;

/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/data/DSLocation.class */
public class DSLocation {
    private static final String TAG = "DSLocation";
    private int is_open;
    private int longitude;
    private int latitude;

    public int getIs_open() {
        return this.is_open;
    }

    public void setIs_open(int is_open) {
        this.is_open = is_open;
    }

    public int getLongitude() {
        return this.longitude;
    }

    public void setLongitude(int longitude) {
        this.longitude = longitude;
    }

    public int getLatitude() {
        return this.latitude;
    }

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

    public DSLocation(int is_open, Location location) {
        this.is_open = is_open;
        if (location != null) {
            this.longitude = getIntValue(location.getLongitude());
            this.latitude = getIntValue(location.getLatitude());
            return;
        }
        this.longitude = 0;
        this.latitude = 0;
    }

    public DSLocation() {
    }

    private int getIntValue(double number) {
        int du = (int) Math.floor(Math.abs(number));
        double temp = get_point(Math.abs(number)) * 60.0d;
        int fen = (int) Math.floor(temp);
        double miao = get_point(temp) * 60.0d;
        DSLog.d(TAG, "number=" + number + ",du=" + du + ",fen=" + fen + ",miao=" + miao);
        return (du * 3600 * 100) + (fen * 60 * 100) + (((int) miao) * 100);
    }

    private double get_point(double num) {
        int fInt = (int) num;
        BigDecimal b1 = new BigDecimal(Double.toString(num));
        BigDecimal b2 = new BigDecimal(Integer.toString(fInt));
        double dPoint = b1.subtract(b2).floatValue();
        return dPoint;
    }

    public String toString() {
        return "DSLocation{is_open=" + this.is_open + ", longitude=" + this.longitude + ", latitude=" + this.latitude + '}';
    }
}
