| | |
| | | import android.util.Log |
| | | import android.widget.Toast |
| | | import androidx.work.Data |
| | | import androidx.work.ListenableWorker |
| | | import com.anyun.exam.lib.AYSdk |
| | | import com.anyun.basecommonlib.MyLog |
| | | import com.anyun.exam.lib.AYSdk |
| | | import com.google.gson.Gson |
| | | import com.google.gson.reflect.TypeToken |
| | | import com.google.gson.stream.JsonReader |
| | |
| | | import retrofit2.Call |
| | | import retrofit2.Callback |
| | | import retrofit2.Response |
| | | import retrofit2.http.Url |
| | | import safeluck.drive.evaluation.Constant |
| | | import safeluck.drive.evaluation.DB.WorkRoomDataBase |
| | | import safeluck.drive.evaluation.DB.rtktb.RTKConfig |
| | |
| | | import safeluck.drive.evaluation.httpmodule.HttpYardRsp |
| | | import safeluck.drive.evaluation.httpmodule.RetrofitCreator.Companion.getRestService |
| | | import safeluck.drive.evaluation.platformMessage.PlatFormConstant |
| | | import safeluck.drive.evaluation.worker.MCUUpgradeWorker |
| | | import java.io.File |
| | | import java.io.IOException |
| | | import java.io.InputStreamReader |
| | | import java.net.URL |
| | | import java.net.URLDecoder |
| | | import java.nio.charset.Charset |
| | | |
| | |
| | | private val gson = Gson() |
| | | private val tempQs: MutableList<SimulateNightBean.QuestionBean> = java.util.ArrayList() |
| | | var simulateNightBean:SimulateNightBean=SimulateNightBean() |
| | | fun sendExamLights(applicationContext: Context){ |
| | | fun sendExamLightsAndExamStatus(applicationContext: Context){ |
| | | MyLog.i("发送灯光") |
| | | |
| | | val examType = ExamPlatformData.getInstance().examType |
| | |
| | | |
| | | } |
| | | |
| | | private fun sendMapInfo(){ |
| | | fun sendMapInfo(){ |
| | | val mapPath = ExamPlatformData.getInstance().mapPath |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private fun sendVehicleInfo(){ |
| | | fun sendVehicleInfo(){ |
| | | val carPath = ExamPlatformData.getInstance().carModelPath |
| | | if (!TextUtils.isEmpty(carPath)) { |
| | | MyLog.i("更新后的Car模型$carPath") |
| | |
| | | } |
| | | } |
| | | } |
| | | private fun sendRoadMapInfo(){ |
| | | fun sendRoadMapInfo(){ |
| | | val roadmapPath = ExamPlatformData.getInstance().roadMapPath |
| | | |
| | | if (!TextUtils.isEmpty(roadmapPath)) { |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | fun sendJudgeArgs() { |
| | | val dir = File(Environment.getExternalStorageDirectory().absolutePath + File.separator + app.getAppContext().getPackageName()) |
| | | val names = ExamPlatformData.getRulesettingFilesName() |
| | | for (i in names.indices) { |
| | | val settFile = File(dir, names[i]) |
| | | if (settFile.exists()) { |
| | | Log.i("app.TAG", settFile.name + "存在不复制") |
| | | } else { |
| | | Log.i("app.TAG", settFile.name + "不存在,复制...") |
| | | FileUtil.copyAssertFileToSD(app.getAppContext().applicationContext, names[i]) |
| | | } |
| | | } |
| | | if (dir.exists()) { |
| | | val files = dir.listFiles() |
| | | for (i in files.indices) { |
| | | Log.i("app.TAG", files[i].name+" names.size="+names.size) |
| | | if (names.contains(files[i].name)) { |
| | | val buffer = FileUtil.readFile(files[i].absolutePath) |
| | | var str =String(buffer) |
| | | AYSdk.getInstance().sendCmd(Constant.ID_judge_args, str) |
| | | } else { |
| | | } |
| | | } |
| | | } |
| | | } |