diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java index 2a8a1c8d6d..82d2864654 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BaseBusTabFragment.java @@ -74,7 +74,7 @@ public abstract class BaseBusTabFragment private FrameLayout flStationPanelContainer; private BizMapView mapBizView; private Group groupTestPanel; - private TrafficDataView mTrafficDataView; +// private TrafficDataView mTrafficDataView; // private BusTrafficLightView mTrafficLightView; //远景和中景的切换 @@ -526,15 +526,15 @@ public abstract class BaseBusTabFragment } } - /** - * 迈速表实时更新 - */ - public void updateSpeedView(float newSpeed) { - int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值 - if (mTrafficDataView != null) { - mTrafficDataView.updateSpeedWithValue(speed); - } - } +// /** +// * 迈速表实时更新 +// */ +// public void updateSpeedView(float newSpeed) { +// int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值 +// if (mTrafficDataView != null) { +// mTrafficDataView.updateSpeedWithValue(speed); +// } +// } @Override public void onDestroy() { diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java index 9b4bdaa663..f6d72cb509 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java @@ -201,9 +201,9 @@ public class BusPresenter extends Presenter @Override public void onCarLocationChanged(MogoLocation location) { - if (null != location) { - runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed())); - } +// if (null != location) { +// runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed())); +// } } @Override diff --git a/OCH/bus/driver/src/main/res/layout/bus_base_fragment.xml b/OCH/bus/driver/src/main/res/layout/bus_base_fragment.xml index dcb176d60b..15df30481e 100644 --- a/OCH/bus/driver/src/main/res/layout/bus_base_fragment.xml +++ b/OCH/bus/driver/src/main/res/layout/bus_base_fragment.xml @@ -37,12 +37,9 @@ diff --git a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt index 51c1dd5405..9beefcc925 100644 --- a/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt +++ b/OCH/charter/driver/src/main/java/com/magic/mogo/och/charter/base/CharterBaseFragment.kt @@ -1,16 +1,17 @@ package com.magic.mogo.och.charter.base import android.animation.ObjectAnimator -import android.annotation.SuppressLint import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.view.animation.LinearInterpolator -import android.widget.* +import android.widget.FrameLayout +import android.widget.ImageView +import android.widget.LinearLayout +import android.widget.RelativeLayout +import android.widget.TextView import androidx.constraintlayout.widget.Group import com.magic.mogo.och.charter.R -import com.magic.mogo.och.charter.constant.CharterConst import com.magic.mogo.och.charter.view.SlidePanelView import com.magic.mogo.och.charter.view.autopilot.AutopilotStatusView import com.mogo.commons.mvp.IView @@ -18,8 +19,8 @@ import com.mogo.commons.mvp.MvpFragment import com.mogo.commons.mvp.Presenter import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager +import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.attachAutopilotBeforeLaunchView import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.initAiCollect import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.initBadCase import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showToolsView @@ -27,20 +28,16 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView.ClickListener import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView -import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView import com.mogo.eagle.core.function.smp.view.SmallMapView import com.mogo.eagle.core.function.view.MapBizView import com.mogo.eagle.core.utilcode.kotlin.onClick import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener -import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable -import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.map.listener.IMogoMapListener import com.mogo.map.listener.MogoMapListenerHandler.Companion.mogoMapListenerHandler import com.mogo.map.uicontroller.VisualAngleMode import com.mogo.och.common.module.utils.SoundPoolHelper -import kotlinx.android.synthetic.main.charter_base_fragment.* +import kotlinx.android.synthetic.main.charter_base_fragment.module_mogo_och_arrived_tv import org.greenrobot.eventbus.EventBus -import kotlin.math.abs /** * @author: wangmingjun @@ -92,6 +89,13 @@ abstract class CharterBaseFragment?>() : slidePanelView?.setText(resources.getString(R.string.charter_back_car)) slidePanelView?.setOnSlidePanelMoveToEndListener(onSlideToEndListener) + + // mTrafficDataView = (TrafficDataView) findViewById(R.id.bus_arc); + val flSpeed = findViewById(R.id.fl_speed) + if (flSpeed != null) { + attachAutopilotBeforeLaunchView(flSpeed.context, flSpeed) + } + LayoutInflater.from(context).inflate(getStationPanelViewId(), flStationPanelContainer) mSwitchMapModeLayout = findViewById(R.id.bus_switch_model_layout) mSwitchMapModeImage = findViewById(R.id.bus_switch_model_icon) diff --git a/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml b/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml index 2fc0dd9e2f..fe209b62b2 100644 --- a/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml +++ b/OCH/charter/driver/src/main/res/layout/charter_base_fragment.xml @@ -31,16 +31,12 @@ - @Override public void onCarLocationChanged(MogoLocation location) { - if (null != location) { - runOnUIThread(() -> mView.updateSpeedView(location.getGnssSpeed())); - } +// if (null != location) { +// runOnUIThread(() -> mView.updateSpeedView(location.getGnssSpeed())); +// } } @Override diff --git a/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml b/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml index 070ea2b6cf..7587498309 100644 --- a/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml +++ b/OCH/shuttle/driver/src/main/res/layout/shuttle_base_fragment.xml @@ -38,12 +38,9 @@ diff --git a/OCH/taxi/driver/src/main/res/layout/taxi_base_fragment.xml b/OCH/taxi/driver/src/main/res/layout/taxi_base_fragment.xml index e1ddb7fcc2..3088f8ac13 100644 --- a/OCH/taxi/driver/src/main/res/layout/taxi_base_fragment.xml +++ b/OCH/taxi/driver/src/main/res/layout/taxi_base_fragment.xml @@ -23,13 +23,11 @@ + app:layout_constraintTop_toTopOf="parent"/> - - + app:layout_constraintTop_toTopOf="parent"/> 0) { if (group.visibility != View.VISIBLE) { group.visibility = View.VISIBLE diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/entity/Status.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/entity/Status.kt index 44d6ddc1ee..63f3273f2c 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/entity/Status.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/entity/Status.kt @@ -310,6 +310,24 @@ data class SteerStatus(val angle: Float, var isError: Boolean = false): Status() override fun isException(): Boolean { return isError } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as SteerStatus + + if (angle != other.angle) return false + if (isError != other.isError) return false + + return true + } + + override fun hashCode(): Int { + var result = angle.hashCode() + result = 31 * result + isError.hashCode() + return result + } } /** @@ -320,6 +338,26 @@ data class AcceleratorStatus(val angle: Float, var isError: Boolean = false): St override fun isException(): Boolean { return isError } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as AcceleratorStatus + + if (angle != other.angle) return false + if (isError != other.isError) return false + + return true + } + + override fun hashCode(): Int { + var result = angle.hashCode() + result = 31 * result + isError.hashCode() + return result + } + + } /** @@ -330,6 +368,24 @@ data class BrakeStatus(val angle: Float, var isError: Boolean = false): Status() override fun isException(): Boolean { return isError } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as BrakeStatus + + if (angle != other.angle) return false + if (isError != other.isError) return false + + return true + } + + override fun hashCode(): Int { + var result = angle.hashCode() + result = 31 * result + isError.hashCode() + return result + } } @@ -341,6 +397,24 @@ data class DoubleFlashStatus(val type: Int, var isError: Boolean = false): Statu override fun isException(): Boolean { return isError } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as DoubleFlashStatus + + if (type != other.type) return false + if (isError != other.isError) return false + + return true + } + + override fun hashCode(): Int { + var result = type + result = 31 * result + isError.hashCode() + return result + } } /** @@ -351,6 +425,24 @@ data class GearStatus(val value: Int, var isError: Boolean = false): Status(), I override fun isException(): Boolean { return isError } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as GearStatus + + if (value != other.value) return false + if (isError != other.isError) return false + + return true + } + + override fun hashCode(): Int { + var result = value + result = 31 * result + isError.hashCode() + return result + } } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/ui/AutoPilotLaunchBeforeView.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/ui/AutoPilotLaunchBeforeView.kt index 9503b17c0f..0d8b1143ca 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/ui/AutoPilotLaunchBeforeView.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/ui/AutoPilotLaunchBeforeView.kt @@ -31,6 +31,7 @@ import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.iv_dou import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.iv_steer import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.speed import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.tv_brake_or_accelerator +import me.jessyan.autosize.utils.AutoSizeUtils class AutoPilotLaunchBeforeView: LinearLayout, IStatusListener { @@ -38,11 +39,12 @@ class AutoPilotLaunchBeforeView: LinearLayout, IStatusListener { private const val TAG = "AutoPilotLaunchBeforeView" } - constructor(context: Context?) : this(context, null) - constructor(context: Context?, attrs: AttributeSet?) : this(context, attrs, 0) - constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { + constructor(context: Context) : this(context, null) + constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0) + constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { LayoutInflater.from(context).inflate(R.layout.layout_autopilot_launch_before, this, true) - background = ContextCompat.getDrawable(context!!, R.drawable.bg_autopilot_launch_before) + background = ContextCompat.getDrawable(context, R.drawable.icon_bg_autopilot_status) + setPadding(AutoSizeUtils.dp2px(context, 27f), AutoSizeUtils.dp2px(context, 33f), AutoSizeUtils.dp2px(context, 30f), AutoSizeUtils.dp2px(context, 30f)) } @@ -84,13 +86,13 @@ class AutoPilotLaunchBeforeView: LinearLayout, IStatusListener { val isError = status.isError val angle = status.angle iv_brake_or_accelerator?.isSelected = isError - tv_brake_or_accelerator?.text = "a: $angle" + tv_brake_or_accelerator?.text = "a:${angle.toInt()}" } is BrakeStatus -> { val isError = status.isError val angle = status.angle iv_brake_or_accelerator?.isSelected = isError - tv_brake_or_accelerator?.text = "a: -$angle" + tv_brake_or_accelerator?.text = "a:-${angle.toInt()}" } is DoubleFlashStatus -> { val isError = status.isError diff --git a/core/function-impl/mogo-core-function-devatools/src/main/res/drawable-xhdpi/icon_bg_autopilot_status.png b/core/function-impl/mogo-core-function-devatools/src/main/res/drawable-xhdpi/icon_bg_autopilot_status.png new file mode 100644 index 0000000000..f769d83037 Binary files /dev/null and b/core/function-impl/mogo-core-function-devatools/src/main/res/drawable-xhdpi/icon_bg_autopilot_status.png differ diff --git a/core/function-impl/mogo-core-function-devatools/src/main/res/drawable-xhdpi/icon_bg_speed.png b/core/function-impl/mogo-core-function-devatools/src/main/res/drawable-xhdpi/icon_bg_speed.png new file mode 100644 index 0000000000..abd202be48 Binary files /dev/null and b/core/function-impl/mogo-core-function-devatools/src/main/res/drawable-xhdpi/icon_bg_speed.png differ diff --git a/core/function-impl/mogo-core-function-devatools/src/main/res/drawable/bg_autopilot_launch_before.xml b/core/function-impl/mogo-core-function-devatools/src/main/res/drawable/bg_autopilot_launch_before.xml deleted file mode 100644 index 677145e413..0000000000 --- a/core/function-impl/mogo-core-function-devatools/src/main/res/drawable/bg_autopilot_launch_before.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/core/function-impl/mogo-core-function-devatools/src/main/res/drawable/bg_speed_chart.xml b/core/function-impl/mogo-core-function-devatools/src/main/res/drawable/bg_speed_chart.xml deleted file mode 100644 index ecd8466379..0000000000 --- a/core/function-impl/mogo-core-function-devatools/src/main/res/drawable/bg_speed_chart.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_autopilot_launch_before.xml b/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_autopilot_launch_before.xml index 6c2c8659bf..cc450cdd9d 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_autopilot_launch_before.xml +++ b/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_autopilot_launch_before.xml @@ -2,10 +2,14 @@ + tools:background="@drawable/icon_bg_autopilot_status" + tools:paddingTop="@dimen/dp_33" + tools:paddingBottom="@dimen/dp_30" + tools:paddingStart="@dimen/dp_27" + tools:paddingEnd="@dimen/dp_30"> + android:background="@drawable/icon_bg_speed"> - + android:gravity="center_vertical" + android:paddingEnd="@dimen/dp_34"> + android:text="a:-0.0"/> \ No newline at end of file