[6.2.0]录包工具改版
This commit is contained in:
@@ -10,9 +10,12 @@ import android.os.SystemClock
|
||||
import android.util.DisplayMetrics
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import android.widget.CheckBox
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.ScaleAnimation
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.iflytek.cloud.ErrorCode
|
||||
import com.iflytek.cloud.InitListener
|
||||
import com.iflytek.cloud.RecognizerListener
|
||||
@@ -25,10 +28,13 @@ import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordCaseEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordOptionEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.devatools.badcase.BadCaseNetListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsNetManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
@@ -46,8 +52,10 @@ import com.zhidao.loglib.upload.UploadManager
|
||||
import com.zhidao.loglib.util.FileUtil
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseAnalyticsManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.BadReasonListAdapter
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.BadCaseNetManager
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import org.json.JSONException
|
||||
@@ -63,7 +71,7 @@ import java.util.*
|
||||
* @since: 2022/7/13
|
||||
*/
|
||||
class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||
IMoGoAutopilotRecordListener {
|
||||
IMoGoAutopilotRecordListener, BadCaseNetListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "InitiativeBadCaseWindow"
|
||||
@@ -79,19 +87,16 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
private lateinit var tvInitiativeTime: TextView
|
||||
private lateinit var tvInitiativeIdentity: TextView
|
||||
|
||||
private lateinit var rbOne: CheckBox
|
||||
private lateinit var rbTwo: CheckBox
|
||||
private lateinit var rbThree: CheckBox
|
||||
private lateinit var rbFour: CheckBox
|
||||
private lateinit var rbFive: CheckBox
|
||||
private lateinit var rbSix: CheckBox
|
||||
|
||||
private lateinit var viewAudioBg: ImageView
|
||||
private lateinit var viewAudioButton: ImageView
|
||||
private lateinit var tvAudioCountDown: TextView
|
||||
|
||||
private lateinit var tvInitiativeReport: TextView
|
||||
private lateinit var tvInitiativeCancel: TextView
|
||||
|
||||
private lateinit var rvInitiativeList: RecyclerView
|
||||
private var badReasonListAdapter: BadReasonListAdapter ?= null
|
||||
|
||||
private var audioStatus = false
|
||||
private var audioFileName:String?=null //录音文件名称
|
||||
|
||||
@@ -144,18 +149,29 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
tvInitiativeTime = mFloatLayout.findViewById(R.id.tvInitiativeTime)
|
||||
tvInitiativeIdentity = mFloatLayout.findViewById(R.id.tvInitiativeIdentity)
|
||||
|
||||
rbOne = mFloatLayout.findViewById(R.id.rbOne)
|
||||
rbTwo = mFloatLayout.findViewById(R.id.rbTwo)
|
||||
rbThree = mFloatLayout.findViewById(R.id.rbThree)
|
||||
rbFour = mFloatLayout.findViewById(R.id.rbFour)
|
||||
rbFive = mFloatLayout.findViewById(R.id.rbFive)
|
||||
rbSix = mFloatLayout.findViewById(R.id.rbSix)
|
||||
|
||||
viewAudioBg = mFloatLayout.findViewById(R.id.viewAudioBg)
|
||||
viewAudioButton = mFloatLayout.findViewById(R.id.viewAudioButton)
|
||||
tvAudioCountDown = mFloatLayout.findViewById(R.id.tvAudioCountDown)
|
||||
|
||||
tvInitiativeReport = mFloatLayout.findViewById(R.id.tvInitiativeReport)
|
||||
tvInitiativeCancel = mFloatLayout.findViewById(R.id.tvInitiativeCancel)
|
||||
|
||||
rvInitiativeList = mFloatLayout.findViewById(R.id.rvInitiativeList)
|
||||
val linearLayoutManager = LinearLayoutManager(mActivity)
|
||||
linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
|
||||
rvInitiativeList.layoutManager = linearLayoutManager
|
||||
badReasonListAdapter = BadReasonListAdapter(mActivity)
|
||||
badReasonListAdapter?.setListener(object: BadReasonListAdapter.ReasonClickListener{
|
||||
override fun onClick(reason: String, isChecked: Boolean) {
|
||||
if(isChecked){
|
||||
uploadReason.append(reason)
|
||||
}else{
|
||||
val index = uploadReason.indexOf(reason)
|
||||
uploadReason.delete(index,index+reason.length)
|
||||
}
|
||||
}
|
||||
})
|
||||
rvInitiativeList.adapter = badReasonListAdapter
|
||||
if(BadCaseConfig.windowNum<1){
|
||||
BadCaseConfig.windowNum = 1
|
||||
}
|
||||
@@ -164,38 +180,27 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
tvInitiativeTime.text = "时间:${millis2String(System.currentTimeMillis(),TimeUtils.getHourMinSecondFormat())}"
|
||||
tvInitiativeIdentity.text = "身份:${BadCaseConfig.identity}"
|
||||
|
||||
/**
|
||||
* 获取录包原因数据
|
||||
*/
|
||||
BadCaseNetManager.badCaseNetManager.getRecordOption(1,AppConfigInfo.iPCMacAddress)
|
||||
// BadCaseNetManager.badCaseNetManager.getRecordOption(1,"48:b0:2d:3a:9c:8f")
|
||||
|
||||
//采集结果回调监听
|
||||
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(),this)
|
||||
viewAudioButton.setOnClickListener {
|
||||
//主动录包采集原因回调监听
|
||||
CallerDevaToolsNetManager.addListener(this.hashCode().toString(),this)
|
||||
viewAudioBg.setOnClickListener {
|
||||
audioStatus = !audioStatus
|
||||
setAudio(audioStatus)
|
||||
}
|
||||
|
||||
//上报
|
||||
tvInitiativeReport.setOnClickListener {
|
||||
if(!rbOne.isChecked && !rbTwo.isChecked && !rbThree.isChecked &&
|
||||
!rbFour.isChecked && !rbFive.isChecked && !rbSix.isChecked){
|
||||
TipToast.shortTip("请选择至少一个Case")
|
||||
if(uploadReason.isBlank()){
|
||||
ToastUtils.showShort("请选择最少一个原因")
|
||||
return@setOnClickListener
|
||||
}
|
||||
uploadReason.clear()
|
||||
if(rbOne.isChecked){
|
||||
uploadReason.append("严重画龙 ")
|
||||
}
|
||||
if(rbTwo.isChecked){
|
||||
uploadReason.append("速度过慢 ")
|
||||
}
|
||||
if(rbThree.isChecked){
|
||||
uploadReason.append("感知、定位、地图等其他 ")
|
||||
}
|
||||
if(rbFour.isChecked){
|
||||
uploadReason.append("速度过快 ")
|
||||
}
|
||||
if(rbFive.isChecked){
|
||||
uploadReason.append("存在碰撞风险 ")
|
||||
}
|
||||
if(rbSix.isChecked){
|
||||
uploadReason.append("点刹、顿挫")
|
||||
}
|
||||
if(audioStatus){
|
||||
audioStatus = false
|
||||
setAudio(false)
|
||||
@@ -207,6 +212,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
}
|
||||
}
|
||||
|
||||
//取消
|
||||
tvInitiativeCancel.setOnClickListener {
|
||||
BadCaseConfig.windowNum--
|
||||
clickListener?.closeWindow()
|
||||
@@ -219,8 +225,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
it.gravity = Gravity.START or Gravity.TOP
|
||||
it.width = 924
|
||||
it.height = 668
|
||||
it.width = 859
|
||||
it.height = 850
|
||||
it.alpha = 1.0f
|
||||
}
|
||||
}
|
||||
@@ -312,8 +318,15 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
}
|
||||
audioFileName = "Audio_${System.currentTimeMillis()}_BadCase"
|
||||
RecordManager.getInstance().start(audioFileName)
|
||||
//更改录音按钮背景
|
||||
viewAudioButton.setImageResource(R.drawable.icon_bad_case_audio_select)
|
||||
//开始录音,展示放大缩小动效
|
||||
val scaleAnimation = ScaleAnimation(
|
||||
1.0f, 0.9f, 1.0f, 0.9f,
|
||||
Animation.RELATIVE_TO_SELF, 0.9f, Animation.RELATIVE_TO_SELF, 0.9f
|
||||
)
|
||||
scaleAnimation.duration = 1000
|
||||
scaleAnimation.repeatCount = -1
|
||||
viewAudioButton.startAnimation(scaleAnimation)
|
||||
|
||||
tvAudioCountDown.visibility = View.VISIBLE
|
||||
//开始倒计时
|
||||
if(countDownTimer==null){
|
||||
@@ -327,8 +340,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
tvAudioCountDown.visibility = View.GONE
|
||||
//结束录音
|
||||
RecordManager.getInstance().stop()
|
||||
//更改录音按钮背景
|
||||
viewAudioButton.setImageResource(R.drawable.icon_bad_case_audio_normal)
|
||||
//结束动画
|
||||
viewAudioButton.clearAnimation()
|
||||
}
|
||||
}
|
||||
countDownTimer?.start()
|
||||
@@ -482,7 +495,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
val metrics = DisplayMetrics()
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
// mWindowParams!!.x = metrics.widthPixels
|
||||
mWindowParams!!.x = 0
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
//开启录包
|
||||
@@ -502,7 +516,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
val metrics = DisplayMetrics()
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
// mWindowParams!!.x = metrics.widthPixels
|
||||
mWindowParams!!.x = 0
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
//已经录包无需再次启动录包,只要将录包信息同步到弹窗
|
||||
@@ -517,6 +532,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
fun hideFloatWindow() {
|
||||
//注销采集结果回调监听
|
||||
CallerAutopilotRecordListenerManager.removeListener(this.hashCode().toString())
|
||||
//注销采集原因回调监听
|
||||
CallerDevaToolsNetManager.removeListener(this.hashCode().toString())
|
||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
|
||||
@@ -542,4 +559,10 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
fun closeWindow()
|
||||
}
|
||||
|
||||
override fun onInitiativeResponse(list: List<RecordOptionEntity>) {
|
||||
if(list.isNotEmpty()){
|
||||
badReasonListAdapter?.setData(list)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -101,8 +101,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
private lateinit var tvPassiveReport: TextView
|
||||
private lateinit var tvPassiveCancel: TextView
|
||||
|
||||
private lateinit var flReasonLayout: FlexboxLayout
|
||||
|
||||
// 语音听写对象
|
||||
private var mIat: SpeechRecognizer? = null
|
||||
|
||||
@@ -137,7 +135,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
tvAudioCountDown = mFloatLayout.findViewById(R.id.tvAudioCountDown)
|
||||
tvPassiveReport = mFloatLayout.findViewById(R.id.tvPassiveReport)
|
||||
tvPassiveCancel = mFloatLayout.findViewById(R.id.tvPassiveCancel)
|
||||
flReasonLayout = mFloatLayout.findViewById(R.id.flReasonLayout)
|
||||
if(BadCaseConfig.windowNum<1){
|
||||
BadCaseConfig.windowNum = 1
|
||||
}
|
||||
@@ -183,8 +180,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
it.gravity = Gravity.START or Gravity.TOP
|
||||
it.width = 924
|
||||
it.height = 668
|
||||
it.width = 859
|
||||
it.height = 850
|
||||
it.alpha = 1.0f
|
||||
}
|
||||
}
|
||||
@@ -291,7 +288,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
//结束录音
|
||||
RecordManager.getInstance().stop()
|
||||
//更改录音按钮背景
|
||||
viewAudioButton.setImageResource(R.drawable.icon_bad_case_audio_normal)
|
||||
//TODO
|
||||
// viewAudioButton.setImageResource(R.drawable.icon_bad_case_audio_normal)
|
||||
}
|
||||
}
|
||||
countDownTimer?.start()
|
||||
@@ -452,29 +450,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
}
|
||||
|
||||
GlobalScope.launch{
|
||||
presenter.loadBadCases(true).also {
|
||||
ThreadUtils.runOnUiThread {
|
||||
it.iterator().forEach {
|
||||
val checkBox = CheckBox(mActivity)
|
||||
checkBox.setTextColor(Color.WHITE)
|
||||
val lp = FlexboxLayout.LayoutParams(FlexboxLayout.LayoutParams.WRAP_CONTENT,
|
||||
FlexboxLayout.LayoutParams.WRAP_CONTENT)
|
||||
checkBox.buttonDrawable = mActivity.resources.getDrawable(R.drawable.badcase_radio_button_style)
|
||||
checkBox.setPadding(SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(10f))
|
||||
checkBox.textSize = AutoSizeUtils.dp2px(mActivity,18f).toFloat()
|
||||
checkBox.text = it.reason
|
||||
checkBox.isChecked = it.isChecked
|
||||
checkBox.setOnCheckedChangeListener(this@PassiveBadCaseWindow)
|
||||
flReasonLayout.addView(checkBox,lp)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onCheckedChanged(buttonView: CompoundButton?, isChecked: Boolean) {
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz.adapter
|
||||
|
||||
import android.app.Activity
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.CheckBox
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.flexbox.FlexboxLayout
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordOptionEntity
|
||||
import com.mogo.eagle.core.utilcode.util.SizeUtils
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
/**
|
||||
* 主动录包和被动录包采集原因列表适配器
|
||||
*/
|
||||
class BadReasonListAdapter(activity: Activity): RecyclerView.Adapter<BadReasonListAdapter.BadReasonHolder>() {
|
||||
|
||||
init {
|
||||
activity.also { this.mActivity = it }
|
||||
}
|
||||
|
||||
private var data:List<RecordOptionEntity> ?= null
|
||||
private var clickListener: ReasonClickListener ?= null
|
||||
private var mActivity: Activity
|
||||
|
||||
fun setData(data: List<RecordOptionEntity>){
|
||||
this.data = data
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun setListener(listener: ReasonClickListener){
|
||||
clickListener = listener
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BadReasonHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_case_reason, parent, false)
|
||||
return BadReasonHolder(view)
|
||||
}
|
||||
|
||||
|
||||
override fun onBindViewHolder(holder: BadReasonHolder, position: Int) {
|
||||
data?.let {
|
||||
val entity = it[position]
|
||||
holder.tvReasonTitle.text = entity.optionName
|
||||
if(entity.children.size>0){
|
||||
entity.children.forEach { child->
|
||||
val checkBox = CheckBox(mActivity)
|
||||
checkBox.setTextColor(Color.WHITE)
|
||||
val lp = FlexboxLayout.LayoutParams(FlexboxLayout.LayoutParams.WRAP_CONTENT,
|
||||
FlexboxLayout.LayoutParams.WRAP_CONTENT)
|
||||
checkBox.buttonDrawable = mActivity.resources.getDrawable(R.drawable.badcase_radio_button_style)
|
||||
checkBox.setPadding(
|
||||
SizeUtils.dp2px(15f),
|
||||
SizeUtils.dp2px(5f),
|
||||
SizeUtils.dp2px(15f),
|
||||
SizeUtils.dp2px(5f))
|
||||
checkBox.textSize = AutoSizeUtils.dp2px(mActivity,15f).toFloat()
|
||||
checkBox.text = child.optionName
|
||||
checkBox.setOnCheckedChangeListener{ _, isChecked ->
|
||||
clickListener?.onClick(checkBox.text.toString(),isChecked)
|
||||
}
|
||||
holder.flReasonLayout.addView(checkBox,lp)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
class BadReasonHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
var tvReasonTitle: TextView = itemView.findViewById(R.id.tvReasonTitle)
|
||||
var flReasonLayout: FlexboxLayout = itemView.findViewById(R.id.flReasonLayout)
|
||||
}
|
||||
|
||||
interface ReasonClickListener{
|
||||
fun onClick(reason: String,isChecked: Boolean)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.repository.net
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
@@ -65,6 +66,9 @@ internal class BadCaseNetModel {
|
||||
.create(BadCaseApi::class.java)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取AI数据采集配置项数据
|
||||
*/
|
||||
fun getAiData(onSuccess: ((String) -> Unit),onError: ((String) -> Unit)){
|
||||
request<BaseResponse<Any?>>{
|
||||
loader{
|
||||
@@ -85,5 +89,28 @@ internal class BadCaseNetModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户端根据录包类型和车辆 mac 地址查询录包数据
|
||||
* @param optionType 选项类型1-主动录包;2-被动录包
|
||||
* @param mac 设备mac地址
|
||||
*/
|
||||
fun getRecordOption(optionType: Int,mac: String,onSuccess: ((String) -> Unit),onError: ((String) -> Unit)){
|
||||
request<BaseResponse<Any?>>{
|
||||
loader {
|
||||
getNetWorkApi().getRecordOption(optionType, mac)
|
||||
}
|
||||
onSuccess{
|
||||
if(it.msg == "success"){
|
||||
onSuccess.invoke(GsonUtils.toJson(it.result))
|
||||
}else{
|
||||
onError.invoke(it.msg)
|
||||
}
|
||||
}
|
||||
onError {
|
||||
it.message?.let { it1 -> onError.invoke(it1) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.zhjt.mogo_core_function_devatools.badcase.repository.net.api
|
||||
|
||||
import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.deva.badcase.AiDataEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordOptionEntity
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.BadCaseResponse
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.UploadResult
|
||||
import retrofit2.Response
|
||||
@@ -21,4 +22,12 @@ internal interface BadCaseApi {
|
||||
*/
|
||||
@GET("eagleEye-mis/dataGather/select/active")
|
||||
suspend fun getAiData(): BaseResponse<List<AiDataEntity>>
|
||||
|
||||
/**
|
||||
* 客户端根据录包类型和车辆 mac 地址查询录包数据
|
||||
* @param optionType 选项类型1-主动录包;2-被动录包
|
||||
* @param mac 设备mac地址
|
||||
*/
|
||||
@GET("eagleEye-mis/recordPackageOption/client/list")
|
||||
suspend fun getRecordOption(@Query("optionType") optionType: Int,@Query("mac") mac: String): BaseResponse<List<RecordOptionEntity>>
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.repository.net.api
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.deva.badcase.AiDataEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.RecordOptionEntity
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsNetManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.BadCaseNetModel
|
||||
import org.json.JSONArray
|
||||
@@ -16,6 +18,9 @@ class BadCaseNetManager {
|
||||
|
||||
private val badCaseNetModel = BadCaseNetModel()
|
||||
|
||||
/**
|
||||
* 获取AI数据采集数据
|
||||
*/
|
||||
fun getAiData(){
|
||||
badCaseNetModel.getAiData(
|
||||
onSuccess =
|
||||
@@ -41,4 +46,52 @@ class BadCaseNetManager {
|
||||
})
|
||||
}
|
||||
|
||||
fun getRecordOption(optionType: Int,mac: String){
|
||||
badCaseNetModel.getRecordOption(optionType,mac,
|
||||
onSuccess =
|
||||
{
|
||||
Log.i("xuxinchao","onSuccess="+it)
|
||||
val list = ArrayList<RecordOptionEntity>()
|
||||
val result = JSONArray(it)
|
||||
if(result.length() > 0){
|
||||
for(i in 0 until result.length()){
|
||||
val entity = RecordOptionEntity()
|
||||
val jsonObject = result[i] as JSONObject
|
||||
val optionName = jsonObject.optString("optionName")
|
||||
entity.optionName = optionName
|
||||
val optionCode = jsonObject.optString("optionCode")
|
||||
entity.optionCode = optionCode
|
||||
val children = jsonObject.optJSONArray("children")
|
||||
if (children != null) {
|
||||
if(children.length() > 0){
|
||||
for(index in 0 until children.length()){
|
||||
val childJson = children[index] as JSONObject
|
||||
val child = RecordOptionEntity()
|
||||
val childOptionNme = childJson.optString("optionName")
|
||||
val childOptionCode = childJson.optString("optionCode")
|
||||
child.optionName = childOptionNme
|
||||
child.optionCode = childOptionCode
|
||||
entity.children.add(child)
|
||||
}
|
||||
}
|
||||
}
|
||||
list.add(entity)
|
||||
}
|
||||
}
|
||||
//将结果回调到调用页面
|
||||
if(optionType == 1){
|
||||
//主动录包
|
||||
CallerDevaToolsNetManager.invokeInitiativeResponse(list)
|
||||
} else if(optionType == 2){
|
||||
//被动录包
|
||||
CallerDevaToolsNetManager.invokePassiveResponse(list)
|
||||
}
|
||||
},
|
||||
onError =
|
||||
{
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 87 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 9.1 KiB |
@@ -5,5 +5,5 @@
|
||||
android:endColor="#1B2966"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:radius="40dp" />
|
||||
<corners android:radius="@dimen/dp_36" />
|
||||
</shape>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
|
||||
<View
|
||||
android:id="@+id/tvReasonTitleDivider"
|
||||
android:layout_width="@dimen/dp_6"
|
||||
android:layout_height="@dimen/dp_29"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvReasonTitle"
|
||||
android:background="#0176FF"
|
||||
android:layout_margin="@dimen/dp_15"
|
||||
/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReasonTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintTop_toTopOf="@id/tvReasonTitleDivider"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvReasonTitleDivider"
|
||||
app:layout_constraintStart_toEndOf="@id/tvReasonTitleDivider"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
/>
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/flReasonLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:alignContent="flex_start"
|
||||
app:alignItems="center"
|
||||
app:flexDirection="row"
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_start"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReasonTitleDivider"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,26 +2,26 @@
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="924dp"
|
||||
android:layout_height="668dp"
|
||||
app:roundLayoutRadius="40dp"
|
||||
android:layout_width="@dimen/dp_859"
|
||||
android:layout_height="@dimen/dp_850"
|
||||
app:roundLayoutRadius="@dimen/dp_36"
|
||||
android:background="#1B2966">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="113dp"
|
||||
android:layout_height="@dimen/dp_102"
|
||||
android:background="@drawable/ai_collect_title_bg"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvInitiativeNum"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="113dp"
|
||||
android:layout_width="@dimen/dp_108"
|
||||
android:layout_height="@dimen/dp_102"
|
||||
android:background="@drawable/icon_num_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46dp"
|
||||
android:textSize="@dimen/sp_42"
|
||||
android:gravity="center"
|
||||
android:text="1"
|
||||
/>
|
||||
@@ -33,9 +33,8 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/tvInitiativeNum"
|
||||
app:layout_constraintTop_toTopOf="@id/tvInitiativeNum"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvInitiativeNum"
|
||||
android:text="时间:14:23:10"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38dp"
|
||||
android:textSize="@dimen/sp_34"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
/>
|
||||
|
||||
@@ -46,131 +45,49 @@
|
||||
app:layout_constraintTop_toTopOf="@id/tvInitiativeNum"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvInitiativeNum"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="身份:QA"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38dp"
|
||||
android:textSize="@dimen/sp_34"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/rbOne"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="严重画龙"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="34dp"
|
||||
android:button="@null"
|
||||
android:drawableLeft="@drawable/badcase_radio_button_style"
|
||||
android:drawablePadding="@dimen/dp_10"
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvInitiativeList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvInitiativeNum"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/rbTwo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="速度过慢"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="34dp"
|
||||
android:button="@null"
|
||||
android:drawableLeft="@drawable/badcase_radio_button_style"
|
||||
android:drawablePadding="@dimen/dp_10"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvInitiativeNum"
|
||||
app:layout_constraintLeft_toRightOf="@id/rbOne"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/rbThree"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="感知、定位、地图等其他"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="34dp"
|
||||
android:button="@null"
|
||||
android:drawableLeft="@drawable/badcase_radio_button_style"
|
||||
android:drawablePadding="@dimen/dp_20"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvInitiativeNum"
|
||||
app:layout_constraintLeft_toRightOf="@id/rbTwo"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/rbFour"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="速度过快"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="34dp"
|
||||
android:button="@null"
|
||||
android:drawableLeft="@drawable/badcase_radio_button_style"
|
||||
android:drawablePadding="@dimen/dp_10"
|
||||
app:layout_constraintTop_toBottomOf="@id/rbOne"
|
||||
app:layout_constraintLeft_toLeftOf="@id/rbOne"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/rbFive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="存在碰撞风险"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="34dp"
|
||||
android:button="@null"
|
||||
android:drawableLeft="@drawable/badcase_radio_button_style"
|
||||
android:drawablePadding="@dimen/dp_20"
|
||||
app:layout_constraintTop_toBottomOf="@id/rbTwo"
|
||||
app:layout_constraintLeft_toLeftOf="@id/rbTwo"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/rbSix"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="点刹、顿挫"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="34dp"
|
||||
android:button="@null"
|
||||
android:drawableLeft="@drawable/badcase_radio_button_style"
|
||||
android:drawablePadding="@dimen/dp_20"
|
||||
app:layout_constraintTop_toBottomOf="@id/rbOne"
|
||||
app:layout_constraintLeft_toRightOf="@id/rbFive"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewAudioBg"
|
||||
android:scrollbars="vertical"
|
||||
android:fadeScrollbars="false"
|
||||
android:layout_margin="@dimen/dp_20"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvInitiativeReport"
|
||||
android:layout_width="270dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_width="@dimen/dp_370"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvInitiativeCancel"
|
||||
android:background="@drawable/report_button_bg"
|
||||
android:text="上报"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="30dp"
|
||||
android:textSize="@dimen/dp_27"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvInitiativeCancel"
|
||||
android:layout_width="270dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_width="@dimen/dp_370"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvInitiativeReport"
|
||||
android:text="取消"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="30dp"
|
||||
android:textSize="@dimen/dp_27"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/icon_cancel_bg"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
@@ -178,8 +95,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/viewAudioBg"
|
||||
android:layout_width="824dp"
|
||||
android:layout_height="174dp"
|
||||
android:layout_width="@dimen/dp_768"
|
||||
android:layout_height="@dimen/dp_122"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvInitiativeReport"
|
||||
@@ -189,8 +106,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/viewAudioButton"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_width="@dimen/dp_34"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewAudioBg"
|
||||
app:layout_constraintRight_toRightOf="@id/viewAudioBg"
|
||||
app:layout_constraintTop_toTopOf="@id/viewAudioBg"
|
||||
@@ -203,7 +120,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="30dp"
|
||||
android:textSize="@dimen/dp_27"
|
||||
app:layout_constraintTop_toTopOf="@id/viewAudioButton"
|
||||
app:layout_constraintBottom_toBottomOf="@id/viewAudioButton"
|
||||
app:layout_constraintLeft_toRightOf="@id/viewAudioButton"
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
app:layout_constraintLeft_toRightOf="@id/tvPassiveNum"
|
||||
app:layout_constraintTop_toTopOf="@id/tvPassiveNum"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvPassiveNum"
|
||||
android:text="时间:14:23:10"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38dp"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
@@ -46,7 +45,6 @@
|
||||
app:layout_constraintTop_toTopOf="@id/tvPassiveNum"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvPassiveNum"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="身份:QA"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38dp"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
@@ -116,28 +114,5 @@
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
/>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvPassiveNum"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewAudioBg"
|
||||
android:layout_margin="@dimen/dp_30"
|
||||
>
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/flReasonLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:alignContent="flex_start"
|
||||
app:alignItems="center"
|
||||
app:flexDirection="row"
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_start"
|
||||
/>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
Reference in New Issue
Block a user