Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0

# Conflicts:
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java
This commit is contained in:
donghongyu
2023-02-17 14:23:49 +08:00
43 changed files with 585 additions and 211 deletions

View File

@@ -20,8 +20,7 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo.NoticeTrafficAccou
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.notice.NoticeValue
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager.bizProvider
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
@@ -201,8 +200,8 @@ class NoticeTrafficDialog : BaseFloatDialog, LifecycleObserver {
mTrafficStyleInfo!!.lat, mTrafficStyleInfo!!.lon
)
parameters.startLatLon = AutoPilotLonLat(
getCurWgs84Lat(),
getCurWgs84Lon()
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude,
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude
)
parameters.endLatLon = AutoPilotLonLat(gcj02[0], gcj02[1])
startAutoPilot(parameters)

View File

@@ -0,0 +1,16 @@
package com.mogo.eagle.core.function.hmi.ui.setting
import android.content.Context
import android.util.AttributeSet
import android.view.View
class ToggleDebugViewTrigger(context: Context, attrs: AttributeSet?
) : View(context, attrs){
init {
setOnLongClickListener {
ToggleDebugView.toggleDebugView.toggle(this.context)
true
}
}
}

View File

@@ -12,10 +12,12 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.Utils
import kotlinx.android.synthetic.main.view_steering_brake.view.*
@@ -30,6 +32,7 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
private const val TAG = "SteeringBrakeView"
}
@Volatile
private var isShowTurnLight = false
private var brakeLight = -1
@@ -59,11 +62,13 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
"$M_HMI$TAG",
"---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight
)
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(brakeLight)
} else {
brakeView.visibility = View.GONE
ThreadUtils.runOnUiThread {
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(brakeLight)
} else {
brakeView.visibility = View.GONE
}
}
}
}
@@ -73,13 +78,16 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
//can数据转发 转向灯状态 0是正常 1是左转 2是右转
if (lightSwitch != null) {
CallerLogger.d("$M_HMI$TAG", "---lightSwitch.getNumber() = " + lightSwitch.number)
if (lightSwitch.number == 1 || lightSwitch.number == 2) {
isShowTurnLight = true
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(0)
} else {
brakeView.visibility = View.GONE
isShowTurnLight = false
ThreadUtils.runOnUiThread {
if (lightSwitch.number == 1 || lightSwitch.number == 2) {
isShowTurnLight = true
brakeView.visibility = View.VISIBLE
brakeView.setBrakeLight(0)
} else {
brakeView.visibility = View.GONE
isShowTurnLight = false
}
turnLightView.visibility = View.VISIBLE
}
}
}

View File

