From 399bf6ae73d636d56ecd590036964e52433b4743 Mon Sep 17 00:00:00 2001 From: endian11 <Dana_Lee1016@126.com> Date: 星期四, 17 九月 2020 17:30:27 +0800 Subject: [PATCH] 设置一个ROUTE_MODE 为 采集模式, app HomeFragment增加这个模式的判断 --- app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java | 41 +++++++++++++++++++++++++++++++---------- 1 files changed, 31 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java b/app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java index 14b7277..e480e6b 100644 --- a/app/src/main/java/safeluck/drive/evaluation/fragment/TrainFragment.java +++ b/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;//杩斿洖鐨刬c鍗′俊鎭� 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())); + } } -- Gitblit v1.8.0