diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt index 86c9390b90..09a32c23cc 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt @@ -37,7 +37,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutopilotStatusRespByQuery import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager.invokeAutopilotAbility import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager.invokeAutopilotCarConfigData -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager.invokeAutopilotCarStateData import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyPlanningObj import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotWarnMessage @@ -45,6 +44,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningAction import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordConfig import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager.invokeAutopilotStatistics +import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssInfoListenerManager.invokeAutopilotCarStateData import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager.invokeAutopilotRotting import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager.invokeAutopilotTrajectory import com.mogo.eagle.core.function.call.autopilot.CallerStartAutopilotFailedListenerManager.invokeStartAutopilotFailed @@ -159,15 +159,15 @@ class MoGoAdasListenerImpl : OnAdasListener { //刹车灯数据 CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus) //方向盘转向角数据 - CallerAutopilotVehicleStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering) + CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering) //挂挡档位数据 - CallerAutopilotVehicleStateListenerManager.invokeAutopilotGearData(vehicleState.gear) + CallerChassisGearStateListenerManager.invokeAutopilotGearData(vehicleState.gear) //加速度 - CallerAutopilotVehicleStateListenerManager.invokeAutopilotAcc(vehicleState.accel) + CallerChassisAccStateListenerManager.invokeAutopilotAcc(vehicleState.accel) //油门 - CallerAutopilotVehicleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle) + CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle) //刹车 - CallerAutopilotVehicleStateListenerManager.invokeAutopilotBrake(vehicleState.brake) + CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(vehicleState.brake) //清扫车(福田)清扫控制系统状态 vehicleState.sweeperFutianCleanSystemState?.also { CallerSweeperFutianCleanSystemListenerManager.invokeSweeperFutianCleanSystemState(it) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoHandAdasMsgManager.java b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoHandAdasMsgManager.java index 557215e91d..e2053a621e 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoHandAdasMsgManager.java +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoHandAdasMsgManager.java @@ -11,13 +11,11 @@ import androidx.annotation.Nullable; import com.mogo.cloud.passport.MoGoAiCloudClientConfig; import com.mogo.eagle.core.data.constants.MoGoConfig; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener; +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssInfoListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager; -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager; -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssInfoListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager; import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; @@ -30,9 +28,8 @@ import chassis.Chassis; import mogo.telematics.pad.MessagePad; public class MoGoHandAdasMsgManager implements - IMoGoAutopilotVehicleStateListener, IMoGoAutopilotCarConfigListener, - IMoGoAutopilotCarStateListener, + IMoGoChassisGnssInfoListener, IMoGoChassisLamplightListener { private final String TAG = "AdasEventManager"; @@ -41,9 +38,8 @@ public class MoGoHandAdasMsgManager implements private Context mContext; private MoGoHandAdasMsgManager(Context context) { - CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, this); CallerAutopilotCarConfigListenerManager.INSTANCE.addListener(TAG, this); - CallerAutopilotCarStatusListenerManager.INSTANCE.addListener(TAG, this); + CallerChassisGnssInfoListenerManager.INSTANCE.addListener(TAG, this); CallerChassisLamplightListenerManager.INSTANCE.addListener(TAG, this); mContext = context; } @@ -147,44 +143,4 @@ public class MoGoHandAdasMsgManager implements } } - /** - * 车辆方向盘转向角回调 - * - * @param steering 方向盘转向角 - */ - @Override - public void onAutopilotSteeringData(float steering) { - - } - - /** - * 车辆挂挡档位 - * - * @param gear 档位 - */ - @Override - public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) { - - } - - @Override - public void onAutopilotDataException(long timestamp) { - } - - @Override - public void onAutopilotAcc(float carAcc) { - - } - - @Override - public void onAutopilotThrottle(float throttle) { - - } - - @Override - public void onAutopilotBrake(float brake) { - - } - - } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt index e9632f1da6..57799515e8 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt @@ -10,10 +10,10 @@ import android.widget.RadioButton import android.widget.TextView import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.app.AppConfigInfo -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssInfoListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssInfoListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA @@ -37,7 +37,7 @@ import java.util.* * @since: 2022/7/12 */ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener, - IMoGoAutopilotRecordListener, IMoGoAutopilotCarStateListener { + IMoGoAutopilotRecordListener, IMoGoChassisGnssInfoListener { companion object { const val TAG = "AIDataCollectWindow" @@ -117,7 +117,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener //采集结果回调监听 CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(), this) // 添加 ADAS车辆状态&定位 监听 - CallerAutopilotCarStatusListenerManager.addListener(this.hashCode().toString(), this) + CallerChassisGnssInfoListenerManager.addListener(this.hashCode().toString(), this) //开始录制AI数据采集Bag包 CallerAutoPilotManager.recordPackage( 99, @@ -341,7 +341,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener //注销采集结果回调监听 CallerAutopilotRecordListenerManager.removeListener(this.hashCode().toString()) // 移除 ADAS车辆状态&定位 监听 - CallerAutopilotCarStatusListenerManager.removeListener(this.hashCode().toString()) + CallerChassisGnssInfoListenerManager.removeListener(this.hashCode().toString()) if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt index 9aab7c532e..fca72ca768 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt @@ -14,10 +14,10 @@ import android.widget.TextView import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.badcase.RecordCaseEntity -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssInfoListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssInfoListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA @@ -47,7 +47,7 @@ import java.util.* * @since: 2022/7/13 */ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchListener, - IMoGoAutopilotRecordListener, IMoGoAutopilotCarStateListener { + IMoGoAutopilotRecordListener, IMoGoChassisGnssInfoListener { companion object { const val TAG = "InitiativeBadCaseWindow" @@ -140,7 +140,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList //采集结果回调监听 CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(), this) // 添加 ADAS车辆状态&定位 监听 - CallerAutopilotCarStatusListenerManager.addListener(this.hashCode().toString(), this) + CallerChassisGnssInfoListenerManager.addListener(this.hashCode().toString(), this) viewAudioButton.setOnClickListener { audioStatus = !audioStatus setAudio(audioStatus) @@ -367,7 +367,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList //注销采集结果回调监听 CallerAutopilotRecordListenerManager.removeListener(this.hashCode().toString()) // 移除 ADAS车辆状态&定位 监听 - CallerAutopilotCarStatusListenerManager.removeListener(this.hashCode().toString()) + CallerChassisGnssInfoListenerManager.removeListener(this.hashCode().toString()) if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt index 7936699ab4..24bcb28ac5 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt @@ -17,8 +17,8 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.RecordBagMsg -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssInfoListener +import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssInfoListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA @@ -44,7 +44,7 @@ import java.io.File * @since: 2022/7/17 */ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListener, - IMoGoAutopilotCarStateListener, CompoundButton.OnCheckedChangeListener { + IMoGoChassisGnssInfoListener, CompoundButton.OnCheckedChangeListener { companion object { const val TAG = "PassiveBadCaseWindow" @@ -117,7 +117,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene "时间:${millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())}" tvPassiveIdentity.text = "身份:${BadCaseConfig.identity}" // 添加 ADAS车辆状态&定位 监听 - CallerAutopilotCarStatusListenerManager.addListener(TAG, this) + CallerChassisGnssInfoListenerManager.addListener(TAG, this) viewAudioButton.setOnClickListener { audioStatus = !audioStatus setAudio(audioStatus) @@ -361,7 +361,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene fun hideFloatWindow() { // 移除 ADAS车辆状态&定位 监听 - CallerAutopilotCarStatusListenerManager.removeListener(TAG) + CallerChassisGnssInfoListenerManager.removeListener(TAG) if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt index 3659d2f417..97f383210f 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt @@ -5,14 +5,8 @@ import android.util.Log import chassis.Chassis.GearPosition import chassis.Chassis.LightSwitch import chassis.VehicleStateOuterClass -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener -import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener -import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager -import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager +import com.mogo.eagle.core.function.api.autopilot.* +import com.mogo.eagle.core.function.call.autopilot.* import com.mogo.eagle.core.utilcode.kotlin.safeCancel import com.zhjt.mogo_core_function_devatools.status.entity.CanStatus import com.zhjt.mogo_core_function_devatools.status.flow.IFlow @@ -24,9 +18,17 @@ import mogo_msg.MogoReportMsg.MogoReportMessage import system_master.SystemStatusInfo.StatusInfo import java.util.concurrent.atomic.AtomicInteger -internal class CanImpl(ctx: Context): +internal class CanImpl(ctx: Context) : IFlow(ctx), + IMoGoAutopilotVehicleStateListener, + + IMoGoChassisAccStateListener, + IMoGoChassisSteeringStateListener, + IMoGoChassisGearStateListener, + IMoGoChassisBrakeStateListener, + IMoGoChassisThrottleStateListener, + IMoGoAutopilotStatusListener, IMoGoChassisLamplightListener, IMoGoSweeperFutianCleanSystemListener { @@ -40,7 +42,13 @@ internal class CanImpl(ctx: Context): override fun onCreate() { send(CanStatus(CallerAutoPilotManager.isConnected())) - CallerAutopilotVehicleStateListenerManager.addListener(TAG, this) + + CallerChassisAccStateListenerManager.addListener(TAG, this) + CallerChassisBrakeStateListenerManager.addListener(TAG, this) + CallerChassisGearStateListenerManager.addListener(TAG, this) + CallerChassisSteeringStateListenerManager.addListener(TAG, this) + CallerChassisThrottleStateListenerManager.addListener(TAG, this) + CallerAutoPilotStatusListenerManager.addListener(TAG, this) CallerChassisLamplightListenerManager.addListener(TAG, this) } @@ -121,13 +129,19 @@ internal class CanImpl(ctx: Context): launch(Dispatchers.Unconfined) { delay(4000) send(CanStatus(isCanEnabled())) - }.also { job = it } + }.also { job = it } } override fun onDestroy() { super.onDestroy() job?.safeCancel() - CallerAutopilotVehicleStateListenerManager.removeListener(TAG) + + CallerChassisAccStateListenerManager.removeListener(TAG) + CallerChassisBrakeStateListenerManager.removeListener(TAG) + CallerChassisGearStateListenerManager.removeListener(TAG) + CallerChassisSteeringStateListenerManager.removeListener(TAG) + CallerChassisThrottleStateListenerManager.removeListener(TAG) + CallerAutoPilotStatusListenerManager.removeListener(TAG) CallerChassisLamplightListenerManager.removeListener(TAG) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/rtk/RTKImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/rtk/RTKImpl.kt index 69f1b8f199..c2aa5368b1 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/rtk/RTKImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/rtk/RTKImpl.kt @@ -14,7 +14,7 @@ import system_master.SystemStatusInfo.HealthInfo import system_master.SystemStatusInfo.StatusInfo import java.util.concurrent.atomic.* -internal class RTKImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener { +internal class RTKImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatusListener, IMoGoChassisGnssInfoListener { companion object { const val TAG = "RTKImpl" } @@ -34,7 +34,7 @@ internal class RTKImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatu send(RTKStatus(getDesc(), getCode())) CallerLogger.d("$M_DEVA$TAG", "-- onCreate --") CallerAutoPilotStatusListenerManager.addListener(TAG, this) - CallerAutopilotCarStatusListenerManager.addListener(TAG, this) + CallerChassisGnssInfoListenerManager.addListener(TAG, this) if (CallerAutoPilotManager.isConnected()) { check() } @@ -95,7 +95,7 @@ internal class RTKImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatu private fun isRTKEnabled(): Boolean { val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode() - val gnssInfo = CallerAutopilotCarStatusListenerManager.getCurrentGnssInfo() + val gnssInfo = CallerChassisGnssInfoListenerManager.getCurrentGnssInfo() return CallerAutoPilotManager.isConnected() && ( code != "EHW_RTK" && code != "EHW_GNSS" && @@ -117,6 +117,6 @@ internal class RTKImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatu isOldVersion.set(false) CallerLogger.d("$M_DEVA$TAG", "-- onDestroy --") CallerAutoPilotStatusListenerManager.removeListener(TAG) - CallerAutopilotCarStatusListenerManager.removeListener(TAG) + CallerChassisGnssInfoListenerManager.removeListener(TAG) } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index f0d24cb4f4..75bfa78c1d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -101,15 +101,19 @@ class DebugSettingView @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener, IMoGoAutopilotStatusListener, - IMoGoAutopilotCarStateListener, + IMoGoChassisGnssInfoListener, IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener, IMoGoPlanningRottingListener, IMoGoPlanningTrajectoryListener, - IMoGoAutopilotVehicleStateListener, IMoGoDevaToolsFuncConfigListener, IMoGoChassisLamplightListener, IMoGoDevaToolsListener, + IMoGoChassisAccStateListener, + IMoGoChassisSteeringStateListener, + IMoGoChassisGearStateListener, + IMoGoChassisBrakeStateListener, + IMoGoChassisThrottleStateListener, IMoGoSweeperFutianCleanSystemListener{ private val TAG = "DebugSettingView" @@ -194,7 +198,7 @@ class DebugSettingView @JvmOverloads constructor( // 添加 ADAS状态 监听 CallerAutoPilotStatusListenerManager.addListener(TAG, this) // 添加 ADAS车辆状态&定位 监听 - CallerAutopilotCarStatusListenerManager.addListener(TAG, this) + CallerChassisGnssInfoListenerManager.addListener(TAG, this) // 添加 地图样式改变 监听 CallerMapLocationListenerManager.addListener(TAG, this, false) // 添加 域控制器感知数据 监听 @@ -203,7 +207,12 @@ class DebugSettingView @JvmOverloads constructor( CallerPlanningRottingListenerManager.addListener(TAG, this) CallerPlanningTrajectoryListenerManager.addListener(TAG, this) //添加 车辆底盘数据回调 监听 - CallerAutopilotVehicleStateListenerManager.addListener(TAG, this) + CallerChassisAccStateListenerManager.addListener(TAG, this) + CallerChassisBrakeStateListenerManager.addListener(TAG, this) + CallerChassisGearStateListenerManager.addListener(TAG, this) + CallerChassisSteeringStateListenerManager.addListener(TAG, this) + CallerChassisThrottleStateListenerManager.addListener(TAG, this) + //添加 开发套件工具接口 监听 CallerDevaToolsListenerManager.addListener(TAG, this) //添加 底盘灯光数据 监听 @@ -232,7 +241,7 @@ class DebugSettingView @JvmOverloads constructor( // 移除 ADAS状态 监听 CallerAutoPilotStatusListenerManager.removeListener(TAG) // 移除 ADAS车辆状态&定位 监听 - CallerAutopilotCarStatusListenerManager.removeListener(TAG) + CallerChassisGnssInfoListenerManager.removeListener(TAG) // 移除 地图样式改变 监听 CallerMapLocationListenerManager.removeListener(TAG, false) // 移除 域控制器感知数据 监听 @@ -241,7 +250,11 @@ class DebugSettingView @JvmOverloads constructor( CallerPlanningRottingListenerManager.removeListener(TAG) CallerPlanningTrajectoryListenerManager.removeListener(TAG) // 移除 车辆底盘数据回调 监听 - CallerAutopilotVehicleStateListenerManager.removeListener(TAG) + CallerChassisAccStateListenerManager.removeListener(TAG) + CallerChassisBrakeStateListenerManager.removeListener(TAG) + CallerChassisGearStateListenerManager.removeListener(TAG) + CallerChassisSteeringStateListenerManager.removeListener(TAG) + CallerChassisThrottleStateListenerManager.removeListener(TAG) // 移除 开发套件工具接口 监听 CallerDevaToolsListenerManager.removeListener(TAG) // 移除 底盘灯光数据 监听 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java index f6b894cca9..b32cfeeab4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java @@ -18,9 +18,11 @@ import androidx.constraintlayout.widget.ConstraintLayout; import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener; +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener; +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager; import com.mogo.eagle.core.function.hmi.R; import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -29,7 +31,6 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils; import org.jetbrains.annotations.NotNull; import chassis.Chassis; -import chassis.VehicleStateOuterClass; import mogo.telematics.pad.MessagePad; import mogo_msg.MogoReportMsg; import system_master.SystemStatusInfo; @@ -41,7 +42,9 @@ import system_master.SystemStatusInfo; * 档位随CAN数据做切换和高亮显示 * @since: 4/7/22 */ -public class SteeringWheelView extends ConstraintLayout { +public class SteeringWheelView extends ConstraintLayout implements + IMoGoChassisSteeringStateListener, + IMoGoChassisGearStateListener { private static final String TAG = "SteeringWheelView"; private ImageView autopilotIV; private TextView steeringTVL; @@ -65,7 +68,8 @@ public class SteeringWheelView extends ConstraintLayout { } initView(); CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener); - CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener); + CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this); + CallerChassisSteeringStateListenerManager.INSTANCE.addListener(TAG, this); tapPositionView.updateWithGear(Chassis.GearPosition.GEAR_R); } @@ -163,92 +167,59 @@ public class SteeringWheelView extends ConstraintLayout { } }; - private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() { - - /** - * @param brake 刹车 - */ - @Override - public void onAutopilotBrake(float brake) { - + /** + * 方向盘转向角 左+右- + * @param steering + */ + @Override + public void onAutopilotSteeringData(float steering) { + if (Math.abs(steering) < 1) { + steering = 0; } - - /** - * @param throttle 油门 - */ - @Override - public void onAutopilotThrottle(float throttle) { - - } - - /** - * 车辆加速度 - * @param carAcc - */ - @Override - public void onAutopilotAcc(float carAcc) { - - } - - /** - * 方向盘转向角 左+右- - * @param steering - */ - @Override - public void onAutopilotSteeringData(float steering) { - if (Math.abs(steering) < 1) { - steering = 0; + float steeringValue = steering; + ThreadUtils.runOnUiThread(new Runnable() { + @Override + public void run() { + if (steeringTVL != null && steeringValue > 0) { + steeringTVR.setVisibility(View.INVISIBLE); + steeringTVL.setVisibility(View.VISIBLE); + steeringTVL.setText(String.valueOf((int) steeringValue) + "°"); + } else if (steeringTVR != null && steeringValue <= 0) { + steeringTVL.setVisibility(View.INVISIBLE); + steeringTVR.setVisibility(View.VISIBLE); + steeringTVR.setText(String.valueOf((int) -steeringValue) + "°"); + } else { + CallerLogger.INSTANCE.d(TAG, "onAutopilotSteeringData error"); + } + animationWithSteeringData(-steeringValue); + if (steeringCircularV != null) { + steeringCircularV.setProgress((int) (-steeringValue * 100) / 360, 20); + } + if (steeringCircularVAlpha != null) { + steeringCircularVAlpha.setProgress((int) (-steeringValue * 100) / 360, 20); + } } - float steeringValue = steering; - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - if (steeringTVL != null && steeringValue > 0) { - steeringTVR.setVisibility(View.INVISIBLE); - steeringTVL.setVisibility(View.VISIBLE); - steeringTVL.setText(String.valueOf((int) steeringValue) + "°"); - } else if (steeringTVR != null && steeringValue <= 0) { - steeringTVL.setVisibility(View.INVISIBLE); - steeringTVR.setVisibility(View.VISIBLE); - steeringTVR.setText(String.valueOf((int) -steeringValue) + "°"); - } else { - CallerLogger.INSTANCE.d(TAG, "onAutopilotSteeringData error"); - } - animationWithSteeringData(-steeringValue); - if (steeringCircularV != null) { - steeringCircularV.setProgress((int) (-steeringValue * 100) / 360, 20); - } - if (steeringCircularVAlpha != null) { - steeringCircularVAlpha.setProgress((int) (-steeringValue * 100) / 360, 20); - } + }); + + } + + /** + * 档位 + * @param gear + */ + @Override + public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) { + ThreadUtils.runOnUiThread(new Runnable() { + @Override + public void run() { + CallerLogger.INSTANCE.d(TAG, "乘客屏档位" + gear.toString()); + if (tapPositionView != null) { + tapPositionView.updateWithGear(gear); } - }); + } + }); - } - - /** - * 档位 - * @param gear - */ - @Override - public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - CallerLogger.INSTANCE.d(TAG, "乘客屏档位" + gear.toString()); - if (tapPositionView != null) { - tapPositionView.updateWithGear(gear); - } - } - }); - - } - - @Override - public void onAutopilotDataException(long timestamp) { - - } - }; + } /** * 方向盘随CAN数据做方向和角度旋转 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java index cb6c486e16..0e963ad90d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java @@ -15,10 +15,16 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.ConstraintLayout; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener; +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener; +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener; +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener; +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningActionsListenerManager; -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisBrakeStateListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager; import com.mogo.eagle.core.function.hmi.R; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.ThreadUtils; @@ -32,7 +38,11 @@ import chassis.Chassis; * @description 速度 加速度 档位 刹车 油门状态值 * @since: 6/24/22 */ -public class TrafficDataView extends ConstraintLayout { +public class TrafficDataView extends ConstraintLayout implements + IMoGoChassisSteeringStateListener, + IMoGoChassisGearStateListener , + IMoGoChassisBrakeStateListener, + IMoGoChassisThrottleStateListener { private static final String TAG = "TrafficDataView"; private TapPositionView tapPositionView; private TextView speedTextView; @@ -100,7 +110,10 @@ public class TrafficDataView extends ConstraintLayout { protected void onAttachedToWindow() { super.onAttachedToWindow(); handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L); - CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener); + CallerChassisSteeringStateListenerManager.INSTANCE.addListener(TAG, this); + CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this); + CallerChassisBrakeStateListenerManager.INSTANCE.addListener(TAG, this); + CallerChassisThrottleStateListenerManager.INSTANCE.addListener(TAG, this); CallerAutopilotPlanningActionsListenerManager.INSTANCE.addListener(TAG, planningActionMsg -> acceleration = planningActionMsg.getDestinationAcc()); } @@ -116,63 +129,52 @@ public class TrafficDataView extends ConstraintLayout { @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); - CallerAutopilotVehicleStateListenerManager.INSTANCE.removeListener(TAG); + CallerChassisSteeringStateListenerManager.INSTANCE.removeListener(TAG); + CallerChassisGearStateListenerManager.INSTANCE.removeListener(TAG); + CallerChassisBrakeStateListenerManager.INSTANCE.removeListener(TAG); + CallerChassisThrottleStateListenerManager.INSTANCE.removeListener(TAG); CallerAutopilotPlanningActionsListenerManager.INSTANCE.removeListener(TAG); } - private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() { - /** - * 方向盘转向角 左+右- - * @param steering - */ - @Override - public void onAutopilotSteeringData(float steering) { - CallerLogger.INSTANCE.d(TAG, "steering原始值====" + steering); - if (Math.abs(steering) < 1) { - steering = 0; + /** + * 方向盘转向角 左+右- + * @param steering + */ + @Override + public void onAutopilotSteeringData(float steering) { + CallerLogger.INSTANCE.d(TAG, "steering原始值====" + steering); + if (Math.abs(steering) < 1) { + steering = 0; + } + CallerLogger.INSTANCE.d(TAG, "steering忽略小数点后====" + (int) steering); + } + + /** + * 档位 + * @param gear + */ + @Override + public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) { + CallerLogger.INSTANCE.d(TAG, "司机屏档位" + gear.toString()); + ThreadUtils.runOnUiThread(() -> { + if (tapPositionView != null) { + tapPositionView.updateWithGear(gear); } - CallerLogger.INSTANCE.d(TAG, "steering忽略小数点后====" + (int) steering); - } + }); + } - /** - * 档位 - * @param gear - */ - @Override - public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) { - CallerLogger.INSTANCE.d(TAG, "司机屏档位" + gear.toString()); - ThreadUtils.runOnUiThread(() -> { - if (tapPositionView != null) { - tapPositionView.updateWithGear(gear); - } - }); - } - - @Override - public void onAutopilotDataException(long timestamp) { - - } - - @Override - public void onAutopilotAcc(float carAcc) { - - } - - @Override - public void onAutopilotBrake(float brake) { - CallerLogger.INSTANCE.d(TAG, "刹车:" + brake); - mBrake = brake; - } - - @Override - public void onAutopilotThrottle(float throttle) { - CallerLogger.INSTANCE.d(TAG, "油门:" + throttle); - mThrottle = throttle; - } - - }; + @Override + public void onAutopilotBrake(float brake) { + CallerLogger.INSTANCE.d(TAG, "刹车:" + brake); + mBrake = brake; + } + @Override + public void onAutopilotThrottle(float throttle) { + CallerLogger.INSTANCE.d(TAG, "油门:" + throttle); + mThrottle = throttle; + } /** * 设置弧形颜色 * diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt index 28354c8918..b094cad618 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt @@ -1,43 +1,14 @@ package com.mogo.eagle.core.function.api.autopilot -import chassis.Chassis - /** * 车辆底盘 数据 回调监听 */ interface IMoGoAutopilotVehicleStateListener { - /** - * 车辆方向盘转向角回调 - * @param steering 方向盘转向角 - */ - fun onAutopilotSteeringData(steering: Float) - - /** - * 车辆挂挡档位 - * @param gear 档位 - */ - fun onAutopilotGearData(gear: Chassis.GearPosition) - /** * 没有自车状态数据 */ fun onAutopilotDataException(timestamp: Long){} - /** - * 车辆加速度 - */ - fun onAutopilotAcc(carAcc: Float) - - /** - * 油门 - */ - fun onAutopilotThrottle(throttle: Float) - - /** - * 刹车 - */ - fun onAutopilotBrake(brake: Float) - } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisAccStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisAccStateListener.kt new file mode 100644 index 0000000000..452ce2de4c --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisAccStateListener.kt @@ -0,0 +1,13 @@ +package com.mogo.eagle.core.function.api.autopilot + +/** + * 车辆加速度 数据 回调监听 + */ +interface IMoGoChassisAccStateListener { + + /** + * 车辆加速度 + */ + fun onAutopilotAcc(carAcc: Float) + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisBrakeStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisBrakeStateListener.kt new file mode 100644 index 0000000000..45e6e2702d --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisBrakeStateListener.kt @@ -0,0 +1,12 @@ +package com.mogo.eagle.core.function.api.autopilot + +/** + * 刹车 数据 回调监听 + */ +interface IMoGoChassisBrakeStateListener { + + /** + * 刹车 + */ + fun onAutopilotBrake(brake: Float) +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisGearStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisGearStateListener.kt new file mode 100644 index 0000000000..6c5f58060e --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisGearStateListener.kt @@ -0,0 +1,16 @@ +package com.mogo.eagle.core.function.api.autopilot + +import chassis.Chassis + +/** + * 车辆挂挡档位 数据 回调监听 + */ +interface IMoGoChassisGearStateListener { + + /** + * 车辆挂挡档位 + * @param gear 档位 + */ + fun onAutopilotGearData(gear: Chassis.GearPosition) + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotCarStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisGnssInfoListener.kt similarity index 77% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotCarStateListener.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisGnssInfoListener.kt index e372eed6aa..bd9e945b73 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotCarStateListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisGnssInfoListener.kt @@ -5,9 +5,9 @@ import mogo.telematics.pad.MessagePad /** *@author xiaoyuzhou *@date 2021/11/2 2:06 下午 - * 车辆状态&定位 数据 数据 回调监听 + * 车辆定位 数据 数据 回调监听 */ -interface IMoGoAutopilotCarStateListener { +interface IMoGoChassisGnssInfoListener { /** * 车辆状态&定位 数据 diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoSteeringStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisSteeringStateListener.kt similarity index 84% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoSteeringStateListener.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisSteeringStateListener.kt index 09b2b36556..fd9c736e58 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoSteeringStateListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisSteeringStateListener.kt @@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.api.autopilot /** * 车辆方向盘转向角 数据 回调监听 */ -interface IMoGoSteeringStateListener { +interface IMoGoChassisSteeringStateListener { /** * 车辆方向盘转向角回调 diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisThrottleStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisThrottleStateListener.kt new file mode 100644 index 0000000000..639f778597 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisThrottleStateListener.kt @@ -0,0 +1,12 @@ +package com.mogo.eagle.core.function.api.autopilot + +/** + * 油门 数据 回调监听 + */ +interface IMoGoChassisThrottleStateListener { + + /** + * 油门 + */ + fun onAutopilotThrottle(throttle: Float) +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoStartAutopilotFailedListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoStartAutopilotFailedListener.kt index 8a8a83a4c3..f1f75862f6 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoStartAutopilotFailedListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoStartAutopilotFailedListener.kt @@ -1,6 +1,5 @@ package com.mogo.eagle.core.function.api.autopilot -import com.zhidao.support.adas.high.bean.AutopilotAbility import mogo_msg.MogoReportMsg diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt index 2da7bddd91..f8c96434ee 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt @@ -1,6 +1,5 @@ package com.mogo.eagle.core.function.call.autopilot -import chassis.Chassis import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener import com.mogo.eagle.core.function.call.base.CallerBase @@ -12,59 +11,6 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() { + + + /** + * 车辆加速度 + * acc 加速度 + */ + fun invokeAutopilotAcc(carAcc: Float) { + M_LISTENERS.forEach { + val listener = it.value + listener.onAutopilotAcc(carAcc) + } + } +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisBrakeStateListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisBrakeStateListenerManager.kt new file mode 100644 index 0000000000..27f92fef1d --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisBrakeStateListenerManager.kt @@ -0,0 +1,21 @@ +package com.mogo.eagle.core.function.call.autopilot + +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * 车辆挂挡档位 回调监听 + */ +object CallerChassisBrakeStateListenerManager : CallerBase() { + + + /** + * brake 刹车 + */ + fun invokeAutopilotBrake(brake: Float){ + M_LISTENERS.forEach{ + val listener = it.value + listener.onAutopilotBrake(brake) + } + } +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisGearStateListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisGearStateListenerManager.kt new file mode 100644 index 0000000000..907e4b0553 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisGearStateListenerManager.kt @@ -0,0 +1,22 @@ +package com.mogo.eagle.core.function.call.autopilot + +import chassis.Chassis +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * 车辆挂挡档位 回调监听 + */ +object CallerChassisGearStateListenerManager : CallerBase() { + + /** + * 车辆挂挡档位 + * @param gear 档位 + */ + fun invokeAutopilotGearData(gear: Chassis.GearPosition) { + M_LISTENERS.forEach { + val listener = it.value + listener.onAutopilotGearData(gear) + } + } +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisGnssInfoListenerManager.kt similarity index 81% rename from core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt rename to core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisGnssInfoListenerManager.kt index a8f1035d67..5d948f4b55 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotCarStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisGnssInfoListenerManager.kt @@ -1,6 +1,6 @@ package com.mogo.eagle.core.function.call.autopilot -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssInfoListener import com.mogo.eagle.core.function.call.base.CallerBase import mogo.telematics.pad.MessagePad @@ -9,7 +9,7 @@ import mogo.telematics.pad.MessagePad * @date 2021/9/30 5:48 下午 * 车辆状态&定位 数据 数据 回调监听 */ -object CallerAutopilotCarStatusListenerManager : CallerBase() { +object CallerChassisGnssInfoListenerManager : CallerBase() { @Volatile private var gnssInfo: MessagePad.GnssInfo? = null @@ -32,5 +32,4 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() { +object CallerChassisSteeringStateListenerManager : CallerBase() { /** * 车辆方向盘转向角回调 diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisThrottleStateListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisThrottleStateListenerManager.kt new file mode 100644 index 0000000000..95e8db5eba --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisThrottleStateListenerManager.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.call.autopilot + +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * throttle 油门 回调监听 + */ +object CallerChassisThrottleStateListenerManager : CallerBase() { + + /** + * throttle 油门 + */ + fun invokeAutopilotThrottle(throttle: Float) { + M_LISTENERS.forEach { + val listener = it.value + listener.onAutopilotThrottle(throttle) + } + } +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningTrajectoryListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningTrajectoryListenerManager.kt index febca6f0de..33e23e9dc5 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningTrajectoryListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningTrajectoryListenerManager.kt @@ -17,7 +17,6 @@ object CallerPlanningTrajectoryListenerManager : CallerBase) { - M_LISTENERS.forEach { val tag = it.key val listener = it.value