@@ -12,15 +12,10 @@ import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import chassis.Chassis
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.map.angle.Turning
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.hmi.R
import kotlinx.android.synthetic.main.view_steering_brake.view.*
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import kotlinx.android.synthetic.main.view_turn_light_status.view.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
/**
* @description
@@ -39,6 +34,9 @@ open class TurnLightViewStatus @JvmOverloads constructor(
}
private val visible: Boolean
private var isLeftLight: Boolean = false
private var isRightLight: Boolean = false
private var isDisappear: Boolean = false
init {
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.TurnLightView)
@@ -71,8 +69,9 @@ open class TurnLightViewStatus @JvmOverloads constructor(
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
super.onAutopilotLightSwitchData(lightSwitch)
lightSwitch?.let {
turnLightView.visibility = View.VISIBLE
setTurnLight(it)
ThreadUtils.runOnUiThread {
setTurnLight(it)
}
}
}
@@ -83,27 +82,37 @@ open class TurnLightViewStatus @JvmOverloads constructor(
if (!isAttachedToWindow) {
return
}
GlobalScope.launch(Dispatchers.Main) {
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
when (directionLight) {
Chassis.LightSwitch.LIGHT_LEFT -> { //左转向
CallerVisualAngleManager.changeAngle(Turning(true))
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
when (directionLight.number) {
Chassis.LightSwitch.LIGHT_LEFT_VALUE -> { //左转向
if (!isLeftLight) {
isLeftLight = true
isRightLight = false
isDisappear = false
showNormalAnimation()
left_select_image.visibility = View.VISIBLE
right_select_image.visibility = View.GONE
right_select_image.clearAnimation()
setAnimation(left_select_image)
}
Chassis.LightSwitch.LIGHT_RIGHT -> { //右转向
CallerVisualAngleManager.changeAngle(Turning(true))
}
Chassis.LightSwitch.LIGHT_RIGHT_VALUE -> { //右转向
if (!isRightLight) {
isRightLight = true
isLeftLight = false
isDisappear = false
showNormalAnimation()
left_select_image.visibility = View.GONE
right_select_image.visibility = View.VISIBLE
left_select_image.clearAnimation()
setAnimation(right_select_image)
}
else -> { //消失
CallerVisualAngleManager.changeAngle(Turning(false))
}
Chassis.LightSwitch.LIGHT_NONE_VALUE -> { //消失
if (!isDisappear) {
isDisappear = true
isLeftLight = false
isRightLight = false
animationDisappear()
}
}
@@ -154,8 +163,10 @@ open class TurnLightViewStatus @JvmOverloads constructor(
}
override fun onAnimationEnd(p0: Animation?) {
left_nor_image.visibility = View.GONE
right_nor_image.visibility = View.GONE
if (!visible) {
left_nor_image.visibility = View.GONE
right_nor_image.visibility = View.GONE
}
}
})
@@ -167,10 +178,9 @@ open class TurnLightViewStatus @JvmOverloads constructor(
}
override fun onAnimationEnd(p0: Animation?) {
if (visible) {
if (!visible) {
turn_light_layout.visibility = View.GONE
}
stopAnimate()
}
})
}
@@ -179,19 +189,13 @@ open class TurnLightViewStatus @JvmOverloads constructor(
private fun setAnimation(imageView: ImageView) {
val animationSet = AnimatorSet()
val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha", 0f, 1.0f)
val valueAnimatorDisappare = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f)
val valueAnimatorDisappear = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f)
valueAnimator.duration = 1000
valueAnimatorDisappare.duration = 800
valueAnimatorDisappear.duration = 800
valueAnimator.repeatCount = -1
valueAnimatorDisappare.repeatCount = -1
animationSet.playTogether(valueAnimatorDisappare, valueAnimator)
valueAnimatorDisappear.repeatCount = -1
animationSet.playTogether(valueAnimatorDisappear, valueAnimator)
animationSet.start()
}
private fun stopAnimate() {
turn_light_layout.clearAnimation()
left_nor_image.clearAnimation()
right_nor_image.clearAnimation()
}
}

View File

@@ -10,8 +10,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -80,7 +79,10 @@ class AutoPilotStatusView constructor(
currentAutopilot.endName = "HYJC"
currentAutopilot.isSpeakVoice = false
currentAutopilot.startLatLon =
AutopilotControlParameters.AutoPilotLonLat(getCurWgs84Lat(), getCurWgs84Lon())
AutopilotControlParameters.AutoPilotLonLat(
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude,
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude
)
currentAutopilot.endLatLon =
AutopilotControlParameters.AutoPilotLonLat(26.819716071924688, 112.57715442110867)
currentAutopilot.vehicleType = 10

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
@@ -12,6 +13,7 @@ import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
/**
@@ -37,13 +39,16 @@ class LimitingVelocityView constructor(
}
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
if (limitingVelocity > 0) {
this.visibility = View.VISIBLE
tvLimitingVelocity.text = "$limitingVelocity"
tvLimitingSource.text = sourceType.name
} else {
this.visibility = View.GONE
tvLimitingSource.text = ""
ThreadUtils.runOnUiThread {
if (limitingVelocity > 0) {
visibility = View.VISIBLE
tvLimitingVelocity.text = "$limitingVelocity"
Log.d("emArrow","limit : ${ DataSourceType.getName(sourceType)}")
tvLimitingSource.text = DataSourceType.getName(sourceType)
} else {
visibility = View.GONE
tvLimitingSource.text = ""
}
}
}

View File

@@ -53,6 +53,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
}
CallerDevaToolsManager.INSTANCE.updateUpgradeProgress();
CallerDevaToolsManager.INSTANCE.updateObuUpgradeStatus();
}
@Override

View File

@@ -23,14 +23,12 @@
android:id="@+id/tvLimitingSource"
android:layout_width="120dp"
android:layout_height="35dp"
android:layout_marginEnd="40dp"
android:gravity="center"
android:text=""
android:text="123"
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/dp_30"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvLimitingVelocity"
android:visibility="gone" />
app:layout_constraintTop_toBottomOf="@+id/tvLimitingVelocity" />
</androidx.constraintlayout.widget.ConstraintLayout>