| | |
| | | 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; |
| | |
| | | * 邮箱: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;//线路采集标志 |
| | |
| | | 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<>(); |
| | |
| | | |
| | | |
| | | 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); |
| | |
| | | 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); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | 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())); |
| | | } |
| | | } |