diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_light_increase_set.png b/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_light_increase_set.png new file mode 100644 index 0000000000..5ec15568b0 Binary files /dev/null and b/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_light_increase_set.png differ diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_light_set.png b/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_light_set.png new file mode 100644 index 0000000000..de1f7f064f Binary files /dev/null and b/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_light_set.png differ diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_voice_increase_set.png b/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_voice_increase_set.png new file mode 100644 index 0000000000..7e62e77a05 Binary files /dev/null and b/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_voice_increase_set.png differ diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_voice_set.png b/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_voice_set.png new file mode 100644 index 0000000000..c0f586f35e Binary files /dev/null and b/OCH/mogo-och-taxi-passenger/src/main/res/drawable/iv_voice_set.png differ diff --git a/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_setting_view.xml b/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_setting_view.xml index 2ab36421c7..89dbc2ffaa 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_setting_view.xml +++ b/OCH/mogo-och-taxi-passenger/src/main/res/layout/taxi_p_setting_view.xml @@ -18,10 +18,11 @@ app:layout_constraintTop_toTopOf="parent" /> @@ -40,10 +41,11 @@ app:layout_constraintWidth_percent="0.253" /> @@ -72,10 +74,11 @@ app:layout_constraintTop_toBottomOf="@+id/tvSettingLight" /> @@ -94,10 +97,11 @@ app:layout_constraintWidth_percent="0.253" /> @@ -105,7 +109,7 @@ android:id="@+id/tvVoicePer" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_333" + android:layout_marginTop="@dimen/dp_330" android:layout_marginRight="@dimen/dp_113" android:gravity="right" android:textColor="@color/taxi_p_303C52" 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 f7cc9e3ba4..fac5ae9442 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 @@ -170,6 +170,8 @@ class MoGoAdasListenerImpl : OnAdasListener { CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle) //刹车 CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(vehicleState.brake) + //车门 + CallerChassisDoorStateListenerManager.invokeAutopilotDoorState(vehicleState.doorStateList) //电量 if (vehicleState.hasBmsSoc()) { CallerBatteryManagementSystemListenerManager.invokeBatteryManagementSystemStates( diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisDoorStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisDoorStateListener.kt new file mode 100644 index 0000000000..5cecb34e8c --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisDoorStateListener.kt @@ -0,0 +1,22 @@ +package com.mogo.eagle.core.function.api.autopilot + +import chassis.Chassis.DoorNumber +import chassis.VehicleStateOuterClass + +/** + * 车门数据 回调监听 + */ +interface IMoGoChassisDoorStateListener { + + /** + * 车门状态集合 底盘HZ + */ + fun onAutopilotDoorState(doorList: MutableList) {} + + /** + * 单个车门状态回调(变化回调) + * @param num 枚举 taxi(前左/右,后左/右) / bus(中) + * @param open true:开门(1), false:关门(0) + */ + fun onAutopilotSingleDoorState(num:DoorNumber, open:Boolean){} +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisDoorStateListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisDoorStateListenerManager.kt new file mode 100644 index 0000000000..65714818ad --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisDoorStateListenerManager.kt @@ -0,0 +1,108 @@ +package com.mogo.eagle.core.function.call.autopilot + +import chassis.Chassis +import chassis.VehicleStateOuterClass +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisDoorStateListener +import com.mogo.eagle.core.function.call.base.CallerBase +import java.util.* +import kotlin.properties.Delegates + +/** + * 车门数据 回调监听 + */ +object CallerChassisDoorStateListenerManager : CallerBase() { + + private val listCache = Collections.emptyList() + + private var frontLeft by Delegates.observable(0) { _, oldV, newV -> + if (oldV != newV) { + invokeSingleDoorState(Chassis.DoorNumber.FRONT_LEFT, newV) + } + } + + private var frontRight by Delegates.observable(0) { _, oldV, newV -> + if (oldV != newV) { + invokeSingleDoorState(Chassis.DoorNumber.FRONT_RIGHT, newV) + } + } + + private var backLeft by Delegates.observable(0) { _, oldV, newV -> + if (oldV != newV) { + invokeSingleDoorState(Chassis.DoorNumber.REAR_LEFT, newV) + } + } + + private var backRight by Delegates.observable(0) { _, oldV, newV -> + if (oldV != newV) { + invokeSingleDoorState(Chassis.DoorNumber.REAR_RIGHT, newV) + } + } + + private var middle by Delegates.observable(0) { _, oldV, newV -> + if (oldV != newV) { + invokeSingleDoorState(Chassis.DoorNumber.MIDDLE, newV) + } + } + + override fun doSomeAfterAddListener(tag: String, listener: IMoGoChassisDoorStateListener) { + super.doSomeAfterAddListener(tag, listener) + if (listCache.size > 0) { + listener.onAutopilotDoorState(listCache) + } + } + + /** + * 车门状态 + */ + fun invokeAutopilotDoorState(doorList: MutableList) { + listCache.addAll(doorList) + doorList.forEach { + when (it.number) { + Chassis.DoorNumber.FRONT_LEFT -> frontLeft = it.status + Chassis.DoorNumber.FRONT_RIGHT -> frontRight = it.status + Chassis.DoorNumber.REAR_LEFT -> backLeft = it.status + Chassis.DoorNumber.REAR_RIGHT -> backRight = it.status + Chassis.DoorNumber.MIDDLE -> middle = it.status + else -> {} + } + } + M_LISTENERS.forEach { + val listener = it.value + listener.onAutopilotDoorState(doorList) + } + } + + @Synchronized + private fun invokeSingleDoorState(num: Chassis.DoorNumber, value: Int) { + M_LISTENERS.forEach { + val listener = it.value + listener.onAutopilotSingleDoorState(num, value == 1) + } + } + + /** + * 返回所有门状态 + */ + fun getDoorList(): List? { + return if (listCache.size > 0) listCache else null + } + + /** + * 获取某个门的状态 + * @param num + * @return true:开门,false:关门 + */ + fun getIndexDoorState(num: Chassis.DoorNumber): Boolean { + return when (num) { + Chassis.DoorNumber.FRONT_LEFT -> frontLeft == 1 + Chassis.DoorNumber.FRONT_RIGHT -> frontRight == 1 + Chassis.DoorNumber.REAR_LEFT -> backLeft == 1 + Chassis.DoorNumber.REAR_RIGHT -> backRight == 1 + Chassis.DoorNumber.MIDDLE -> middle == 1 + else -> { + false + } + } + } +} +