package safeluck.drive.evaluation.routecollect;
|
|
import android.util.Log;
|
|
import com.anyun.exam.lib.AYSdk;
|
|
import safeluck.drive.evaluation.fragment.TrainFragment;
|
import safeluck.drive.evaluation.routecollect.bean.RoadCrossInfo;
|
import safeluck.drive.evaluation.routecollect.bean.RoadInfo;
|
import safeluck.drive.evaluation.routecollect.impl.RouteModel;
|
|
/**
|
* DriveJudge
|
* Created by lzw on 2020/9/16. 10:08:18
|
* 邮箱:632393724@qq.com
|
* All Rights Saved! Chongqing AnYun Tech co. LTD
|
*/
|
public class RouteCollectController implements ILoadListener {
|
|
ICollectView iCollectView;
|
RouteModel routeModel;
|
|
private static final String TAG = "RouteModel";
|
private boolean isStartRoadListener = false;
|
|
private RouteCollectController() {
|
routeModel = new RouteModel();
|
}
|
public static RouteCollectController getInstance(){
|
return new RouteCollectController();
|
}
|
/**
|
* Topic=[bind_rtk_info_map],message={"utc":"20200917081227.40","qf":3,"coord_x":0.974,"coord_x_dir":"N","coord_y":-0.191,"coord_y_dir":"E","heading":315.0,"pitch":0.0,"roll":0.0,"sat_num":14,"latitude":31.174458016666667,"longitude":121.38786518333333,"altitude":58.9666,"speed":1.72591488,"track_ture":315.0}
|
* @param collectView
|
*/
|
public void setRouteCollectController(ICollectView collectView){
|
this.iCollectView = collectView;
|
|
routeModel.setLoadListener(this);
|
}
|
|
|
public void startCollect() {
|
if (iCollectView != null){
|
iCollectView.beginCollectView();
|
}
|
if (routeModel != null){
|
routeModel.startCollect();
|
}
|
}
|
|
public void endCollect(){
|
if (routeModel != null){
|
routeModel.endCollect();
|
}
|
}
|
|
@Override
|
public void finishCollectItem(CollectPointResult collectPointResult) {
|
if (iCollectView != null){
|
iCollectView.endCollectView();
|
iCollectView.routeItem(collectPointResult);
|
}
|
}
|
|
@Override
|
public void roadInfo(RoadInfo roadInfo) {
|
if (iCollectView != null){
|
iCollectView.roadinfo(roadInfo);
|
}
|
}
|
|
|
|
@Override
|
public void roadCrossInfo(RoadCrossInfo roadCrossInfo) {
|
if (iCollectView != null){
|
iCollectView.roadcrossInfo(roadCrossInfo);
|
}
|
}
|
|
public void startRoadListener() {
|
if (!isStartRoadListener){
|
isStartRoadListener = true;
|
if (routeModel != null){
|
routeModel.startRoadListener();
|
}
|
}else{
|
Log.i(TAG,"已经监听过了,不再监听");
|
}
|
|
}
|
|
public void endRoadListener(){
|
if (routeModel != null){
|
routeModel.endRoadListener();
|
}
|
}
|
}
|