endian11
2020-12-04 bde7f140ef75a1434ec3a2b698433bd767ba4943
app/src/main/java/safeluck/drive/evaluation/util/DataInit.kt
@@ -270,6 +270,9 @@
                                }
                            }else{
                                MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的道路文件")
                                sendRoadMapInfo()
                            }}
                        "yard" ->{
                            mapInfoHead.type = BaseDataUIBean.TYPE_.yard
@@ -290,6 +293,9 @@
                                        sendMapInfo()
                                    })
                                }
                            }else{
                                MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的场地文件")
                                sendMapInfo()
                            }
                        }
                        else ->{
@@ -312,6 +318,9 @@
                                    })
                                }
                            }else{
                                MyLog.i(PlatFormConstant.HTTPTAG,"返回失败,则发送用户已经选择的车辆模型文件")
                                sendVehicleInfo()
                            }
                        }
                    }
@@ -333,14 +342,19 @@
        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)) {
@@ -348,10 +362,14 @@
        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(){
@@ -362,13 +380,15 @@
        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
    }
}