| | |
| | | package safeluck.drive.evaluation.routecollect; |
| | | |
| | | import android.util.Log; |
| | | |
| | | import com.anyun.exam.lib.AYSdk; |
| | | |
| | | import safeluck.drive.evaluation.fragment.TrainFragment; |
| | |
| | | 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 RouteCollectController(ICollectView collectView){ |
| | | public void setRouteCollectController(ICollectView collectView){ |
| | | this.iCollectView = collectView; |
| | | routeModel = new RouteModel(); |
| | | |
| | | routeModel.setLoadListener(this); |
| | | } |
| | | |
| | | |
| | |
| | | iCollectView.beginCollectView(); |
| | | } |
| | | if (routeModel != null){ |
| | | routeModel.startCollect(this); |
| | | routeModel.startCollect(); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @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(); |
| | | } |
| | | } |
| | | } |