| | |
| | | Iterator<Map .Entry<BaseDataUIBean.TYPE_,MapInfoHead>> iterator = hashMaps.entrySet().iterator(); |
| | | while (iterator.hasNext()){ |
| | | Map.Entry<BaseDataUIBean.TYPE_,MapInfoHead>entry = iterator.next(); |
| | | MapInfoHead mapInfoHead = entry.getValue(); |
| | | Log.i(TAG,"key= " + entry.getKey() + " and value= " + entry.getValue()); |
| | | datas.add(new BaseDataUIBean(str2SpannableString(entry.getValue().getStr()),R.mipmap.province_id,str2FouregourdSpannableString(getResources().getString(R.string.mapversion)+entry.getValue().getVersion()), |
| | | entry.getKey()== BaseDataUIBean.TYPE_.car?"更新车辆模型":(entry.getKey()== BaseDataUIBean.TYPE_.road?"更新道路地图":"更新场地地图") |
| | | ,1, entry.getKey())); |
| | | if (mapInfoHead!=null){ |
| | | String str = mapInfoHead.getStr(); |
| | | if (!TextUtils.isEmpty(str)){ |
| | | datas.add(new BaseDataUIBean(str2SpannableString(entry.getValue().getStr()),R.mipmap.province_id,str2FouregourdSpannableString(getResources().getString(R.string.mapversion)+entry.getValue().getVersion()), |
| | | entry.getKey()== BaseDataUIBean.TYPE_.car?"更新车辆模型":(entry.getKey()== BaseDataUIBean.TYPE_.road?"更新道路地图":"更新场地地图") |
| | | ,1, entry.getKey())); |
| | | if (str.contains("失败")){ |
| | | showMannualMapCar(); |
| | | |
| | | } |
| | | }else{ |
| | | showMannualMapCar(); |
| | | } |
| | | }else{ |
| | | showMannualMapCar(); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | }; |
| | | |
| | | private void showMannualMapCar() { |
| | | String roadMapPath = ExamPlatformData.getInstance().getRoadMapPath(); |
| | | String MapPath = ExamPlatformData.getInstance().getMapPath(); |
| | | String carModelPath = ExamPlatformData.getInstance().getCarModelPath(); |
| | | if (!TextUtils.isEmpty(roadMapPath)){ |
| | | datas.add(new BaseDataUIBean(str2SpannableString("手动设置道路 "),R.mipmap.platform_pic,str2FouregourdSpannableString(roadMapPath),"",1,null)); |
| | | } |
| | | if (!TextUtils.isEmpty(MapPath)){ |
| | | datas.add(new BaseDataUIBean(str2SpannableString("手动设置场地 "),R.mipmap.platform_pic,str2FouregourdSpannableString(MapPath),"",1,null)); |
| | | } |
| | | if (!TextUtils.isEmpty(carModelPath)){ |
| | | datas.add(new BaseDataUIBean(str2SpannableString("手动设置车辆 "),R.mipmap.platform_pic,str2FouregourdSpannableString(carModelPath),"",1,null)); |
| | | } |
| | | } |
| | | |
| | | |
| | | private String left(String s,int pos){ |
| | |
| | | MyLog.i(PlatFormConstant.HTTPTAG,str) |
| | | jsonObject1 = JSONObject(str) |
| | | val result = jsonObject1!!.getBoolean("result") |
| | | if (result) { |
| | | var mapInfoHead: MapInfoHead = MapInfoHead("","", BaseDataUIBean.TYPE_.car,"","") |
| | | if (result) { |
| | | |
| | | when(type){ |
| | | "road" ->{ |
| | |
| | | |
| | | }else{ |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的道路文件") |
| | | mapInfoHead.version = "" |
| | | mapInfoHead.str = "获取道路地图失败" |
| | | sendRoadMapInfo() |
| | | }} |
| | | "yard" ->{ |
| | |
| | | }) |
| | | } |
| | | }else{ |
| | | mapInfoHead.version = "" |
| | | mapInfoHead.str = "获取场地地图失败" |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的场地文件") |
| | | sendMapInfo() |
| | | } |
| | |
| | | |
| | | } |
| | | }else{ |
| | | mapInfoHead.version = "" |
| | | mapInfoHead.str = "获取车辆模型失败" |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的车辆模型文件") |
| | | sendVehicleInfo() |
| | | } |
| | |
| | | ExamPlatformData.getInstance().setMapHeadInfo(mapInfoHead) |
| | | } else { |
| | | if (str.contains("car")){ |
| | | mapInfoHead.type= BaseDataUIBean.TYPE_.car |
| | | mapInfoHead.version = "" |
| | | mapInfoHead.str = "从平台获取车辆模型失败" |
| | | ExamPlatformData.getInstance().setMapHeadInfo(mapInfoHead) |
| | | sendVehicleInfo() |
| | | } |
| | | if (str.contains("yard")){ |
| | | mapInfoHead.type= BaseDataUIBean.TYPE_.yard |
| | | mapInfoHead.version = "" |
| | | mapInfoHead.str = "从平台获取场地地图失败" |
| | | ExamPlatformData.getInstance().setMapHeadInfo(mapInfoHead) |
| | | sendMapInfo() |
| | | } |
| | | if (str.contains("road")){ |
| | | |
| | | |
| | | mapInfoHead.type= BaseDataUIBean.TYPE_.road |
| | | mapInfoHead.version = "" |
| | | mapInfoHead.str = "从平台获取道路地图失败" |
| | | ExamPlatformData.getInstance().setMapHeadInfo(mapInfoHead) |
| | | sendRoadMapInfo() |
| | | } |
| | | |