Merge branch 'dev_sweeper-d_230614_3.1.4' into 'test_sweeper-d_230614_3.1.4.1'
Dev sweeper d 230614 3.1.4 See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!794
This commit is contained in:
@@ -122,6 +122,11 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
}
|
||||
}
|
||||
|
||||
override fun setAutoState(state: Int) {
|
||||
super.setAutoState(state)
|
||||
getCurrentView().updateStartAutoPilotBtnState(state)
|
||||
}
|
||||
|
||||
fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
|
||||
mCleanSystemState = cleanSystemState
|
||||
sweeper_cl_work_mode.setSweeperFutianCleanSystemState(mSubTaskType, cleanSystemState)
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.mogo.och.sweepercloud.view
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.sweepercloud.R
|
||||
import com.zhjt.mogo.adas.data.sweeper.common.SweeperCommon.TaskStatus
|
||||
@@ -27,8 +29,20 @@ class SweeperCurrentTaskInfoView : ConstraintLayout {
|
||||
initView(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {}
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
}
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes) {
|
||||
}
|
||||
|
||||
private fun initView(context: Context) {
|
||||
LayoutInflater.from(context).inflate(R.layout.sweeper_current_task_info, this)
|
||||
@@ -39,6 +53,34 @@ class SweeperCurrentTaskInfoView : ConstraintLayout {
|
||||
return tvStartAuto
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据当前自动驾驶状态,更新【请求进入自动驾驶】按钮样式
|
||||
*/
|
||||
fun updateStartAutoPilotBtnState(autopilotState: Int) {
|
||||
when (autopilotState) {
|
||||
//不可自动驾驶
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {
|
||||
tvStartAuto.setTextColor(Color.parseColor("#66FFFFFF"))
|
||||
tvStartAuto.isSelected = false
|
||||
}
|
||||
//人工驾驶
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {
|
||||
tvStartAuto.setTextColor(Color.parseColor("#FFFFFFFF"))
|
||||
tvStartAuto.isSelected = true
|
||||
}
|
||||
//自动驾驶中
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
tvStartAuto.setTextColor(Color.parseColor("#66FFFFFF"))
|
||||
tvStartAuto.isSelected = false
|
||||
}
|
||||
//平行驾驶
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
|
||||
tvStartAuto.setTextColor(Color.parseColor("#66FFFFFF"))
|
||||
tvStartAuto.isSelected = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前任务数据
|
||||
*/
|
||||
@@ -51,12 +93,13 @@ class SweeperCurrentTaskInfoView : ConstraintLayout {
|
||||
tvTaskName.text = taskName
|
||||
val calendarStart = DateTimeUtil.formatLongToCalendar(taskStartTime)
|
||||
val calendarEnd = DateTimeUtil.formatLongToCalendar(taskEndTime)
|
||||
tvTaskTime.text = "${DateTimeUtil.formatCalendarToString(calendarStart, DateTimeUtil.HH_mm)}-${
|
||||
DateTimeUtil.formatCalendarToString(
|
||||
calendarEnd,
|
||||
DateTimeUtil.HH_mm
|
||||
)
|
||||
}"
|
||||
tvTaskTime.text =
|
||||
"${DateTimeUtil.formatCalendarToString(calendarStart, DateTimeUtil.HH_mm)}-${
|
||||
DateTimeUtil.formatCalendarToString(
|
||||
calendarEnd,
|
||||
DateTimeUtil.HH_mm
|
||||
)
|
||||
}"
|
||||
}
|
||||
listTask?.let {
|
||||
//特殊处理当前暂无执行中任务的情况
|
||||
@@ -75,10 +118,10 @@ class SweeperCurrentTaskInfoView : ConstraintLayout {
|
||||
*/
|
||||
private fun setSubTaskState(isWorking: Boolean) {
|
||||
if (isWorking) {
|
||||
tvTaskState.text = "正在作业"
|
||||
tvTaskState.text = "任务执行中"
|
||||
tvTaskState.setBackgroundResource(R.drawable.bg_shape_task_state_working)
|
||||
} else {
|
||||
tvTaskState.text = "暂未准备"
|
||||
tvTaskState.text = "任务待开始"
|
||||
tvTaskState.setBackgroundResource(R.drawable.bg_shape_task_state_not_ready)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<corners android:bottomRightRadius="30dp" android:bottomLeftRadius="@dimen/dp_30"/>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" android:bottomRightRadius="@dimen/dp_30" />
|
||||
<gradient android:angle="180" android:endColor="#2F6EFF" android:startColor="#20AAFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_selected="false">
|
||||
<shape>
|
||||
<solid android:color="#4D2F6EFF" />
|
||||
<corners android:bottomLeftRadius="@dimen/dp_30" android:bottomRightRadius="@dimen/dp_30" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -26,7 +26,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_36"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="当前作业模式:"
|
||||
android:text="当前上装模式:"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -322,10 +322,29 @@ class MoGoAutopilotControlProvider :
|
||||
startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.PAD)
|
||||
}
|
||||
|
||||
override fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters) {
|
||||
startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.MO_FANG)
|
||||
override fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?) {
|
||||
if (controlParameters==null){
|
||||
startAutoPilotWithNoParameter(Constants.AUTOPILOT_SOURCE.MO_FANG)
|
||||
}else{
|
||||
startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.MO_FANG)
|
||||
}
|
||||
}
|
||||
private fun startAutoPilotWithNoParameter(source: Int) {
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
val invokeResult = AdasManager.getInstance()
|
||||
.sendAutoPilotModeReq(1, source, null)
|
||||
invokeAutoPilotResult(if (invokeResult) "无参自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空")
|
||||
} else {
|
||||
if (AdasManager.getInstance().ipcConnectionStatus == IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
val invokeResult = AdasManager.getInstance()
|
||||
.sendAutoPilotModeReq(1, source, null)
|
||||
invokeAutoPilotResult(if (invokeResult) "无参自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空")
|
||||
} else {
|
||||
invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶 无参")
|
||||
CallerLogger.e("$M_ADAS_IMPL$TAG", "车机与工控机链接失败,无法开启自动驾驶")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int) {
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
val invokeResult = AdasManager.getInstance()
|
||||
|
||||
@@ -42,7 +42,7 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
|
||||
*
|
||||
* @param controlParameters 开启自动驾驶的控制参数
|
||||
*/
|
||||
fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters)
|
||||
fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?)
|
||||
|
||||
/**
|
||||
* 给工控机透出路口红绿灯信息
|
||||
|
||||
@@ -93,10 +93,6 @@ object CallerAutoPilotControlManager {
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?) {
|
||||
if (controlParameters == null) {
|
||||
//LogUtils.eTag(TAG, "自动驾驶控制参数异常,请检查参数信息")
|
||||
return
|
||||
}
|
||||
providerApi?.startAutoPilotByMoFang(controlParameters)
|
||||
// 更新记录在全局的控制参数
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(controlParameters)
|
||||
|
||||
@@ -836,7 +836,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* 设置自动驾驶模式 启动自动驾驶
|
||||
*
|
||||
* @param mode 1: enter autopilot mode, 0: quit autopilot mode
|
||||
* @param source 命令来源: 0: pad模拟(模拟时routeInfo传null), 1: AICloud业务
|
||||
* @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线)
|
||||
* @param routeInfo 自动驾驶路径信息
|
||||
* @return boolean
|
||||
*/
|
||||
|
||||
@@ -297,7 +297,7 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* 设置自动驾驶模式 启动自动驾驶
|
||||
*
|
||||
* @param mode 1: enter autopilot mode, 0: quit autopilot mode
|
||||
* @param source 命令来源: 0: pad模拟(模拟时routeInfo传null), 1: AICloud业务
|
||||
* @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线)
|
||||
* @param routeInfo 自动驾驶路径信息
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -86,7 +86,7 @@ public interface IAdasNetCommApi {
|
||||
* 设置自动驾驶模式 启动自动驾驶
|
||||
*
|
||||
* @param mode 1: enter autopilot mode, 0: quit autopilot mode
|
||||
* @param source 命令来源: 0: pad模拟(模拟时routeInfo传null), 1: AICloud业务
|
||||
* @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线)
|
||||
* @param routeInfo 自动驾驶路径信息
|
||||
* @return 加入WS发送消息队列是否成功
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user