[shuttle]

[方向盘修改]
This commit is contained in:
yangyakun
2023-03-08 09:36:48 +08:00
parent 29ae93e933
commit dadf330a2c
2 changed files with 21 additions and 5 deletions

View File

@@ -19,6 +19,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
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.AppIdentityModeUtils.isBus
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isTaxi
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
@@ -46,10 +47,12 @@ class SteeringWheelView : ConstraintLayout, IMoGoChassisSteeringStateListener,
constructor(context: Context) : super(context) {}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
if (isBus(FunctionBuildConfig.appIdentityMode)) {
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this)
} else {
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_taxi, this)
when (AppIdentityModeUtils.getProduct(FunctionBuildConfig.appIdentityMode)) {
AppIdentityModeUtils.Product.BUS -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this)
AppIdentityModeUtils.Product.TAXI -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_taxi, this)
AppIdentityModeUtils.Product.SWEEPER -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this)
AppIdentityModeUtils.Product.SHUTTLE -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this)
AppIdentityModeUtils.Product.CHARTER -> LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel_bus, this)
}
initView()
CallerAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)

View File

@@ -227,7 +227,20 @@ object AppIdentityModeUtils {
return false
}
fun getProduct(appIdentityMode: String): Product {
val (bussness, _, _) = getInfo(appIdentityMode)
return when (bussness) {
TAXI -> Product.TAXI
BUS -> Product.BUS
SWEEPER -> Product.SWEEPER
SHUTTLE -> Product.SHUTTLE
CHARTER -> Product.CHARTER
else -> Product.TAXI
}
}
enum class Product{
BUS,TAXI,SWEEPER,SHUTTLE,CHARTER
}
}