From 4cb32ec4a6ced13b663fa90e9498c8247319ca6d Mon Sep 17 00:00:00 2001 From: donghongyu Date: Wed, 22 Feb 2023 17:56:14 +0800 Subject: [PATCH] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[=201?= =?UTF-8?q?=E3=80=81=E5=90=88=E5=B9=B63.0=E5=88=86=E6=94=AF=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../och/sweeper/model/SweeperTaskModel.java | 4 +- .../sweeper/util/SweeperAnalyticsManager.java | 8 +- .../hmi/ui/widget/SteeringWheelView.java | 253 ------------------ .../eagle/core/widget/TextureVideoView.java | 2 - 4 files changed, 6 insertions(+), 261 deletions(-) delete mode 100644 core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperTaskModel.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperTaskModel.java index d3af6062c2..925d85177b 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperTaskModel.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperTaskModel.java @@ -9,7 +9,6 @@ import androidx.annotation.Nullable; import com.amap.api.maps.model.LatLng; import com.elegant.network.utils.GsonUtil; -import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.module.status.IMogoStatusChangedListener; import com.mogo.commons.module.status.MogoStatusManager; @@ -24,6 +23,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; +import com.mogo.eagle.core.utilcode.util.CoordinateUtils; import com.mogo.eagle.core.utilcode.util.NetworkUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.och.common.module.biz.network.OchCommonServiceCallback; @@ -40,9 +40,9 @@ import com.mogo.och.sweeper.bean.SweeperMainTaskBean; import com.mogo.och.sweeper.bean.SweeperRoutePlanningUpdateReqBean; import com.mogo.och.sweeper.bean.SweeperSubTaskBean; import com.mogo.och.sweeper.bean.SweeperSubTaskDetailBean; -import com.mogo.och.sweeper.callback.ISweeperTaskCallback; import com.mogo.och.sweeper.callback.ISweeperADASStatusCallback; import com.mogo.och.sweeper.callback.ISweeperControllerStatusCallback; +import com.mogo.och.sweeper.callback.ISweeperTaskCallback; import com.mogo.och.sweeper.constant.SubTaskTypeEnum; import com.mogo.och.sweeper.constant.SweeperConst; import com.mogo.och.sweeper.constant.TaskStatusEnum; diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/util/SweeperAnalyticsManager.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/util/SweeperAnalyticsManager.java index a8f9aae036..4693fae7ed 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/util/SweeperAnalyticsManager.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/util/SweeperAnalyticsManager.java @@ -1,13 +1,15 @@ package com.mogo.och.sweeper.util; +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_SWEEPER; + import android.os.Build; import android.text.TextUtils; import com.mogo.cloud.passport.MoGoAiCloudClientConfig; import com.mogo.commons.debug.DebugConfig; +import com.mogo.commons.utils.MogoAnalyticUtils; import com.mogo.eagle.core.data.app.AppConfigInfo; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; -import com.mogo.commons.utils.MogoAnalyticUtils; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.DateTimeUtils; @@ -16,8 +18,6 @@ import com.mogo.och.sweeper.constant.SweeperConst; import java.util.HashMap; -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_SWEEPER; - /** * OCH sweeper埋点工具 * @@ -145,6 +145,6 @@ public class SweeperAnalyticsManager { params.put(SweeperConst.EVENT_PARAM_END_NAME, endName); params.put(SweeperConst.EVENT_PARAM_LINE_ID, lineId); params.put(SweeperConst.EVENT_PARAM_UNABLE_START_REASON, reason); - AnalyticsManager.INSTANCE.track(SweeperConst.EVENT_KEY_AP_UNABLE_START_REASON, params); + MogoAnalyticUtils.INSTANCE.track(SweeperConst.EVENT_KEY_AP_UNABLE_START_REASON, params); } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java deleted file mode 100644 index 77bfcf3bab..0000000000 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java +++ /dev/null @@ -1,253 +0,0 @@ -package com.mogo.eagle.core.function.hmi.ui.widget; - -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P; - -import android.content.Context; -import android.graphics.BlurMaskFilter; -import android.util.AttributeSet; -import android.view.LayoutInflater; -import android.view.View; -import android.view.animation.RotateAnimation; -import android.widget.ImageView; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.constraintlayout.widget.ConstraintLayout; - -import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; -import com.mogo.eagle.core.data.config.FunctionBuildConfig; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; -import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener; -import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; -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.logger.CallerLogger; -import com.mogo.eagle.core.utilcode.util.ThreadUtils; - -import org.jetbrains.annotations.NotNull; - -import chassis.Chassis; -import mogo.telematics.pad.MessagePad; -import mogo_msg.MogoReportMsg; -import planning.RoboSweeperTaskIndexOuterClass; -import system_master.SystemStatusInfo; - -/** - * @author Jing - * @description 方向盘 - * 方向盘跟随CAN数据做旋转 - * 档位随CAN数据做切换和高亮显示 - * @since: 4/7/22 - */ -public class SteeringWheelView extends ConstraintLayout implements - IMoGoChassisSteeringStateListener, - IMoGoChassisGearStateListener { - private static final String TAG = "SteeringWheelView"; - private ImageView autopilotIV; - private TextView steeringTVL; - private TextView steeringTVR; - private TapPositionView tapPositionView; - private CircularProgressView steeringCircularV; - private CircularProgressView steeringCircularVAlpha; - private RotateAnimation rotateAnimation; - private float fromDegrees = 0;//方向盘旋转起始位置 - - public SteeringWheelView(@NonNull Context context) { - super(context); - } - - public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs) { - super(context, attrs); - if (AppIdentityModeUtils.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); - } - initView(); - CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener); - CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this); - CallerChassisSteeringStateListenerManager.INSTANCE.addListener(TAG, this); - tapPositionView.updateWithGear(Chassis.GearPosition.GEAR_R); - } - - private void initView() { - autopilotIV = (ImageView) findViewById(R.id.autopilot_iv); - steeringTVL = findViewById(R.id.steering_tv_left); - steeringTVR = findViewById(R.id.steering_tv_right); - tapPositionView = findViewById(R.id.tap_position); - steeringCircularV = findViewById(R.id.steering_circular); - steeringCircularV.setBackWidth(8); - steeringCircularV.setBackColor(R.color.hmi_light_back_bg); - steeringCircularV.setProgress((int) (0 * 100) / 360, 20); - steeringCircularV.setProgColor(R.color.hmi_light_blue, R.color.hmi_dark_blue); - if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { - steeringCircularVAlpha = findViewById(R.id.steering_circular_alpha); - steeringCircularVAlpha.setProgress((int) (0 * 100) / 360, 20); - steeringCircularV.setProgColor(R.color.hmi_dark_blue, R.color.hmi_light_blue); - steeringCircularVAlpha.setBackWidth(8); - steeringCircularVAlpha.setBackColor(R.color.hmi_clear_00); - steeringCircularVAlpha.setProgColor(R.color.hmi_light_blue_alpha_ff, R.color.hmi_light_blue_alpha_00); - steeringCircularVAlpha.setBlurMaskFilter(BlurMaskFilter.Blur.NORMAL, 12); - } - } - - public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - - public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - } - - private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() { - - @Override - public void onAutopilotRouteLineId(long lineId) { - - } - - @Override - public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { - } - - @Override - public void onAutopilotArriveAtStation(@org.jetbrains.annotations.Nullable MessagePad.ArrivalNotification arrivalNotification) { - - } - - @Override - public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) { - - } - - @Override - public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - if (autopilotStatusInfo == null) return; - int state = autopilotStatusInfo.getState(); - CallerLogger.INSTANCE.d(M_BUS_P + TAG, "state = %s", state); - if (autopilotIV != null) { - if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { - if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { - // TODO - - } else { - autopilotIV.setImageResource(R.drawable.bg_auto); - } - } else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) { - if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { - // TODO - - } else { - autopilotIV.setImageResource(R.drawable.bg_auto_nor); - } - } else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) { - if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { - // TODO - - } else { - autopilotIV.setImageResource(R.drawable.bg_auto_nor); - } - } - } else { - CallerLogger.INSTANCE.d(TAG, "autopilotIV=null"); - } - } - }); - } - - @Override - public void onAutopilotSNRequest() { - - } - - @Override - public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) { - - } - }; - - /** - * 方向盘转向角 左+右- - * @param steering - */ - @Override - public void onAutopilotSteeringData(float steering) { - if (Math.abs(steering) < 1) { - steering = 0; - } - float steeringValue = steering; - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - if (steeringTVL != null && steeringValue > 0) { - steeringTVR.setVisibility(View.INVISIBLE); - steeringTVL.setVisibility(View.VISIBLE); - steeringTVL.setText(String.valueOf((int) steeringValue) + "°"); - } else if (steeringTVR != null && steeringValue <= 0) { - steeringTVL.setVisibility(View.INVISIBLE); - steeringTVR.setVisibility(View.VISIBLE); - steeringTVR.setText(String.valueOf((int) -steeringValue) + "°"); - } else { - CallerLogger.INSTANCE.d(TAG, "onAutopilotSteeringData error"); - } - animationWithSteeringData(-steeringValue); - if (steeringCircularV != null) { - steeringCircularV.setProgress((int) (-steeringValue * 100) / 360, 20); - } - if (steeringCircularVAlpha != null) { - steeringCircularVAlpha.setProgress((int) (-steeringValue * 100) / 360, 20); - } - } - }); - - } - - /** - * 档位 - * @param gear - */ - @Override - public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) { - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - CallerLogger.INSTANCE.d(TAG, "乘客屏档位" + gear.toString()); - if (tapPositionView != null) { - tapPositionView.updateWithGear(gear); - } - } - }); - - } - - /** - * 方向盘随CAN数据做方向和角度旋转 - * 参数1从哪一个旋转角度开始 - * 参数2:转到什么角度 - * 后4个参数用于设置围绕着旋转的圆的圆心在哪里 - * 参数3:肯定x轴坐标的类型,有ABSOLUT绝对坐标、RELATIVE_TO_SELF相对于自身坐标、RELATIVE_TO_PARENT相对于父控件的坐标 - * 参数4:x轴的值,0.5f代表是以自身这个控件的一半长度为x轴 - * 参数5:肯定y轴坐标的类型 - * 参数6:y轴的值,0.5f代表是以自身这个控件的一半长度为x轴 - * - * @param steering - */ - private void animationWithSteeringData(float steering) { - rotateAnimation = new RotateAnimation(fromDegrees, steering, - RotateAnimation.RELATIVE_TO_SELF, 0.5f, - RotateAnimation.RELATIVE_TO_SELF, 0.5f); - rotateAnimation.setDuration(20);//旋转时长 - rotateAnimation.setFillAfter(true);//旋转后保持原状 - autopilotIV.clearAnimation(); - autopilotIV.startAnimation(rotateAnimation); - fromDegrees = steering; - } - -} diff --git a/core/mogo-core-res/src/main/java/com/mogo/eagle/core/widget/TextureVideoView.java b/core/mogo-core-res/src/main/java/com/mogo/eagle/core/widget/TextureVideoView.java index 009e282d58..5bb11c89cf 100644 --- a/core/mogo-core-res/src/main/java/com/mogo/eagle/core/widget/TextureVideoView.java +++ b/core/mogo-core-res/src/main/java/com/mogo/eagle/core/widget/TextureVideoView.java @@ -18,7 +18,6 @@ package com.mogo.eagle.core.widget; import android.annotation.SuppressLint; import android.content.Context; -import android.graphics.Color; import android.graphics.SurfaceTexture; import android.media.AudioManager; import android.media.MediaPlayer; @@ -33,7 +32,6 @@ import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.MediaController.MediaPlayerControl; - import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import java.io.IOException;