endian11
2020-09-17 0832081b696b58a01f50e0c65aa20cc538e19e4b
加入路口信息
7个文件已修改
2个文件已添加
161 ■■■■■ 已修改文件
app/src/main/java/safeluck/drive/evaluation/Constant.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/app.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/routecollect/ICollectView.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/routecollect/ILoadListener.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/routecollect/RouteCollectController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/routecollect/bean/RoadCrossInfo.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/routecollect/bean/RoadInfo.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/routecollect/impl/RouteModel.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/safeluck/drive/evaluation/Constant.java
@@ -94,6 +94,9 @@
    //用于地图车辆移动 坐标
    public static final String BIND_RTK_INFO_MAP = "bind_rtk_info_map";
    public static final int ID_SM_CARSENSOR = 0x0013;
    public static final String BIND_ROUTE_COLLECT_TOPIC = "BIND_ROUTE_COLLECT_TOPIC";
    public static final int ENTER_OR_EXIT_ROAD_ID = 0x0015;
    public static final int ENTER_OR_EXIT_ROADCROSS_ID = 0x0016;
    public static String exam_enter_exitdata="exam_enter_exitdata";
    public static int Chang_di = 2;
    public static int DaoLu_night = 3;
app/src/main/java/safeluck/drive/evaluation/app.java
@@ -517,6 +517,12 @@
                Log.i("InspectSignal",json);
                CEventCenter.dispatchEvent(Constant.BIND_MCUINFO_TOPIC,cmd,0,json);
                break;
            case Constant.ENTER_OR_EXIT_ROAD_ID:
//                CEventCenter.dispatchEvent(Constant.BIND_RTK_INFO_MAP,cmd,0,json);
//                break;
                case Constant.ENTER_OR_EXIT_ROADCROSS_ID:
                    CEventCenter.dispatchEvent(Constant.BIND_RTK_INFO_MAP,cmd,0,json);
                break;
        }
    }
