[add] 乘客屏速度数据信息
This commit is contained in:
@@ -61,12 +61,14 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
}else {
|
||||
implementation project(":core:mogo-core-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
@@ -72,7 +73,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
private FrameLayout flStationPanelContainer;
|
||||
private Group groupTestPanel;
|
||||
private FrameLayout flSpeed;
|
||||
private BusArcView mouduleArc;
|
||||
private TrafficDataView dataView;
|
||||
private ImageView mUpgradeTipIv;
|
||||
// private BusTrafficLightView mTrafficLightView;
|
||||
|
||||
@@ -118,7 +119,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
tvOperationStatus = findViewById(R.id.module_mogo_och_operation_status);
|
||||
|
||||
flSpeed = (FrameLayout) findViewById(R.id.fl_speed);
|
||||
mouduleArc = (BusArcView) findViewById(R.id.bus_arc);
|
||||
dataView = (TrafficDataView) findViewById(R.id.bus_arc);
|
||||
|
||||
panelView = LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
|
||||
slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener);
|
||||
@@ -146,8 +147,8 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
});
|
||||
|
||||
if (DebugConfig.isDebug()) {
|
||||
mouduleArc.setLongClickable(true);
|
||||
mouduleArc.setOnLongClickListener(v -> {
|
||||
dataView.setLongClickable(true);
|
||||
dataView.setOnLongClickListener(v -> {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "长按显示状态工具栏");
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("oper", 52);
|
||||
@@ -478,9 +479,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
*/
|
||||
public void updateSpeedView(float newSpeed) {
|
||||
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
||||
mouduleArc.setArcColor(Color.parseColor(speed > 60 ? "#DB3137" : "#3E77F6"));
|
||||
mouduleArc.setValues(speed);
|
||||
flSpeed.setBackgroundResource(speed > 60 ? R.drawable.bus_yi_biao_pan_bg_speeding : R.drawable.bus_yi_biao_pan_bg_nor);
|
||||
dataView.showWithSpeedValue(speed);
|
||||
// mouduleArc.setArcColor(Color.parseColor(speed > 60 ? "#DB3137" : "#3E77F6"));
|
||||
// mouduleArc.setValues(speed);
|
||||
// flSpeed.setBackgroundResource(speed > 60 ? R.drawable.bus_yi_biao_pan_bg_speeding : R.drawable.bus_yi_biao_pan_bg_nor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,37 +5,43 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_72">
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speed"
|
||||
android:layout_width="@dimen/bus_ext_speed_width"
|
||||
android:layout_height="@dimen/bus_ext_speed_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginTop="@dimen/module_mogo_och_margin_left"
|
||||
android:background="@drawable/bus_yi_biao_pan_bg_nor"
|
||||
android:elevation="@dimen/bus_dp_10"
|
||||
android:padding="@dimen/bus_dp_20"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speed"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
android:layout_height="@dimen/dp_320"
|
||||
android:layout_marginLeft="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:elevation="@dimen/bus_dp_10"
|
||||
android:padding="@dimen/bus_dp_20"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<!-- <com.mogo.och.bus.view.BusArcView-->
|
||||
<!-- android:id="@+id/bus_arc"-->
|
||||
<!-- android:layout_width="@dimen/bus_ext_arcView_width"-->
|
||||
<!-- android:layout_height="@dimen/bus_ext_arcView_height"-->
|
||||
<!-- android:layout_gravity="center" />-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView
|
||||
android:id="@+id/bus_arc"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
android:layout_height="@dimen/dp_320"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.mogo.och.bus.view.BusArcView
|
||||
android:id="@+id/bus_arc"
|
||||
android:layout_width="@dimen/bus_ext_arcView_width"
|
||||
android:layout_height="@dimen/bus_ext_arcView_height"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
</FrameLayout>
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_autopilot_status"
|
||||
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
|
||||
android:layout_marginTop="@dimen/bus_ext_arcView_top"
|
||||
android:background="@drawable/bus_autopilot_status_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:gravity="center"
|
||||
tools:visibility="visible" >
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_autopilot_btn_iv"
|
||||
@@ -43,17 +49,18 @@
|
||||
android:layout_height="56px"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@drawable/bus_ic_autopilot" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bus_autopolot_btn_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="自动驾驶"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="28px"
|
||||
android:layout_toRightOf="@+id/bus_autopilot_btn_iv"
|
||||
android:text="自动驾驶"
|
||||
android:textColor="@color/bus_autopilot_text_color_normal"
|
||||
android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"
|
||||
android:layout_centerVertical="true"
|
||||
android:textStyle="bold"/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -71,28 +78,31 @@
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--切换地图远近事件 @dimen/module_switch_map -->
|
||||
<LinearLayout
|
||||
android:id="@+id/bus_switch_model_layout"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:background="@drawable/bus_switch_map_bg"
|
||||
android:elevation="@dimen/bus_dp_10"
|
||||
android:padding="@dimen/bus_dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_operation_status"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_operation_status"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
<LinearLayout
|
||||
android:id="@+id/bus_switch_model_layout"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:background="@drawable/bus_switch_map_bg"
|
||||
android:elevation="@dimen/bus_dp_10"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/bus_dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_mogo_och_operation_status"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_operation_status">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_switch_model_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bus_switch_model_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<CheckedTextView
|
||||
android:id="@+id/module_mogo_och_operation_status"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:background="@drawable/bus_operation_status_bg"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
@@ -101,10 +111,8 @@
|
||||
android:textColor="@color/bus_autopilot_text_color_selector"
|
||||
android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_setting_layout"
|
||||
@@ -116,21 +124,23 @@
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/bus_switch_model_layout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_och_bus_upgrade_red_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_gravity="right"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/bus_setting_tip_red_cir_bg"
|
||||
android:elevation="8px"
|
||||
android:background="@drawable/bus_setting_tip_red_cir_bg" />
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/bus_setting_btn_bg" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -140,11 +150,11 @@
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_och_margin_left"
|
||||
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
|
||||
android:src="@drawable/bus_badcase_btn_bg"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:src="@drawable/bus_badcase_btn_bg"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout"/>
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_setting_layout" />
|
||||
|
||||
<com.mogo.och.bus.view.SlidePanelView
|
||||
android:id="@+id/module_mogo_och_slide_panel"
|
||||
@@ -203,6 +213,7 @@
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotRoute"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -222,13 +233,13 @@
|
||||
,btnAutopilotRunning,btnAutopilotRoute"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!-- <com.mogo.och.bus.ui.BusTrafficLightView-->
|
||||
<!-- android:id="@+id/bus_traffic_light_view"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- android:layout_marginRight="@dimen/bus_traffic_light_layout_margin_right"-->
|
||||
<!-- android:layout_marginTop="@dimen/bus_traffic_light_layout_margin_top"-->
|
||||
<!-- android:visibility="gone"/>-->
|
||||
<!-- <com.mogo.och.bus.ui.BusTrafficLightView-->
|
||||
<!-- android:id="@+id/bus_traffic_light_view"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- android:layout_marginRight="@dimen/bus_traffic_light_layout_margin_right"-->
|
||||
<!-- android:layout_marginTop="@dimen/bus_traffic_light_layout_margin_top"-->
|
||||
<!-- android:visibility="gone"/>-->
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -104,9 +104,9 @@
|
||||
<dimen name="bus_ext_arcView_stroke_with">20px</dimen>
|
||||
<dimen name="bus_ext_arcView_top">40px</dimen>
|
||||
<dimen name="bus_ext_arcView_width">320px</dimen>
|
||||
<dimen name="bus_ext_speed_height">460px</dimen>
|
||||
<dimen name="bus_ext_speed_height">320px</dimen>
|
||||
<dimen name="bus_ext_speed_padding">70px</dimen>
|
||||
<dimen name="bus_ext_speed_width">460px</dimen>
|
||||
<dimen name="bus_ext_speed_width">616px</dimen>
|
||||
<dimen name="bus_ext_speed_width_big_radius">130px</dimen>
|
||||
<dimen name="bus_ext_speed_width_sm_radius">30px</dimen>
|
||||
<dimen name="bus_switch_map">279px</dimen>
|
||||
|
||||
@@ -776,7 +776,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
SharedPrefsMgr.getInstance(context)
|
||||
.getString(MoGoConfig.AUTOPILOT_IP, FunctionBuildConfig.adasConnectIP)
|
||||
|
||||
etAutopilotIP.setText("192.168.1.102")
|
||||
etAutopilotIP.setText("172.30.10.10:41102")
|
||||
etAutopilotIP.text?.let { etAutopilotIP.setSelection(it.length) }
|
||||
//设置工控机IP
|
||||
btnSetAutopilotIP.setOnClickListener {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
@@ -30,7 +31,7 @@ public class TapPositionView extends ConstraintLayout {
|
||||
private TextView tabR;
|
||||
private TextView tabN;
|
||||
private TextView tabD;
|
||||
|
||||
private TypedArray typedArray;
|
||||
public TapPositionView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
Log.d(TAG, "2");
|
||||
@@ -39,6 +40,8 @@ public class TapPositionView extends ConstraintLayout {
|
||||
tabR = findViewById(R.id.tap_r);
|
||||
tabN = findViewById(R.id.tap_n);
|
||||
tabD = findViewById(R.id.tap_d);
|
||||
typedArray = context.obtainStyledAttributes(attrs, R.styleable.CircularProgressView);
|
||||
|
||||
}
|
||||
|
||||
public void updateWithGear(@NotNull Chassis.GearPosition gear) {
|
||||
@@ -125,4 +128,64 @@ public class TapPositionView extends ConstraintLayout {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 司机屏档位信息
|
||||
*/
|
||||
public void updateWithGearForDriverPanel(@NotNull Chassis.GearPosition gear) {
|
||||
if (tabP != null && tabR != null && tabN != null && tabD != null) {
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
busDriverPanel(gear);
|
||||
} else {
|
||||
busDriverPanel(gear);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void busDriverPanel(@NotNull Chassis.GearPosition gear) {
|
||||
Log.d(TAG, "gear" + gear.toString());
|
||||
tabP.setTextSize(36f);
|
||||
tabR.setTextSize(36f);
|
||||
tabN.setTextSize(36f);
|
||||
tabD.setTextSize(36f);
|
||||
int defaultColor = typedArray.getColor(R.styleable.TapPositionView_defaultColor, -1);
|
||||
int selectColor = typedArray.getColor(R.styleable.TapPositionView_selectColor, -1);
|
||||
|
||||
switch (gear) {
|
||||
case GEAR_NONE:
|
||||
tabP.setTextColor(Color.parseColor("#FFF"));
|
||||
tabR.setTextColor(Color.parseColor("#FFF"));
|
||||
tabN.setTextColor(Color.parseColor("#FFF"));
|
||||
tabD.setTextColor(Color.parseColor("#FFF"));
|
||||
break;
|
||||
case GEAR_P:
|
||||
tabP.setTextColor(Color.parseColor("#343c63"));
|
||||
tabR.setTextColor(Color.parseColor("#FFF"));
|
||||
tabN.setTextColor(Color.parseColor("#FFF"));
|
||||
tabD.setTextColor(Color.parseColor("#FFF"));
|
||||
break;
|
||||
case GEAR_R:
|
||||
tabR.setTextColor(Color.parseColor("#343c63"));
|
||||
tabP.setTextColor(Color.parseColor("#FFF"));
|
||||
tabN.setTextColor(Color.parseColor("#FFF"));
|
||||
tabD.setTextColor(Color.parseColor("#FFF"));
|
||||
break;
|
||||
case GEAR_N:
|
||||
tabN.setTextColor(Color.parseColor("#343c63"));
|
||||
tabR.setTextColor(Color.parseColor("#FFF"));
|
||||
tabP.setTextColor(Color.parseColor("#FFF"));
|
||||
tabD.setTextColor(Color.parseColor("#FFF"));
|
||||
break;
|
||||
case GEAR_D:
|
||||
tabD.setTextColor(selectColor);
|
||||
tabN.setTextColor(defaultColor);
|
||||
tabR.setTextColor(defaultColor);
|
||||
tabP.setTextColor(defaultColor);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
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.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import chassis.Chassis;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 速度 加速度 档位 刹车 油门状态值
|
||||
* @since: 6/24/22
|
||||
*/
|
||||
public class TrafficDataView extends ConstraintLayout {
|
||||
private static final String TAG = "TrafficDataView";
|
||||
private TapPositionView tapPositionView;
|
||||
//圆弧颜色
|
||||
private int mArcColor;
|
||||
|
||||
public TrafficDataView(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public TrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView(context);
|
||||
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
|
||||
}
|
||||
|
||||
public TrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public TrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
private void initView(@NonNull Context context) {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this);
|
||||
} else {
|
||||
}
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this);
|
||||
tapPositionView = findViewById(R.id.traffic_position);
|
||||
}
|
||||
|
||||
private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() {
|
||||
|
||||
/**
|
||||
* 车辆转向灯
|
||||
* @param lightSwitch
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
|
||||
Log.d(TAG, "车辆转向灯:" + lightSwitch.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 刹车灯
|
||||
* @param brakeLight
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotBrakeLightData(boolean brakeLight) {
|
||||
Log.d(TAG, "刹车灯:" + String.valueOf(brakeLight));
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
* @param steering
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
Log.d(TAG, "steering原始值====" + String.valueOf(steering));
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
float steeringValue = steering;
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "steering忽略小数点后====" + String.valueOf((int) steeringValue));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 档位
|
||||
* @param gear
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "司机屏档位" + gear.toString());
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGearForDriverPanel(gear);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDataException(long timestamp) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 设置弧形颜色
|
||||
*
|
||||
* @param value 颜色值
|
||||
*/
|
||||
public void setArcColor(int value) {
|
||||
mArcColor = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置数据
|
||||
*
|
||||
* @param value 当前绘制的值
|
||||
*/
|
||||
public void setValues(int value) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 车速过快
|
||||
*/
|
||||
public void showWithSpeedValue(int newSpeed){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
android:layout_height="@dimen/dp_320"
|
||||
android:background="@drawable/traffic_data_back">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/speedImage"
|
||||
android:layout_width="@dimen/dp_270"
|
||||
android:layout_height="@dimen/dp_270"
|
||||
android:layout_marginLeft="@dimen/dp_46"
|
||||
android:background="@drawable/traffic_data_speed"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/speedTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="80px"
|
||||
android:text="0"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/dp_70"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speedImage"
|
||||
app:layout_constraintRight_toRightOf="@+id/speedImage"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/kmTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_176"
|
||||
android:text="KM/H"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speedImage"
|
||||
app:layout_constraintRight_toRightOf="@+id/speedImage"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView
|
||||
android:id="@+id/traffic_position"
|
||||
android:layout_width="@dimen/dp_220"
|
||||
app:defaultColor="@color/text_color_343c63"
|
||||
app:selectColor="#FFF"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
android:layout_marginRight="@dimen/dp_80"
|
||||
app:layout_constraintLeft_toRightOf="@+id/speedImage"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/brakeStatus"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_68"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_174"
|
||||
android:layout_marginBottom="@dimen/dp_57"
|
||||
android:src="@drawable/traffic_data_empty"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/speedImage"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/speedAccTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginLeft="@dimen/dp_42"
|
||||
android:layout_marginTop="@dimen/dp_190"
|
||||
android:text="a: "
|
||||
android:textAlignment="center"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/brakeStatus"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -6,4 +6,5 @@
|
||||
<color name="notice_check_dialog_bg_color">#E63B4577</color>
|
||||
<color name="notice_traffic_line">#555C7E</color>
|
||||
<color name="notice_dialog_back">#3B4577</color>
|
||||
<color name="text_color_343c63">#343C63</color>
|
||||
</resources>
|
||||
@@ -49,4 +49,8 @@
|
||||
<attr name="progress" format="integer" /> <!--圆环进度-->
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TapPositionView">
|
||||
<attr name="defaultColor" format="color"/> <!--档位默认色值-->
|
||||
<attr name="selectColor" format="color"/> <!--当前档位色值-->
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
@@ -60,4 +60,5 @@
|
||||
<color name="hmi_light_blue_alpha_00">#D945D3FF</color>
|
||||
<color name="hmi_light_blue_alpha_ff">#D93261B6</color>
|
||||
<color name="hmi_clear_00">#00FFFFFF</color>
|
||||
<color name="text_color_343c63">#343C63</color>
|
||||
</resources>
|
||||
@@ -131,16 +131,16 @@ public class AMapCustomView
|
||||
sList.add(mStartLatlng);
|
||||
eList.add(mEndLatlng);
|
||||
//测试代码:路线指定路径328线路
|
||||
mWayPointList.add(new NaviLatLng(39.968847, 116.406952));
|
||||
mWayPointList.add(new NaviLatLng(39.969058, 116.407346));
|
||||
mWayPointList.add(new NaviLatLng(39.968955, 116.401767));
|
||||
mWayPointList.add(new NaviLatLng(39.968626, 116.394938));
|
||||
mWayPointList.add(new NaviLatLng(39.968433, 116.388725));
|
||||
mWayPointList.add(new NaviLatLng(39.968542, 116.383775));
|
||||
mWayPointList.add(new NaviLatLng(40.037808, 116.342539));
|
||||
mWayPointList.add(new NaviLatLng(40.037239, 116.337172));
|
||||
mWayPointList.add(new NaviLatLng(40.035897, 116.329582));
|
||||
mWayPointList.add(new NaviLatLng(40.036396, 116.322166));
|
||||
// mWayPointList.add(new NaviLatLng(39.968847, 116.406952));
|
||||
// mWayPointList.add(new NaviLatLng(39.969058, 116.407346));
|
||||
// mWayPointList.add(new NaviLatLng(39.968955, 116.401767));
|
||||
// mWayPointList.add(new NaviLatLng(39.968626, 116.394938));
|
||||
// mWayPointList.add(new NaviLatLng(39.968433, 116.388725));
|
||||
// mWayPointList.add(new NaviLatLng(39.968542, 116.383775));
|
||||
// mWayPointList.add(new NaviLatLng(40.037808, 116.342539));
|
||||
// mWayPointList.add(new NaviLatLng(40.037239, 116.337172));
|
||||
// mWayPointList.add(new NaviLatLng(40.035897, 116.329582));
|
||||
// mWayPointList.add(new NaviLatLng(40.036396, 116.322166));
|
||||
|
||||
//顺义国展路线
|
||||
// mWayPointList.add(new NaviLatLng(40.097621,116.526495));
|
||||
@@ -243,7 +243,7 @@ public class AMapCustomView
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from) {
|
||||
|
||||
Log.d(TAG, "高精定位onLocationChanged" + location.toString());
|
||||
}
|
||||
|
||||
private void removeLocation(Location latLng) {
|
||||
|
||||
@@ -3,8 +3,13 @@
|
||||
<dimen name="dp_12">12px</dimen>
|
||||
<dimen name="dp_20">20px</dimen>
|
||||
<dimen name="dp_22">22px</dimen>
|
||||
<dimen name="dp_43">43px</dimen>
|
||||
<dimen name="dp_57">57px</dimen>
|
||||
<dimen name="dp_72">72px</dimen>
|
||||
<dimen name="dp_88">88px</dimen>
|
||||
<dimen name="module_v2n_tip_text_margin_right">26px</dimen>
|
||||
<dimen name="warning_distance_right">30px</dimen>
|
||||
<dimen name="dp_270">270px</dimen>
|
||||
<dimen name="dp_320">320px</dimen>
|
||||
<dimen name="dp_630">630px</dimen>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user