endian11
2020-09-17 399bf6ae73d636d56ecd590036964e52433b4743
app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java
@@ -88,6 +88,9 @@
import safeluck.drive.evaluation.platformMessage.JKMessage0202;
import safeluck.drive.evaluation.platformMessage.JKMessage0204;
import safeluck.drive.evaluation.platformMessage.PlatFormConstant;
import safeluck.drive.evaluation.routecollect.CollectPointResult;
import safeluck.drive.evaluation.routecollect.ICollectView;
import safeluck.drive.evaluation.routecollect.RouteCollectController;
import safeluck.drive.evaluation.util.CThreadPoolExecutor;
import safeluck.drive.evaluation.util.Utils;
import safeluck.drive.evaluation.widget.StatusDialog;
@@ -98,7 +101,7 @@
 * 邮箱:632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
public class TrainFragment extends SupportFragment implements View.OnClickListener {
public class TrainFragment extends SupportFragment implements View.OnClickListener, ICollectView {
    private static final String TAG = TrainFragment.class.getSimpleName();
    private static final int ROUTE_COLLECT = 5;//线路采集标志
@@ -137,6 +140,7 @@
    String icson;//返回的ic卡信息 json
    private String content;//用以生成二维码的内容
    RouteCollectController routeCollectController;
private List<Integer> btn_ids = new ArrayList<Integer>();
private HashMap<String,Integer> routeCollect_btn_ids = new HashMap<>();
@@ -547,6 +551,7 @@
    private void initView(View view) {
        routeCollectController = new RouteCollectController(this);
        items = view.findViewById(R.id.items);
        items_score=view.findViewById(R.id.items_score);
        route_collect=view.findViewById(R.id.route_collect);
@@ -673,22 +678,23 @@
                                        for (RouteBean bean:mRouteBeans){
                                            if (string.equalsIgnoreCase(bean.getRouteName())){
                                                //有重名的线路,提示用户并不开启线路采集
                                                Toast.makeText(_mActivity, "该线路名称已被使用,请更换", Toast.LENGTH_SHORT).show();
                                                Toast.makeText(_mActivity, "继续采集"+bean.getRouteName(), Toast.LENGTH_SHORT).show();
                                                flag = true;
                                                break;
                                            }
                                        }
                                        Toast.makeText(_mActivity, "线路采集", Toast.LENGTH_SHORT).show();
                                        ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.ROUTE_MODE);
                                        exam_type = 5;
                                        examStatusViewModel.updateStartExam(exam_type);
                                        items.setVisibility(View.GONE);
                                        items_score.setVisibility(View.GONE);
                                        route_collect.setVisibility(View.VISIBLE);
                                        if (!flag){
                                            RouteBean routeBean = new RouteBean();
                                            routeBean.setRouteName(string);
                                            routeLineViewModel.insertRouteBean(routeBean);
                                            Toast.makeText(_mActivity, "线路采集", Toast.LENGTH_SHORT).show();
                                            ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.TRAINING_MODE);
                                            exam_type = 5;
                                            examStatusViewModel.updateStartExam(exam_type);
                                            items.setVisibility(View.GONE);
                                            items_score.setVisibility(View.GONE);
                                            route_collect.setVisibility(View.VISIBLE);
                                        }
                                    }
@@ -782,7 +788,7 @@
                while (iterator.hasNext()){
                    Map.Entry<String, Integer> next = iterator.next();
                    if (next.getValue()== v.getId()){
                routeCollectController.startCollect();
                Toast.makeText(_mActivity, String.format("点击了%s",next.getKey()), Toast.LENGTH_SHORT).show();
                break;
                    }
@@ -1039,4 +1045,19 @@
        return spannableString;
    }
    @Override
    public void beginCollectView() {
        Log.i(TAG,"BIND_RTK_INFO_MAP");
    }
    @Override
    public void endCollectView() {
        Log.i(TAG,"endCollectView");
        routeCollectController.endCollect();
    }
    @Override
    public void routeItem(CollectPointResult collectPointResult) {
        Log.i(TAG,String.format("x=%f,y=%f",collectPointResult.getX(),collectPointResult.getY()));
    }
}