刹车 油门视图呈现,无优先级,谁有返回值替换成谁

This commit is contained in:
liujing
2022-07-27 14:57:29 +08:00
parent 6717ca1c33
commit e21a4953ba
6 changed files with 60 additions and 1 deletions

View File

@@ -155,6 +155,13 @@ class MoGoAdasListenerImpl : OnAdasListener {
CallerAutopilotVehicleStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering)
//挂挡档位数据
CallerAutopilotVehicleStateListenerManager.invokeAutopilotGearData(vehicleState.gear)
//加速度
CallerAutopilotVehicleStateListenerManager.invokeAutopilotAcc(vehicleState.accel)
//油门
CallerAutopilotVehicleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle)
//刹车
CallerAutopilotVehicleStateListenerManager.invokeAutopilotThrottle(vehicleState.brake)
} else {
CallerAutopilotVehicleStateListenerManager.invokeAutopilotDataException(header.timestamp.toLong())
}

View File

@@ -158,4 +158,14 @@ public class MoGoHandAdasMsgManager implements
public void onAutopilotAcc(float carAcc) {
}
@Override
public void onAutopilotThrottle(float throttle) {
}
@Override
public void onAutopilotBrake(float brake) {
}
}

View File

@@ -71,6 +71,16 @@ internal class CanImpl(ctx: Context): IFlow<CanStatus>(ctx), IMoGoAutopilotVehic
timeOutCheck()
}
override fun onAutopilotThrottle(throttle: Float) {
send(CanStatus(isCanEnabled()))
timeOutCheck()
}
override fun onAutopilotBrake(brake: Float) {
send(CanStatus(isCanEnabled()))
timeOutCheck()
}
override fun onAutopilotGuardian(guardianInfo: MogoReportMessage?) {
super.onAutopilotGuardian(guardianInfo)
send(CanStatus(isCanEnabled()))

View File

@@ -1959,7 +1959,21 @@ class DebugSettingView @JvmOverloads constructor(
* 车辆加速度
*/
override fun onAutopilotAcc(carAcc: Float) {
TODO("Not yet implemented")
}
/**
* 油门
*/
override fun onAutopilotThrottle(throttle: Float) {
}
/**
* 刹车
*/
override fun onAutopilotBrake(brake: Float) {
}
/**

View File

@@ -158,6 +158,22 @@ public class SteeringWheelView extends ConstraintLayout {
private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() {
/**
* @param brake 刹车
*/
@Override
public void onAutopilotBrake(float brake) {
}
/**
* @param throttle 油门
*/
@Override
public void onAutopilotThrottle(float throttle) {
}
/**
* 车辆转向灯
* @param lightSwitch

View File

@@ -145,11 +145,13 @@ public class TrafficDataView extends ConstraintLayout {
@Override
public void onAutopilotBrake(float brake) {
Log.d(TAG, "刹车:" + String.valueOf(brake));
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
}
@Override
public void onAutopilotThrottle(float throttle) {
Log.d(TAG, "油门:" + String.valueOf(throttle));
brakeStatus.setImageResource(R.drawable.traffic_data_accelerator);
}
};