package com.tofly.ghrq_route.module.gps.controller;

import android.content.Context;

import com.tofly.ghrq_route.module.gps.domain.GPSDataBean;
import com.tofly.ghrq_route.module.gps.service.GPSServiceImpl;
import com.tofly.ghrq_route.module.gps.service.IGPSService;

import java.util.List;

/**
 * Created by Amu on 2017/3/15.
 */

public class GPSController {
    /**
     * 是否在綫
     */
    boolean mbOnline;
    /**
     * 上下文
     */
    Context mContext;
    /**
     * GPS接口实现对象
     */
    IGPSService gpsService;

    public GPSController(Context context){
        mbOnline = true;
        mContext = context;
        gpsService = new GPSServiceImpl(context);
    }

    public GPSController(boolean online, Context context){
        mbOnline = online;
        mContext = context;
        gpsService = new GPSServiceImpl(context);
    }

    /**
     * 上传GPS数据信息
     * @param gpsData  上传的GPS数据
     * @param gpsCallBack
     */
    public void uploadGpsInfo(Context context, GPSDataBean gpsData, GPSCallBack gpsCallBack){
        gpsService.uploadGpsInfo(context, gpsData, gpsCallBack);
    }

    /**
     * 批量上传GPS数据信息
     * @param gpsDataList  批量上传的GPS数据
     * @param gpsCallBack
     */
    public void uploadBatchGpsInfo(Context context, List<GPSDataBean> gpsDataList, GPSCallBack gpsCallBack){
        gpsService.uploadBatchGpsInfo(context, gpsDataList, gpsCallBack);
    }

    /**
     *  更新Gps位置状态信息
     */
    public void updateGpsStatus(Context context, GPSDataBean gpsData, GPSCallBack gpsCallBack) {
        gpsService.updateGpsStatus(context, gpsData, gpsCallBack);
    }
}
