| | |
| | | + applicationContext.getPackageName() + "/" + fileName) |
| | | CThreadPoolExecutor.runInBackground(Runnable { |
| | | str = gson.toJson(map.data.map_json) |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"科三道路地图保存成功") |
| | | FileUtil.writeTxtFileToSD(applicationContext, fileName, str, "") |
| | | sendRoadMapInfo() |
| | | // sendRoadMapInfo() |
| | | }) |
| | | } |
| | | |
| | |
| | | ExamPlatformData.getInstance().setNewMapPath(Environment.getExternalStorageDirectory().absolutePath + "/" |
| | | + applicationContext.getPackageName() + "/"+fileName) |
| | | CThreadPoolExecutor.runInBackground(Runnable{ |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"科三场地地图保存成功") |
| | | str = gson.toJson(yard.data.map_json) |
| | | FileUtil.writeTxtFileToSD(applicationContext,fileName,str,"") |
| | | sendMapInfo() |
| | | // sendMapInfo() |
| | | }) |
| | | } |
| | | } |
| | |
| | | Log.i(TAG, "解析之后的车模型=$str") |
| | | CThreadPoolExecutor.runInBackground(Runnable{ |
| | | str = gson.toJson(car.data.map_json) |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"车辆模型保存成功") |
| | | FileUtil.writeTxtFileToSD(applicationContext,fileName,str,"") |
| | | sendVehicleInfo() |
| | | // sendVehicleInfo() |
| | | }) |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | } else { |
| | | Toast.makeText(applicationContext, jsonObject1!!.getString("data"), Toast.LENGTH_SHORT).show() |
| | | // Toast.makeText(applicationContext, jsonObject1!!.getString("data"), Toast.LENGTH_SHORT).show() |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }else{ |
| | | MyLog.i(PlatFormConstant.HTTPTAG,"已存在直接发送车辆和地图") |
| | | when(type){ |
| | | "road" -> sendRoadMapInfo() |
| | | "yard" -> sendMapInfo() |
| | | else -> sendVehicleInfo() |
| | | } |
| | | // MyLog.i(PlatFormConstant.HTTPTAG,"已存在直接发送车辆和地图"+fileName) |
| | | // when(type){ |
| | | // "road" -> sendRoadMapInfo() |
| | | // "yard" -> sendMapInfo() |
| | | // else -> sendVehicleInfo() |
| | | // } |
| | | |
| | | } |
| | | } |