endian11
2021-01-19 b2fe9c4f073523284c671bf8895a8412cd269518
app/src/main/java/safeluck/drive/evaluation/util/DataInit.kt
@@ -23,6 +23,7 @@
import safeluck.drive.evaluation.DB.signalConfigdb.SingalConfig
import safeluck.drive.evaluation.app
import safeluck.drive.evaluation.bean.*
import safeluck.drive.evaluation.bean.SimulateNightBean.QuestionBean
import safeluck.drive.evaluation.httpmodule.HttpCarRespBean
import safeluck.drive.evaluation.httpmodule.HttpRequetBean
import safeluck.drive.evaluation.httpmodule.HttpRoadMapRsp
@@ -78,19 +79,39 @@
    val examType = ExamPlatformData.getInstance().examType
    simulateNightBean.setExam(0)
    val list = ExamPlatformData.getInstance().simulate_light_tips
    tempQs.clear()
    val list = WorkRoomDataBase.getWorkRoomDataBase(applicationContext).lightUseQuestionsDao.lightUseQuestionsNoLive()
    Log.i("AYJiaKao",list.size.toString())
    tempQs.add(QuestionBean(100, "下面将进行模拟夜间行驶场景灯光使用的考试,请按语音指令在5秒内做出相应的灯光操作"))//提示下面将进行灯光考试
    tempQs.add(list[list.size-2])//提示下面将进行灯光考试
    tempQs.add(list[0])
    val a = Utils.getRandomInts(4, 10)
    for (i in a.indices) {
        tempQs.add(list[a[i]])
    if (list.size>5){
        var questbean = QuestionBean(list[0].id,list[0].question)
        questbean.parseSolutionAndProcess(list[0].answer)
        tempQs.add(questbean)
        val a = Utils.getRandomInts(4, list.size)
        for (i in a.indices) {
            var te = list[a[i]]
            Log.i("AYJiaKao",te.toString())
            var questbean = QuestionBean(te.id,te.question)
            questbean.parseSolutionAndProcess(te.answer)
            tempQs.add(questbean)
        }
    }else{
        for (i in list.indices){
        var questbean = QuestionBean(list[i].id,list[i].question)
        questbean.parseSolutionAndProcess(list[i].answer)
        tempQs.add(questbean)
    }
    tempQs.add(list[list.size-1])//提示灯光考试结束
    }
    tempQs.add(QuestionBean(101, "模拟夜间考试完成请关闭所有灯光,请起步继续完成考试"))//提示灯光考试结束
    simulateNightBean.setQuestion(tempQs)
    MyLog.i("开始发送灯光,考试项共有"+simulateNightBean.question.size)
    AYSdk.getInstance().sendCmd(0x8012, gson.toJson(simulateNightBean))
    MyLog.i("开始发送灯光,gson="+gson.toJson(simulateNightBean))
//    AYSdk.getInstance().sendCmd(0x8012, gson.toJson(simulateNightBean))
    //发送考试状态
    MyLog.i("查到的考试type=$examType")