[6.7.0]更多内容-上报弹窗UI修改(AI数据采集)
This commit is contained in:
@@ -441,6 +441,13 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener {
|
||||
WorkOrderManager.workOrderManager.showTakeOverRecordView(context)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示AI数据采集页面
|
||||
*/
|
||||
override fun showAiDataCollectView(context: Context) {
|
||||
BadCaseManager.showAiDataCollectView(context)
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动调用SSM停服命令超时检测
|
||||
*/
|
||||
|
||||
@@ -353,6 +353,27 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示AI数据采集页面
|
||||
*/
|
||||
fun showAiDataCollectView(context: Context){
|
||||
val aiDataCollectView = AIDataCollectView(context)
|
||||
aiDataCollectView.setOnClickListener(object: AIDataCollectView.ClickListener{
|
||||
override fun onClose() {
|
||||
hideFloat?.invoke()
|
||||
hideFloat = null
|
||||
}
|
||||
})
|
||||
context.enqueuePop(
|
||||
aiDataCollectView,
|
||||
AutoSizeUtils.dp2px(context, 1046f),
|
||||
WindowManager.LayoutParams.MATCH_PARENT,
|
||||
key = "BadCaseManagerView"
|
||||
).also {
|
||||
hideFloat = it
|
||||
}
|
||||
}
|
||||
|
||||
fun onReceiveBadCaseRecord(msgBoxBean: MsgBoxBean, activity: Activity, countdown: Boolean) {
|
||||
CallerLogger.d("$M_DEVA$TAG", "收到录包结果回调${record}")
|
||||
CallerLogger.d("$M_DEVA$TAG", "开始创建被动录包弹窗,window num=${BadCaseConfig.windowNum}")
|
||||
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.deva.badcase.AiDataEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
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
|
||||
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
|
||||
import com.mogo.eagle.core.utilcode.util.AppStateManager
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getYMDFormat
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.AiDataCollectAdapter
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.BadCaseNetManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.store.BadCaseReasonStore
|
||||
import com.zhjt.mogo_core_function_devatools.workorder.adapter.BottomDecoration
|
||||
import kotlinx.android.synthetic.main.view_ai_data_collect.view.collectGroup
|
||||
import kotlinx.android.synthetic.main.view_ai_data_collect.view.ivDataCollectClose
|
||||
import kotlinx.android.synthetic.main.view_ai_data_collect.view.rvDataCollectList
|
||||
import kotlinx.android.synthetic.main.view_ai_data_collect.view.tvDataCollectDate
|
||||
import kotlinx.android.synthetic.main.view_ai_data_collect.view.tvDataCollectNoData
|
||||
import kotlinx.android.synthetic.main.view_ai_data_collect.view.tvDeleteSelect
|
||||
import kotlinx.android.synthetic.main.view_ai_data_collect.view.tvUpload
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import record_cache.RecordPanelOuterClass
|
||||
|
||||
/**
|
||||
* AI数据采集View
|
||||
*/
|
||||
class AIDataCollectView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr),
|
||||
IMoGoAutopilotRecordListener, BadCaseNetListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "AIDataCollectView"
|
||||
}
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
private var aiDataCollectAdapter: AiDataCollectAdapter?= null
|
||||
@Volatile
|
||||
private var recordKey: Long = 0 //录制bag包key
|
||||
@Volatile
|
||||
private var recordFileName: String? = null //录制文件包名
|
||||
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
||||
private var collectReason: StringBuilder = StringBuilder()
|
||||
private var collectList = ArrayList<String>()
|
||||
|
||||
private var aiDataList = ArrayList<AiDataEntity>()
|
||||
|
||||
private val presenter by lazy {
|
||||
BadCasePresenter()
|
||||
}
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_ai_data_collect, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
//关闭窗口
|
||||
ivDataCollectClose.setOnClickListener{
|
||||
clickListener?.onClose()
|
||||
}
|
||||
//接管记录日期
|
||||
tvDataCollectDate.text = millis2String(System.currentTimeMillis(), getYMDFormat())
|
||||
val linearLayoutManager = LinearLayoutManager(context)
|
||||
linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
|
||||
rvDataCollectList?.layoutManager = linearLayoutManager
|
||||
aiDataCollectAdapter = AiDataCollectAdapter()
|
||||
aiDataCollectAdapter?.setListener(object: AiDataCollectAdapter.AiDataClickListener{
|
||||
override fun onClick(reason: String, isChecked: Boolean) {
|
||||
if(isChecked){
|
||||
if(!collectList.contains(reason)){
|
||||
collectList.add(reason)
|
||||
}
|
||||
}else{
|
||||
if(collectList.contains(reason)){
|
||||
collectList.remove(reason)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
rvDataCollectList.addItemDecoration(
|
||||
BottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 194f)
|
||||
)
|
||||
)
|
||||
rvDataCollectList?.adapter = aiDataCollectAdapter
|
||||
//数据请求错误,使用缓存数据
|
||||
if(BadCaseReasonStore.getAiDataRecord().isNotEmpty()){
|
||||
val result = JSONArray(BadCaseReasonStore.getAiDataRecord())
|
||||
if(result.length()>0){
|
||||
for(i in 0 until result.length()){
|
||||
val jsonObject = result[i] as JSONObject
|
||||
val id = jsonObject.optInt("id")
|
||||
val name = jsonObject.optString("name")
|
||||
val content = jsonObject.optString("content")
|
||||
val entity = AiDataEntity(id, name, content,false)
|
||||
aiDataList.add(entity)
|
||||
}
|
||||
}
|
||||
if(aiDataList.isNotEmpty()){
|
||||
//刷新列表
|
||||
aiDataCollectAdapter?.setData(aiDataList)
|
||||
tvDataCollectNoData.visibility = View.GONE
|
||||
collectGroup.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
//上报
|
||||
tvUpload.setOnClickListener {
|
||||
if(collectList.isEmpty()){
|
||||
ToastUtils.showShort("请选择最少一个原因")
|
||||
return@setOnClickListener
|
||||
}
|
||||
collectReason.clear()
|
||||
for(index in collectList.indices){
|
||||
if(index!=0){
|
||||
collectReason.append("&")
|
||||
}
|
||||
collectReason.append(collectList[index])
|
||||
}
|
||||
//上报到工控机
|
||||
CallerAutoPilotControlManager.recordCause(recordKey.toString(),recordFileName,"",
|
||||
collectReason.toString())
|
||||
GlobalScope.launch {
|
||||
val uploadResult = presenter.upload(mutableMapOf<String, String>().also { itx ->
|
||||
itx["carLicense"] = AppConfigInfo.plateNumber //车牌号
|
||||
itx["filename"] = recordFileName ?: "" //bag包文件地址
|
||||
itx["filesize"] = "0" //bag包文件大小
|
||||
itx["key"] = recordKey.toString() //key
|
||||
itx["reason"] = collectReason.toString() //采集原因
|
||||
itx["duration"] = "20" //采集时长,固定为20S
|
||||
itx["startTime"] = System.currentTimeMillis().toString() //上报时间(时间戳格式)
|
||||
itx["channel"] = "AI" //渠道
|
||||
itx["carSn"] = SharedPrefsMgr.getInstance().sn //SN
|
||||
itx["userRole"] = "" //采集者角色
|
||||
itx["audioUrl"] = "" //音频COS地址
|
||||
itx["mapVersion"] = BadCaseConfig.dockerVersion ?: "" //工控机版本
|
||||
itx["eyeVersion"] = AppUtils.getAppVersionName() //鹰眼版本
|
||||
itx["coordinate"] =
|
||||
"latitude:${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude};longitude:${CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude}" //坐标
|
||||
|
||||
})
|
||||
if (uploadResult == null || uploadResult.code != 200) {
|
||||
TipToast.shortTip("上报失败")
|
||||
} else {
|
||||
//上报成功
|
||||
ThreadUtils.runOnUiThread {
|
||||
val customToastView = AppStateManager.currentActivity()?.layoutInflater?.inflate(R.layout.view_custom_toast,null)
|
||||
val customToast = Toast(context.applicationContext)
|
||||
customToast.duration = Toast.LENGTH_SHORT
|
||||
customToast.view = customToastView
|
||||
customToast.setGravity(Gravity.START,AutoSizeUtils.dp2px(context, 262f),0)
|
||||
customToast.show()
|
||||
//取消选择
|
||||
for(data in aiDataList){
|
||||
data.isChecked = false
|
||||
}
|
||||
collectReason.clear()
|
||||
collectList.clear()
|
||||
aiDataCollectAdapter?.setData(aiDataList)
|
||||
}
|
||||
//将上报BI的结果同步给工控机记录保存
|
||||
recordKey.let {
|
||||
val descReqEntity = BagDescriptionEntity(collectReason.toString(),false,"",true)
|
||||
bagManagerEntity.reqType = 5
|
||||
bagManagerEntity.keyReq = it
|
||||
bagManagerEntity.descReq = descReqEntity
|
||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//取消
|
||||
tvDeleteSelect.setOnClickListener {
|
||||
clickListener?.onClose()
|
||||
}
|
||||
}
|
||||
|
||||
fun setOnClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener {
|
||||
fun onClose()
|
||||
}
|
||||
|
||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||
CallerLogger.d("${M_DEVA}${TAG}", "-- 收到工控机录制任务回调 -- $recordPanel")
|
||||
ThreadUtils.runOnUiThread {
|
||||
recordKey = recordPanel.key
|
||||
//开始录制
|
||||
if(recordPanel.stat == 300){
|
||||
BadCaseConfig.recordKeyList.add(recordPanel.key)
|
||||
val aiDataSet = BadCaseConfig.getAiDataSet()
|
||||
//保存录包状态
|
||||
aiDataSet.add(recordPanel.key.toString())
|
||||
BadCaseConfig.setAiDataSet(aiDataSet)
|
||||
}
|
||||
if (recordFileName == null) {
|
||||
recordFileName = recordPanel.filename
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
//采集结果回调监听
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
//注册网络接口获取数据监听
|
||||
CallerDevaToolsNetManager.addListener(TAG,this)
|
||||
//获取数据
|
||||
BadCaseNetManager.badCaseNetManager.getAiData()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
//注销采集结果回调监听
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
//注销网络接口监听
|
||||
CallerDevaToolsNetManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAiDataResponse(list: List<AiDataEntity>) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if(list.isEmpty()){
|
||||
tvDataCollectNoData.visibility = View.VISIBLE
|
||||
collectGroup.visibility = View.GONE
|
||||
}else{
|
||||
tvDataCollectNoData.visibility = View.GONE
|
||||
collectGroup.visibility = View.VISIBLE
|
||||
aiDataList = list as ArrayList<AiDataEntity>
|
||||
//刷新列表
|
||||
aiDataCollectAdapter?.setData(list)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAiDataError() {
|
||||
if(BadCaseReasonStore.getAiDataRecord().isEmpty()){
|
||||
ToastUtils.showShort("AI数据采集数据请求错误且无缓存数据可用")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -100,7 +100,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initFloatWindow() {
|
||||
mFloatLayout =
|
||||
LayoutInflater.from(mActivity).inflate(R.layout.view_ai_data_collect, null) as View
|
||||
LayoutInflater.from(mActivity).inflate(R.layout.window_ai_data_collect, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
tvCollectNum = mFloatLayout.findViewById(R.id.tvCollectNum)
|
||||
tvCollectTime = mFloatLayout.findViewById(R.id.tvCollectTime)
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.CheckBox
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.deva.badcase.AiDataEntity
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
|
||||
/**
|
||||
* AI数据采集适配器
|
||||
*/
|
||||
class AiDataCollectAdapter: RecyclerView.Adapter<AiDataCollectAdapter.AiDataHolder>() {
|
||||
|
||||
private var data:List<AiDataEntity> ?= null
|
||||
private var clickListener: AiDataClickListener ?= null
|
||||
|
||||
fun setData(data: List<AiDataEntity>){
|
||||
this.data = data
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
fun setListener(listener: AiDataClickListener){
|
||||
clickListener = listener
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AiDataHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_ai_data_collect, parent, false)
|
||||
return AiDataHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: AiDataHolder, position: Int) {
|
||||
data?.let {
|
||||
val entity = it[position]
|
||||
if(entity.content.isBlank()){
|
||||
holder.rbDataSelect.text = entity.name
|
||||
}else{
|
||||
holder.rbDataSelect.text = "${entity.name}:${entity.content}"
|
||||
}
|
||||
holder.rbDataSelect.isChecked = entity.isChecked
|
||||
holder.rbDataSelect.tag = entity
|
||||
holder.rbDataSelect.setOnCheckedChangeListener { _, isChecked ->
|
||||
clickListener?.onClick(holder.rbDataSelect.text.toString(),isChecked)
|
||||
entity.isChecked = isChecked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
class AiDataHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
var rbDataSelect: CheckBox = itemView.findViewById(R.id.rb_data_select)
|
||||
}
|
||||
|
||||
interface AiDataClickListener{
|
||||
fun onClick(reason: String,isChecked: Boolean)
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_151"
|
||||
android:orientation="vertical">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/rb_data_select"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/sp_34"
|
||||
android:button="@null"
|
||||
android:drawableLeft="@drawable/record_radio_button_style"
|
||||
android:text="@string/take_over_reason"
|
||||
android:drawablePadding="@dimen/dp_20"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1"
|
||||
android:background="#668E9DD4"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,84 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_1046"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_72"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="924dp"
|
||||
android:layout_height="668dp"
|
||||
app:roundLayoutRadius="40dp"
|
||||
android:background="#1B2966">
|
||||
android:background="@drawable/bg_take_over_record">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="113dp"
|
||||
android:background="@drawable/ai_collect_title_bg"
|
||||
/>
|
||||
android:id="@+id/viewDataCollectLine"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:layout_marginStart="@dimen/dp_80"
|
||||
android:layout_marginTop="@dimen/dp_92"
|
||||
android:background="@drawable/icon_take_over_label"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCollectNum"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="113dp"
|
||||
android:background="@drawable/icon_num_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46dp"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCollectTime"
|
||||
android:id="@+id/tvDataCollectTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvCollectNum"
|
||||
app:layout_constraintTop_toTopOf="@id/tvCollectNum"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvCollectNum"
|
||||
android:text="@string/ai_collect_report_title"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38dp"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
android:textSize="@dimen/sp_42"
|
||||
app:layout_constraintTop_toTopOf="@id/viewDataCollectLine"
|
||||
app:layout_constraintLeft_toRightOf="@id/viewDataCollectLine"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:layout_marginTop="@dimen/dp_m_2"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivDataCollectClose"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:background="@drawable/icon_close_take_over"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/tvDataCollectTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvDataCollectTitle"
|
||||
android:contentDescription="@string/take_over_record_close"
|
||||
android:layout_marginStart="@dimen/dp_896"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDataCollectDate"
|
||||
android:layout_width="@dimen/dp_880"
|
||||
android:layout_height="@dimen/dp_61"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewDataCollectLine"
|
||||
app:layout_constraintLeft_toLeftOf="@id/viewDataCollectLine"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
android:background="#7F000000"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvCollectList"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/rvDataCollectList"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCollectNum"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvCollectReport"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvDataCollectDate"
|
||||
app:layout_constraintRight_toRightOf="@id/tvDataCollectDate"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDataCollectDate"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvDataCollectNoData"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:scrollbars="vertical"
|
||||
android:fadeScrollbars="false"
|
||||
android:layout_margin="@dimen/dp_25"
|
||||
android:layout_marginStart="@dimen/dp_401"
|
||||
android:layout_marginTop="@dimen/dp_606"
|
||||
app:drawableTopCompat="@drawable/icon_record_no_data"
|
||||
android:text="@string/take_over_record_no_data"
|
||||
android:drawablePadding="@dimen/dp_31"
|
||||
android:textColor="#B2FFFFFF"
|
||||
android:textSize="@dimen/sp_40"
|
||||
android:gravity="center_horizontal"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewDataCollectBottom"
|
||||
android:layout_width="@dimen/dp_1000"
|
||||
android:layout_height="@dimen/dp_364"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@drawable/bg_take_over_bottom"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCollectReport"
|
||||
android:layout_width="270dp"
|
||||
android:layout_height="70dp"
|
||||
android:id="@+id/tvUpload"
|
||||
android:layout_width="@dimen/dp_421"
|
||||
android:layout_height="@dimen/dp_126"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvCollectCancel"
|
||||
android:background="@drawable/report_button_bg"
|
||||
android:text="上报"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="30dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:layout_marginBottom="@dimen/dp_75"
|
||||
android:layout_marginLeft="@dimen/dp_60"
|
||||
android:background="@drawable/icon_ai_data_report"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCollectCancel"
|
||||
android:layout_width="270dp"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:id="@+id/tvDeleteSelect"
|
||||
android:layout_width="@dimen/dp_441"
|
||||
android:layout_height="@dimen/dp_146"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvCollectReport"
|
||||
android:text="取消"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="30dp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/icon_cancel_bg"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_55"
|
||||
android:layout_marginRight="@dimen/dp_85"
|
||||
android:background="@drawable/icon_ai_data_cancel"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/collectGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="tvDataCollectDate,
|
||||
rvDataCollectList,tvUpload,tvDeleteSelect,viewDataCollectBottom"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_477"
|
||||
android:layout_height="@dimen/dp_371"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
|
||||
<View
|
||||
android:layout_width="@dimen/dp_477"
|
||||
android:layout_height="@dimen/dp_371"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:background="@drawable/bg_custom_toast"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivReportSuccess"
|
||||
android:layout_width="@dimen/dp_140"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:src="@drawable/icon_ai_report_success"
|
||||
android:contentDescription="@string/report_success"
|
||||
android:layout_marginTop="@dimen/dp_78"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ivReportSuccess"
|
||||
android:text="@string/report_success"
|
||||
android:textSize="@dimen/sp_38"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:background="#1B2966">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="113dp"
|
||||
android:background="@drawable/ai_collect_title_bg"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCollectNum"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="113dp"
|
||||
android:background="@drawable/icon_num_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46dp"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCollectTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvCollectNum"
|
||||
app:layout_constraintTop_toTopOf="@id/tvCollectNum"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvCollectNum"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38dp"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvCollectList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCollectNum"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvCollectReport"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:scrollbars="vertical"
|
||||
android:fadeScrollbars="false"
|
||||
android:layout_margin="@dimen/dp_25"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCollectReport"
|
||||
android:layout_width="270dp"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvCollectCancel"
|
||||
android:background="@drawable/report_button_bg"
|
||||
android:text="上报"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="30dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCollectCancel"
|
||||
android:layout_width="270dp"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvCollectReport"
|
||||
android:text="取消"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="30dp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/icon_cancel_bg"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
/>
|
||||
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -66,5 +66,6 @@
|
||||
<string name="take_over_cancel">取消</string>
|
||||
<string name="take_over_record_no_data">暂无内容</string>
|
||||
<string name="take_over_record_cannot_check">不能选则</string>
|
||||
<string name="ai_collect_report_title">上报</string>
|
||||
|
||||
</resources>
|
||||
@@ -199,23 +199,8 @@ object ToolKitDataManager : IToolKitItemClickListener, IDataCenterBizListener {
|
||||
}
|
||||
|
||||
ToolTypeEnum.AI_REPORT.name -> {
|
||||
(ctx as? FragmentActivity)?.also {
|
||||
if (NetworkUtils.isConnected()) {
|
||||
if (BadCaseConfig.dockerVersion != null) {
|
||||
val aiDataCollectWindow = AIDataCollectWindow(it)
|
||||
aiDataCollectWindow.setClickListener(object :
|
||||
AIDataCollectWindow.ClickListener {
|
||||
override fun closeWindow() {
|
||||
aiDataCollectWindow.hideFloatWindow()
|
||||
}
|
||||
})
|
||||
aiDataCollectWindow.showFloatWindow()
|
||||
} else {
|
||||
ToastUtils.showShort("工控机连接状态异常")
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showShort("网络异常,请检查网络")
|
||||
}
|
||||
ctx?.also {
|
||||
CallerDevaToolsManager.showAiDataCollectView(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,9 +209,8 @@
|
||||
|
||||
<string name="fault_time_reduce">故障发生时间减少</string>
|
||||
<string name="fault_time_add">故障发生时间增加</string>
|
||||
|
||||
<string name="msg_box_toast_icon">消息盒子吐司图标</string>
|
||||
|
||||
<string name="traffic_light_source">红绿灯信号来源</string>
|
||||
<string name="report_success">已发起上报</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -152,6 +152,11 @@ interface IDevaToolsProvider : IProvider {
|
||||
*/
|
||||
fun showTakeOverRecordView(context: Context)
|
||||
|
||||
/**
|
||||
* 展示AI数据采集页面
|
||||
*/
|
||||
fun showAiDataCollectView(context: Context)
|
||||
|
||||
/**
|
||||
* 启动调用SSM停服命令超时检测
|
||||
*/
|
||||
|
||||
@@ -207,6 +207,13 @@ object CallerDevaToolsManager {
|
||||
devaToolsProviderApi?.showTakeOverRecordView(context)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示AI数据采集页面
|
||||
*/
|
||||
fun showAiDataCollectView(context: Context){
|
||||
devaToolsProviderApi?.showAiDataCollectView(context)
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动调用SSM停服命令超时检测
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user