@@ -14,40 +14,79 @@ import com.mogo.eagle.core.data.multidisplay.TelematicConstant
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.function.api.autopilot.IMoGoGetParamResponseListener
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
import com.mogo.eagle.core.function.api.devatools.mofang.*
import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangProvider
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_DEMO
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_RAIN
import com.mogo.eagle.core.function.api.setting.ISopSettingListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotGetParamResponseDispatcher
import com.mogo.eagle.core.function.call.devatools.*
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.call.vehicle.CallerSweeperModeListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.tools.DockerRebootDialog
import com.mogo.eagle.core.function.hmi.ui.tools.SweeperModeChangedConfirmDialog
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiAction
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.vehicle.SweeperVehicleConfigUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhjt.mogo.adas.data.AdasConstants
import com.zhjt.mogo.adas.data.bean.AdasParam
import kotlinx.android.synthetic.main.view_sop_setting.view.*
import kotlinx.android.synthetic.main.view_sop_setting.view.btnSpeedSet
import kotlinx.android.synthetic.main.view_sop_setting.view.ivSpeedAdd
import kotlinx.android.synthetic.main.view_sop_setting.view.ivSpeedReduce
import kotlinx.android.synthetic.main.view_sop_setting.view.mfStatusLayout
import kotlinx.android.synthetic.main.view_sop_setting.view.mfTest
import kotlinx.android.synthetic.main.view_sop_setting.view.rgFusionMode
import kotlinx.android.synthetic.main.view_sop_setting.view.scCarAperture
import kotlinx.android.synthetic.main.view_sop_setting.view.scDemoMode
import kotlinx.android.synthetic.main.view_sop_setting.view.scDrawPointCloudData
import kotlinx.android.synthetic.main.view_sop_setting.view.scFaultSlowDown
import kotlinx.android.synthetic.main.view_sop_setting.view.scGreenWaveSop
import kotlinx.android.synthetic.main.view_sop_setting.view.scIPCReport
import kotlinx.android.synthetic.main.view_sop_setting.view.scMarkingObstacles
import kotlinx.android.synthetic.main.view_sop_setting.view.scNew360LookAround
import kotlinx.android.synthetic.main.view_sop_setting.view.scNewV2NData
import kotlinx.android.synthetic.main.view_sop_setting.view.scObstacleAvoidance
import kotlinx.android.synthetic.main.view_sop_setting.view.scObu
import kotlinx.android.synthetic.main.view_sop_setting.view.scObuV2vView
import kotlinx.android.synthetic.main.view_sop_setting.view.scObuWeaknessTrafficSop
import kotlinx.android.synthetic.main.view_sop_setting.view.scRainMode
import kotlinx.android.synthetic.main.view_sop_setting.view.scRouteDynamicEffect
import kotlinx.android.synthetic.main.view_sop_setting.view.scRunRedLightSop
import kotlinx.android.synthetic.main.view_sop_setting.view.scShowBagRecordWindow
import kotlinx.android.synthetic.main.view_sop_setting.view.scSpeedLimit
import kotlinx.android.synthetic.main.view_sop_setting.view.scSweeperModeSwitch
import kotlinx.android.synthetic.main.view_sop_setting.view.scTrafficLight
import kotlinx.android.synthetic.main.view_sop_setting.view.scV2ISwitch
import kotlinx.android.synthetic.main.view_sop_setting.view.scV2NSwitch
import kotlinx.android.synthetic.main.view_sop_setting.view.scV2XSwitch
import kotlinx.android.synthetic.main.view_sop_setting.view.scV2iPnc
import kotlinx.android.synthetic.main.view_sop_setting.view.scV2nPnc
import kotlinx.android.synthetic.main.view_sop_setting.view.scWeakNetSlowDown
import kotlinx.android.synthetic.main.view_sop_setting.view.sopLayout
import kotlinx.android.synthetic.main.view_sop_setting.view.tvSpeed
import kotlinx.android.synthetic.main.view_sop_setting.view.tvSpeedThresholdTitle
import mogo.telematics.pad.MessagePad
/**
* SOP设置窗口
*/
internal class SOPSettingView @JvmOverloads constructor (
context : Context ,
attrs : AttributeSet ? = null ,
defStyleAttr : Int = 0
context : Context ,
attrs : AttributeSet ? = null ,
defStyleAttr : Int = 0
) : ConstraintLayout ( context , attrs , defStyleAttr ) , IMoGoDevaToolsFuncConfigListener ,
IViewControlListener , IMoGoMoFangProvider . OnMoFangStatusListener ,
IMoGoGetParamResponseListener , ISopSettingListener {
IViewControlListener , IMoGoMoFangProvider . OnMoFangStatusListener ,
IMoGoGetParamResponseListener , ISopSettingListener {
companion object {
const val TAG = " SOPSettingView "
@@ -64,7 +103,7 @@ internal class SOPSettingView @JvmOverloads constructor(
}
private fun initView ( ) {
sopLayout . setOnClickListener { }
sopLayout . setOnClickListener { }
//V2X消息设置
v2xSetting ( )
//地图效果类设置
@@ -78,50 +117,50 @@ internal class SOPSettingView @JvmOverloads constructor(
/**
* V2X消息设置
*/
private fun v2xSetting ( ) {
private fun v2xSetting ( ) {
//V2X总开关
scV2XSwitch . isChecked = FunctionBuildConfig . v2xMainSwitch
scV2XSwitch . setOnCheckedChangeListener { _ , isChecked ->
FunctionBuildConfig . v2xMainSwitch = isChecked
hmiAction ( " SOP V2X总开关, " , isChecked )
Log . i ( TAG , " SOP V2X总开关, $isChecked " )
if ( isChecked ) {
hmiAction ( " SOP V2X总开关, " , isChecked )
Log . i ( TAG , " SOP V2X总开关, $isChecked " )
if ( isChecked ) {
//V2N总开关
scV2NSwitch . isChecked = FunctionBuildConfig . v2nMainSwitch
hmiAction ( " SOP V2N总开关, " , FunctionBuildConfig . v2nMainSwitch )
Log . i ( TAG , " SOP V2N总开关, ${FunctionBuildConfig.v2nMainSwitch} " )
hmiAction ( " SOP V2N总开关, " , FunctionBuildConfig . v2nMainSwitch )
Log . i ( TAG , " SOP V2N总开关, ${FunctionBuildConfig.v2nMainSwitch} " )
//V2I总开关
scV2ISwitch . isChecked = HmiBuildConfig . isShowObuV2iView
hmiAction ( " SOP V2I总开关, " , HmiBuildConfig . isShowObuV2iView )
Log . i ( TAG , " SOP V2I总开关, ${HmiBuildConfig.isShowObuV2iView} " )
hmiAction ( " SOP V2I总开关, " , HmiBuildConfig . isShowObuV2iView )
Log . i ( TAG , " SOP V2I总开关, ${HmiBuildConfig.isShowObuV2iView} " )
//V2V总开关
scObuV2vView . isChecked = HmiBuildConfig . isShowObuV2vView
hmiAction ( " SOP V2V总开关, " , HmiBuildConfig . isShowObuV2vView )
Log . i ( TAG , " SOP V2V总开关, ${HmiBuildConfig.isShowObuV2vView} " )
hmiAction ( " SOP V2V总开关, " , HmiBuildConfig . isShowObuV2vView )
Log . i ( TAG , " SOP V2V总开关, ${HmiBuildConfig.isShowObuV2vView} " )
//obu总开关
scObu . isChecked = obuConnectStatus
hmiAction ( " SOP obu总开关, " , obuConnectStatus )
Log . i ( TAG , " SOP obu总开关, $obuConnectStatus " )
if ( obuConnectStatus ) {
hmiAction ( " SOP obu总开关, " , obuConnectStatus )
Log . i ( TAG , " SOP obu总开关, $obuConnectStatus " )
if ( obuConnectStatus ) {
CallerObuApiManager . resetObuIpAddress ( MogoObuConst . OBU _DEFAULT _IP )
}
} else {
} else {
//V2N总开关
scV2NSwitch . isChecked = false
hmiAction ( " SOP V2N总开关, " , false )
Log . i ( TAG , " SOP V2N总开关, false " )
hmiAction ( " SOP V2N总开关, " , false )
Log . i ( TAG , " SOP V2N总开关, false " )
//V2I总开关
scV2ISwitch . isChecked = false
hmiAction ( " SOP V2I总开关, " , false )
Log . i ( TAG , " SOP V2I总开关, false " )
hmiAction ( " SOP V2I总开关, " , false )
Log . i ( TAG , " SOP V2I总开关, false " )
//V2V总开关
scObuV2vView . isChecked = false
hmiAction ( " SOP V2V总开关, " , false )
Log . i ( TAG , " SOP V2V总开关, false " )
hmiAction ( " SOP V2V总开关, " , false )
Log . i ( TAG , " SOP V2V总开关, false " )
//obu总开关
scObu . isChecked = false
hmiAction ( " SOP OBU控制总开关, " , false )
Log . i ( TAG , " SOP OBU控制总开关, false " )
hmiAction ( " SOP OBU控制总开关, " , false )
Log . i ( TAG , " SOP OBU控制总开关, false " )
//断开链接
CallerObuApiManager . disConnectObu ( )
}
@@ -141,41 +180,41 @@ internal class SOPSettingView @JvmOverloads constructor(
//绿波通行(默认关闭)
scGreenWaveSop . isEnabled = FunctionBuildConfig . v2nMainSwitch
scV2NSwitch . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( isChecked ) {
if ( isChecked ) {
//V2N新链路
scNewV2NData . isChecked = FunctionBuildConfig . isNewV2NData
hmiAction ( " SOP 是否是V2N新链路(云->工控机->App) " , FunctionBuildConfig . isNewV2NData )
Log . i ( TAG , " SOP 是否是V2N新链路(云->工控机->App), ${FunctionBuildConfig.isNewV2NData} " )
hmiAction ( " SOP 是否是V2N新链路(云->工控机->App) " , FunctionBuildConfig . isNewV2NData )
Log . i ( TAG , " SOP 是否是V2N新链路(云->工控机->App), ${FunctionBuildConfig.isNewV2NData} " )
//V2N场景进PNC
scV2nPnc . isChecked = FunctionBuildConfig . isV2NPnc
hmiAction ( " SOP V2N场景进PNC, " , FunctionBuildConfig . isV2NPnc )
Log . i ( TAG , " SOP V2N场景进PNC, ${FunctionBuildConfig.isV2NPnc} " )
hmiAction ( " SOP V2N场景进PNC, " , FunctionBuildConfig . isV2NPnc )
Log . i ( TAG , " SOP V2N场景进PNC, ${FunctionBuildConfig.isV2NPnc} " )
CallerAutoPilotControlManager . sendV2nToPncCmd ( FunctionBuildConfig . isV2NPnc )
//绿波通行
scGreenWaveSop . isChecked = HmiBuildConfig . isShowGreenWaveView
hmiAction ( " SOP obu绿波通行, " , HmiBuildConfig . isShowGreenWaveView )
Log . i ( TAG , " SOP obu绿波通行, ${HmiBuildConfig.isShowGreenWaveView} " )
hmiAction ( " SOP obu绿波通行, " , HmiBuildConfig . isShowGreenWaveView )
Log . i ( TAG , " SOP obu绿波通行, ${HmiBuildConfig.isShowGreenWaveView} " )
CallerTelematicManager . sendMsgToAllClients ( TelematicConstant . OBU _GREENWAVE _WARNING , " 1 " . toByteArray ( ) )
} else {
} else {
//V2N新链路
scNewV2NData . isChecked = false
hmiAction ( " SOP 是否是V2N新链路(云->工控机->App) " , false )
Log . i ( TAG , " SOP 是否是V2N新链路(云->工控机->App), false " )
hmiAction ( " SOP 是否是V2N新链路(云->工控机->App) " , false )
Log . i ( TAG , " SOP 是否是V2N新链路(云->工控机->App), false " )
//V2N场景进PNC
scV2nPnc . isChecked = false
hmiAction ( " SOP V2N场景进PNC, " , false )
Log . i ( TAG , " SOP V2N场景进PNC, false " )
hmiAction ( " SOP V2N场景进PNC, " , false )
Log . i ( TAG , " SOP V2N场景进PNC, false " )
CallerAutoPilotControlManager . sendV2nToPncCmd ( false )
//绿波通行
scGreenWaveSop . isChecked = false
hmiAction ( " SOP obu绿波通行, " , false )
Log . i ( TAG , " SOP obu绿波通行, false " )
hmiAction ( " SOP obu绿波通行, " , false )
Log . i ( TAG , " SOP obu绿波通行, false " )
CallerTelematicManager . sendMsgToAllClients ( TelematicConstant . OBU _GREENWAVE _WARNING , " 0 " . toByteArray ( ) )
}
scNewV2NData . isEnabled = isChecked
scV2nPnc . isEnabled = isChecked
scGreenWaveSop . isEnabled = isChecked
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
FunctionBuildConfig . v2nMainSwitch = isChecked
@@ -188,41 +227,41 @@ internal class SOPSettingView @JvmOverloads constructor(
scRunRedLightSop . isEnabled = HmiBuildConfig . isShowObuV2iView
scObuWeaknessTrafficSop . isEnabled = HmiBuildConfig . isShowObuV2iView
scV2ISwitch . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( isChecked ) {
if ( isChecked ) {
//V2I场景进PNC
scV2iPnc . isChecked = FunctionBuildConfig . isV2IPnc
hmiAction ( " SOP V2I场景进PNC, " , FunctionBuildConfig . isV2IPnc )
Log . i ( TAG , " SOP V2I场景进PNC, ${FunctionBuildConfig.isV2IPnc} " )
hmiAction ( " SOP V2I场景进PNC, " , FunctionBuildConfig . isV2IPnc )
Log . i ( TAG , " SOP V2I场景进PNC, ${FunctionBuildConfig.isV2IPnc} " )
CallerAutoPilotControlManager . sendV2iToPncCmd ( FunctionBuildConfig . isV2IPnc )
//闯红灯预警
scRunRedLightSop . isChecked = HmiBuildConfig . isShowRunRedLightView
hmiAction ( " SOP obu闯红灯预警, " , HmiBuildConfig . isShowRunRedLightView )
Log . i ( TAG , " SOP obu闯红灯预警, ${HmiBuildConfig.isShowRunRedLightView} " )
hmiAction ( " SOP obu闯红灯预警, " , HmiBuildConfig . isShowRunRedLightView )
Log . i ( TAG , " SOP obu闯红灯预警, ${HmiBuildConfig.isShowRunRedLightView} " )
CallerTelematicManager . sendMsgToAllClients ( TelematicConstant . OBU _RUNREDLIGHT _WARNING , " 1 " . toByteArray ( ) )
//路侧弱势交通参与者
scObuWeaknessTrafficSop . isChecked = HmiBuildConfig . isShowObuWeaknessTrafficView
hmiAction ( " SOP obu弱势交通控制, " , HmiBuildConfig . isShowObuWeaknessTrafficView )
Log . i ( TAG , " SOP obu弱势交通控制, ${HmiBuildConfig.isShowObuWeaknessTrafficView} " )
} else {
hmiAction ( " SOP obu弱势交通控制, " , HmiBuildConfig . isShowObuWeaknessTrafficView )
Log . i ( TAG , " SOP obu弱势交通控制, ${HmiBuildConfig.isShowObuWeaknessTrafficView} " )
} else {
//V2I场景进PNC
scV2iPnc . isChecked = false
CallerAutoPilotControlManager . sendV2iToPncCmd ( false )
hmiAction ( " SOP V2I场景进PNC, " , false )
Log . i ( TAG , " SOP V2I场景进PNC, false " )
hmiAction ( " SOP V2I场景进PNC, " , false )
Log . i ( TAG , " SOP V2I场景进PNC, false " )
//闯红灯预警
scRunRedLightSop . isChecked = false
hmiAction ( " SOP obu闯红灯预警, " , false )
Log . i ( TAG , " SOP obu闯红灯预警, false " )
hmiAction ( " SOP obu闯红灯预警, " , false )
Log . i ( TAG , " SOP obu闯红灯预警, false " )
CallerTelematicManager . sendMsgToAllClients ( TelematicConstant . OBU _RUNREDLIGHT _WARNING , " 0 " . toByteArray ( ) )
//路侧弱势交通参与者
scObuWeaknessTrafficSop . isChecked = false
hmiAction ( " SOP obu弱势交通控制, " , false )
Log . i ( TAG , " SOP obu弱势交通控制, false " )
hmiAction ( " SOP obu弱势交通控制, " , false )
Log . i ( TAG , " SOP obu弱势交通控制, false " )
}
scV2iPnc . isEnabled = isChecked
scRunRedLightSop . isEnabled = isChecked
scObuWeaknessTrafficSop . isEnabled = isChecked
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
HmiBuildConfig . isShowObuV2iView = isChecked
@@ -231,22 +270,22 @@ internal class SOPSettingView @JvmOverloads constructor(
//V2N新链路
scNewV2NData . isChecked = FunctionBuildConfig . isNewV2NData
scNewV2NData . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
hmiAction ( " SOP 是否是V2N新链路(云->工控机->App) " , isChecked )
Log . i ( TAG , " SOP 是否是V2N新链路(云->工控机->App) ${isChecked} " )
hmiAction ( " SOP 是否是V2N新链路(云->工控机->App) " , isChecked )
Log . i ( TAG , " SOP 是否是V2N新链路(云->工控机->App) ${isChecked} " )
FunctionBuildConfig . isNewV2NData = isChecked
}
//V2N场景进PNC
scV2nPnc . isChecked = FunctionBuildConfig . isV2NPnc
scV2nPnc . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
scV2nPnc . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
hmiAction ( " SOP V2N场景进PNC, " , isChecked )
Log . i ( TAG , " SOP V2N场景进PNC, $isChecked " )
hmiAction ( " SOP V2N场景进PNC, " , isChecked )
Log . i ( TAG , " SOP V2N场景进PNC, $isChecked " )
CallerAutoPilotControlManager . sendV2nToPncCmd ( isChecked )
FunctionBuildConfig . isV2NPnc = isChecked
}
@@ -254,11 +293,11 @@ internal class SOPSettingView @JvmOverloads constructor(
//绿波通行(默认关闭)
scGreenWaveSop . isChecked = HmiBuildConfig . isShowGreenWaveView
scGreenWaveSop . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
hmiAction ( " SOP obu绿波通行, " , isChecked )
Log . i ( TAG , " SOP obu绿波通行, $isChecked " )
hmiAction ( " SOP obu绿波通行, " , isChecked )
Log . i ( TAG , " SOP obu绿波通行, $isChecked " )
HmiBuildConfig . isShowGreenWaveView = isChecked
if ( HmiBuildConfig . isShowGreenWaveView ) {
CallerTelematicManager . sendMsgToAllClients ( TelematicConstant . OBU _GREENWAVE _WARNING , " 1 " . toByteArray ( ) )
@@ -269,12 +308,12 @@ internal class SOPSettingView @JvmOverloads constructor(
//V2I场景进PNC
scV2iPnc . isChecked = FunctionBuildConfig . isV2IPnc
scV2iPnc . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
scV2iPnc . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
hmiAction ( " SOP V2I场景进PNC, " , isChecked )
Log . i ( TAG , " SOP V2I场景进PNC, $isChecked " )
hmiAction ( " SOP V2I场景进PNC, " , isChecked )
Log . i ( TAG , " SOP V2I场景进PNC, $isChecked " )
CallerAutoPilotControlManager . sendV2iToPncCmd ( isChecked )
FunctionBuildConfig . isV2IPnc = isChecked
}
@@ -282,11 +321,11 @@ internal class SOPSettingView @JvmOverloads constructor(
//闯红灯预警(默认关闭)
scRunRedLightSop . isChecked = HmiBuildConfig . isShowRunRedLightView
scRunRedLightSop . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
hmiAction ( " SOP obu闯红灯预警, " , isChecked )
Log . i ( TAG , " SOP obu闯红灯预警, $isChecked " )
hmiAction ( " SOP obu闯红灯预警, " , isChecked )
Log . i ( TAG , " SOP obu闯红灯预警, $isChecked " )
HmiBuildConfig . isShowRunRedLightView = isChecked
if ( HmiBuildConfig . isShowRunRedLightView ) {
CallerTelematicManager . sendMsgToAllClients ( TelematicConstant . OBU _RUNREDLIGHT _WARNING , " 1 " . toByteArray ( ) )
@@ -298,22 +337,22 @@ internal class SOPSettingView @JvmOverloads constructor(
//路侧弱势交通参与者(默认开启)
scObuWeaknessTrafficSop . isChecked = HmiBuildConfig . isShowObuWeaknessTrafficView
scObuWeaknessTrafficSop . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
hmiAction ( " SOP obu弱势交通控制, " , isChecked )
Log . i ( TAG , " SOP obu弱势交通控制, $isChecked " )
hmiAction ( " SOP obu弱势交通控制, " , isChecked )
Log . i ( TAG , " SOP obu弱势交通控制, $isChecked " )
HmiBuildConfig . isShowObuWeaknessTrafficView = isChecked
}
//V2V总开关(默认关闭)
scObuV2vView . isChecked = HmiBuildConfig . isShowObuV2vView
scObuV2vView . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
hmiAction ( " SOP obuV2V开关, " , isChecked )
Log . i ( TAG , " SOP obuV2V开关, $isChecked " )
hmiAction ( " SOP obuV2V开关, " , isChecked )
Log . i ( TAG , " SOP obuV2V开关, $isChecked " )
HmiBuildConfig . isShowObuV2vView = isChecked
}
@@ -321,11 +360,11 @@ internal class SOPSettingView @JvmOverloads constructor(
obuConnectStatus = CallerObuApiManager . isConnected ( )
scObu . isChecked = obuConnectStatus
scObu . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
hmiAction ( " SOP OBU控制总开关, " , isChecked )
Log . i ( TAG , " SOP OBU控制总开关, $isChecked " )
hmiAction ( " SOP OBU控制总开关, " , isChecked )
Log . i ( TAG , " SOP OBU控制总开关, $isChecked " )
if ( isChecked ) {
CallerObuApiManager . resetObuIpAddress ( MogoObuConst . OBU _DEFAULT _IP )
} else {
@@ -339,12 +378,12 @@ internal class SOPSettingView @JvmOverloads constructor(
/**
* 地图效果类设置
*/
private fun mapSetting ( ) {
private fun mapSetting ( ) {
//危险障碍物颜色标记开关
scMarkingObstacles . isChecked = FunctionBuildConfig . isPNCWarning
scMarkingObstacles . setOnCheckedChangeListener { _ , isChecked ->
hmiAction ( " SOP 危险障碍物颜色标记开关, " , isChecked )
Log . i ( TAG , " SOP 危险障碍物颜色标记开关, $isChecked " )
hmiAction ( " SOP 危险障碍物颜色标记开关, " , isChecked )
Log . i ( TAG , " SOP 危险障碍物颜色标记开关, $isChecked " )
FunctionBuildConfig . isPNCWarning = isChecked
}
if ( AppIdentityModeUtils . isBus ( FunctionBuildConfig . appIdentityMode ) ) {
@@ -354,8 +393,8 @@ internal class SOPSettingView @JvmOverloads constructor(
//引导线动态效果
scRouteDynamicEffect . isChecked = HmiBuildConfig . isShowRouteStrategy
scRouteDynamicEffect . setOnCheckedChangeListener { _ , isChecked ->
hmiAction ( " SOP 引导线动态效果, " , isChecked )
Log . i ( TAG , " SOP 引导线动态效果, $isChecked " )
hmiAction ( " SOP 引导线动态效果, " , isChecked )
Log . i ( TAG , " SOP 引导线动态效果, $isChecked " )
HmiBuildConfig . isShowRouteStrategy = isChecked
}
@@ -364,40 +403,40 @@ internal class SOPSettingView @JvmOverloads constructor(
scDrawPointCloudData . isChecked = FunctionBuildConfig . isDrawPointCloudData
//是否渲染点云数据
scDrawPointCloudData . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
//打开点云效果时,如果自车光圈是关闭状态,则自动打开自车光圈(点云是跟随光圈的 默认没有光圈就不显示点云的)
if ( isChecked && ! FunctionBuildConfig . isDisplayAnimEnable ) {
if ( isChecked && ! FunctionBuildConfig . isDisplayAnimEnable ) {
scCarAperture . isChecked = true
} else {
} else {
scCarAperture . isChecked = FunctionBuildConfig . isDisplayAnimEnable
}
CallerAutoPilotControlManager . setIsDrawPointCloud ( isChecked )
FunctionBuildConfig . isDrawPointCloudData = isChecked
CallerMapUIServiceManager . getMapUIController ( ) ?. setIsDrawPointCloud ( isChecked )
CallerSopSettingManager . invokePointCloudListener ( isChecked )
hmiAction ( " SOP 是否渲染点云数据, " , isChecked )
Log . i ( TAG , " SOP 是否渲染点云数据, $isChecked " )
hmiAction ( " SOP 是否渲染点云数据, " , isChecked )
Log . i ( TAG , " SOP 是否渲染点云数据, $isChecked " )
}
//自车光圈
if ( FunctionBuildConfig . isDrawPointCloudData ) {
if ( FunctionBuildConfig . isDrawPointCloudData ) {
//如果点云效果是打开的,则自车光圈也跟随打开
FunctionBuildConfig . isDisplayAnimEnable = true
scCarAperture . isChecked = true
CallerMapUIServiceManager . getMapUIController ( ) ?. setDisplayAnimEnable ( true )
hmiAction ( " SOP 是否展示自车光圈, " , FunctionBuildConfig . isDisplayAnimEnable )
Log . i ( TAG , " SOP 是否展示自车光圈, ${FunctionBuildConfig.isDisplayAnimEnable} " )
} else {
hmiAction ( " SOP 是否展示自车光圈, " , FunctionBuildConfig . isDisplayAnimEnable )
Log . i ( TAG , " SOP 是否展示自车光圈, ${FunctionBuildConfig.isDisplayAnimEnable} " )
} else {
scCarAperture . isChecked = FunctionBuildConfig . isDisplayAnimEnable
}
scCarAperture . setOnCheckedChangeListener { compoundButton , isChecked ->
CallerMapUIServiceManager . getMapUIController ( ) ?. setDisplayAnimEnable ( isChecked )
CallerSopSettingManager . invokeCarApertureListener ( isChecked )
hmiAction ( " SOP 是否展示自车光圈, " , isChecked )
Log . i ( TAG , " SOP 是否展示自车光圈, $isChecked " )
if ( ! compoundButton . isPressed ) {
hmiAction ( " SOP 是否展示自车光圈, " , isChecked )
Log . i ( TAG , " SOP 是否展示自车光圈, $isChecked " )
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
FunctionBuildConfig . isDisplayAnimEnable = isChecked
@@ -407,12 +446,12 @@ internal class SOPSettingView @JvmOverloads constructor(
/**
* 与车相关类设置
*/
private fun vehicleSetting ( ) {
private fun vehicleSetting ( ) {
//绕障类功能
scObstacleAvoidance . isChecked = FunctionBuildConfig . isDetouring
scObstacleAvoidance . setOnCheckedChangeListener { _ , isChecked ->
hmiAction ( " SOP 绕障类功能开关, " , isChecked )
Log . i ( TAG , " SOP 绕障类功能开关, $isChecked " )
hmiAction ( " SOP 绕障类功能开关, " , isChecked )
Log . i ( TAG , " SOP 绕障类功能开关, $isChecked " )
CallerAutoPilotControlManager . sendDetouring ( isChecked )
FunctionBuildConfig . isDetouring = isChecked
}
@@ -420,11 +459,11 @@ internal class SOPSettingView @JvmOverloads constructor(
// 演示模式,上一次勾选的数据
scDemoMode . isChecked = FunctionBuildConfig . isDemoMode
scDemoMode . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
hmiAction ( " SOP 演示模式开关, " , ! FunctionBuildConfig . isDemoMode )
Log . i ( TAG , " SOP 演示模式开关, ${!FunctionBuildConfig.isDemoMode} " )
hmiAction ( " SOP 演示模式开关, " , ! FunctionBuildConfig . isDemoMode )
Log . i ( TAG , " SOP 演示模式开关, ${!FunctionBuildConfig.isDemoMode} " )
FunctionBuildConfig . isDemoMode = ! FunctionBuildConfig . isDemoMode
CallerAutoPilotControlManager . setDemoMode ( FunctionBuildConfig . isDemoMode )
CallerHmiViewControlListenerManager . invokeFuncMode ( FUNC _MODE _DEMO , FunctionBuildConfig . isDemoMode )
@@ -442,11 +481,11 @@ internal class SOPSettingView @JvmOverloads constructor(
// 雨天模式,上一次勾选的数据
scRainMode . isChecked = FunctionBuildConfig . isRainMode
scRainMode . setOnCheckedChangeListener { compoundButton , isChecked ->
if ( ! compoundButton . isPressed ) {
if ( ! compoundButton . isPressed ) {
return @setOnCheckedChangeListener
}
hmiAction ( " SOP 雨天模式开关, " , isChecked )
Log . i ( TAG , " SOP 雨天模式开关, $isChecked " )
hmiAction ( " SOP 雨天模式开关, " , isChecked )
Log . i ( TAG , " SOP 雨天模式开关, $isChecked " )
FunctionBuildConfig . isRainMode = isChecked
CallerAutoPilotControlManager . setRainMode ( isChecked )
CallerHmiViewControlListenerManager . invokeFuncMode ( FUNC _MODE _RAIN , isChecked )
@@ -459,47 +498,47 @@ internal class SOPSettingView @JvmOverloads constructor(
//弱网减速停车
scWeakNetSlowDown . isChecked = FunctionBuildConfig . isWeakNetSlowDown
scWeakNetSlowDown . setOnCheckedChangeListener { _ , isChecked ->
scWeakNetSlowDown . setOnCheckedChangeListener { _ , isChecked ->
FunctionBuildConfig . isWeakNetSlowDown = isChecked
CallerAutoPilotControlManager . sendWeakNetSlowDown ( isChecked )
hmiAction ( " SOP 弱网减速停车, " , isChecked )
Log . i ( TAG , " SOP 弱网减速停车, $isChecked " )
hmiAction ( " SOP 弱网减速停车, " , isChecked )
Log . i ( TAG , " SOP 弱网减速停车, $isChecked " )
}
//故障减速停车
scFaultSlowDown . isChecked = FunctionBuildConfig . isFaultSlowDown
scFaultSlowDown . setOnCheckedChangeListener { _ , isChecked ->
scFaultSlowDown . setOnCheckedChangeListener { _ , isChecked ->
FunctionBuildConfig . isFaultSlowDown = isChecked
CallerAutoPilotControlManager . sendBreakdownSlowDown ( isChecked )
hmiAction ( " SOP 故障减速停车, " , isChecked )
Log . i ( TAG , " SOP 故障减速停车, $isChecked " )
hmiAction ( " SOP 故障减速停车, " , isChecked )
Log . i ( TAG , " SOP 故障减速停车, $isChecked " )
}
//融合模式
rgFusionMode . setOnCheckedChangeListener { _ , p1 ->
when ( p1 ) {
when ( p1 ) {
//全融合模式
R . id . rbFullIntegration -> {
R . id . rbFullIntegration -> {
FunctionBuildConfig . fusionMode = 1
}
//盲区模式
R . id . rbBlind -> {
R . id . rbBlind -> {
FunctionBuildConfig . fusionMode = 2
}
//超视距模式
R . id . rbBeyondSight -> {
R . id . rbBeyondSight -> {
FunctionBuildConfig . fusionMode = 3
}
//透传模式
R . id . rbTransparent -> {
R . id . rbTransparent -> {
FunctionBuildConfig . fusionMode = 4
}
//纯路侧模式
R . id . rbPureRoad -> {
R . id . rbPureRoad -> {
FunctionBuildConfig . fusionMode = 5
}
}
hmiAction ( " SOP 融合模式, " , FunctionBuildConfig . fusionMode )
Log . i ( TAG , " SOP 融合模式, ${FunctionBuildConfig.fusionMode} " )
hmiAction ( " SOP 融合模式, " , FunctionBuildConfig . fusionMode )
Log . i ( TAG , " SOP 融合模式, ${FunctionBuildConfig.fusionMode} " )
CallerAutoPilotControlManager . sendFusionMode ( FunctionBuildConfig . fusionMode )
}
}
@@ -507,12 +546,12 @@ internal class SOPSettingView @JvmOverloads constructor(
/**
* 其他类别开关设置
*/
private fun otherSetting ( ) {
private fun otherSetting ( ) {
//红绿灯标识开关
scTrafficLight . isChecked = ! HmiBuildConfig . isShowTrafficLightView
scTrafficLight . setOnCheckedChangeListener { _ , isChecked ->
hmiAction ( " SOP 红绿灯标识开关, " , isChecked )
Log . i ( TAG , " SOP 红绿灯标识开关, $isChecked " )
hmiAction ( " SOP 红绿灯标识开关, " , isChecked )
Log . i ( TAG , " SOP 红绿灯标识开关, $isChecked " )
if ( isChecked ) {
CallerHmiManager . showTrafficLightView ( )
} else {
@@ -523,22 +562,22 @@ internal class SOPSettingView @JvmOverloads constructor(
//限速标识
scSpeedLimit . isChecked = HmiBuildConfig . isShowLimitingVelocityView
scSpeedLimit . setOnCheckedChangeListener { _ , isChecked ->
hmiAction ( " SOP 限速标识开关, " , isChecked )
Log . i ( TAG , " SOP 限速标识开关, $isChecked " )
hmiAction ( " SOP 限速标识开关, " , isChecked )
Log . i ( TAG , " SOP 限速标识开关, $isChecked " )
if ( isChecked ) {
HmiBuildConfig . isShowLimitingVelocityView = true
CallerHmiViewControlListenerManager . invokeVisible ( IViewControlListener . LimitingVelocityView _TAG , View . VISIBLE )
CallerHmiViewControlListenerManager . invokeVisible ( IViewControlListener . LimitingVelocityView _TAG , View . VISIBLE )
} else {
HmiBuildConfig . isShowLimitingVelocityView = false
CallerHmiViewControlListenerManager . invokeVisible ( IViewControlListener . LimitingVelocityView _TAG , View . GONE )
CallerHmiViewControlListenerManager . invokeVisible ( IViewControlListener . LimitingVelocityView _TAG , View . GONE )
}
}
//异常上报提示
scIPCReport . isChecked = FunctionBuildConfig . isReportWarning
scIPCReport . setOnCheckedChangeListener { _ , isChecked ->
hmiAction ( " SOP 是否开启异常上报, " , isChecked )
Log . i ( TAG , " SOP 是否开启异常上报, $isChecked " )
hmiAction ( " SOP 是否开启异常上报, " , isChecked )
Log . i ( TAG , " SOP 是否开启异常上报, $isChecked " )
FunctionBuildConfig . isReportWarning = isChecked
}
@@ -561,10 +600,52 @@ internal class SOPSettingView @JvmOverloads constructor(
//是否展示被动触发的录包弹窗(自动驾驶下出现问题触发的录包)
scShowBagRecordWindow . isChecked = FunctionBuildConfig . isShowBagRecordWindow
scShowBagRecordWindow . setOnCheckedChangeListener { _ , isChecked ->
scShowBagRecordWindow . setOnCheckedChangeListener { _ , isChecked ->
FunctionBuildConfig . isShowBagRecordWindow = isChecked
hmiAction ( " SOP 是否展示被动触发的录包弹窗, " , isChecked )
Log . i ( TAG , " SOP 是否展示被动触发的录包弹窗, $isChecked " )
hmiAction ( " SOP 是否展示被动触发的录包弹窗, " , isChecked )
Log . i ( TAG , " SOP 是否展示被动触发的录包弹窗, $isChecked " )
}
// 清扫车业务模式切换
scSweeperModeSwitch ?. also { switchView ->
switchView . isChecked =
if ( SweeperVehicleConfigUtils . isSPExistCurrentSweeperModeConfig ( ) )
SweeperVehicleConfigUtils . isSPCurrentSweeperCloudMode ( )
else
SweeperVehicleConfigUtils . isDefaultSweeperCloudMode ( FunctionBuildConfig . sweeperDefaultMode )
if ( ! AppIdentityModeUtils . isSweeper ( FunctionBuildConfig . appIdentityMode ) ) {
switchView . visibility = GONE
} else {
if ( SweeperVehicleConfigUtils . isDefaultSweeperCanSwitchMode ( FunctionBuildConfig . sweeperCanSwitchMode ) ) {
switchView . isEnabled = true
switchView . visibility = VISIBLE
switchView . setOnCheckedChangeListener { buttonView , isChecked ->
// isChecked==true 云控模式, isChecked==false 运营模式
// 先弹框确认
if ( ! buttonView . isPressed ) return @setOnCheckedChangeListener
context ?. also { cxt ->
val confirmDialog = SweeperModeChangedConfirmDialog ( cxt )
confirmDialog . setClickListener ( object : SweeperModeChangedConfirmDialog . ClickListener {
override fun confirm ( ) {
CallerSweeperModeListenerManager . invokeSweeperModeListeners (
if ( isChecked ) SweeperVehicleConfigUtils . BUSINESS _MODE _CLOUD
else SweeperVehicleConfigUtils . BUSINESS _MODE _OPERATE
)
}
override fun cancel ( ) {
buttonView . isChecked = !is Checked
}
} )
confirmDialog . showSweeperModeChangeConfirmDialog ( )
}
}
} else {
switchView . isEnabled = false
switchView . visibility = GONE
}
}
}
//变道绕障的目标障碍物速度阈值
@@ -576,7 +657,7 @@ internal class SOPSettingView @JvmOverloads constructor(
FunctionBuildConfig . detouringSpeed --
tvSpeed . text = " ${FunctionBuildConfig.detouringSpeed} m/s "
}
hmiAction ( " SOP 变道绕障的目标障碍物速度阈值 " , FunctionBuildConfig . detouringSpeed )
hmiAction ( " SOP 变道绕障的目标障碍物速度阈值 " , FunctionBuildConfig . detouringSpeed )
}
ivSpeedAdd . setOnClickListener {
if ( FunctionBuildConfig . detouringSpeed >= 7 ) {
@@ -585,17 +666,17 @@ internal class SOPSettingView @JvmOverloads constructor(
FunctionBuildConfig . detouringSpeed ++
tvSpeed . text = " ${FunctionBuildConfig.detouringSpeed} m/s "
}
hmiAction ( " SOP 变道绕障的目标障碍物速度阈值 " , FunctionBuildConfig . detouringSpeed )
hmiAction ( " SOP 变道绕障的目标障碍物速度阈值 " , FunctionBuildConfig . detouringSpeed )
}
btnSpeedSet . setOnClickListener {
val isSuccess =
CallerAutoPilotControlManager . sendDetouringSpeed ( FunctionBuildConfig . detouringSpeed . toDouble ( ) )
CallerAutoPilotControlManager . sendDetouringSpeed ( FunctionBuildConfig . detouringSpeed . toDouble ( ) )
if ( isSuccess == true ) {
ToastUtils . showShort ( " 变道绕障的目标障碍物速度阈值设置成功 " )
hmiAction ( " SOP 变道绕障的目标障碍物速度阈值设置 " , " 成功 " )
hmiAction ( " SOP 变道绕障的目标障碍物速度阈值设置 " , " 成功 " )
} else {
ToastUtils . showShort ( " 变道绕障的目标障碍物速度阈值设置失败 " )
hmiAction ( " SOP 变道绕障的目标障碍物速度阈值设置 " , " 失败 " )
hmiAction ( " SOP 变道绕障的目标障碍物速度阈值设置 " , " 失败 " )
}
}
@@ -614,7 +695,7 @@ internal class SOPSettingView @JvmOverloads constructor(
val mf = CallerDevaToolsManager . mofang ( )
if ( mf != null ) {
mfStatusLayout . setClickEnabled ( true )
mfStatusLayout . setClickedTextAndTag ( if ( mf . isConnected ( ) ) " 断开魔方连接 " else " 开始连接魔方 " , if ( mf . isConnected ( ) ) 0 else 1 )
mfStatusLayout . setClickedTextAndTag ( if ( mf . isConnected ( ) ) " 断开魔方连接 " else " 开始连接魔方 " , if ( mf . isConnected ( ) ) 0 else 1 )
mf . registerMoFangStatusListener ( TAG , this )
mfStatusLayout . setOnClickCallback {
val tag = it . tag as ? Int
@@ -659,22 +740,22 @@ internal class SOPSettingView @JvmOverloads constructor(
super . onAttachedToWindow ( )
//添加 业务配置监听
CallerDevaToolsFuncConfigListenerManager . registerDevaToolsFuncConfigListener (
FuncBizConfig . FOUNDATION , TAG , true , this
FuncBizConfig . FOUNDATION , TAG , true , this
)
CallerHmiViewControlListenerManager . addListener ( TAG , this )
CallerHmiViewControlListenerManager . addListener ( TAG , this )
CallerAutopilotGetParamResponseDispatcher . addListener ( TAG , this )
//查询融合模式
CallerAutoPilotControlManager . sendGetParamReq ( AdasConstants . MapSystemParamType . FUSION _MODE )
//雨天、美化、点云设置同步
CallerSopSettingManager . addListener ( TAG , this )
CallerSopSettingManager . addListener ( TAG , this )
}
override fun updateFuncMode ( tag : String , boolean : Boolean ) {
super . updateFuncMode ( tag , boolean )
if ( tag == FUNC _MODE _DEMO ) {
if ( tag == FUNC _MODE _DEMO ) {
scDemoMode . isChecked = FunctionBuildConfig . isDemoMode
}
if ( tag == FUNC _MODE _RAIN ) {
if ( tag == FUNC _MODE _RAIN ) {
scRainMode . isChecked = FunctionBuildConfig . isRainMode
}
}
@@ -696,9 +777,9 @@ internal class SOPSettingView @JvmOverloads constructor(
//美化模式
FuncBizConfig . BIZ _BEAUTY _MODE -> {
scDemoMode . isClickable = ! lock
if ( lock ) {
if ( lock ) {
scDemoMode . visibility = View . INVISIBLE
} else {
} else {
scDemoMode . visibility = View . VISIBLE
}
}
@@ -781,31 +862,35 @@ internal class SOPSettingView @JvmOverloads constructor(
* 工控机配置参数获取
*/
override fun onGetParamResp (
header : MessagePad . Header ,
getParamResp : MessagePad . SetParamReq ,
adasParam : AdasParam
header : MessagePad . Header ,
getParamResp : MessagePad . SetParamReq ,
adasParam : AdasParam
) {
//融合模式
ThreadUtils . runOnUiThread {
FunctionBuildConfig . fusionMode = adasParam . fusionMode
when ( FunctionBuildConfig . fusionMode ) {
1 -> {
when ( FunctionBuildConfig . fusionMode ) {
1 -> {
//全融合模式
rgFusionMode . check ( R . id . rbFullIntegration )
}
2 -> {
2 -> {
//盲区模式
rgFusionMode . check ( R . id . rbBlind )
}
3 -> {
3 -> {
//超视距模式
rgFusionMode . check ( R . id . rbBeyondSight )
}
4 -> {
4 -> {
//透传模式
rgFusionMode . check ( R . id . rbTransparent )
}
5 -> {
5 -> {
//纯路侧模式
rgFusionMode . check ( R . id . rbPureRoad )
}