| | |
| | | } |
| | | |
| | | |
| | | }else{ |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的道路文件") |
| | | sendRoadMapInfo() |
| | | }} |
| | | "yard" ->{ |
| | | mapInfoHead.type = BaseDataUIBean.TYPE_.yard |
| | |
| | | sendMapInfo() |
| | | }) |
| | | } |
| | | }else{ |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的场地文件") |
| | | sendMapInfo() |
| | | } |
| | | } |
| | | else ->{ |
| | |
| | | }) |
| | | |
| | | } |
| | | }else{ |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的车辆模型文件") |
| | | sendVehicleInfo() |
| | | } |
| | | } |
| | | } |
| | |
| | | val fileContent = FileUtil.readFile(mapPath) |
| | | if (fileContent != null) { |
| | | val str = String(fileContent) |
| | | sendmapAndVehi = true |
| | | AYSdk.getInstance().sendCmd(safeluck.drive.evaluation.Constant.PUSH_MAP_INFO, str) |
| | | } else { |
| | | sendmapAndVehi = false |
| | | MyLog.i(String.format("文件:%s不存在", mapPath)) |
| | | CThreadPoolExecutor.runOnMainThread { Toast.makeText(app.getAppContext(), "文件:" + mapPath + "不存在", Toast.LENGTH_SHORT).show() } |
| | | } |
| | | }else{ |
| | | sendmapAndVehi = false |
| | | } |
| | | } |
| | | |
| | | //标记车辆模型或地图 发送成功的标志-true |
| | | var sendmapAndVehi = false |
| | | fun sendVehicleInfo(){ |
| | | val carPath = ExamPlatformData.getInstance().carModelPath |
| | | if (!TextUtils.isEmpty(carPath)) { |
| | |
| | | val bytes = FileUtil.readFile(carPath) |
| | | if (bytes != null) { |
| | | val str = String(bytes) |
| | | sendmapAndVehi = true |
| | | AYSdk.getInstance().sendCmd(safeluck.drive.evaluation.Constant.PUSH_VECHILE_PROFILE, str) |
| | | } else { |
| | | MyLog.i(String.format("文件:%s不存在", carPath)) |
| | | sendmapAndVehi = false |
| | | } |
| | | }else{ |
| | | sendmapAndVehi = false |
| | | } |
| | | } |
| | | fun sendRoadMapInfo(){ |
| | |
| | | val fileContent = FileUtil.readFile(roadmapPath) |
| | | if (fileContent != null) { |
| | | val str = String(fileContent) |
| | | sendmapAndVehi = true |
| | | AYSdk.getInstance().sendCmd(safeluck.drive.evaluation.Constant.PUSH_ROAD_MAP_INFO, str) |
| | | } else { |
| | | MyLog.i(String.format("文件:%s不存在", roadmapPath)) |
| | | sendmapAndVehi = false |
| | | CThreadPoolExecutor.runOnMainThread { Toast.makeText(app.getAppContext(), "文件:" + roadmapPath + "不存在", Toast.LENGTH_SHORT).show() } |
| | | } |
| | | } else { |
| | | |
| | | sendmapAndVehi = false |
| | | } |
| | | } |
| | | |