app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java
@@ -91,6 +91,8 @@
import safeluck.drive.evaluation.routecollect.CollectPointResult;
import safeluck.drive.evaluation.routecollect.ICollectView;
import safeluck.drive.evaluation.routecollect.RouteCollectController;
import safeluck.drive.evaluation.routecollect.bean.RoadCrossInfo;
import safeluck.drive.evaluation.routecollect.bean.RoadInfo;
import safeluck.drive.evaluation.util.CThreadPoolExecutor;
import safeluck.drive.evaluation.util.Utils;
import safeluck.drive.evaluation.widget.StatusDialog;
@@ -1060,4 +1062,14 @@
    public void routeItem(CollectPointResult collectPointResult) {
        Log.i(TAG,String.format("x=%f,y=%f",collectPointResult.getX(),collectPointResult.getY()));
    }
    @Override
    public void roadinfo(RoadInfo roadInfo) {
    }
    @Override
    public void roadcrossInfo(RoadCrossInfo roadCrossInfo) {
    }
}
app/src/main/java/safeluck/drive/evaluation/routecollect/ICollectView.java
@@ -1,5 +1,8 @@
package safeluck.drive.evaluation.routecollect;
import safeluck.drive.evaluation.routecollect.bean.RoadCrossInfo;
import safeluck.drive.evaluation.routecollect.bean.RoadInfo;
/**
 * DriveJudge
 * Created by lzw on 2020/9/16. 10:12:23
@@ -15,4 +18,7 @@
     * @param collectPointResult
     */
    void routeItem(CollectPointResult collectPointResult );
    void roadinfo(RoadInfo roadInfo);
    void roadcrossInfo(RoadCrossInfo roadCrossInfo);
}
app/src/main/java/safeluck/drive/evaluation/routecollect/ILoadListener.java
@@ -1,5 +1,8 @@
package safeluck.drive.evaluation.routecollect;
import safeluck.drive.evaluation.routecollect.bean.RoadCrossInfo;
import safeluck.drive.evaluation.routecollect.bean.RoadInfo;
/**
 * DriveJudge
 * Created by lzw on 2020/9/16. 10:54:19
@@ -9,4 +12,7 @@
public interface ILoadListener {
    void finishCollectItem(CollectPointResult collectPointResult);
    void roadInfo(RoadInfo roadInfo);
    void roadCrossInfo(RoadCrossInfo roadCrossInfo);
}
app/src/main/java/safeluck/drive/evaluation/routecollect/RouteCollectController.java
@@ -1,6 +1,8 @@
package safeluck.drive.evaluation.routecollect;
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;
/**
@@ -45,4 +47,15 @@
            iCollectView.routeItem(collectPointResult);
        }
    }
    @Override
    public void roadInfo(RoadInfo roadInfo) {
    }
    @Override
    public void roadCrossInfo(RoadCrossInfo roadCrossInfo) {
    }
}
app/src/main/java/safeluck/drive/evaluation/routecollect/bean/RoadCrossInfo.java
New file
@@ -0,0 +1,44 @@
package safeluck.drive.evaluation.routecollect.bean;
/**
 * DriveJudge
 * Created by lzw on 2020/9/17. 17:39:51
 * 邮箱:632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
public class RoadCrossInfo {
    /**
     * road_id : 0
     * crossing_index : 0
     * status : 0
     */
    private int road_id;
    private int crossing_index;
    private int status;
    public int getRoad_id() {
        return road_id;
    }
    public void setRoad_id(int road_id) {
        this.road_id = road_id;
    }
    public int getCrossing_index() {
        return crossing_index;
    }
    public void setCrossing_index(int crossing_index) {
        this.crossing_index = crossing_index;
    }
    public int getStatus() {
        return status;
    }
    public void setStatus(int status) {
        this.status = status;
    }
}
app/src/main/java/safeluck/drive/evaluation/routecollect/bean/RoadInfo.java
New file
@@ -0,0 +1,34 @@
package safeluck.drive.evaluation.routecollect.bean;
/**
 * DriveJudge
 * Created by lzw on 2020/9/17. 17:39:38
 * 邮箱:632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
public class RoadInfo {
    /**
     * road_id : 0
     * status : 0
     */
    private int road_id;
    private int status;
    public int getRoad_id() {
        return road_id;
    }
    public void setRoad_id(int road_id) {
        this.road_id = road_id;
    }
    public int getStatus() {
        return status;
    }
    public void setStatus(int status) {
        this.status = status;
    }
}
app/src/main/java/safeluck/drive/evaluation/routecollect/impl/RouteModel.java
@@ -29,22 +29,33 @@
        @Override
        public void onCEvent(String topic, int msgCode, int resultCode, Object obj) {
            //,"coord_x":0.974,"coord_x_dir":"N","coord_y":-0.191,"c
            if (iLoadListener != null){
                CollectPointResult collectPointResult = new CollectPointResult();
                try {
                    JSONObject jsonObject = new JSONObject((String)obj);
                    double x = jsonObject.getDouble("coord_x");
                    double y = jsonObject.getDouble("coord_y");
            if (msgCode==Constant.RTK_INFO){
                if (iLoadListener != null){
                    CollectPointResult collectPointResult = new CollectPointResult();
                    try {
                        JSONObject jsonObject = new JSONObject((String)obj);
                        double x = jsonObject.getDouble("coord_x");
                        double y = jsonObject.getDouble("coord_y");
                    Log.i(TAG,String.format("采集到的点【x=%f,y=%f]",x,y));
                    collectPointResult.setX(Utils.getdouble(x,4));
                    collectPointResult.setY(Utils.getdouble(y,4));
                    iLoadListener.finishCollectItem(collectPointResult);
                } catch (JSONException e) {
                    e.printStackTrace();
                        Log.i(TAG,String.format("采集到的点【x=%f,y=%f]",x,y));
                        collectPointResult.setX(Utils.getdouble(x,4));
                        collectPointResult.setY(Utils.getdouble(y,4));
                        iLoadListener.finishCollectItem(collectPointResult);
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            }
            if (msgCode == Constant.ENTER_OR_EXIT_ROAD_ID){
                Log.i(TAG,"道路消息"+(String)obj);
            }
            if (msgCode == Constant.ENTER_OR_EXIT_ROADCROSS_ID){
                Log.i(TAG,"路口消息"+(String)obj);
            }
        }
    };