收到11和14号消息不再打印,因为太多了;进入/退出科二场地(ExamStatus)发送到ArcGismap以进行地图的放大和缩小
| | |
| | | }) |
| | | .install(); |
| | | |
| | | |
| | | |
| | | |
| | | CrashHandler crashHandler = CrashHandler.getInstance(); |
| | | crashHandler.init(getApplicationContext()); |
| | | AYSdk.getInstance().init(getApplicationContext()); |
| | |
| | | MyLog.i("开始初始化数据发送地图/车辆/mcu升级文件/考试状态="+type); |
| | | ExamPlatformData.getInstance().setExamType(type); |
| | | // OneTimeWorkRequest examStatausOutWorker = OneTimeWorkRequest.from(ExamStatusOutWorker.class); |
| | | sendMapInfo(); |
| | | sendVechileInfo(); |
| | | // sendMapInfo(); |
| | | // sendVechileInfo(); |
| | | sendRouteExam(); |
| | | // DataInitKt.MCUUpgrade(getApplicationContext()); |
| | | DataInitKt.sendExamLights(getApplicationContext()); |
| | |
| | | int enter_status = -1; |
| | | @Override |
| | | public void callBackMsg(final int cmd, String json) { |
| | | String strConent = String.format("收到命令[%d],Json内容为%s,线程号=%d,时间=%s", cmd, json,Thread.currentThread().getId(),Utils.formatTimeYYMMDDHHmmSSSSS(System.currentTimeMillis())); |
| | | if (strConent.equalsIgnoreCase(lastStr)){ |
| | | if (cmd!=11 && cmd!=14){ |
| | | String strConent = String.format("收到命令[%d],Json内容为%s,线程号=%d,时间=%s", cmd, json,Thread.currentThread().getId(),Utils.formatTimeYYMMDDHHmmSSSSS(System.currentTimeMillis())); |
| | | if (strConent.equalsIgnoreCase(lastStr)){ |
| | | |
| | | }else{ |
| | | }else{ |
| | | |
| | | MyLog.d(TAG,strConent ); |
| | | lastStr = strConent; |
| | | MyLog.d(TAG,strConent ); |
| | | lastStr = strConent; |
| | | } |
| | | } |
| | | |
| | | switch (cmd) { |
| | | case Constant.ID_SM_BLUETOOTH_BRIEF: |
| | | CEventCenter.dispatchEvent(Constant.BIND_CONNECT_RTK_TOPIC,cmd,0,json); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | MyLog.i("收到命令13="+json); |
| | | |
| | | CThreadPoolExecutor.runInBackground(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | examStatus.setMap_id(mapId); |
| | | examStatus.setMap_item(type); |
| | | WorkRoomDataBase.getWorkRoomDataBase(getApplicationContext()).getExamStatusDao().insert(examStatus); |
| | | CEventCenter.dispatchEvent(Constant.BIND_EXAM_STATUS_TOPIC,cmd,0,examStatus); |
| | | } |
| | | }); |
| | | // Data exam_enter_exitdata = new Data.Builder().putString(Constant.exam_enter_exitdata,json).build(); |
| | |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.Constant; |
| | | import safeluck.drive.evaluation.DB.exam_status.ExamStatus; |
| | | import safeluck.drive.evaluation.R; |
| | | import safeluck.drive.evaluation.bean.BaseDataUIBean; |
| | | import safeluck.drive.evaluation.bean.ExamPlatformData; |
| | |
| | | public class ArcGisMapFragment extends SupportFragment implements View.OnClickListener { |
| | | |
| | | private static final String TAG = ArcGisMapFragment.class.getSimpleName(); |
| | | private static final int ENTER = 1;//进入 科二某个项目地图 |
| | | |
| | | private LinkedBlockingQueue queue = new LinkedBlockingQueue(100); |
| | | private ExecutorService consumer = Executors.newSingleThreadExecutor(); |
| | |
| | | // MyLog.i(TAG,"处理完11.时间="+Utils.formatTimeYYMMDDHHmmSSSSS(System.currentTimeMillis())); |
| | | |
| | | |
| | | } |
| | | }; |
| | | private ICEventListener icEventListener1 = new ICEventListener() { |
| | | @Override |
| | | public void onCEvent(String topic, int msgCode, int resultCode, Object obj) { |
| | | if (msgCode==13){ |
| | | ExamStatus examStatus = (ExamStatus)obj; |
| | | if (examStatus.getMap_id()>-1){ |
| | | if (examStatus.getEnter()==ENTER){ |
| | | MyLog.i(TAG,String.format("进入[%d] map",examStatus.getMap_id())); |
| | | double scale = mMapView.getMapScale(); |
| | | mMapView.setViewpointScaleAsync(scale * 0.2*0.2); |
| | | }else{ |
| | | MyLog.i(TAG,String.format("退出[%d] map",examStatus.getMap_id())); |
| | | double scale = mMapView.getMapScale(); |
| | | mMapView.setViewpointScaleAsync(scale * 5*5); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | |
| | |
| | | } |
| | | startWithPop(jiaXiaoFragment); |
| | | } |
| | | |
| | | |
| | | break; |
| | | } |
| | |
| | | SimpleFillSymbol simpleFillSymbolGls = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, Color.argb(255,0,0,0), lineSymbolGls); |
| | | private void drawGlses(List<safeluck.drive.evaluation.bean.Point> carNew, GisCarModel gisCarModel) { |
| | | |
| | | if(gisCarModel== null){ |
| | | return; |
| | | } |
| | | long beginTime = System.currentTimeMillis(); |
| | | |
| | | |
| | |
| | | consumer .shutdown(); |
| | | queue.clear(); |
| | | CEventCenter.onBindEvent(false,icEventListener, Constant.BIND_RTK_INFO_MAP); |
| | | CEventCenter.onBindEvent(false,icEventListener1, Constant.BIND_EXAM_STATUS_TOPIC); |
| | | |
| | | |
| | | } |
| | |
| | | public void onAttach(Context context) { |
| | | super.onAttach(context); |
| | | CEventCenter.onBindEvent(true,icEventListener,Constant.BIND_RTK_INFO_MAP); |
| | | CEventCenter.onBindEvent(true,icEventListener1,Constant.BIND_EXAM_STATUS_TOPIC); |
| | | } |
| | | |
| | | } |