| | |
| | | |
| | | private fun sendMapInfo(){ |
| | | val mapPath = ExamPlatformData.getInstance().mapPath |
| | | val roadmapPath = ExamPlatformData.getInstance().roadMapPath |
| | | |
| | | if (!TextUtils.isEmpty(roadmapPath)) { |
| | | MyLog.i("调用更新RoadMap路径后的地图$roadmapPath") |
| | | val fileContent = FileUtil.readFile(roadmapPath) |
| | | if (fileContent != null) { |
| | | val str = String(fileContent) |
| | | Log.i(TAG,"文件内容:$str") |
| | | AYSdk.getInstance().sendCmd(safeluck.drive.evaluation.Constant.PUSH_ROAD_MAP_INFO, str) |
| | | } else { |
| | | MyLog.i(String.format("文件:%s不存在", roadmapPath)) |
| | | CThreadPoolExecutor.runOnMainThread { Toast.makeText(app.getAppContext(), "文件:" + roadmapPath + "不存在", Toast.LENGTH_SHORT).show() } |
| | | } |
| | | } else { |
| | | val buffer: StringBuffer? |
| | | buffer = FileUtil.readAssetTxtFile(applicationContext, safeluck.drive.evaluation.Constant.ROAD_MAP) |
| | | if (buffer != null) { |
| | | AYSdk.getInstance().sendCmd(safeluck.drive.evaluation.Constant.PUSH_ROAD_MAP_INFO, buffer.toString()) |
| | | } else { |
| | | MyLog.i(String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().absolutePath + "/" + applicationContext.packageName)) |
| | | CThreadPoolExecutor.runOnMainThread { Toast.makeText(app.getAppContext(), String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().absolutePath + "/" + applicationContext.packageName), Toast.LENGTH_SHORT).show() } |
| | | } |
| | | } |
| | | |
| | | if (!TextUtils.isEmpty(mapPath)) { |
| | | MyLog.i("调用更新Map路径后的地图$mapPath") |
| | | val fileContent = FileUtil.readFile(mapPath) |
| | |
| | | } else { |
| | | MyLog.i("读取Assert目录下初始化的地图") |
| | | var buffer: StringBuffer? |
| | | buffer = FileUtil.readAssetTxtFile(applicationContext, safeluck.drive.evaluation.Constant.ROAD_MAP) |
| | | if (buffer != null) { |
| | | AYSdk.getInstance().sendCmd(safeluck.drive.evaluation.Constant.PUSH_ROAD_MAP_INFO, buffer.toString()) |
| | | } else { |
| | | MyLog.i( String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().absolutePath + "/" + applicationContext.packageName)) |
| | | CThreadPoolExecutor.runOnMainThread { Toast.makeText(app.getAppContext(), String.format("地图模型未拷入[%s]目录下", Environment.getExternalStorageDirectory().absolutePath + "/" + applicationContext.packageName), Toast.LENGTH_SHORT).show() } |
| | | } |
| | | buffer = FileUtil.readAssetTxtFile(applicationContext, safeluck.drive.evaluation.Constant.MAP) |
| | | if (buffer != null) { |
| | | AYSdk.getInstance().sendCmd(safeluck.drive.evaluation.Constant.PUSH_MAP_INFO, buffer.toString()) |