| | |
| | | import com.anyun.basecommonlib.MyLog; |
| | | import com.google.gson.Gson; |
| | | |
| | | |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | |
| | |
| | | import safeluck.drive.evaluation.DB.exam_status.ExamStatusViewModel; |
| | | import safeluck.drive.evaluation.DB.failitems.FailedProjViewModel; |
| | | import safeluck.drive.evaluation.DB.failitems.FailedProj_select; |
| | | import safeluck.drive.evaluation.DB.route.RouteBean; |
| | | import safeluck.drive.evaluation.DB.route.RouteCross; |
| | | import safeluck.drive.evaluation.DB.route.RouteLineViewModel; |
| | | import safeluck.drive.evaluation.DB.route.RouteTriggerLine; |
| | | import safeluck.drive.evaluation.MainActivity; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.adapter.ScoreAdapter; |
| | | import safeluck.drive.evaluation.bean.BaseDataUIBean; |
| | | import safeluck.drive.evaluation.bean.ExamPlatformData; |
| | | import safeluck.drive.evaluation.bean.MapInfoHead; |
| | | import safeluck.drive.evaluation.bean.RemoteRouteCollect; |
| | | import safeluck.drive.evaluation.bean.RouteCollect; |
| | | import safeluck.drive.evaluation.bean.ScoreBean; |
| | | import safeluck.drive.evaluation.cEventCenter.CEventCenter; |
| | | import safeluck.drive.evaluation.cEventCenter.ICEventListener; |
| | |
| | | import safeluck.drive.evaluation.customview.QRCodeDialog; |
| | | import safeluck.drive.evaluation.customview.SelectDialog; |
| | | import safeluck.drive.evaluation.customview.SelectDialogThree; |
| | | import safeluck.drive.evaluation.customview.SelectMutliDialog; |
| | | import safeluck.drive.evaluation.im.MessageProcessor; |
| | | import safeluck.drive.evaluation.platformMessage.JKMessage0201; |
| | | import safeluck.drive.evaluation.platformMessage.JKMessage0202; |
| | |
| | | private Button av_zhijiao, av_curve, av_park, av_podao; |
| | | private Button houseView; |
| | | private RouteLineViewModel routeLineViewModel; |
| | | private List<RouteBean> mRouteBeans = new ArrayList<>(); |
| | | private List<ExamStatus> examStatusList = new ArrayList<>(); |
| | | private List<String> item_conents = new ArrayList<>();//坡道定点停车和起步 |
| | | |
| | |
| | | |
| | | failedProjViewModel = ViewModelProviders.of(this).get(FailedProjViewModel.class); |
| | | routeLineViewModel = ViewModelProviders.of(this).get(RouteLineViewModel.class); |
| | | routeLineViewModel.getRouteBeans().observe(this, new Observer<List<RouteBean>>() { |
| | | @Override |
| | | public void onChanged(List<RouteBean> routeBeans) { |
| | | if (routeBeans.size()>0){ |
| | | mRouteBeans.clear(); |
| | | mRouteBeans.addAll(routeBeans); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | failedProjViewModel.getFailedProjectsForIII(Constant.TEST_STU_ID).observe(this, new Observer<List<FailedProj_select>>() { |
| | | @Override |
| | |
| | | selectDialog.show(getFragmentManager(),"selectdialog"); |
| | | }else{ |
| | | if (exam_type == ROUTE_COLLECT){ |
| | | List<RouteCollect.CrossingActiveBean> crossingActiveBeans = new ArrayList<>(); |
| | | List<RouteCollect.TriggerLineBean> triggerLineBeans = new ArrayList<>(); |
| | | List<Double> xy = new ArrayList<>(); |
| | | RemoteRouteCollect remoteRouteCollect = new RemoteRouteCollect(); |
| | | RouteCollect routeCollect = new RouteCollect(); |
| | | List<RouteCollect> routeCollects = new ArrayList<>(); |
| | | Toast.makeText(_mActivity, "结束采集", Toast.LENGTH_SHORT).show(); |
| | | CThreadPoolExecutor.runInBackground(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | for (RouteBean routeBean:mRouteBeans){ |
| | | int id = routeBean.getId(); |
| | | |
| | | routeCollect.setName(routeBean.getRouteName()); |
| | | List<RouteTriggerLine> routeTriggerLines = WorkRoomDataBase.getWorkRoomDataBase(getContext().getApplicationContext()).getRouteTriggerLineDao().getAllRouteTriggerLine(id); |
| | | List<RouteCross> routeCrosses = WorkRoomDataBase.getWorkRoomDataBase(getContext().getApplicationContext()).getRouteCrooDao().getAllRouteCross(id); |
| | | for (RouteTriggerLine line:routeTriggerLines){ |
| | | RouteCollect.TriggerLineBean triggerLineBean = new RouteCollect.TriggerLineBean(); |
| | | int road = line.getRoad(); |
| | | int type = line.getType(); |
| | | |
| | | double x = line.getX(); |
| | | double y = line.getY(); |
| | | xy.clear(); |
| | | xy.add(x); |
| | | xy.add(y); |
| | | triggerLineBean.setRoad(road); |
| | | triggerLineBean.setType(type); |
| | | triggerLineBean.setX_y(xy); |
| | | triggerLineBeans.add(triggerLineBean); |
| | | |
| | | |
| | | } |
| | | routeCollect.setTrigger_line(triggerLineBeans); |
| | | |
| | | for (RouteCross routeCross:routeCrosses){ |
| | | int idx = routeCross.getIdx(); |
| | | int road = routeCross.getRoad(); |
| | | int active = routeCross.getActive(); |
| | | RouteCollect.CrossingActiveBean crossingActiveBean = new RouteCollect.CrossingActiveBean(); |
| | | crossingActiveBean.setActive(active); |
| | | crossingActiveBean.setIdx(idx); |
| | | crossingActiveBean.setRoad(road); |
| | | crossingActiveBeans.add(crossingActiveBean); |
| | | } |
| | | routeCollect.setCrossing_active(crossingActiveBeans); |
| | | routeCollects.add(routeCollect); |
| | | |
| | | } |
| | | remoteRouteCollect.setScheme(routeCollects); |
| | | String str = new Gson().toJson(remoteRouteCollect); |
| | | Log.i(TAG,"json====="+str); |
| | | } |
| | | }); |
| | | ExamPlatformData.getInstance().setTrainingMode(ExamPlatformData.MODE_NONE); |
| | | exam_type = 0; |
| | | examStatusViewModel.updateStartExam(exam_type); |
| | |
| | | // startArcGisMapFragment(url); |
| | | // StatusDialog.with(_mActivity).setCancelable(true).setPrompt("加载中,请稍后...").setType(StatusDialog.Type.PROGRESS).show(); |
| | | |
| | | MyInputDialog myDialog = MyInputDialog.Companion.newInstance("您将退出系统,请确认数据已保存"); |
| | | SelectMutliDialog myDialog = SelectMutliDialog.newInstance("您将退出系统,请确认数据已保存"); |
| | | |
| | | myDialog.setOnClick(new MyInputDialog.MyOnClickListener() { |
| | | @Override |
| | | public void onSure(String string) { |
| | | |
| | | Log.i(TAG,"收到的:"+string); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onCancle() { |
| | | |
| | | } |
| | | }); |
| | | |
| | | myDialog.show(getFragmentManager(),"mydialog"); |
| | | break; |