Merge remote-tracking branch 'origin/dev_minibus-d_230425_3.2.0' into dev_minibus-d_230425_3.2.0

This commit is contained in:
yangyakun
2023-05-08 11:24:02 +08:00
352 changed files with 10421 additions and 2209 deletions

View File

@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

View File

@@ -1,6 +1,6 @@
package com.mogo.och.bus.passenger;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import android.content.Context;
@@ -69,7 +69,7 @@ public class MogoOCHBusPassenger implements IMogoOCH {
* 进入鹰眼模式,设置手势缩放地图失效
*/
private void stepIntoVrMode() {
CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "进入vr模式" );
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "进入vr模式" );
CallerMoGoUiSettingManager.INSTANCE.stepInDayMode();//白天模式 状态栏字体颜色变黑
}

View File

@@ -46,6 +46,18 @@ public class BusPassengerRoutesResult {
return runningDur;
}
public String csvFileUrl = ""; //轨迹文件下载的cos url默认“”
public String csvFileMd5 = ""; //轨迹文件md5默认“”
public String txtFileUrl = ""; //打点文件下载的cos url默认“”
public String txtFileMd5 = ""; //轨迹文件md5默认“”
public long contrailSaveTime; //上传轨迹完成时间戳ms用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
public String carModel = ""; //[optional] 车型号如红旗H9默认“”暂不加入校验逻辑、用于人工排查问题
public String csvFileUrlDPQP = ""; //轨迹文件下载的cos url默认“”
public String csvFileMd5DPQP = ""; //轨迹文件md5默认“”
public String txtFileUrlDPQP = ""; //打点文件下载的cos url默认“”
public String txtFileMd5DPQP = ""; //轨迹文件md5默认“”
public long contrailSaveTimeDPQP; //上传轨迹完成时间戳ms用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
@Override
public String toString() {
return "BusPassengerRoutesResult{" +
@@ -56,6 +68,18 @@ public class BusPassengerRoutesResult {
", description='" + description + '\'' +
", status=" + status +
", runningDur='" + runningDur + '\'' +
", taskTime=" + taskTime +
", csvFileUrl='" + csvFileUrl + '\'' +
", csvFileMd5='" + csvFileMd5 + '\'' +
", txtFileUrl='" + txtFileUrl + '\'' +
", txtFileMd5='" + txtFileMd5 + '\'' +
", contrailSaveTime=" + contrailSaveTime +
", carModel='" + carModel + '\'' +
", csvFileUrlDPQP='" + csvFileUrlDPQP + '\'' +
", csvFileMd5DPQP='" + csvFileMd5DPQP + '\'' +
", txtFileUrlDPQP='" + txtFileUrlDPQP + '\'' +
", txtFileMd5DPQP='" + txtFileMd5DPQP + '\'' +
", contrailSaveTimeDPQP=" + contrailSaveTimeDPQP +
'}';
}

View File

@@ -21,6 +21,7 @@ import com.mogo.commons.module.intent.IntentManager;
import com.mogo.commons.module.status.IMogoStatusChangedListener;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.module.status.StatusDescriptor;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
@@ -64,6 +65,7 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
import com.mogo.och.common.module.utils.PinYinUtil;
import com.mogo.och.common.module.utils.DateTimeUtil;
import org.jetbrains.annotations.NotNull;
@@ -107,7 +109,7 @@ public class BusPassengerModel {
List<BusPassengerStation> mStations = new ArrayList<>();
private int mNextStationIndex = 0;// 要到达站的index
private List<MogoLocation> mTwoStationsRouts = new ArrayList<>();
private final List<MogoLocation> mTwoStationsRouts = new ArrayList<>();
private int mPreRouteIndex = 0;
private int mWipePreIndex = 0;
@@ -233,21 +235,24 @@ public class BusPassengerModel {
mStations.addAll(stations);
for (int i = 0; i< stations.size(); i++){
BusPassengerStation station = stations.get(i);
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){ //离站
mRouteLineInfoCallback.updateStationsInfo(stations,i+1,false);
if(mNextStationIndex != i+1){
mTwoStationsRouts.clear();
startRemainRouteInfo();
}
mNextStationIndex = i+1;
updateAutopilotControlParameters(result,i);
return;
}else if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){
}else if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){ //到站
if (i == 0){
startOrStopRouteAndWipe(false);
}
mPreRouteIndex = 0;
startOrStopCalculateRouteInfo(false);
mRouteLineInfoCallback.updateStationsInfo(stations,i,true);
clearAutopilotControlParameters();
return;
}
}
@@ -256,6 +261,58 @@ public class BusPassengerModel {
}
private void updateAutopilotControlParameters(BusPassengerRoutesResult busRoutesResult,
int leaveIndex) {
AutopilotControlParameters parameters = initAutopilotControlParameters(busRoutesResult,leaveIndex);
if (null == parameters) {
CallerLogger.INSTANCE.e(M_BUS_P + TAG, "AutopilotControlParameters is empty.");
return;
}
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "AutopilotControlParameters is update.");
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(parameters);
}
private void clearAutopilotControlParameters() {
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "AutopilotControlParameters is clear.");
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(null);
}
private AutopilotControlParameters initAutopilotControlParameters(BusPassengerRoutesResult busRoutesResult,
int leaveIndex) {
if (busRoutesResult.getSites() == null){ return null ;}
List<BusPassengerStation> stations = busRoutesResult.getSites();
if (leaveIndex + 1 > stations.size() - 1) {
CallerLogger.INSTANCE.e(M_BUS_P + TAG, "行程日志-mismatch condition1.");
return null;
}
BusPassengerStation currentStation = stations.get(leaveIndex);
BusPassengerStation nextStation = stations.get(leaveIndex + 1);
AutopilotControlParameters parameters = new AutopilotControlParameters();
parameters.routeID = busRoutesResult.getLineId();
parameters.routeName = busRoutesResult.getName();
parameters.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName());
parameters.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName());
parameters.startLatLon = new AutopilotControlParameters
.AutoPilotLonLat(currentStation.getLat(), currentStation.getLon());
parameters.endLatLon = new AutopilotControlParameters
.AutoPilotLonLat(nextStation.getLat(), nextStation.getLon());
parameters.vehicleType = 10;
if (parameters.autoPilotLine == null) {
parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
busRoutesResult.getLineId(),
busRoutesResult.csvFileUrl, busRoutesResult.csvFileMd5,
busRoutesResult.txtFileUrl, busRoutesResult.txtFileMd5,
busRoutesResult.contrailSaveTime, busRoutesResult.carModel,
busRoutesResult.csvFileUrlDPQP, busRoutesResult.csvFileMd5DPQP,
busRoutesResult.txtFileUrlDPQP, busRoutesResult.txtFileMd5DPQP,
busRoutesResult.contrailSaveTimeDPQP);
}
return parameters;
}
public void release() {
releaseListeners();
startOrStopCalculateRouteInfo(false);

View File

@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

View File

@@ -21,7 +21,6 @@ import androidx.constraintlayout.widget.Group;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
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;
@@ -29,17 +28,14 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
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.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.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.listener.MogoMapListenerHandler;
import com.mogo.map.uicontroller.IMogoMapUIController;
@@ -77,7 +73,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
protected TextView tvArrived;
protected RelativeLayout mSettingBtn;
protected RelativeLayout mBadcaseBtn;
protected RelativeLayout mAICollectBtn;
private FrameLayout flStationPanelContainer;
private MapBizView mapBizView;
private Group groupTestPanel;
@@ -147,18 +142,12 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
CallerVisualAngleManager.INSTANCE.updateLongSightLevel(false);
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
CallerVisualAngleManager.INSTANCE.updateLongSightLevel(true);
if (FunctionBuildConfig.isRomaMode) {
controller.setRomaMode(1);
} else {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
}
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
@@ -222,21 +211,17 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
}
mAICollectBtn = findViewById(R.id.module_mogo_och_ai_collet_rl);
if (mAICollectBtn != null) {
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
}
//消息盒子
viewDriverMsgBoxButton = findViewById(R.id.viewDriverMsgBoxButton);
viewDriverMsgBoxList = findViewById(R.id.viewDriverMsgBoxList);
viewDriverMsgBoxBubble = findViewById(R.id.viewDriverMsgBoxBubble);
viewDriverMsgBoxButton.setClickListener(show -> {
if(show){
if (show) {
viewDriverMsgBoxList.setVisibility(View.VISIBLE);
viewDriverMsgBoxList.notifyData();
viewDriverMsgBoxBubble.setVisibility(View.GONE);
viewDriverMsgBoxBubble.isShowData(false);
}else{
} else {
viewDriverMsgBoxList.setVisibility(View.GONE);
viewDriverMsgBoxBubble.setVisibility(View.VISIBLE);
viewDriverMsgBoxBubble.isShowData(true);

View File

@@ -169,7 +169,6 @@ public class BusPresenter extends Presenter<BusFragment>
@Override
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
if (autopilotStatusInfo == null) return;
int state = autopilotStatusInfo.getState();
// CallerLogger.INSTANCE.d(M_BUS + TAG, "onStateChange: " + state + "currentAutopilotStatus = " + currentAutopilotStatus);
switch (state) {

View File

@@ -12,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.mogo.och.bus.R
import com.mogo.och.bus.bean.BusQueryLinesResponse
import com.mogo.och.bus.ui.adapter.SwitchLineAdapter.SwitchLineViewHolder
import java.lang.Exception
import kotlin.text.StringBuilder
/**

View File

@@ -9,7 +9,7 @@
<com.mogo.eagle.core.function.view.MapBizView
android:id="@+id/mapBizView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
@@ -39,7 +39,7 @@
<!--浓雾预警动画-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XFogEventView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
@@ -299,6 +299,12 @@
android:src="@drawable/icon_bad_case" />
</RelativeLayout>
<com.mogo.eagle.core.function.hmi.ui.widget.RomaView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_badcase_rl"/>
<RelativeLayout
android:id="@+id/module_mogo_och_ai_collet_rl"
android:layout_width="@dimen/dp_172"
@@ -411,7 +417,6 @@
android:layout_marginBottom="30dp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

View File

@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

View File

@@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.alibaba.arouter'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion

View File

@@ -85,7 +85,7 @@ public class OCHBorderShadowLayout extends LinearLayout {
public OCHBorderShadowLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.setLayerType(LAYER_TYPE_SOFTWARE, null);//取消硬件加速
// this.setLayerType(LAYER_TYPE_SOFTWARE, null);//取消硬件加速
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ShadowLayout);
shadowColor = typedArray.getColor(R.styleable.ShadowLayout_shadowColor, Color.BLUE);
blurRadius = typedArray.getDimension(R.styleable.ShadowLayout_blurRadius, SHADOW_DEFAULT_BLUR_RADIUS);

View File

@@ -214,7 +214,7 @@ class AdvanceVideoView @JvmOverloads constructor(
Logger.d(ImageVideoRotationView.TAG, "download-onProgress== $length")
}
override fun onFinished(url: String?, threadBean: ThreadBean?) {
override fun onFinished(url: String?, threadBean: ThreadBean?, localPath: String?) {
Logger.d(ImageVideoRotationView.TAG, "download-onFinished = $url")
if (url.equals(fileNetPath)) { //发现下载工具在断网又连网后,已完成的任务又都下载,跳转播放出现问题
//下载完成

View File

@@ -3,7 +3,6 @@ plugins {
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
id 'com.alibaba.arouter'
}
android {

View File

@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

View File

@@ -9,19 +9,25 @@ import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.widget.ContentLoadingProgressBar;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.multidisplay.TelematicConstant;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
import com.mogo.eagle.core.function.hmi.ui.widget.DriverMonitorView;
import com.mogo.eagle.core.function.view.MapBizView;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.constant.BusPassengerConst;
import com.mogo.och.common.module.utils.NumberFormatUtil;
import com.mogo.och.common.module.wigets.OCHBorderShadowLayout;
/**
* Created on 2022/3/31
@@ -33,6 +39,22 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
private MapBizView mapBizView;
private FrameLayout flContainer;
private ContentLoadingProgressBar mProgressBar;
private View mLiveBtn;
private View mLiveShadow;
private DriverMonitorView driverMonitorView;
// 记录司机端是否打开了显示开关,
// 开关开启时,有视频流的车辆持续常驻展示视频流,无视频流的车辆不展示(无占位);
// 开关关闭时,无论是否有视频流,均不展示(无占位);开关默认关闭
private boolean driverToggle = false;
/**
* 改变自动驾驶状态
*
* @param status 2 - running 1 - enable 2 - disable
*/
private int mPrevAPStatus = -1;
@Override
protected int getLayoutId() {
@@ -47,7 +69,58 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
@Override
protected void initViews() {
mapBizView = findViewById(R.id.mapBizView);
mProgressBar = findViewById(R.id.bus_progress_bar);
mLiveShadow = findViewById(R.id.liveShadow);
driverMonitorView = findViewById(R.id.driverMonitorView);
mLiveBtn = findViewById(R.id.liveBtn);
driverMonitorView.setLiveListener(
() -> {
mLiveShadow.setVisibility(View.GONE);
}
);
mLiveBtn.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
mLiveShadow.setVisibility(mLiveShadow.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);
return true;
}
});
CallerTelematicListenerManager.INSTANCE.addListener(TAG, new IReceivedMsgListener() {
@Override
public void onReceivedServerSn(@Nullable String sn) {
}
@Override
public void onReceivedMsg(int type, @NonNull byte[] byteArray) {
if (type == TelematicConstant.CONTROL_PASSENGER_DRIVER_MONITOR) {
switch (new String(byteArray)) {
// 乘客端开启漫游
case "0": {
mLiveShadow.setVisibility(View.GONE);
break;
}
// 乘客端关闭漫游
case "1": {
mLiveShadow.setVisibility(View.VISIBLE);
break;
}
}
}
}
});
showRouteFragment();
// mCurrentArriveStation.setOnLongClickListener(new View.OnLongClickListener() {
// @Override
// public boolean onLongClick(View v) {
// showOverviewFragment();
// return false;
// }
// });
}
@Override

View File

@@ -219,7 +219,7 @@ public class BusPassengerMapDirectionView
addRouteColorList();
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "mLinePointsLatLng.size() = " +mLineStationLatLng.size()
+" mCoordinatesLatLng.size()= " + mCoordinatesLatLng.size());
if (mLineStationLatLng.size() >= 2 && mCoordinatesLatLng.size() > 2) {
if (mLineStationLatLng.size() >= 2 && mCoordinatesLatLng.size() >= 2) {
//设置线段纹理
PolylineOptions polylineOptions = new PolylineOptions();
polylineOptions.addAll(mCoordinatesLatLng);

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="MissingDefaultResource">
<item android:drawable="@drawable/iv_roma_bus_passenger_press_bg" android:state_focused="true" android:state_pressed="true" />
<item android:drawable="@drawable/iv_roma_bus_passenger_press_bg" android:state_focused="false" android:state_pressed="true" />
<item android:drawable="@drawable/iv_roma_bus_passenger_press_bg" android:state_selected="true" />
<item android:drawable="@drawable/iv_roma_bus_passenger_press_bg" android:state_focused="true" />
<item android:drawable="@drawable/iv_roma_bus_passenger_bg" />
</selector>

View File

@@ -1,6 +1,7 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -8,9 +9,9 @@
android:id="@+id/mapBizView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.och.bus.passenger.ui.BusPStatusBarView
android:layout_width="match_parent"
@@ -53,14 +54,30 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_100"
android:layout_marginBottom="@dimen/dp_110"
<com.mogo.eagle.core.function.hmi.ui.widget.RomaPassengerView
android:id="@+id/ivMoGoLogo"
android:layout_width="@dimen/dp_121"
android:layout_height="@dimen/dp_121"
android:layout_marginRight="@dimen/dp_751"
android:layout_marginBottom="@dimen/dp_59"
android:background="@drawable/roma_bus_p_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintRight_toRightOf="parent"
app:roma_close="@drawable/roma_bus_p_bg_selector"
app:roma_open="@drawable/iv_roma_bus_passenger_press_bg" />
<com.mogo.eagle.core.function.hmi.ui.widget.RomaPassengerView
android:id="@+id/ivMoGoLogo"
android:layout_width="@dimen/dp_121"
android:layout_height="@dimen/dp_121"
android:layout_marginRight="@dimen/dp_751"
android:layout_marginBottom="@dimen/dp_59"
android:background="@drawable/roma_bus_p_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:roma_close="@drawable/roma_bus_p_bg_selector"
app:roma_open="@drawable/iv_roma_bus_passenger_press_bg" />
<com.mogo.och.bus.passenger.ui.BusPassengerTrafficLightView
android:id="@+id/bus_p_traffic_light_view"
@@ -180,10 +197,17 @@
<com.mogo.eagle.core.function.hmi.ui.msgbox.BusPassengerMsgBoxBubbleView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toLeftOf="@+id/bus_p_route_panel"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginRight="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_100"
/>
android:layout_marginRight="@dimen/dp_40"
app:layout_constraintRight_toLeftOf="@+id/bus_p_route_panel"
app:layout_constraintTop_toTopOf="parent" />
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_100"
android:layout_marginBottom="@dimen/dp_110"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -94,6 +94,14 @@
app:layout_constraintLeft_toLeftOf="@+id/bus_p_speed_tv"
app:layout_constraintTop_toBottomOf="@+id/bus_p_speed_tv"/>
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
android:id="@+id/bus_p_traffic_light_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/auto_close"
app:layout_constraintLeft_toLeftOf="@+id/bus_p_speed_tv"
app:layout_constraintTop_toBottomOf="@+id/bus_p_speed_tv"/>
<com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_121"
android:layout_height="@dimen/dp_121"
android:background="@drawable/iv_roma_bus_passenger_bg"
tools:ignore="MissingDefaultResource">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -56,6 +56,9 @@
<dimen name="bus_p_curent_station_txt_size1">55dp</dimen>
<dimen name="bus_p_curent_station_tip_size1">40dp</dimen>
<dimen name="bus_p_live_station_panel_width">495dp</dimen>
<dimen name="bus_p_live_station_panel_height">309dp</dimen>
<dimen name="bus_p_curent_station_txt_width">584dp</dimen>
<dimen name="bus_p_station_txt_width">550dp</dimen>
</resources>

View File

@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

View File

@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

View File

@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

View File

@@ -11,6 +11,7 @@ import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
@@ -162,6 +163,7 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
if (TaxiPassengerOrderStatusEnum.Cancel.getCode() == order.orderStatus){
runOnUIThread(() -> {
mView.showOrHideServingOrderFragment(false,true);
mView.showOrHideOverMapViewFragment(false);
mView.showOrHideStartAutopilotView(false,false);
mView.showOrHidePressengerCheckPager(false, "",
"", "", "", "");
@@ -208,6 +210,9 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
mView.showOrHideArrivedEndLayout(false,"","");
mView.showOrHidePressengerCheckPager(false, "",
"", "", "", "");
if(TaxiPassengerOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){
CallerOrderListenerManager.INSTANCE.invokeOrderStatus(true);
}
});
return;
}
@@ -217,9 +222,11 @@ public class BaseTaxiPassengerPresenter extends Presenter<TaxiPassengerBaseFragm
TaxiPassengerModel.getInstance().recoverNaviInfo();
TaxiPassengerModel.getInstance().startOrStopRouteAndWipe(false);
TaxiPassengerGeocodeSearchModel.getInstance(getContext()).destroyGeocodeSearch();
mView.showOrHideOverMapViewFragment(false);
runOnUIThread(() -> {
mView.showOrHideServingOrderFragment(false,true);
mView.showOrHideArrivedEndLayout(true, order.endSiteAddr,order.orderNo);
CallerOrderListenerManager.INSTANCE.invokeOrderStatus(false);
});
clearV2XMarkers();
return;

View File

@@ -1,16 +1,33 @@
package com.mogo.och.taxi.passenger.ui
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.mogo.commons.mvp.BaseFragment
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
import com.mogo.eagle.core.function.view.OverMapView
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum
import com.mogo.och.taxi.passenger.model.TaxiPassengerModel
import com.mogo.och.taxi.passenger.ui.leftmenu.OverlayLeftViewUtils
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import java.util.concurrent.TimeUnit
class OverviewFragment : BaseFragment() {
private var overmapview: OverMapView?=null
private var lifeVisable2User = false
private var finalVisable2User = false
private var subscribe: Disposable?=null
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
@@ -23,24 +40,83 @@ class OverviewFragment : BaseFragment() {
viewGroup.removeView(overmapview)
}
overmapview?.onCreateView(savedInstanceState)
CallerLogger.d(SceneConstant.M_TAXI_P + TAG,"onCreateView")
statusChange(TaxiPassengerModel.getInstance().curOrderStatus)
return overmapview!!
}
override fun onResume() {
super.onResume()
overmapview?.onResume()
CallerLogger.d(SceneConstant.M_TAXI_P + TAG,"onResume")
lifeVisable2User = true
checkVisable()
}
override fun onPause() {
super.onPause()
overmapview?.onPause()
CallerLogger.d(SceneConstant.M_TAXI_P + TAG,"onPause")
lifeVisable2User = false
checkVisable()
}
private fun checkVisable() {
subscribe?.let {
if (!it.isDisposed) {
it.dispose()
}
}
subscribe = Observable.timer(500, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
if(lifeVisable2User){//展示
if(!finalVisable2User){
CallerLogger.d(SceneConstant.M_TAXI_P + TAG,"正在展示")
finalVisable2User = true
statusChange(TaxiPassengerModel.getInstance().curOrderStatus)
}
}else{//没有展示
if(finalVisable2User){
CallerLogger.d(SceneConstant.M_TAXI_P + TAG,"已经隐藏")
finalVisable2User = false
stopAndClear()
}
}
}
}
override fun onDestroy() {
super.onDestroy()
overmapview?.onDestroy()
CallerLogger.d(SceneConstant.M_TAXI_P + TAG,"onDestroy")
}
private fun statusChange(currentStatusEnum: TaxiPassengerOrderStatusEnum){
CallerLogger.d(SceneConstant.M_TAXI_P + TAG,"状态变更最新状态:$currentStatusEnum")
when (currentStatusEnum) {
TaxiPassengerOrderStatusEnum.OnTheWayToEnd -> {
CallerFuncBizManager.bizProvider.getAllV2XEvents()
}
TaxiPassengerOrderStatusEnum.ArriveAtEnd,TaxiPassengerOrderStatusEnum.JourneyCompleted,
TaxiPassengerOrderStatusEnum.Cancel -> {
// stop clear
stopAndClear()
}
else -> {}
}
}
private fun stopAndClear(){
CallerFuncBizManager.bizProvider.stopQueryV2XEvents()
UiThreadHandler.post({
overmapview?.clearV2XMarkers()
}, UiThreadHandler.MODE.QUEUE)
}
override fun getLayoutId(): Int {
return 0
}

View File

@@ -11,14 +11,13 @@ import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView;
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxButtonView;
import com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView;
@@ -52,7 +51,7 @@ import java.util.Objects;
* @author tongchenfei
*/
public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFragment, BaseTaxiPassengerPresenter>
implements IMogoMapListener, TaxiPassengerTaxiView, ITPClickStartAutopilotCallback{
implements IMogoMapListener, TaxiPassengerTaxiView, ITPClickStartAutopilotCallback {
public static final String TAG = "TaxiPassengerBaseFragment";
@@ -109,11 +108,11 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
viewPassengerMsgBoxBubble = findViewById(R.id.viewPassengerMsgBoxBubble);
viewPassengerMsgBoxList = findViewById(R.id.viewPassengerMsgBoxList);
viewPassengerMsgBoxButton.setClickListener(show -> {
if(show){
if (show) {
viewPassengerMsgBoxList.setVisibility(View.VISIBLE);
viewPassengerMsgBoxBubble.setVisibility(View.GONE);
viewPassengerMsgBoxBubble.isShowData(false);
}else{
} else {
viewPassengerMsgBoxList.setVisibility(View.GONE);
viewPassengerMsgBoxBubble.setVisibility(View.VISIBLE);
viewPassengerMsgBoxBubble.isShowData(true);
@@ -146,18 +145,12 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
CallerVisualAngleManager.INSTANCE.updateLongSightLevel(false);
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
CallerVisualAngleManager.INSTANCE.updateLongSightLevel(true);
if (FunctionBuildConfig.isRomaMode) {
controller.setRomaMode(1);
} else {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
}
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mMapswitchBtn.setImageResource(R.drawable.taxi_p_switch_map_long);
} else {
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
@@ -167,7 +160,7 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
//OverlayLeftViewUtils.INSTANCE.dismissOverlayView();
});
findViewById(R.id.iv_temp).setOnClickListener(view -> {
OverlayLeftViewUtils.INSTANCE.showOverlayView(getActivity(),0,true,-1,true);
OverlayLeftViewUtils.INSTANCE.showOverlayView(getActivity(), 0, true, -1, true);
//showOrHideArrivedEndLayout(true, "北京北京北京", "1527481606997577728");
//showOrHidePressengerCheckPager(true, "开始站点开", "开始站点开始站点开始", "2", "京A888888", "18811539480");
//OCHFloatWindowManager.getInstance().ShowFloatWindow(getContext());
@@ -364,21 +357,25 @@ public class TaxiPassengerBaseFragment extends MvpFragment<TaxiPassengerBaseFrag
if (overviewFragment.isHidden()) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.show(overviewFragment).commitAllowingStateLoss();
transaction.setMaxLifecycle(overviewFragment, Lifecycle.State.RESUMED);
return;
}
if (overviewFragment.isAdded()) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.show(overviewFragment).commitAllowingStateLoss();
transaction.setMaxLifecycle(overviewFragment, Lifecycle.State.RESUMED);
return;
}
transaction
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.add(R.id.fl_container_overview, overviewFragment)
.show(overviewFragment).commitAllowingStateLoss();
transaction.setMaxLifecycle(overviewFragment, Lifecycle.State.RESUMED);
} else {
if (overviewFragment != null) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE)
.hide(overviewFragment).commitAllowingStateLoss();
transaction.setMaxLifecycle(overviewFragment, Lifecycle.State.STARTED);
}
}
}

View File

@@ -220,7 +220,7 @@ public class TaxiPassengerMapDirectionView
if (mEndMarker != null) {
mEndMarker.setVisible(false);
}
if (mCoordinatesLatLng.size() > 2) {
if (mCoordinatesLatLng.size() >= 2) {
// 设置开始结束Marker位置
LatLng startLatLng = mCoordinatesLatLng.get(0);
LatLng endLatLng = mCoordinatesLatLng.get(mCoordinatesLatLng.size() - 1);
@@ -241,7 +241,7 @@ public class TaxiPassengerMapDirectionView
addRouteColorList();
if (mCoordinatesLatLng.size() > 2) {
if (mCoordinatesLatLng.size() >= 2) {
//设置线段纹理
PolylineOptions polylineOptions = new PolylineOptions();
polylineOptions.addAll(mCoordinatesLatLng);

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="MissingDefaultResource">
<item android:drawable="@drawable/iv_roma_taxi_passenger_press_bg" android:state_focused="true" android:state_pressed="true" />
<item android:drawable="@drawable/iv_roma_taxi_passenger_press_bg" android:state_focused="false" android:state_pressed="true" />
<item android:drawable="@drawable/iv_roma_taxi_passenger_press_bg" android:state_selected="true" />
<item android:drawable="@drawable/iv_roma_taxi_passenger_press_bg" android:state_focused="true" />
<item android:drawable="@drawable/iv_roma_passenger_bg" />
</selector>

View File

@@ -54,6 +54,17 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.widget.RomaPassengerView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="@dimen/dp_557"
android:layout_marginBottom="50dp"
android:background="@drawable/roma_taxi_p_bg_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:roma_close="@drawable/roma_taxi_p_bg_selector"
app:roma_open="@drawable/iv_roma_taxi_passenger_press_bg"
app:layout_constraintLeft_toLeftOf="parent" />
<ImageView
android:id="@+id/module_och_taxi_swich_map_iv"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
@@ -176,7 +187,7 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.och.taxi.passenger.ui.TaxiPassengerTrafficLightView
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
android:id="@+id/traffic_light_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@drawable/iv_roma_passenger_bg"
tools:ignore="MissingDefaultResource">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,5 +1,4 @@
apply plugin: 'com.android.library'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

View File

@@ -129,7 +129,7 @@ public class TaxiModel {
private volatile boolean isRestartAutopilot = false;
private List<MogoLocation> mRoutePoints = new ArrayList<>();
private final List<MogoLocation> mRoutePoints = new ArrayList<>();
private int mPreRouteIndex = 0;
private double mLongitude, mLatitude;
@@ -1160,7 +1160,6 @@ public class TaxiModel {
@Override
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
if (autopilotStatusInfo == null) return;
int state = autopilotStatusInfo.getState();
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
if (state != mPrevAPStatus && mADASStatusCallback != null){
@@ -1400,7 +1399,9 @@ public class TaxiModel {
, "---lastSumLength: " + lastSumLength + "----lastTime : " + lastTime
+ " thread = "+ Thread.currentThread().getName());
mCurrentOCHOrder.decreaseTravelDistance(lastSumLength);
if (mCurrentOCHOrder != null){
mCurrentOCHOrder.decreaseTravelDistance(lastSumLength);
}
if (mOrderStatusCallback != null) {
mOrderStatusCallback.onCurrentOrderDistToEndChanged((long) lastSumLength, (long) lastTime);
}

View File

@@ -13,6 +13,7 @@ import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean;
@@ -243,7 +244,11 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus){
TaxiModel.getInstance().startDynamicCalculateRouteInfo();
runOnUIThread(() -> mView.updateCtvAutopilotStatusTag(true));
runOnUIThread(() -> {
mView.updateCtvAutopilotStatusTag(true);
CallerOrderListenerManager.INSTANCE.invokeOrderStatus(true);
});
}
if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus ||
@@ -251,6 +256,11 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
TaxiOrderStatusEnum.JourneyCompleted.getCode() == order.orderStatus){
TaxiModel.getInstance().startOrStopCalculateRouteInfo(false);
TaxiModel.getInstance().setRouteLineMarker(null);
runOnUIThread(() -> {
if(TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus){
CallerOrderListenerManager.INSTANCE.invokeOrderStatus(false);
}
});
}
runOnUIThread(() -> mView.updateCurrentOrderStatusChanged(order));
}

View File

@@ -25,7 +25,6 @@ import androidx.fragment.app.FragmentTransaction;
import com.mogo.commons.mvp.IView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
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;
@@ -33,7 +32,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
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.DriverMsgBoxListView;
@@ -43,7 +41,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
@@ -84,7 +81,6 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
private ImageView mCloseNaviIcon;
protected RelativeLayout mSettingBtn;
protected LinearLayout mBadcaseBtn;
protected LinearLayout mAICollectBtn;
//消息盒子
protected DriverMsgBoxButtonView driverMsgBoxButtonView;
protected DriverMsgBoxListView viewDriverMsgBoxList;
@@ -197,18 +193,12 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
CallerVisualAngleManager.INSTANCE.updateLongSightLevel(false);
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
CallerVisualAngleManager.INSTANCE.updateLongSightLevel(true);
if (FunctionBuildConfig.isRomaMode) {
controller.setRomaMode(1);
} else {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
}
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
} else {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
@@ -233,11 +223,6 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
}
mAICollectBtn = findViewById(R.id.module_och_taxi_ai_collect_ll);
if (mAICollectBtn != null) {
CallerDevaToolsManager.INSTANCE.initAiCollect(mAICollectBtn);
}
panelView = LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
ctvAutopilotStatusRL.setOnClickListener(new OnPreventFastClickListener() {
@Override
@@ -298,12 +283,12 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
});
driverMsgBoxButtonView.setClickListener(show -> {
if(show){
if (show) {
viewDriverMsgBoxList.setVisibility(View.VISIBLE);
viewDriverMsgBoxList.notifyData();
viewDriverMsgBoxBubble.setVisibility(View.GONE);
viewDriverMsgBoxBubble.isShowData(false);
}else{
} else {
viewDriverMsgBoxList.setVisibility(View.GONE);
viewDriverMsgBoxBubble.setVisibility(View.VISIBLE);
viewDriverMsgBoxBubble.isShowData(true);

View File

@@ -9,7 +9,7 @@
<com.mogo.eagle.core.function.view.MapBizView
android:id="@+id/mapBizView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
@@ -21,36 +21,34 @@
<LinearLayout
android:id="@+id/module_mogo_och_speed_layout"
android:layout_height="@dimen/taxi_tab_speed_width_height"
android:layout_width="@dimen/taxi_tab_speed_width_height"
android:layout_height="@dimen/taxi_tab_speed_width_height"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:elevation="@dimen/dp_10"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="@drawable/taxi_speed_bg"
android:elevation="@dimen/dp_10"
android:gravity="center_horizontal"
android:orientation="vertical"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/module_mogo_och_speed_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:paddingTop="6dp"
android:textColor="#FFFFFF"
android:id="@+id/module_mogo_och_speed_tv"
android:text="0"
android:textSize="74dp"
/>
android:textColor="#FFFFFF"
android:textSize="74dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-10dp"
android:text="KM/H"
android:textColor="#FFFFFF"
android:layout_marginTop="-10dp"
android:textSize="32dp"
/>
android:textSize="32dp" />
</LinearLayout>
@@ -58,8 +56,8 @@
android:id="@+id/module_mogo_och_autopilot_status"
android:layout_width="@dimen/taxi_tab_autoaploit_width"
android:layout_height="@dimen/taxi_tab_autoaploit_height"
android:layout_marginTop="20dp"
android:layout_marginLeft="220dp"
android:layout_marginTop="20dp"
android:background="@drawable/taxi_autopilot_bg_selector"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
@@ -71,24 +69,24 @@
<ImageView
android:id="@+id/module_och_autopilot_iv"
android:layout_marginTop="@dimen/dp_56"
android:layout_width="@dimen/dp_65"
android:layout_height="@dimen/dp_65"
android:layout_gravity="center_horizontal"
android:layout_centerHorizontal="true"
android:src="@drawable/taxi_ic_autopilot"
/>
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_56"
android:src="@drawable/taxi_ic_autopilot" />
<TextView
android:id="@+id/module_och_autopilot_tv"
android:layout_width="match_parent"
android:layout_height="180dp"
android:elevation="@dimen/dp_12"
android:layout_below="@+id/module_och_autopilot_iv"
android:layout_marginTop="@dimen/dp_10"
android:elevation="@dimen/dp_12"
android:gravity="center_horizontal"
android:text="开启自动驾驶"
android:textColor="@color/taxi_autopilot_text_color_normal"
android:textSize="32dp"
android:layout_below="@+id/module_och_autopilot_iv"
tools:visibility="visible" />
</RelativeLayout>
@@ -96,7 +94,7 @@
<!--浓雾预警动画-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XFogEventView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
@@ -111,11 +109,11 @@
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
android:layout_width="@dimen/module_vip_width"
android:layout_height="@dimen/module_vip_height"
android:visibility="gone"
android:layout_marginStart="@dimen/dp_640"
android:layout_marginTop="@dimen/dp_80"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent" />
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
@@ -161,7 +159,7 @@
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
tools:visibility="visible"/>
tools:visibility="visible" />
<!--消息盒子选择入口-->
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
@@ -171,8 +169,7 @@
android:layout_marginTop="15dp"
android:layout_marginEnd="25dp"
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
/>
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
<!--消息盒子打开视图-->
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
android:id="@+id/viewDriverMsgBoxList"
@@ -226,10 +223,10 @@
android:id="@+id/module_mogo_och_station_panel_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="244dp"
android:background="@android:color/transparent"
app:layout_constraintLeft_toLeftOf="@+id/module_mogo_och_speed_layout"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="244dp"
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call"
tools:visibility="visible" />
@@ -254,16 +251,17 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<TextView
android:id="@+id/taxi_driver_role_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/taxi_diver_role_size"
android:textColor="@color/taxi_role_text_color"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_20"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
android:textColor="@color/taxi_role_text_color"
android:textSize="@dimen/taxi_diver_role_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<RelativeLayout
android:id="@+id/module_och_taxi_setting_layout"
@@ -308,12 +306,13 @@
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="40dp"
android:background="@drawable/taxi_operation_status_bg_selector"
android:layout_marginBottom="@dimen/module_mogo_och_margin_bottom"
android:background="@drawable/taxi_operation_status_bg_selector"
android:elevation="@dimen/dp_10"
android:gravity="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_swich_map_layout">
<ImageView
android:layout_width="@dimen/dp_70"
android:layout_height="@dimen/dp_70"
@@ -321,6 +320,12 @@
android:background="@drawable/bad_case_selector_och"/>
</LinearLayout>
<com.mogo.eagle.core.function.hmi.ui.widget.RomaView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/module_och_taxi_badcase_ll"/>
<LinearLayout
android:id="@+id/module_och_taxi_ai_collect_ll"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
@@ -368,6 +373,7 @@
android:visibility="gone"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotEnable" />
<Button
android:id="@+id/btnAutopilotmanco"
android:layout_width="wrap_content"
@@ -385,24 +391,26 @@
android:visibility="gone"
app:constraint_referenced_ids="btnAutopilotDisable,btnAutopilotEnable,btnAutopilotRunning,btnAutopilotmanco"
tools:visibility="gone" />
<FrameLayout
android:id="@+id/module_mogo_och_navi_panel_container"
android:layout_width="600dp"
android:layout_height="600dp"
android:layout_marginRight="38dp"
android:layout_marginBottom="38dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<ImageView
android:id="@+id/taxi_close_navi_icon"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_marginBottom="534dp"
android:layout_marginRight="532dp"
android:layout_marginBottom="534dp"
android:src="@drawable/taxi_close_navi_icon"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:src="@drawable/taxi_close_navi_icon"/>
app:layout_constraintRight_toRightOf="parent" />
<com.mogo.eagle.core.function.smp.view.SmallMapView
android:id="@+id/smallMapView"
@@ -412,7 +420,6 @@
android:layout_marginBottom="30dp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -4,136 +4,11 @@ import groovy.json.JsonSlurper
import java.text.SimpleDateFormat
apply plugin: 'com.android.application'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'android-aspectjx'
apply plugin: 'bugly'
def isReleaseBuild = isReleaseBuild()
//apply ByteX宿主
if (!isAndroidTestBuild()) {
apply plugin: 'bytex'
ByteX {
enable true
enableInDebug true
logLevel "DEBUG"
}
}
if (!isAndroidTestBuild()) {
apply plugin: 'bytex.notsticky.service'
}
if (!isAndroidTestBuild()) {
apply plugin: 'chain.log.hook'
hooklog {
enableTraceToServer false
enableLoggerToLocal true
}
apply plugin: 'biz.config.hook'
}
if (!isAndroidTestBuild()) {
apply plugin: 'apm-plugin'
}
if (!isAndroidTestBuild()) {
apply plugin: 'bytex.threadOpt'
thread_opt {
enable false
enableInDebug false
logLevel "DEBUG"
}
}
if (!isAndroidTestBuild()) {
apply plugin: 'LancetX'
LancetX {
enable true
enableInDebug true
weaveGroup {
anr_fix {
enable true
}
crash_fix {
enable true
}
memory_leak {
enable true
}
textview_opt {
enable true
}
}
}
}
if (!isReleaseBuild) {
apply plugin: 'bytex.matrix'
matrix {
trace {
enable = true //if you don't want to use trace canary, set false
baseMethodMapFile = "${project.buildDir}/matrix_output/customMethodMapping.txt"
blackListFile = "${project.projectDir}/matrixTrace/blackMethodList.txt"
}
logLevel = "D"
}
}
//if (!isAndroidTestBuild()) {
// /**
// * 方便使用systrace工具在工程侧打点便于分析工程侧性能问题
// */
// apply plugin: 'bytex.systrace'
// systrace {
// /**
// * 交付时要关闭,会有性能损耗
// */
// enable false
// enableInDebug false
// /**
// * - 是否使用[Trace.beginAsyncSection(String, int)/Trace.endAsyncSection(String, int)]进行打点
// * - 默认使用[Trace.beginSection(String)/Trace.endSection()]进行打点
// */
// isTraceAsync false
// /**
// * - 是否在运行时只针对主线程打点,其它线程不打
// */
// isOnlyMainThread false
//
// /**
// * - 是否忽略对类的静态构造方法打点
// * - 默认不忽略
// */
// isIgnoreClinitMethod false
//
// /**
// * - 是否忽略对类中的简单方法打点
// * 简单方法定义:
// * - 空方法
// * - get/set 方法
// * - 单独的方法,方法体内没有调用其它方法
// * - 默认不忽略
// */
// isIgnoreSampleMethod false
//
// /**
// * - 针对特定类集合,配置打点白名单,在此集合中的类中的所有方法不打点
// * - 支持正则表达式
// */
// whiteListForClass = []
//
// /**
// * - 针对特定包名集合,配置打点白名单,所有类以此包名为前缀的类不打点
// * - 支持正则表达式
// */
// whiteListForPackage = []
// }
//}
apply from: rootProject.file('gradle/bytex/bytex.gradle')
bugly {
appId = 'ac71228f85' // 注册时分配的App ID
@@ -318,11 +193,6 @@ repositories {
}
}
aspectjx {
include "com.mogo.eagle.core.function.chat"
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation rootProject.ext.dependencies.androidxappcompat
@@ -334,6 +204,7 @@ dependencies {
implementation rootProject.ext.dependencies.android_start_up
implementation rootProject.ext.dependencies.lancetx_runtime
implementation rootProject.ext.dependencies.mogocustommap
implementation project(':core:function-impl:mogo-core-function-startup')
implementation project(':core:function-impl:mogo-core-function-devatools')
implementation project(':core:function-impl:mogo-core-function-datacenter')
@@ -341,6 +212,7 @@ dependencies {
implementation project(':core:function-impl:mogo-core-function-hmi')
implementation project(':core:function-impl:mogo-core-function-map')
implementation project(':core:function-impl:mogo-core-function-chat')
implementation project(':core:function-impl:mogo-core-function-patch')
implementation project(':foudations:mogo-commons')
implementation project(':core:mogo-core-function-call')
implementation project(':core:mogo-core-utils')
@@ -359,37 +231,8 @@ dependencies {
androidTestImplementation rootProject.ext.dependencies.androidx_runner
androidTestImplementation rootProject.ext.dependencies.androidx_espresso_core
androidTestImplementation rootProject.ext.dependencies.localbroadcastmanager
// if (isAndroidTestBuild()) {
// implementation "com.mogo.thread.opt:lib:${THREAD_OPT_VERSION}"
// }
}
if (!isAndroidTestBuild()) {
ApmPlugin {
// 是否进行插桩
enable true
// 是否在Debug包插桩默认不插桩
enableInDebug true
// DEBUG("DEBUG"), INFO("INFO"), WARN("WARN"), ERROR("ERROR");
// INFO 级别Log会汇总所有被插桩处理的类供查看路径 app/build/ByteX/ApmPlugin
logLevel "DEBUG"
// 启动分析开关监控App启动耗时需要同时开启pageLoadSwitch
startSwitch = true
// 页面响应开关监控Activity的生命周期耗时
pageLoadSwitch = true
// 网络监控开关监控okhttp3的网络请求
okHttp3Switch = false
// 白名单下的包进行插桩,需要填写要插装类所在的包名,支持前缀配置
whiteList = [
"com.mogo"
]
// 黑名单包下类不进行插桩,可以配置包名和类名,没有可以填空
blackList = [
]
}
}
android.applicationVariants.all { variant ->
def buildTime = new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+08:00"))
@@ -444,26 +287,7 @@ static def getBuildTime() {
return "\"${buildTime}\""
}
boolean isAndroidTestBuild() {
for (String s : gradle.startParameter.taskNames) {
if (s.contains("AndroidTest")) {
return true
}
}
return false
}
boolean isReleaseBuild() {
for (String s : gradle.startParameter.taskNames) {
if (s.contains("Release") | s.contains("release")) {
return true
}
}
return false
}
Object readFileToJson(env){
Object readFileToJson(env) {
try {
// 加载config.json 文件
File file = new File("${rootDir}/app/config/urlConfig.json")

View File

@@ -54,4 +54,4 @@
"passenger": ["ochJL","ochM2"]
}
}
}
}

View File

@@ -25,9 +25,6 @@ project.android.productFlavors {
// ②车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '2'
// ③是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'true'
// ④GPS数据提供源 0-Android系统1-工控机2-OBU
buildConfigField 'int', 'GPS_PROVIDER', "1"

View File

@@ -25,9 +25,6 @@ project.android.productFlavors {
// ②车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '2'
// ③是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'true'
// ④GPS数据提供源 0-Android系统1-工控机2-OBU
buildConfigField 'int', 'GPS_PROVIDER', "1"

View File

@@ -24,8 +24,6 @@ project.android.productFlavors {
// ②车机类型主要用于区分自研车机还是别人家的车机自研车机类型为0
buildConfigField 'int', 'CAR_MACHINE_TYPE', '2'
// ③是否需要实时上报坐标
buildConfigField 'boolean', 'IS_NEED_UPLOAD_COORDINATES_IN_TIME', 'true'
// ④GPS数据提供源 0-Android系统1-工控机2-OBU
buildConfigField 'int', 'GPS_PROVIDER', "1"

Binary file not shown.

View File

@@ -0,0 +1,88 @@
package com.mogo.functions.test
import android.util.*
import androidx.test.core.app.*
import androidx.test.ext.junit.runners.*
import androidx.test.filters.*
import androidx.test.platform.app.InstrumentationRegistry
import com.mogo.eagle.core.function.hmi.ui.*
import com.mogo.eagle.core.function.main.*
import com.mogo.eagle.core.utilcode.util.*
import kotlinx.coroutines.*
import org.junit.*
import org.junit.runner.*
import java.util.concurrent.*
import java.util.concurrent.TimeUnit.MILLISECONDS
import kotlin.Result
@RunWith(AndroidJUnit4::class)
@LargeTest
class ApkInstallerTest {
lateinit var launch: ActivityScenario<MainLauncherActivity>
@Before
fun before() {
launch = ActivityScenario.launch(MainLauncherActivity::class.java)
}
@Test
fun testInstall(): Unit = runBlocking {
Log.d("RWJ", "wait fragment show ...")
val f = ensureMoGoHmiFragmentShow()
Log.d("RWJ", "fragment showed, delay 10s ...")
delay(10000)
Log.d("RWJ", "10s end, start install ...")
val context = InstrumentationRegistry.getInstrumentation().context
ApkInstaller.installApp(f.requireContext(), context.assets.open("190000013.apk")) { code, msg ->
Log.d("RWJ", "code: $code, msg: $msg")
}
Log.d("RWJ", "开始延时10分钟....")
delay(TimeUnit.MINUTES.toMillis(10))
Log.d("RWJ", "延时10分钟结束....")
}
@Test
fun testInstall2(): Unit = runBlocking {
Log.d("RWJ", "wait fragment show ...")
val f = ensureMoGoHmiFragmentShow()
Log.d("RWJ", "fragment showed, delay 10s ...")
delay(10000)
Log.d("RWJ", "10s end, start install ...")
val context = InstrumentationRegistry.getInstrumentation().context
ApkInstaller.installApp(f.requireContext(), context.assets.open("HelloActivity.zip")) { code, msg ->
Log.d("RWJ", "code: $code, msg: $msg")
}
Log.d("RWJ", "开始延时10分钟....")
delay(TimeUnit.MINUTES.toMillis(10))
Log.d("RWJ", "延时10分钟结束....")
}
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
launch.onActivity { itx ->
val executor = Executors.newSingleThreadScheduledExecutor()
executor.scheduleAtFixedRate({
var find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
while (find == null) {
find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
}
while (!find.isResumed) {
Thread.sleep(500)
}
it.resumeWith(Result.success(find))
try {
Thread.sleep(500)
executor.shutdownNow()
} catch (e: Throwable) {
e.printStackTrace()
}
}, 50, 500, MILLISECONDS)
}
}
}

View File

@@ -0,0 +1,89 @@
package com.mogo.functions.test
import androidx.test.core.app.*
import androidx.test.ext.junit.runners.*
import androidx.test.filters.*
import com.mogo.eagle.core.function.hmi.ui.*
import com.mogo.eagle.core.function.main.*
import com.mogo.launcher.patch.*
import com.mogo.launcher.patch.utils.*
import kotlinx.coroutines.*
import org.junit.*
import org.junit.runner.*
import java.io.*
import java.util.concurrent.*
import java.util.concurrent.TimeUnit.MILLISECONDS
import kotlin.Result
@RunWith(AndroidJUnit4::class)
@LargeTest
class PatchUtilsTest {
lateinit var launch: ActivityScenario<MainLauncherActivity>
@Before
fun before() {
launch = ActivityScenario.launch(MainLauncherActivity::class.java)
}
@Test
fun testGeneratePatchAndMergeThenInstall() = runBlocking {
val f = ensureMoGoHmiFragmentShow()
withContext(Dispatchers.Default) {
val context = f.context ?: return@withContext
val oldApkPath = context.let {
it.packageManager.getPackageInfo(it.packageName, 0)?.applicationInfo?.sourceDir
} ?: return@withContext
val oldApk = File(oldApkPath)
if (!oldApk.exists()) {
throw AssertionError("old apk file is not exist.")
}
val oldApkTemp = File(context.getExternalFilesDir(null), "patches/old.apk")
if (oldApkTemp.exists()) {
oldApkTemp.delete()
}
oldApkTemp.parentFile?.takeIf { !it.exists() }?.also { it.mkdirs() }
oldApk.copyTo(oldApkTemp)
val patch = File(context.getExternalFilesDir(null), "patches/patch.zip")
if (!patch.exists()) {
throw AssertionError("patch file is not exist.")
}
val newApk = File(context.getExternalFilesDir(null), "patches/new.apk")
// PatchUtils.applyPatch(context, File(oldApkPath), patch, newApk)
// PatchUtils.install(context, newApk)
}
delay(TimeUnit.MINUTES.toMillis(1))
}
private suspend fun ensureMoGoHmiFragmentShow(): MoGoHmiFragment = suspendCancellableCoroutine {
launch.onActivity { itx ->
val executor = Executors.newSingleThreadScheduledExecutor()
executor.scheduleAtFixedRate({
var find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
while (find == null) {
find =
itx.supportFragmentManager.fragments.find { it is MoGoHmiFragment } as? MoGoHmiFragment
}
while (!find.isResumed) {
Thread.sleep(500)
}
it.resumeWith(Result.success(find))
try {
Thread.sleep(500)
executor.shutdownNow()
} catch (e: Throwable) {
e.printStackTrace()
}
}, 50, 500, MILLISECONDS)
}
}
}

View File

@@ -1,10 +1,15 @@
package com.mogo.launcher.lancet
import android.app.Activity
import android.os.*
import android.view.View
import androidx.annotation.*
import com.knightboost.lancet.api.*
import com.knightboost.lancet.api.Scope.ALL
import com.knightboost.lancet.api.annotations.*
import com.knightboost.lancet.api.annotations.Weaver
import com.mogo.eagle.core.utilcode.util.*
import kotlinx.coroutines.*
import kotlinx.coroutines.Runnable
@Keep
@@ -12,60 +17,72 @@ import kotlinx.coroutines.Runnable
@Group("anr_fix")
class ANRFix {
@Insert
@TargetClass("com.zhidao.cosupload.service.UploadService")
@TargetMethod(methodName = "addUploadPaths")
private fun fixAddUploadPathsANR() {
ThreadUtils.getIoPool().execute(ANRFixTask(This.get(), "addUploadPaths"))
}
companion object {
@Insert
@TargetClass("com.zhidao.cosupload.service.UploadService")
@TargetMethod(methodName = "upload")
private fun fixUploadANR(@ClassOf("com.zhidao.cosupload.model.CacheUploadIdData") data: Any?) {
ThreadUtils.getIoPool().execute(ANRFixTask2(This.get(), "upload", data))
}
@Insert
@TargetClass("com.zhidao.cosupload.manager.CosUploadManagerImpl")
@TargetMethod(methodName = "upload")
private fun fixCosUploadManagerImplANR(productLine: String?, paths: List<String>?, eventId: String?, @ClassOf("com.zhidao.cosupload.DbPriorityConfig") config: Any?) {
ThreadUtils.getIoPool().execute(ANRFixTask3(This.get(), "upload", productLine, paths, eventId, config))
}
}
class ANRFixTask(private val delegate: Any, private val methodName: String): Runnable {
override fun run() {
delegate.javaClass.declaredMethods.find {
it.name != methodName && it.name.contains(methodName)
}?.also {
it.isAccessible = true
it.invoke(delegate)
}
}
}
class ANRFixTask2(private val delegate: Any, private val methodName: String, private val p: Any?): Runnable {
override fun run() {
delegate.javaClass.declaredMethods.find {
it.name != methodName && it.name.contains(methodName)
}?.also {
it.isAccessible = true
it.invoke(delegate, p)
}
}
}
class ANRFixTask3(private val delegate: Any, private val methodName: String,private val productLine: String?, private val paths: List<String>?, private val eventId: String?, private val config: Any?): Runnable {
override fun run() {
delegate.javaClass.declaredMethods.find {
it.name != methodName && it.name.contains(methodName)
}?.also {
it.isAccessible = true
it.invoke(delegate, productLine, paths, eventId, config)
}
// @JvmStatic
// @TargetClass(value = "android.os.Handler", scope = ALL)
// @TargetMethod(methodName = "post")
// @ReplaceInvoke
// fun handlerPostProxy(handler: Handler, action: Runnable): Boolean {
// if (Looper.getMainLooper() != handler.looper) {
// return handler.post(action)
// }
// val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
// handler.removeMessages(what)
// val msg = Message.obtain(handler, action)
// msg.what = what
// return handler.sendMessage(msg)
// }
//
// @JvmStatic
// @TargetClass(value = "android.os.Handler", scope = ALL)
// @TargetMethod(methodName = "postDelayed")
// @ReplaceInvoke
// fun handlerPostDelayProxy(handler: Handler, action: Runnable, delayMillis: Long): Boolean {
// if (Looper.getMainLooper() != handler.looper) {
// return handler.postDelayed(action, delayMillis)
// }
// val what = ObjectHashCodeUtils.getHashCodeIfNeed(action)
// handler.removeMessages(what)
// val msg = Message.obtain(handler, action)
// msg.what = what
// return handler.sendMessageDelayed(msg, delayMillis)
// }
//
// @JvmStatic
// @TargetClass(value = "android.app.Activity", scope = ALL)
// @TargetMethod(methodName = "post")
// @ReplaceInvoke
// fun runOnUiThreadOfActivityProxy(activity: Activity, action: Runnable) {
// if (Looper.myLooper() != Looper.getMainLooper()) {
// UiThreadHandler.post(action)
// } else {
// activity.runOnUiThread(action)
// }
// }
//
// @JvmStatic
// @TargetClass(value = "android.view.View", scope = ALL)
// @TargetMethod(methodName = "post")
// @ReplaceInvoke
// fun postOfViewProxy(view: View, action: Runnable): Boolean {
// return if (Looper.myLooper() != Looper.getMainLooper()) {
// UiThreadHandler.post(action)
// } else {
// view.post(action)
// }
// }
//
// @JvmStatic
// @TargetClass(value = "android.view.View", scope = ALL)
// @TargetMethod(methodName = "postDelayed")
// @ReplaceInvoke
// fun postDelayedOfViewProxy(view: View, action: Runnable, delayMillis: Long): Boolean {
// return if (Looper.myLooper() != Looper.getMainLooper()) {
// UiThreadHandler.postDelayed(action, delayMillis)
// } else {
// view.postDelayed(action, delayMillis)
// }
// }
}
}

View File

@@ -25,7 +25,7 @@ import java.util.concurrent.ConcurrentHashMap
@Group("memory_leak")
class MemoryLeakFix {
@NameRegex("(com\\.mogo|com\\.zhidao|com\\.elegant|com\\.zhidaoauto|com\\.zhjt).*")
@NameRegex("(com\\.zhidao|com\\.elegant|com\\.zhidaoauto|com\\.zhjt|com\\.mogo(?!(\\.thread\\.ext|\\.launcher\\.lancet))).*")
@Insert(mayCreateSuper = true)
@ImplementedInterface("java.lang.Runnable", scope = LEAF)
@TargetMethod(methodName = "run")

View File

@@ -13,7 +13,7 @@ import com.knightboost.lancet.api.annotations.Weaver;
@Weaver
@Group("textview_opt")
public class TextViewSetTextOpt {
public class TextViewOpt {
@NameRegex("(com\\.mogo|com\\.zhidao|com\\.elegant|com\\.zhidaoauto|com\\.zhjt).*")
@TargetClass(value = "android.widget.TextView",scope = Scope.ALL)
@@ -33,7 +33,7 @@ public class TextViewSetTextOpt {
return;
}
CharSequence old = view.getText();
if (old != null && !old.equals(text)) {
if (old == null || !old.equals(text)) {
view.setText(text);
}
}

View File

@@ -49,6 +49,8 @@ object ConfigStartUp {
// 临时配置json
FunctionBuildConfig.tempConfig = BuildConfig.tempConfig
//是否支持Patch升级
FunctionBuildConfig.isSupportPatchUpgrade = BuildConfig.IS_SUPPORT_PATCH_UPGRADE
// // 这里影响当前Activity的身份信息多进程先保持与原来一样主进程为司机端:passenger 进程为乘客端 TODO 暂时不启用,仅做洱海交付,独立乘客屏+宣传视频
// if (ProcessUtils.getCurrentProcessName().contains(":passenger")) {
// if (AppIdentityModeUtils.isBus(BuildConfig.APP_IDENTITY_MODE)) {

View File

@@ -1,2 +1,2 @@
#Thu Mar 02 14:18:22 CST 2023
VERSION_CODE=2
#Fri Mar 31 13:39:14 CST 2023
VERSION_CODE=4

View File

@@ -45,6 +45,7 @@ public class DataDistribution {
private Future future;
private Pair<String, OnAdasClientListener> listener;
private volatile boolean isCutDown = true;//是否缩短日志显示
private int resId = R.id.rb_analysis;
private DataDistribution() {
queue = new LinkedBlockingQueue<>();
@@ -62,6 +63,10 @@ public class DataDistribution {
return INSTANCE;
}
public void setResId(int resId) {
this.resId = resId;
}
public void registerAdasClientListener(Pair<String, OnAdasClientListener> listener) {
this.listener = listener;
}
@@ -125,6 +130,9 @@ public class DataDistribution {
public final List<DataShow> listObuRsi = new ArrayList<>();
public final List<DataShow> listObuRsm = new ArrayList<>();
public final List<DataShow> listObuMap = new ArrayList<>();
public final List<DataShow> listV2nCongestionEvent = new ArrayList<>();
public final List<DataShow> listV2nGlobalPathEvents = new ArrayList<>();
public final List<DataShow> listGetParamResp = new ArrayList<>();
private long listTrajectorySize = 0;
private long listTrackedObjectsSize = 0;
@@ -153,7 +161,9 @@ public class DataDistribution {
private long listObuRsiSize = 0;
private long listObuRsmSize = 0;
private long listObuMapSize = 0;
private long listV2nCongestionEventSize = 0;
private long listV2nGlobalPathEventsSize = 0;
private long listGetParamRespSize = 0;
public void clearCount() {
listTrajectorySize = 1;
@@ -183,6 +193,9 @@ public class DataDistribution {
listObuRsiSize = 1;
listObuRsmSize = 1;
listObuMapSize = 1;
listV2nCongestionEventSize = 1;
listV2nGlobalPathEventsSize = 1;
listGetParamRespSize = 1;
}
public String cutDown(String str) {
@@ -193,7 +206,7 @@ public class DataDistribution {
}
private String onTransmit(String time, BaseInfo data) {
String temp = data.toString();
String temp = data.toString(resId);
String str = cutDown(temp);
if (data instanceof Trajectory) {
listTrajectory.add(0, new DataShow(listTrajectorySize++, time + str));
@@ -600,6 +613,30 @@ public class DataDistribution {
if (listener != null && Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeV2nCongestionEvent) {
listV2nCongestionEvent.add(0, new DataShow(listV2nCongestionEventSize++, time + str));
if (listV2nCongestionEvent.size() > LIST_SIZE) {
listV2nCongestionEvent.remove(listV2nCongestionEvent.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_V2N_CONGESTION_EVENT.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeV2nGlobalPathEvents) {
listV2nGlobalPathEvents.add(0, new DataShow(listV2nGlobalPathEventsSize++, time + str));
if (listV2nGlobalPathEvents.size() > LIST_SIZE) {
listV2nGlobalPathEvents.remove(listV2nGlobalPathEvents.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_V2N_GLOBAL_PATH_EVENTS.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeGetParamResp) {
listGetParamResp.add(0, new DataShow(listGetParamRespSize++, time + str));
if (listGetParamResp.size() > LIST_SIZE) {
listGetParamResp.remove(listGetParamResp.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_GET_PARAM_RESP.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof PerceptionTrafficLight) {
listPerceptionTrafficLight.add(0, new DataShow(listPerceptionTrafficLightSize++, time + str));
if (listPerceptionTrafficLight.size() > LIST_SIZE) {

View File

@@ -27,6 +27,7 @@ import com.mogo.support.obu.model.advance.VehControl;
import com.mogo.support.obu.model.advance.VehSize;
import com.mogo.support.obu.model.advance.VerticalLLV;
import com.mogo.support.obu.model.advance.WarningData;
import com.mogo.support.obu.model.result.BaseResult;
import com.zhidao.support.adas.high.common.ThreadPoolManager;
import com.zhidao.support.obu.ObuManager;
import com.zhidao.support.obu.OnObuListener;
@@ -294,6 +295,11 @@ public class ObuTest {
}
@Override
public void onObuCallResult(BaseResult result) {
}
@Override
public void onObuSystemStatus(MogoObuSystemStatusData data) {

View File

@@ -1,6 +1,7 @@
package com.zhidao.adas.client.adapter;
import android.annotation.SuppressLint;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -38,7 +39,8 @@ public class ConnectStatusAdapter extends BaseAdapter<IPCConnectState, ConnectSt
@Override
protected void onBindDataToItem(ViewHolder viewHolder, IPCConnectState data, int position) {
viewHolder.id.setText(String.format(Locale.getDefault(), POS, getItemCount() - position));
viewHolder.editText.setText(sdf.format(new Date(data.time)) + "\n" + data.status);
String str = "<font color='#999999'>" + sdf.format(new Date(data.time)) + "\n</font> <br />" + data.status;
viewHolder.editText.setText(Html.fromHtml(str));
viewHolder.editText.setTextColor(mContext.getResources().getColor(data.color));
}

View File

@@ -0,0 +1,68 @@
package com.zhidao.adas.client.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.bean.SendCmdOption;
import java.util.List;
/**
* @author song kenan
* @des
* @date 2021/8/13
*/
public class SendCmdAdapter extends RecyclerView.Adapter<SendCmdAdapter.ViewHolder> {
private final List<? extends SendCmdOption<?>> data;
private final OnItemClickListener listener;
public interface OnItemClickListener {
void onItemClick(SendCmdOption<?> data);
}
public SendCmdAdapter(List<? extends SendCmdOption<?>> data, OnItemClickListener listener) {
this.data = data;
this.listener = listener;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_info, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
SendCmdOption<?> option = data.get(position);
holder.title.setText(option.name);
}
@Override
public int getItemCount() {
return data == null ? 0 : data.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
TextView title;
public ViewHolder(View itemView) {
super(itemView);
title = itemView.findViewById(R.id.tv_info_title);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.onItemClick(data.get(getBindingAdapterPosition()));
}
});
}
}
}

View File

@@ -0,0 +1,35 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.GeneratedMessageV3;
import com.google.protobuf.TextFormat;
import com.zhidao.adas.client.R;
import com.zhidao.support.adas.high.bean.AdasParam;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class AdasParamReceiveData extends BaseInfo {
public final GeneratedMessageV3 bean;
private final AdasParam adasParam;
public AdasParamReceiveData(MessagePad.Header header, GeneratedMessageV3 bean, AdasParam adasParam, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
this.adasParam = adasParam;
}
public String toString(int resId) {
String srt = "";
if (resId == R.id.rb_analysis) {
srt = TextFormat.printer().shortDebugString(bean);
} else if (resId == R.id.rb_original) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray());
} else if (resId == R.id.rb_all) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().shortDebugString(bean);
}
return super.toString(resId) + srt + "\n原始数据翻译\n" + adasParam.toString();
}
}

View File

@@ -35,8 +35,7 @@ public abstract class BaseInfo {
this.header = null;
}
@Override
public String toString() {
public String toString(int resId) {
String str = "原始数据长度:" + len + "\tPayload数据长度" + payloadLen + '\n';
if (header != null) {
str += "Header:[" + "MessageID:" + header.getMsgID() +

View File

@@ -14,7 +14,7 @@ public class ErrorData extends BaseInfo {
}
@Override
public String toString() {
return super.toString() + status + "\n原始数据" + ByteUtil.byteArrToHex(bytes);
public String toString(int resId) {
return super.toString(resId) + status + "\n原始数据" + ByteUtil.byteArrToHex(bytes);
}
}

View File

@@ -2,6 +2,7 @@ package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.mogo.support.obu.ObuScene;
import com.zhidao.adas.client.R;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -18,8 +19,16 @@ public class ObuMap extends BaseInfo {
}
@Override
public String toString() {
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
public String toString(int resId) {
String srt = "";
if (resId == R.id.rb_analysis) {
srt = TextFormat.printer().escapingNonAscii(false).printToString(bean);
} else if (resId == R.id.rb_original) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray());
} else if (resId == R.id.rb_all) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
return super.toString(resId) + srt;
}
}

View File

@@ -2,6 +2,7 @@ package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.mogo.support.obu.ObuScene;
import com.zhidao.adas.client.R;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -18,8 +19,16 @@ public class ObuRsi extends BaseInfo {
}
@Override
public String toString() {
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
public String toString(int resId) {
String srt = "";
if (resId == R.id.rb_analysis) {
srt = TextFormat.printer().escapingNonAscii(false).printToString(bean);
} else if (resId == R.id.rb_original) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray());
} else if (resId == R.id.rb_all) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
return super.toString(resId) + srt;
}
}

View File

@@ -2,6 +2,7 @@ package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.mogo.support.obu.ObuScene;
import com.zhidao.adas.client.R;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -18,8 +19,16 @@ public class ObuRsm extends BaseInfo {
}
@Override
public String toString() {
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
public String toString(int resId) {
String srt = "";
if (resId == R.id.rb_analysis) {
srt = TextFormat.printer().escapingNonAscii(false).printToString(bean);
} else if (resId == R.id.rb_original) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray());
} else if (resId == R.id.rb_all) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
return super.toString(resId) + srt;
}
}

View File

@@ -2,6 +2,7 @@ package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.mogo.support.obu.ObuScene;
import com.zhidao.adas.client.R;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -18,8 +19,15 @@ public class ObuSpat extends BaseInfo {
}
@Override
public String toString() {
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
public String toString(int resId) {
String srt = "";
if (resId == R.id.rb_analysis) {
srt = TextFormat.printer().escapingNonAscii(false).printToString(bean);
} else if (resId == R.id.rb_original) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray());
} else if (resId == R.id.rb_all) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
return super.toString(resId) + srt;
}
}

View File

@@ -1,6 +1,7 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.zhidao.adas.client.R;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -18,8 +19,16 @@ public class PerceptionTrafficLight extends BaseInfo {
@Override
public String toString() {
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
public String toString(int resId) {
String srt = "";
if (resId == R.id.rb_analysis) {
srt = TextFormat.printer().escapingNonAscii(false).printToString(bean);
} else if (resId == R.id.rb_original) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray());
} else if (resId == R.id.rb_all) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
return super.toString(resId) + srt;
}
}

View File

@@ -16,8 +16,8 @@ public class ReceiveBytesData extends BaseInfo {
@Override
public String toString() {
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(data);
public String toString(int resId) {
return super.toString(resId) + "Payload原始数据" + ByteUtil.byteArrToHex(data);
}
}

View File

@@ -2,6 +2,7 @@ package com.zhidao.adas.client.bean;
import com.google.protobuf.GeneratedMessageV3;
import com.google.protobuf.TextFormat;
import com.zhidao.adas.client.R;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
@@ -17,9 +18,16 @@ public class ReceiveData extends BaseInfo {
}
@Override
public String toString() {
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
public String toString(int resId) {
String srt = "";
if (resId == R.id.rb_analysis) {
srt = TextFormat.printer().escapingNonAscii(false).printToString(bean);
} else if (resId == R.id.rb_original) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray());
} else if (resId == R.id.rb_all) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(bean.toByteArray()) + '\n' + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
return super.toString(resId) + srt;
}
}

View File

@@ -0,0 +1,125 @@
package com.zhidao.adas.client.bean;
import com.zhidao.adas.client.utils.Constants;
import java.util.ArrayList;
import java.util.List;
public class SendCmd<T> {
public final String name;
public final List<SendCmdOption<T>> value;
public SendCmd(String name, List<SendCmdOption<T>> value) {
this.name = name;
this.value = value;
}
//Planning命令
public static SendCmd<Integer> getSendToPlanning() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("靠边停车", SendCmdOption.TAG.PULL_OVER, 1));
cmds.add(new SendCmdOption<Integer>("重新起步", SendCmdOption.TAG.PULL_OVER, 2));
cmds.add(new SendCmdOption<Integer>("紧急停车", SendCmdOption.TAG.PULL_OVER, 3));
cmds.add(new SendCmdOption<Integer>("左变道", SendCmdOption.TAG.LANE_CHANGE, 1));
cmds.add(new SendCmdOption<Integer>("右变道", SendCmdOption.TAG.LANE_CHANGE, 2));
cmds.add(new SendCmdOption<Integer>("超车", SendCmdOption.TAG.LANE_CHANGE, 3));
cmds.add(new SendCmdOption<Integer>("恢复自动决策", SendCmdOption.TAG.LANE_CHANGE, 4));
return new SendCmd<Integer>(Constants.TITLE.SEND_PLANNING_CMD, cmds);
}
//演示模式开关
public static SendCmd<Integer> getSendDemoMode() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("打开", SendCmdOption.TAG.DEMO_MODE, 1));
cmds.add(new SendCmdOption<Integer>("关闭", SendCmdOption.TAG.DEMO_MODE, 0));
return new SendCmd<Integer>(Constants.TITLE.SEND_SET_DEMO_MODE_REQ, cmds);
}
//盲区开关
public static SendCmd<Boolean> getSendBlindArea() {
List<SendCmdOption<Boolean>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Boolean>("开启", SendCmdOption.TAG.BLIND_AREA, true));
cmds.add(new SendCmdOption<Boolean>("关闭", SendCmdOption.TAG.BLIND_AREA, false));
return new SendCmd<Boolean>(Constants.TITLE.SEND_BLIND_AREA, cmds);
}
//V2N数据到PnC
public static SendCmd<Boolean> getSendV2nToPnc() {
List<SendCmdOption<Boolean>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Boolean>("发送", SendCmdOption.TAG.V2N_TO_PNC, true));
cmds.add(new SendCmdOption<Boolean>("关闭", SendCmdOption.TAG.V2N_TO_PNC, false));
return new SendCmd<Boolean>(Constants.TITLE.SEND_V2N_TO_PNC, cmds);
}
//雨天模式开关
public static SendCmd<Integer> getSendRainMode() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("打开", SendCmdOption.TAG.RAIN_MODE, 1));
cmds.add(new SendCmdOption<Integer>("关闭", SendCmdOption.TAG.RAIN_MODE, 0));
return new SendCmd<Integer>(Constants.TITLE.SEND_SET_RAIN_MODE_REQ, cmds);
}
//绕障类功能开关
public static SendCmd<Integer> getSendDetouring() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("", SendCmdOption.TAG.DETOURING, 1));
cmds.add(new SendCmdOption<Integer>("", SendCmdOption.TAG.DETOURING, 0));
return new SendCmd<Integer>(Constants.TITLE.SEND_DETOURING, cmds);
}
//AEB
public static SendCmd<Integer> getSendAeb() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("", SendCmdOption.TAG.AEB, 1));
cmds.add(new SendCmdOption<Integer>("", SendCmdOption.TAG.AEB, 0));
return new SendCmd<Integer>(Constants.TITLE.SEND_AEB, cmds);
}
//限制绕障开关
public static SendCmd<Integer> getSendLaneChangeRestrainVaild() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("限制绕障", SendCmdOption.TAG.LANE_CHANGE_RESTRAIN_VALID, 1));
cmds.add(new SendCmdOption<Integer>("正常绕障", SendCmdOption.TAG.LANE_CHANGE_RESTRAIN_VALID, 0));
return new SendCmd<Integer>(Constants.TITLE.SEND_LANE_CHANGE_RESTRAIN_VALID, cmds);
}
//停车让行线前避让等待开关
public static SendCmd<Integer> getSendStopYieldVaild() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("停车让行线前需要避让等待", SendCmdOption.TAG.STOP_YIELD_VALID, 1));
cmds.add(new SendCmdOption<Integer>("停车让行线前无需避让等待", SendCmdOption.TAG.STOP_YIELD_VALID, 0));
return new SendCmd<Integer>(Constants.TITLE.SEND_STOP_YIELD_VALID, cmds);
}
//地图限速功能开关
public static SendCmd<Integer> getSendHadmapSpeedLimitVaild() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("使用地图限速功能", SendCmdOption.TAG.HADMAP_SPEED_LIMIT_VALID, 1));
cmds.add(new SendCmdOption<Integer>("不使用地图限速功能", SendCmdOption.TAG.HADMAP_SPEED_LIMIT_VALID, 0));
return new SendCmd<Integer>(Constants.TITLE.SEND_HADMAP_SPEED_LIMIT_VALID, cmds);
}
//环岛模式开关
public static SendCmd<Integer> getSendRampThetaValid() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("环岛模式", SendCmdOption.TAG.RAMP_THETA_VALID, 1));
cmds.add(new SendCmdOption<Integer>("普通模式", SendCmdOption.TAG.RAMP_THETA_VALID, 0));
return new SendCmd<Integer>(Constants.TITLE.SEND_RAMP_THETA_VALID, cmds);
}
//参数获取请求
public static SendCmd<Integer> getSendGetParamReq() {
List<SendCmdOption<Integer>> cmds = new ArrayList<>();
cmds.add(new SendCmdOption<Integer>("获取全部", com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.UNKNOWN, com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.UNKNOWN));
cmds.add(new SendCmdOption<Integer>("绕障类功能开关", com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.DETOURING, com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.DETOURING));
cmds.add(new SendCmdOption<Integer>("变道绕障的目标障碍物速度阈值", com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.DETOURING_SPEED, com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.DETOURING_SPEED));
cmds.add(new SendCmdOption<Integer>("AEB开关", com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.AEB, com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.AEB));
cmds.add(new SendCmdOption<Integer>("限制绕障开关", com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.LANE_CHANGE_RESTRAIN_VALID, com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.LANE_CHANGE_RESTRAIN_VALID));
cmds.add(new SendCmdOption<Integer>("停车让行线前避让等待开关", com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.STOP_YIELD_VALID, com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.STOP_YIELD_VALID));
cmds.add(new SendCmdOption<Integer>("地图限速功能开关", com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.HADMAP_SPEED_LIMIT_VALID, com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.HADMAP_SPEED_LIMIT_VALID));
cmds.add(new SendCmdOption<Integer>("环岛模式开关", com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.RAMP_THETA_VALID, com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.RAMP_THETA_VALID));
cmds.add(new SendCmdOption<Integer>("弱网减速停车策略开关", com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.WEAK_NET_SLOW_DOWN, com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.WEAK_NET_SLOW_DOWN));
return new SendCmd<Integer>(Constants.TITLE.SEND_GET_PARAM_REQ, cmds);
}
}

View File

@@ -0,0 +1,28 @@
package com.zhidao.adas.client.bean;
public class SendCmdOption<T> {
public interface TAG {
int PULL_OVER = 0;//Planning指令 靠边停车
int LANE_CHANGE = 1;//Planning指令 变道
int DEMO_MODE = 2;//演示模式
int BLIND_AREA = 3;//盲区数据开关
int RAIN_MODE = 4;//雨天模式
int DETOURING = 5;//绕障类功能
int V2N_TO_PNC = 6;//V2N数据到PnC
int AEB = 7;//AEB开关
int LANE_CHANGE_RESTRAIN_VALID = 8;//限制绕障开关
int STOP_YIELD_VALID = 9;//停车让行线前避让等待开关
int HADMAP_SPEED_LIMIT_VALID = 10;//地图限速功能开关
int RAMP_THETA_VALID = 11;//环岛模式开关
}
public final String name;
public final int tag;
public final T value;
public SendCmdOption(String name, int tag, T value) {
this.name = name;
this.tag = tag;
this.value = value;
}
}

View File

@@ -0,0 +1,68 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import com.zhidao.adas.client.R;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
import mogo.v2x.MogoV2X;
import mogo.v2x.RoadOverviewEvents;
public class V2nGlobalPathEventsReceiveData extends BaseInfo {
public final RoadOverviewEvents.RoadOverviewData roadOverview;
public final MogoV2X.RSI_PB construct;
public final MogoV2X.RSI_PB triangle;
public final MogoV2X.RSI_PB congestion;
public final MogoV2X.RSM_PB parkingViolation;
public V2nGlobalPathEventsReceiveData(MessagePad.Header header, RoadOverviewEvents.RoadOverviewData roadOverview, MogoV2X.RSI_PB construct, MogoV2X.RSI_PB triangle, MogoV2X.RSI_PB congestion, MogoV2X.RSM_PB parkingViolation, SimpleDateFormat sdf) {
super("接收", roadOverview.getSerializedSize(), header, sdf);
this.roadOverview = roadOverview;
this.construct = construct;
this.triangle = triangle;
this.congestion = congestion;
this.parkingViolation = parkingViolation;
}
@Override
public String toString(int resId) {
StringBuilder builder = new StringBuilder();
builder.append('\n').append("施工:");
if (construct != null) {
builder.append(TextFormat.printer().escapingNonAscii(false).printToString(construct));
} else {
builder.append("null");
}
builder.append('\n').append("三角牌:");
if (triangle != null) {
builder.append(TextFormat.printer().escapingNonAscii(false).printToString(triangle));
} else {
builder.append("null");
}
builder.append('\n').append("拥堵:");
if (congestion != null) {
builder.append(TextFormat.printer().escapingNonAscii(false).printToString(congestion));
} else {
builder.append("null");
}
builder.append('\n').append("违停:");
if (parkingViolation != null) {
builder.append(TextFormat.printer().escapingNonAscii(false).printToString(parkingViolation));
} else {
builder.append("null");
}
String srt = "";
if (resId == R.id.rb_analysis) {
srt = builder.toString();
} else if (resId == R.id.rb_original) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(roadOverview.toByteArray());
} else if (resId == R.id.rb_all) {
srt = "Payload原始数据" + ByteUtil.byteArrToHex(roadOverview.toByteArray()) + builder.toString();
}
return super.toString(resId) + srt;
}
}

View File

@@ -13,6 +13,7 @@ import android.view.WindowManager;
import android.widget.ImageView;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.ui.widget.SweeperVideoView;
import com.zhidao.adas.client.utils.SysBarUtil;
import com.zhidao.adas.client.utils.image.ImageLoaderManager;
@@ -38,10 +39,18 @@ public class BackCameraFloatWindow implements View.OnTouchListener {
private float mDownInScreenY;
private float mInScreenX;
private float mInScreenY;
private ImageView image_view;
private SweeperVideoView image_view;
private final boolean isFullScreen;
private final OnBackCameraFloatWindowListener onBackCameraFloatWindowListener;
public BackCameraFloatWindow(Activity context) {
public interface OnBackCameraFloatWindowListener {
void onClose();
}
public BackCameraFloatWindow(Activity context, boolean isFullScreen, OnBackCameraFloatWindowListener onBackCameraFloatWindowListener) {
this.mContext = context;
this.isFullScreen = isFullScreen;
this.onBackCameraFloatWindowListener = onBackCameraFloatWindowListener;
initHandler();
initFloatWindow();
}
@@ -53,6 +62,15 @@ public class BackCameraFloatWindow implements View.OnTouchListener {
return;
mFloatLayout = (View) inflater.inflate(R.layout.layout_back_camera, null);
image_view = mFloatLayout.findViewById(R.id.image_view);
ImageView btn_close = mFloatLayout.findViewById(R.id.btn_close);
btn_close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (onBackCameraFloatWindowListener != null) {
onBackCameraFloatWindowListener.onClose();
}
}
});
mFloatLayout.setOnTouchListener(this);
mWindowParams = new WindowManager.LayoutParams();
// mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
@@ -67,10 +85,13 @@ public class BackCameraFloatWindow implements View.OnTouchListener {
mWindowParams.format = PixelFormat.RGBA_8888;
mWindowParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
mWindowParams.gravity = Gravity.START | Gravity.TOP;
// mWindowParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
// mWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
mWindowParams.width = 1280;
mWindowParams.height = 720;
if (isFullScreen) {
mWindowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
mWindowParams.height = WindowManager.LayoutParams.MATCH_PARENT;
} else {
mWindowParams.width = 1280;
mWindowParams.height = 720;
}
// mWindowParams.alpha = 0.9F;
}
@@ -177,7 +198,7 @@ public class BackCameraFloatWindow implements View.OnTouchListener {
protected void handleMessage(Message msg) {
switch (msg.what) {
case 1:
ImageLoaderManager.loadByteImage(mContext, (byte[]) msg.obj, image_view);
image_view.onSweeperFutianBackCameraVideo((byte[]) msg.obj);
break;
}
}

View File

@@ -99,19 +99,20 @@ public class InfoFragment extends BaseFragment {
}
tvTitle.setGravity(Gravity.CENTER);
if (Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO.equals(title)) {
Button button_full_screen = view.findViewById(R.id.btn_render_full_screen);
Button button = view.findViewById(R.id.btn_render);
button.setVisibility(View.VISIBLE);
button_full_screen.setVisibility(View.VISIBLE);
button_full_screen.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showBackCameraFloatWindow(button_full_screen, true);
}
});
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (backCameraFloatWindow == null) {
backCameraFloatWindow = new BackCameraFloatWindow(getActivity());
final int[] location = new int[2];
button.getLocationOnScreen(location);
backCameraFloatWindow.showFloatWindow(location[1]);
} else {
hideFloatWindow();
}
showBackCameraFloatWindow(button, false);
}
});
}
@@ -154,6 +155,25 @@ public class InfoFragment extends BaseFragment {
rvInfo.setAdapter(adapter);
}
private void showBackCameraFloatWindow(View v, boolean isFullScreen) {
if (isFullScreen) {
hideFloatWindow();
}
if (backCameraFloatWindow == null) {
backCameraFloatWindow = new BackCameraFloatWindow(getActivity(), isFullScreen, new BackCameraFloatWindow.OnBackCameraFloatWindowListener() {
@Override
public void onClose() {
hideFloatWindow();
}
});
final int[] location = new int[2];
v.getLocationOnScreen(location);
backCameraFloatWindow.showFloatWindow(location[1]);
} else {
hideFloatWindow();
}
}
private void setData() {
if (Constants.TITLE.RECEIVE_GNSS_INFO.equals(title)) {
adapter.setData(DataDistribution.getInstance().listGnssInfo);
@@ -205,7 +225,13 @@ public class InfoFragment extends BaseFragment {
adapter.setData(DataDistribution.getInstance().listBackCameraVideo);
} else if (Constants.TITLE.RECEIVE_SWEEPER_TASK_INDEX_DATA.equals(title)) {
adapter.setData(DataDistribution.getInstance().listRoboSweeperTaskIndex);
} else {
} else if (Constants.TITLE.RECEIVE_V2N_CONGESTION_EVENT.equals(title)) {
adapter.setData(DataDistribution.getInstance().listV2nCongestionEvent);
} else if (Constants.TITLE.RECEIVE_V2N_GLOBAL_PATH_EVENTS.equals(title)) {
adapter.setData(DataDistribution.getInstance().listV2nGlobalPathEvents);
}else if (Constants.TITLE.RECEIVE_GET_PARAM_RESP.equals(title)) {
adapter.setData(DataDistribution.getInstance().listGetParamResp);
} else {
adapter.setData(DataDistribution.getInstance().listErrorData);
}
}
@@ -239,9 +265,11 @@ public class InfoFragment extends BaseFragment {
}
}
public void onBackCameraVideo(byte[] data) {
public boolean onBackCameraVideo(byte[] data) {
if (backCameraFloatWindow != null) {
backCameraFloatWindow.onBackCameraVideo(data);
return true;
}
return false;
}
}

View File

@@ -1,5 +1,6 @@
package com.zhidao.adas.client.ui;
import android.Manifest;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -17,6 +18,7 @@ import android.text.Html;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.util.Pair;
import android.view.View;
import android.view.WindowManager;
import android.widget.AdapterView;
@@ -32,6 +34,11 @@ import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.AppCompatButton;
import androidx.fragment.app.FragmentManager;
@@ -43,6 +50,7 @@ import androidx.recyclerview.widget.SimpleItemAnimator;
import com.google.protobuf.TextFormat;
import com.mogo.support.obu.ObuScene;
import com.mogo.support.obu.constants.MogoObuConstants;
import com.zhidao.adas.client.App;
import com.zhidao.adas.client.BuildConfig;
import com.zhidao.adas.client.DataDistribution;
@@ -51,6 +59,7 @@ import com.zhidao.adas.client.adapter.InfoTitleAdapter;
import com.zhidao.adas.client.base.BaseActivity;
import com.zhidao.adas.client.base.BaseAdapter;
import com.zhidao.adas.client.base.BaseFragment;
import com.zhidao.adas.client.bean.AdasParamReceiveData;
import com.zhidao.adas.client.bean.ErrorData;
import com.zhidao.adas.client.bean.IPCConnectState;
import com.zhidao.adas.client.bean.ObuMap;
@@ -60,11 +69,9 @@ import com.zhidao.adas.client.bean.ObuSpat;
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
import com.zhidao.adas.client.bean.ReceiveBytesData;
import com.zhidao.adas.client.bean.ReceiveData;
import com.zhidao.adas.client.bean.SendCmd;
import com.zhidao.adas.client.bean.SpecialVehicleBean;
import com.zhidao.adas.client.bean.StatusInfo;
import com.zhidao.adas.client.bean.TrackedObjects;
import com.zhidao.adas.client.bean.Trajectory;
import com.zhidao.adas.client.bean.Warn;
import com.zhidao.adas.client.bean.V2nGlobalPathEventsReceiveData;
import com.zhidao.adas.client.log.ConnectStatusSave;
import com.zhidao.adas.client.log.LogSave;
import com.zhidao.adas.client.other.permission.BackgrounderPermission;
@@ -72,19 +79,23 @@ import com.zhidao.adas.client.other.permission.OnAdasPermissionListener;
import com.zhidao.adas.client.other.router.RouterActivity;
import com.zhidao.adas.client.ui.special.SpecialVehicleDialog;
import com.zhidao.adas.client.utils.Constants;
import com.zhidao.adas.client.utils.PermissionUtil;
import com.zhidao.adas.client.utils.PreferencesUtils;
import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.AdasOptions;
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.bean.AdasParam;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.common.ProtocolStatus;
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
import com.zhidao.support.adas.high.common.RegexUtils;
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.net.Inet4Address;
import java.net.InetAddress;
@@ -97,12 +108,16 @@ import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
import bag_manager.BagManagerOuterClass;
import chassis.ChassisStatesOuterClass;
import chassis.VehicleStateOuterClass;
import function_state_management.FunctionStates;
import mogo.telematics.pad.MessagePad;
import mogo.v2x.MogoV2X;
import mogo.v2x.RoadOverviewEvents;
import mogo_msg.MogoReportMsg;
import perception.TrafficLightOuterClass;
import planning.RoboSweeperTaskIndexOuterClass;
@@ -126,7 +141,6 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
private TextView ipcIp;
private TextView background;
private TextView localIp;
private View line;
private View line1;
private RadioGroup connectionType;
private AppCompatButton connect;
@@ -140,8 +154,9 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
private RecyclerView infoBtn;
private RecyclerView infoFragment;
private TextView tvConnectState;
private RadioGroup rg_show_log;
private ScheduledExecutorService mExecutorServiceConfigTimer;
private PingFloatWindow pingFloatWindow;
private final List<String> titleFragmentData = new ArrayList<>();
private final List<String> titleBtnData = new ArrayList<>();
@@ -177,6 +192,9 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
PowerManager.WakeLock wakeLock;
WifiManager.WifiLock wifiLock;
private ActivityResultLauncher<Intent> intentActivityResultLauncher;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -194,6 +212,8 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
showIPCIP();
canDrawOverlays();
showHint();
initRegisterForActivityResult();
checkSavePermission();
// PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
// wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
// wakeLock.acquire();
@@ -209,6 +229,104 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
// wifiLock.acquire();
}
private void initRegisterForActivityResult() {
intentActivityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() {
@Override
public void onActivityResult(ActivityResult result) {
checkSavePermission();
// Intent data = result.getData();
// int resultCode = result.getResultCode();
//RESULT_OK
// Log.i("dddd", "resultCode=" + resultCode);
}
});
}
/**
* 权限检查
*/
private void checkSavePermission() {
//权限申请
String[] pgList = new String[]{Manifest.permission_group.STORAGE};
PermissionUtil.requestByGroupName(this, pgList, 10000, permissionsListener);
}
// 跳转到当前应用的设置界面
private void goToAppSetting() {
Uri uri = Uri.fromParts("package", getPackageName(), null);
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(uri);
intentActivityResultLauncher.launch(intent);
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
PermissionUtil.onRequestPermissionsResult(this, permissions, grantResults, permissionsListener, false);
}
//权限申请回调
private final PermissionUtil.OnPermissionsListener permissionsListener = new PermissionUtil.OnPermissionsListener() {
@Override
public void onPermissionsOwned() {
}
@Override
public void onPermissionsForbidden(String[] permissions, int[] grantResults, ArrayList<String> pmList) {
Set<String> nameSet = PermissionUtil.getPermissionsNameByChinese(pmList.toArray(new String[0]));
if (nameSet != null && nameSet.size() > 0) {
AlertDialog dialog = new AlertDialog.Builder(MainActivity.this)
.setTitle("警告")
.setMessage("请前往设置中手动授予" + nameSet.toString() + "权限,否则功能无法正常运行!")
.setNegativeButton("退出", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
})
.setPositiveButton("去设置", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
goToAppSetting();
}
})
.create();
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
}
}
@Override
public void onPermissionsDenied(String[] permissions, int[] grantResults, ArrayList<String> pmList) {
Set<String> nameSet = PermissionUtil.getPermissionsNameByChinese(pmList.toArray(new String[0]));
if (nameSet != null && nameSet.size() > 0) {
//重新请求权限
AlertDialog dialog = new AlertDialog.Builder(MainActivity.this)
.setTitle("提示")
.setMessage(nameSet.toString() + "权限为应用必要权限,请授权")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String[] sList = pmList.toArray(new String[0]);
//重新申请权限,通过权限名的方式申请多组权限
PermissionUtil.requestByPermissionName(MainActivity.this, sList, 10000, permissionsListener);
}
})
.create();
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
}
}
@Override
public void onPermissionsSucceed() {
}
};
private void showHint() {
boolean isShowHint = PreferencesUtils.getBoolean(this, "show_hint", true);
if (isShowHint) {
@@ -293,11 +411,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
private void initView() {
ImageView btn_ping = findViewById(R.id.btn_ping);
include_title = findViewById(R.id.include_title);
etIp = findViewById(R.id.et_ip);
background = findViewById(R.id.background);
role = findViewById(R.id.role);
line = findViewById(R.id.line);
line1 = findViewById(R.id.line1);
connectionType = findViewById(R.id.connection_type);
tvIp = findViewById(R.id.tv_ip);
@@ -315,6 +433,8 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
tvConnectState = findViewById(R.id.tv_connect_state);
ipcIp = findViewById(R.id.ipc_ip);
localIp = findViewById(R.id.local_ip);
rg_show_log = findViewById(R.id.rg_show_log);
findViewById(R.id.btn_router).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -324,12 +444,10 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
role.setSelected(BuildConfig.IS_CLIENT);
if (BuildConfig.IS_CLIENT) {
line.setVisibility(View.GONE);
line1.setVisibility(View.GONE);
connectionType.setVisibility(View.GONE);
etIp.setVisibility(View.GONE);
tvIp.setVisibility(View.GONE);
line.setVisibility(View.GONE);
connect.setVisibility(View.GONE);
disconnect.setVisibility(View.GONE);
cb_timeout.setVisibility(View.GONE);
@@ -591,6 +709,73 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
} else {
background.setVisibility(View.GONE);
}
btn_ping.setSelected(pingFloatWindow != null);
btn_ping.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (pingFloatWindow == null) {
Pair<String, Integer> pair = getInputIp();
if (pair != null) {
pingFloatWindow = new PingFloatWindow(MainActivity.this, pair.first);
int[] location = new int[2];
btn_ping.getLocationOnScreen(location);
int x = location[0];
int y = location[1];
pingFloatWindow.showFloatWindow(x + (btn_ping.getWidth() / 2) - 260, btn_ping.getY() + btn_ping.getHeight());
}
} else {
pingFloatWindow.hideFloatWindow();
pingFloatWindow = null;
}
btn_ping.setSelected(pingFloatWindow != null);
}
});
rg_show_log.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
DataDistribution.getInstance().setResId(checkedId);
}
});
}
private Pair<String, Integer> getInputIp() {
String address = etIp.getText().toString().trim();
if (TextUtils.isEmpty(address)) {
Toast.makeText(this, "请输入OBU地址", Toast.LENGTH_SHORT).show();
return null;
}
String tempIp;
int tempPort;
if (address.contains(":")) {
String[] temp = address.split(":");
if (temp.length < 2) {
Toast.makeText(this, "地址输入有误", Toast.LENGTH_SHORT).show();
return null;
}
tempIp = temp[0];
try {
tempPort = Integer.parseInt(temp[1]);
if (tempPort <= 0 || tempPort > 65535) {
Toast.makeText(this, "端口范围溢出", Toast.LENGTH_SHORT).show();
return null;
}
} catch (NumberFormatException e) {
e.printStackTrace();
Toast.makeText(this, "端口不合法", Toast.LENGTH_SHORT).show();
return null;
}
} else {
tempIp = address;
tempPort = MogoObuConstants.DEFAULT_OBU_PORT;
}
if (!RegexUtils.isIP(tempIp)) {
Toast.makeText(this, "地址不合法", Toast.LENGTH_SHORT).show();
return null;
}
return new Pair<>(tempIp, tempPort);
}
private void showListPopupWindow() {
@@ -625,6 +810,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
titleFragmentData.add(Constants.TITLE.RECEIVE_GNSS_INFO);
titleFragmentData.add(Constants.TITLE.RECEIVE_TRAJECTORY);
titleFragmentData.add(Constants.TITLE.RECEIVE_TRACKED_OBJECTS);
titleFragmentData.add(Constants.TITLE.RECEIVE_VEHICLE_STATE);
titleFragmentData.add(Constants.TITLE.RECEIVE_CHASSIS_STATES);
titleFragmentData.add(Constants.TITLE.RECEIVE_AUTOPILOT_STATE);
titleFragmentData.add(Constants.TITLE.RECEIVE_FUNCTION_STATES);
@@ -647,6 +833,9 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
titleFragmentData.add(Constants.TITLE.RECEIVE_OBU_MAP);
titleFragmentData.add(Constants.TITLE.RECEIVE_SWEEPER_TASK_INDEX_DATA);
titleFragmentData.add(Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO);
titleFragmentData.add(Constants.TITLE.RECEIVE_V2N_CONGESTION_EVENT);
titleFragmentData.add(Constants.TITLE.RECEIVE_V2N_GLOBAL_PATH_EVENTS);
titleFragmentData.add(Constants.TITLE.RECEIVE_GET_PARAM_RESP);
titleFragmentData.add(Constants.TITLE.RECEIVE_WARN);
titleFragmentData.add(Constants.TITLE.RECEIVE_ERROR);
@@ -662,18 +851,22 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
titleBtnData.add(Constants.TITLE.SEND_RECORD_DATA_END);
titleBtnData.add(Constants.TITLE.SEND_TRAFFIC_LIGHT_DATA);
titleBtnData.add(Constants.TITLE.SEND_SET_AUTOPILOT_SPEED_REQ);
titleBtnData.add(Constants.TITLE.SEND_SYSTEM_CMD_REQ_REBOOT);
titleBtnData.add(Constants.TITLE.SEND_RECORD_CAUSE);
titleBtnData.add(Constants.TITLE.SEND_SET_DEMO_MODE_REQ_OPEN);
titleBtnData.add(Constants.TITLE.SEND_SET_DEMO_MODE_REQ_CLOSE);
titleBtnData.add(Constants.TITLE.SEND_SET_RAIN_MODE_REQ_OPEN);
titleBtnData.add(Constants.TITLE.SEND_SET_RAIN_MODE_REQ_CLOSE);
titleBtnData.add(Constants.TITLE.SEND_DETOURING_OPEN);
titleBtnData.add(Constants.TITLE.SEND_DETOURING_CLOSE);
titleBtnData.add(Constants.TITLE.SEND_SET_DEMO_MODE_REQ);
titleBtnData.add(Constants.TITLE.SEND_SET_RAIN_MODE_REQ);
titleBtnData.add(Constants.TITLE.SEND_SYSTEM_CMD_REQ_REBOOT);
titleBtnData.add(Constants.TITLE.SEND_DETOURING);
titleBtnData.add(Constants.TITLE.SEND_DETOURING_SPEED);
titleBtnData.add(Constants.TITLE.SEND_AEB);
titleBtnData.add(Constants.TITLE.SEND_LANE_CHANGE_RESTRAIN_VALID);
titleBtnData.add(Constants.TITLE.SEND_STOP_YIELD_VALID);
titleBtnData.add(Constants.TITLE.SEND_HADMAP_SPEED_LIMIT_VALID);
titleBtnData.add(Constants.TITLE.SEND_RAMP_THETA_VALID);
titleBtnData.add(Constants.TITLE.SEND_TRIP_INFO);
titleBtnData.add(Constants.TITLE.SEND_PLANNING_CMD);
titleBtnData.add(Constants.TITLE.SEND_BLIND_AREA);
titleBtnData.add(Constants.TITLE.SEND_V2N_TO_PNC);
titleBtnData.add(Constants.TITLE.SEND_GET_PARAM_REQ);
}
private void initBtnRecyclerView() {
@@ -964,7 +1157,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
runOnUiThread(new Runnable() {
@Override
public void run() {
showToastCenter("收到车机基础信息请求:" + base.toString());
showToastCenter("收到车机基础信息请求:" + base.toString(R.id.rb_all));
}
});
}
@@ -1052,12 +1245,15 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
@Override
public void onBackCameraVideo(@NotNull MessagePad.Header header, @NotNull byte[] data) {
boolean isAddLog = true;
if (fromFragment instanceof InfoFragment) {
InfoFragment fragment = (InfoFragment) fromFragment;
fragment.onBackCameraVideo(data);
isAddLog = !fragment.onBackCameraVideo(data);
}
if (isAddLog) {
ReceiveBytesData base = new ReceiveBytesData(header, data, sdf);
DataDistribution.getInstance().addData(base);
}
ReceiveBytesData base = new ReceiveBytesData(header, data, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
@@ -1072,6 +1268,24 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
DataDistribution.getInstance().addData(base);
}
@Override
public void onV2nCongestionEvent(@NotNull MessagePad.Header header, @NotNull MogoV2X.RSI_PB rsi) {
ReceiveData base = new ReceiveData(header, rsi, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onV2nGlobalPathEvents(@NotNull MessagePad.Header header, @NotNull RoadOverviewEvents.RoadOverviewData roadOverview, @Nullable MogoV2X.RSI_PB construct, @Nullable MogoV2X.RSI_PB triangle, @Nullable MogoV2X.RSI_PB congestion, @Nullable MogoV2X.RSM_PB parkingViolation) {
V2nGlobalPathEventsReceiveData base = new V2nGlobalPathEventsReceiveData(header, roadOverview, construct, triangle, congestion, parkingViolation, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onGetParamResp(@NonNull MessagePad.Header header, @NonNull MessagePad.SetParamReq getParamResp, @NonNull AdasParam adasParam) {
AdasParamReceiveData base = new AdasParamReceiveData(header, getParamResp, adasParam, sdf);
DataDistribution.getInstance().addData(base);
}
private void initAdas() {
CupidLogUtils.e(TAG, "--->初始化");
AdasOptions options;
@@ -1450,33 +1664,45 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
//采集类型
AdasManager.getInstance().sendRecordCause(recordKey, recordFileName, "1", "变道有干扰");
break;
case Constants.TITLE.SEND_SET_DEMO_MODE_REQ_OPEN:
//打开演示模式
AdasManager.getInstance().sendDemoModeReq(1);
case Constants.TITLE.SEND_SET_DEMO_MODE_REQ:
//演示模式
new SendCmdDialog(this, SendCmd.getSendDemoMode()).show();
break;
case Constants.TITLE.SEND_SET_DEMO_MODE_REQ_CLOSE:
//关闭演示模式
AdasManager.getInstance().sendDemoModeReq(0);
break;
case Constants.TITLE.SEND_SET_RAIN_MODE_REQ_OPEN:
//打开雨天模式
AdasManager.getInstance().sendRainModeReq(1);
break;
case Constants.TITLE.SEND_SET_RAIN_MODE_REQ_CLOSE:
//关闭雨天模式
AdasManager.getInstance().sendRainModeReq(0);
case Constants.TITLE.SEND_SET_RAIN_MODE_REQ:
//雨天模式
new SendCmdDialog(this, SendCmd.getSendRainMode()).show();
break;
case Constants.TITLE.SEND_RECORD_DATA_CONFIG_RESP:
//数据采集配置
showRecordDataConfigRespDialog();
break;
case Constants.TITLE.SEND_DETOURING_OPEN:
//绕障类功能
AdasManager.getInstance().sendDetouring(1);
case Constants.TITLE.SEND_DETOURING:
//绕障类功能
new SendCmdDialog(this, SendCmd.getSendDetouring()).show();
break;
case Constants.TITLE.SEND_DETOURING_CLOSE:
//绕障类功能关
AdasManager.getInstance().sendDetouring(0);
case Constants.TITLE.SEND_AEB:
//AEB
new SendCmdDialog(this, SendCmd.getSendAeb()).show();
break;
case Constants.TITLE.SEND_LANE_CHANGE_RESTRAIN_VALID:
//限制绕障开关
new SendCmdDialog(this, SendCmd.getSendLaneChangeRestrainVaild()).show();
break;
case Constants.TITLE.SEND_STOP_YIELD_VALID:
//停车让行线前避让等待开关
new SendCmdDialog(this, SendCmd.getSendStopYieldVaild()).show();
break;
case Constants.TITLE.SEND_HADMAP_SPEED_LIMIT_VALID:
//地图限速功能开关
new SendCmdDialog(this, SendCmd.getSendHadmapSpeedLimitVaild()).show();
break;
case Constants.TITLE.SEND_RAMP_THETA_VALID:
//环岛模式开关
new SendCmdDialog(this, SendCmd.getSendRampThetaValid()).show();
break;
case Constants.TITLE.SEND_GET_PARAM_REQ:
//获取参数
new SendCmdDialog(this, SendCmd.getSendGetParamReq()).show();
break;
case Constants.TITLE.SEND_DETOURING_SPEED:
//绕障速度设置
@@ -1491,8 +1717,16 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
AdasManager.getInstance().sendTripInfoReq(5, "x22", "x23", "x24", false);
break;
case Constants.TITLE.SEND_PLANNING_CMD:
AdasManager.getInstance().sendPlanningCmd(1);
AdasManager.getInstance().sendPlanningCmd(2);
//Planning指令
new SendCmdDialog(this, SendCmd.getSendToPlanning()).show();
break;
case Constants.TITLE.SEND_BLIND_AREA:
//盲区数据开关
new SendCmdDialog(this, SendCmd.getSendBlindArea()).show();
break;
case Constants.TITLE.SEND_V2N_TO_PNC:
//V2N数据到PnC
new SendCmdDialog(this, SendCmd.getSendV2nToPnc()).show();
break;
}
}
@@ -1597,7 +1831,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
break;
case WHAT_RECEIVE_ERROR_DATA_SHOW:
title.setText(R.string.have_error_data);
title.setTextColor(getColor(android.R.color.holo_red_light));
title.setTextColor(getResources().getColor(android.R.color.holo_red_light));
title.setVisibility(View.VISIBLE);
getHandler().sendEmptyMessageDelayed(WHAT_RECEIVE_ERROR_DATA_HINT, 500);
break;
@@ -1606,7 +1840,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
break;
case WHAT_RECEIVE_ERROR_DATA_STOP:
title.setText(R.string.app_name);
title.setTextColor(getColor(R.color.colorWhile));
title.setTextColor(getResources().getColor(R.color.colorWhile));
title.setVisibility(View.VISIBLE);
errorDataUpdateTime = 0;
break;

View File

@@ -0,0 +1,310 @@
package com.zhidao.adas.client.ui;
import android.app.Activity;
import android.content.Context;
import android.graphics.PixelFormat;
import android.os.Handler;
import android.os.Message;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.support.obu.common.L;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.adapter.ConnectStatusAdapter;
import com.zhidao.adas.client.bean.IPCConnectState;
import com.zhidao.adas.client.utils.MyLinearLayoutManager;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
/**
* ping命令窗口
*/
public class PingFloatWindow implements View.OnTouchListener {
private static final String TAG = PingFloatWindow.class.getSimpleName();
private static final int WHAT_STATE = 8;
private final Activity mContext;
private WindowManager.LayoutParams mWindowParams;
private WindowManager mWindowManager;
private View mFloatLayout;
private float mInViewX;
private float mInViewY;
private float mDownInScreenX;
private float mDownInScreenY;
private float mInScreenX;
private float mInScreenY;
private RecyclerView rv_status;
private ConnectStatusAdapter adapter;
private final List<IPCConnectState> list = new ArrayList<>();
private final String ip;
private Timer timer;
public PingFloatWindow(Activity context, String ip) {
this.mContext = context;
this.ip = ip;
initFloatWindow();
initHandler();
pingTimer(true);
}
private void pingTimer(boolean isStart) {
if (isStart) {
if (timer == null) {
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
ping();
}
}, 100L, 2500L);//延时
}
} else {
if (timer != null) {
timer.cancel();
timer = null;
}
}
}
private void ping() {
Process p;
try {
//ping -c 3 -w 100 中 -c 是指ping的次数 3是指ping 3次 -w 100 以秒为单位指定超时间隔是指超时时间为100秒
p = Runtime.getRuntime().exec("ping -c 1 -w 2 " + ip);
int status = p.waitFor();
InputStream input = p.getInputStream();
BufferedReader in = new BufferedReader(new InputStreamReader(input));
StringBuilder builder = new StringBuilder();
String line;
while ((line = in.readLine()) != null) {
builder.append(line).append("\n");
}
String str = "IP:" + ip + " 是否可以连通:" + (status == 0 ? "" : "");
L.i(TAG, builder.toString() + str);
add(str, status == 0);
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
private void add(String str, boolean isConnect) {
int color;
if (isConnect) {
color = R.color.connect_status_connected;
} else {
color = R.color.connect_status_disconnected;
}
IPCConnectState status = new IPCConnectState(str, color);
list.add(0, status);
if (list.size() > 100) {
list.remove(list.size() - 1);
}
Message msg = Message.obtain();
msg.what = WHAT_STATE;
getHandler().sendMessage(msg);
}
public void refreshView() {
if (adapter != null) {
adapter.refreshView();
}
}
private void initRV() {
//创建默认的线性LayoutManager 横向的GridLayoutManager
MyLinearLayoutManager linearLayoutManager = new MyLinearLayoutManager(mContext);
// linearLayoutManager.setStackFromEnd(true);//列表再底部开始展示,反转后由上面开始展示
// linearLayoutManager.setReverseLayout(true);//列表翻转
rv_status.setLayoutManager(linearLayoutManager);
//如果可以确定每个item的高度是固定的设置这个选项可以提高性能
rv_status.setHasFixedSize(false);
rv_status.setNestedScrollingEnabled(false);
adapter = new ConnectStatusAdapter();
adapter.setHasStableIds(true);
rv_status.setAdapter(adapter);
adapter.setData(list);
}
private void initFloatWindow() {
LayoutInflater inflater = LayoutInflater.from(mContext);
if (inflater == null)
return;
mFloatLayout = (View) inflater.inflate(R.layout.layout_float, null);
rv_status = mFloatLayout.findViewById(R.id.rv_status);
mFloatLayout.setOnTouchListener(this);
initRV();
mWindowParams = new WindowManager.LayoutParams();
// mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
// if (Build.VERSION.SDK_INT >= 26) {//8.0新特性
// mWindowParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
// }else{
// mWindowParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
// }
mWindowManager = mContext.getWindowManager();
mWindowParams.format = PixelFormat.RGBA_8888;
mWindowParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
mWindowParams.gravity = Gravity.START | Gravity.TOP;
mWindowParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
mWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
mWindowParams.alpha = 0.9F;
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
return floatLayoutTouch(motionEvent);
}
private boolean floatLayoutTouch(MotionEvent motionEvent) {
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
// 获取相对View的坐标即以此View左上角为原点
mInViewX = motionEvent.getX();
mInViewY = motionEvent.getY();
// 获取相对屏幕的坐标,即以屏幕左上角为原点
mDownInScreenX = motionEvent.getRawX();
mDownInScreenY = motionEvent.getRawY() - getSysBarHeight(mContext);
mInScreenX = motionEvent.getRawX();
mInScreenY = motionEvent.getRawY() - getSysBarHeight(mContext);
break;
case MotionEvent.ACTION_MOVE:
// 更新浮动窗口位置参数
mInScreenX = motionEvent.getRawX();
mInScreenY = motionEvent.getRawY() - getSysBarHeight(mContext);
mWindowParams.x = (int) (mInScreenX - mInViewX);
mWindowParams.y = (int) (mInScreenY - mInViewY);
// 手指移动的时候更新小悬浮窗的位置
mWindowManager.updateViewLayout(mFloatLayout, mWindowParams);
break;
case MotionEvent.ACTION_UP:
// 如果手指离开屏幕时xDownInScreen和xInScreen相等且yDownInScreen和yInScreen相等则视为触发了单击事件。
if (mDownInScreenX == mInScreenX && mDownInScreenY == mInScreenY) {
}
break;
}
return true;
}
public void showFloatWindow(float x, float y) {
if (mFloatLayout.getParent() == null) {
// DisplayMetrics metrics = new DisplayMetrics();
// 默认固定位置,靠屏幕右边缘的中间
// mWindowManager.getDefaultDisplay().getMetrics(metrics);
mWindowParams.x = (int) x;
mWindowParams.y = (int) (y);
mWindowManager.addView(mFloatLayout, mWindowParams);
}
}
public void hideFloatWindow() {
pingTimer(false);
if (getHandler() != null) {
getHandler().removeCallbacksAndMessages(null);
}
if (mFloatLayout.getParent() != null)
mWindowManager.removeView(mFloatLayout);
}
public void setFloatLayoutAlpha(boolean alpha) {
if (alpha)
mFloatLayout.setAlpha((float) 0.5);
else
mFloatLayout.setAlpha(1);
}
private int sbar = -1;
// 获取系统状态栏高度
public int getSysBarHeight(Context contex) {
if (sbar == -1) {
Class<?> c;
Object obj;
Field field;
int x;
sbar = 0;
try {
c = Class.forName("com.android.internal.R$dimen");
obj = c.newInstance();
field = c.getField("status_bar_height");
x = Integer.parseInt(field.get(obj).toString());
sbar = contex.getResources().getDimensionPixelSize(x);
} catch (Exception e1) {
e1.printStackTrace();
}
}
return sbar;
}
private BaseHandler mBaseHandler;
/**
* 初始化一个Handler如果需要使用Handler先调用此方法
* 然后可以使用postRunnable(Runnable runnable)
* sendMessage在handleMessageMessage msg中接收msg
*/
public void initHandler() {
mBaseHandler = new BaseHandler(this);
}
/**
* 返回Handler在此之前确定已经调用initHandler
*
* @return Handler
*/
public Handler getHandler() {
return mBaseHandler;
}
/**
* 同Handler 的 handleMessage
* getHandler.sendMessage,发送的Message在此接收
* 在此之前确定已经调用initHandler
*
* @param msg
*/
protected void handleMessage(Message msg) {
switch (msg.what) {
case WHAT_STATE:
refreshView();
break;
}
}
protected static class BaseHandler extends Handler {
private final WeakReference<PingFloatWindow> mObjects;
public BaseHandler(PingFloatWindow mPresenter) {
mObjects = new WeakReference<PingFloatWindow>(mPresenter);
}
@Override
public void handleMessage(Message msg) {
PingFloatWindow mPresenter = mObjects.get();
if (mPresenter != null)
mPresenter.handleMessage(msg);
}
}
}

View File

@@ -0,0 +1,137 @@
package com.zhidao.adas.client.ui;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.SimpleItemAnimator;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.adapter.SendCmdAdapter;
import com.zhidao.adas.client.bean.SendCmd;
import com.zhidao.adas.client.bean.SendCmdOption;
import com.zhidao.adas.client.utils.Constants;
import com.zhidao.support.adas.high.AdasManager;
public class SendCmdDialog extends Dialog {
private RecyclerView recyclerView;
private final SendCmd<?> sendCmd;
public SendCmdDialog(@NonNull Context context, SendCmd<?> sendCmd) {
super(context, R.style.CustomDialog);
this.sendCmd = sendCmd;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dialog_send_cmd);
//初始化界面控件
initView();
initRecyclerView();
//初始化界面控件的事件
setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
}
});
}
@Override
public void show() {
super.show();
}
private void initRecyclerView() {
//创建默认的线性LayoutManager 横向的GridLayoutManager
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(linearLayoutManager);
//如果可以确定每个item的高度是固定的设置这个选项可以提高性能
recyclerView.setHasFixedSize(true);
//解决局部刷新闪屏问题
SimpleItemAnimator animator = (SimpleItemAnimator) recyclerView.getItemAnimator();
if (animator != null)
animator.setSupportsChangeAnimations(false);
//创建并设置Adapter
SendCmdAdapter adapter = new SendCmdAdapter(sendCmd.value, new SendCmdAdapter.OnItemClickListener() {
@Override
public void onItemClick(SendCmdOption<?> data) {
String name = sendCmd.name;
if (Constants.TITLE.SEND_PLANNING_CMD.equals(name)) {
if (data.tag == SendCmdOption.TAG.PULL_OVER) {
AdasManager.getInstance().sendPlanningPullOverCmd((int) data.value);
} else if (data.tag == SendCmdOption.TAG.LANE_CHANGE) {
AdasManager.getInstance().sendPlanningLaneChangeCmd((int) data.value);
}
} else if (Constants.TITLE.SEND_SET_DEMO_MODE_REQ.equals(name)) {
if (data.tag == SendCmdOption.TAG.DEMO_MODE) {
AdasManager.getInstance().sendDemoModeReq((int) data.value);
}
} else if (Constants.TITLE.SEND_BLIND_AREA.equals(name)) {
if (data.tag == SendCmdOption.TAG.BLIND_AREA) {
AdasManager.getInstance().sendBlindAreaCmd((boolean) data.value);
}
} else if (Constants.TITLE.SEND_V2N_TO_PNC.equals(name)) {
if (data.tag == SendCmdOption.TAG.V2N_TO_PNC) {
AdasManager.getInstance().sendV2nToPncCmd((boolean) data.value);
}
} else if (Constants.TITLE.SEND_SET_RAIN_MODE_REQ.equals(name)) {
if (data.tag == SendCmdOption.TAG.RAIN_MODE) {
AdasManager.getInstance().sendRainModeReq((int) data.value);
}
} else if (Constants.TITLE.SEND_DETOURING.equals(name)) {
if (data.tag == SendCmdOption.TAG.DETOURING) {
AdasManager.getInstance().sendDetouring((int) data.value);
}
} else if (Constants.TITLE.SEND_AEB.equals(name)) {
if (data.tag == SendCmdOption.TAG.AEB) {
AdasManager.getInstance().sendAebCmd((int) data.value);
}
} else if (Constants.TITLE.SEND_LANE_CHANGE_RESTRAIN_VALID.equals(name)) {
if (data.tag == SendCmdOption.TAG.LANE_CHANGE_RESTRAIN_VALID) {
AdasManager.getInstance().sendLaneChangeRestrainValid((int) data.value);
}
} else if (Constants.TITLE.SEND_STOP_YIELD_VALID.equals(name)) {
if (data.tag == SendCmdOption.TAG.STOP_YIELD_VALID) {
AdasManager.getInstance().sendStopYieldValid((int) data.value);
}
} else if (Constants.TITLE.SEND_HADMAP_SPEED_LIMIT_VALID.equals(name)) {
if (data.tag == SendCmdOption.TAG.HADMAP_SPEED_LIMIT_VALID) {
AdasManager.getInstance().sendHadmapSpeedLimitValid((int) data.value);
}
} else if (Constants.TITLE.SEND_RAMP_THETA_VALID.equals(name)) {
if (data.tag == SendCmdOption.TAG.RAMP_THETA_VALID) {
AdasManager.getInstance().sendRampThetaValid((int) data.value);
}
} else if (Constants.TITLE.SEND_GET_PARAM_REQ.equals(name)) {
if (data.tag == com.zhidao.support.adas.high.common.Constants.PARAM_TYPE.UNKNOWN) {
AdasManager.getInstance().sendGetAllParamReq();
} else {
AdasManager.getInstance().sendGetParamReq((int) data.value);
}
}
}
});
recyclerView.setAdapter(adapter);
}
/**
* 初始化界面控件
*/
private void initView() {
recyclerView = findViewById(R.id.recyclerView);
TextView title = findViewById(R.id.title);
title.setText(sendCmd.name);
}
}

View File

@@ -0,0 +1,80 @@
package com.zhidao.adas.client.ui.widget;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.zhidao.adas.client.utils.image.GlideRoundedCornersTransform;
/**
* 清扫车摄像头展示View
*/
public class SweeperVideoView extends AppCompatImageView {
private static final String TAG = SweeperVideoView.class.getSimpleName();
private final RequestOptions requestOptions = new RequestOptions()
.priority(Priority.HIGH)
.skipMemoryCache(true)
.diskCacheStrategy(DiskCacheStrategy.NONE)
.dontAnimate();
public SweeperVideoView(@NonNull Context context) {
super(context);
}
public SweeperVideoView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public SweeperVideoView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
int i = 0;
public void onSweeperFutianBackCameraVideo(@NonNull byte[] data) {
i++;
Log.i(TAG, "数据源加载次数=" + i);
Glide.with(SweeperVideoView.this)
.asBitmap()
.load(data)
.placeholder(SweeperVideoView.this.getDrawable())
// .optionalTransform(new GlideRoundedCornersTransform(50f, GlideRoundedCornersTransform.CornerType.ALL))
.apply(requestOptions)
.into(target);
}
int j = 0;
private final CustomTarget<Bitmap> target = new CustomTarget<Bitmap>() {
@Override
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
j++;
Log.i(TAG, "显示回调次数=" + j);
//回调内容
if (!resource.isRecycled()) {
setImageBitmap(resource);
} else {
Log.i(TAG, "显示回调 Bitmap被回收");
}
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
//这个方法在target被回收时调用如果在除了imageView以外的地方引用了imageView中的bitmap在这里清除引用以避免崩溃
}
};
}

View File

@@ -161,6 +161,9 @@ public class Constants {
String RECEIVE_PLANNING_OBJECTS = MessageType.TYPE_RECEIVE_PLANNING_OBJECTS.desc;
String RECEIVE_PLANNING_DECISION_STATE = MessageType.TYPE_RECEIVE_PLANNING_DECISION_STATE.desc;
String RECEIVE_SWEEPER_TASK_INDEX_DATA = MessageType.TYPE_RECEIVE_SWEEPER_TASK_INDEX_DATA.desc;
String RECEIVE_V2N_CONGESTION_EVENT = MessageType.TYPE_RECEIVE_V2N_CONGESTION_EVENT.desc;
String RECEIVE_V2N_GLOBAL_PATH_EVENTS = MessageType.TYPE_RECEIVE_V2N_GLOBAL_PATH_EVENTS.desc;
String RECEIVE_GET_PARAM_RESP = MessageType.TYPE_RECEIVE_GET_PARAM_RESP.desc;
// String RECEIVE_BASIC_INFO_REQ = "自动驾驶设备基础信息请求";
String TITLE_CAR_CONFIG_RESP = "工控机版本\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t配置";
@@ -191,17 +194,21 @@ public class Constants {
String SEND_SET_AUTOPILOT_SPEED_REQ = "自动驾驶限速";
String SEND_SYSTEM_CMD_REQ_REBOOT = "重启所有节点";
String SEND_RECORD_CAUSE = "采集类型";
String SEND_SET_DEMO_MODE_REQ_OPEN = "打开演示模式";
String SEND_SET_DEMO_MODE_REQ_CLOSE = "关闭演示模式";
String SEND_SET_RAIN_MODE_REQ_OPEN = "打开雨天模式";
String SEND_SET_RAIN_MODE_REQ_CLOSE = "关闭雨天模式";
String SEND_SET_DEMO_MODE_REQ = "演示模式";
String SEND_SET_RAIN_MODE_REQ = "雨天模式";
String SEND_RECORD_DATA_CONFIG_RESP = "数据采集配置";
String SEND_DETOURING_OPEN = "绕障类功能";
String SEND_DETOURING_CLOSE = "绕障类功能关";
String SEND_DETOURING = "绕障类功能";
String SEND_DETOURING_SPEED = "绕障速度阈值";
String SEND_TRIP_INFO = "行程信息";
String SEND_PLANNING_CMD = "Planning指令";
String SEND_PLANNING_CMD = "Planning指令";
String SEND_BLIND_AREA = "盲区数据开关";
String SEND_V2N_TO_PNC = "V2N数据到PnC";
String SEND_AEB = "AEB开关";
String SEND_LANE_CHANGE_RESTRAIN_VALID = "限制绕障开关";
String SEND_STOP_YIELD_VALID = "停车让行线前避让等待开关";
String SEND_HADMAP_SPEED_LIMIT_VALID = "地图限速开关";
String SEND_RAMP_THETA_VALID = "环岛模式开关";
String SEND_GET_PARAM_REQ = "参数获取";
}
}

View File

@@ -0,0 +1,434 @@
package com.zhidao.adas.client.utils;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
import android.util.Log;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* author:chenjs
*/
public class PermissionUtil {
private static final String TAG = PermissionUtil.class.getSimpleName();
private static final boolean LOG_FLAG = true;//日志标识
//日历
private static final String[] Group_Calendar = {
Manifest.permission.READ_CALENDAR, Manifest.permission.WRITE_CALENDAR
};
//照相机
private static final String[] Group_Camera = {
Manifest.permission.CAMERA
};
//通讯录
private static final String[] Group_Contacts = {
Manifest.permission.WRITE_CONTACTS, Manifest.permission.GET_ACCOUNTS,
Manifest.permission.READ_CONTACTS
};
//定位
private static final String[] Group_Location = {
Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION
};
//麦克风
private static final String[] Group_Microphone = {
Manifest.permission.RECORD_AUDIO
};
//电话
private static final String[] Group_Phone = {
Manifest.permission.READ_PHONE_STATE, Manifest.permission.CALL_PHONE,
Manifest.permission.READ_CALL_LOG, Manifest.permission.WRITE_CALL_LOG,
Manifest.permission.ADD_VOICEMAIL, Manifest.permission.USE_SIP,
Manifest.permission.PROCESS_OUTGOING_CALLS
};
//传感器
private static final String[] Group_Sensors = {
Manifest.permission.BODY_SENSORS
};
//短信
private static final String[] Group_Sms = {
Manifest.permission.READ_SMS, Manifest.permission.SEND_SMS,
Manifest.permission.RECEIVE_SMS, Manifest.permission.RECEIVE_MMS,
Manifest.permission.RECEIVE_WAP_PUSH
};
//存储
private static final String[] Group_Storage = {
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE
};
private static Map<String, String[]> m_PermissionGroupList = null;
private static Map<String, String> m_PermissionsMappingList = null;
static {
initMap();
}
/**
* 通过权限组名来申请一组权限
*
* @param context
* @param permissionGroupName
* @param requestCode
* @param listener
*/
public static void requestByGroupName(Activity context, String permissionGroupName, int requestCode, OnPermissionsListener listener) {
requestByGroupName(context, new String[]{permissionGroupName}, requestCode, listener);
}
/**
* 通过权限组名来申请多组权限
*
* @param context Activity上下文
* @param pgNameArray 多个要申请的权限组名称
* @param requestCode 请求码
* @param listener 回调接口
*/
public static void requestByGroupName(Activity context, String[] pgNameArray, int requestCode, OnPermissionsListener listener) {
showLog("requestByPermissionGroup");
try {
//如果操作系统SDK级别在23之上android6.0),就进行动态权限申请
if (Build.VERSION.SDK_INT >= 23 && pgNameArray != null) {
String[] permissionsList = getAppPermissionsList(context);//应用权限列表
ArrayList<String> targetList = new ArrayList<>();
if (permissionsList == null || permissionsList.length == 0) {
showLog("获得权限列表为空");
return;
}
for (String groupName : pgNameArray) {
ArrayList<String> tmpPermissionList = isPermissionDeclared(permissionsList, groupName);
if (tmpPermissionList == null) {//未找到
showLog("未找到[" + groupName + "]中的权限");
continue;
}
for (int i = 0; i < tmpPermissionList.size(); i++) {
//判断是否拥有权限
int nRet = ContextCompat.checkSelfPermission(context, tmpPermissionList.get(i));
if (nRet != PackageManager.PERMISSION_GRANTED) {
targetList.add(tmpPermissionList.get(i));
}
}
}
if (targetList.size() > 0) {
showLog("进行以下权限申请:" + targetList.toString());
String[] sList = targetList.toArray(new String[0]);
ActivityCompat.requestPermissions(context, sList, requestCode);
} else {
showLog("全部权限都已授权");
if (listener != null) {
listener.onPermissionsOwned();
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 通过权限名来申请一组权限
*
* @param context
* @param permission
* @param requestCode
* @param listener
*/
public static void requestByPermissionName(Activity context, String permission, int requestCode, OnPermissionsListener listener) {
requestByPermissionName(context, new String[]{permission}, requestCode, listener);
}
/**
* 通过权限名来申请多组权限
*
* @param context Activity上下文
* @param permissionArray 多个要申请的权限名称
* @param requestCode 请求码
* @param listener 回调接口
*/
public static void requestByPermissionName(Activity context, String[] permissionArray, int requestCode, OnPermissionsListener listener) {
showLog("requestPermissions");
try {
//如果操作系统SDK级别在23之上android6.0),就进行动态权限申请
if (Build.VERSION.SDK_INT >= 23 && permissionArray != null) {
ArrayList<String> targetList = new ArrayList<>();
for (String strPermission : permissionArray) {
//判断是否拥有权限
int nRet = ContextCompat.checkSelfPermission(context, strPermission);
if (nRet != PackageManager.PERMISSION_GRANTED) {
targetList.add(strPermission);
}
}
if (targetList.size() > 0) {
showLog("进行以下权限申请:" + targetList.toString());
String[] sList = targetList.toArray(new String[0]);
ActivityCompat.requestPermissions(context, sList, requestCode);
} else {
showLog("全部权限都已授权");
if (listener != null) {
listener.onPermissionsOwned();
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 针对申请权限时的用户操作进行处理
*
* @param context
* @param permissions 申请的权限
* @param grantResults 各权限的授权状态
* @param listener 回调接口
* @param controlFlag 控制标识,用于判断当响应禁止列表后,是否继续处理可再申请列表(避免出现同时处理禁止列表和可再申请列表,互相干扰,比如弹出两个提示框)
*/
public static void onRequestPermissionsResult(Activity context, String[] permissions, int[] grantResults, OnPermissionsListener listener, boolean controlFlag) {
try {
ArrayList<String> requestList = new ArrayList<>();//可再申请列表
ArrayList<String> banList = new ArrayList<>();//禁止列表
for (int i = 0; i < permissions.length; i++) {
if (grantResults[i] == PackageManager.PERMISSION_GRANTED) {
showLog("[" + permissions[i] + "]权限授权成功");
} else {
boolean nRet = ActivityCompat.shouldShowRequestPermissionRationale(context, permissions[i]);
//Log.i(TAG,"shouldShowRequestPermissionRationale nRet="+nRet);
if (nRet) {//允许重新申请
requestList.add(permissions[i]);
} else {//禁止申请
banList.add(permissions[i]);
}
}
}
do {
//优先对禁止列表进行判断
if (banList.size() > 0) {
if (listener != null) {
listener.onPermissionsForbidden(permissions, grantResults, banList);
}
if (!controlFlag) {//对禁止列表处理后且控制标识为false则跳过对可再申请列表的处理
break;
}
}
if (requestList.size() > 0) {
if (listener != null) {
listener.onPermissionsDenied(permissions, grantResults, requestList);
}
}
if (banList.size() == 0 && requestList.size() == 0) {
showLog("权限授权成功");
if (listener != null) {
listener.onPermissionsSucceed();
}
}
} while (false);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 判断权限状态
*
* @param context
* @param permission 权限名
* @return
*/
public static boolean checkPermission(Context context, String permission) {
try {
//如果操作系统SDK级别在23之上android6.0),就进行动态权限申请
if (Build.VERSION.SDK_INT >= 23) {
int nRet = ContextCompat.checkSelfPermission(context, permission);
showLog("checkSelfPermission nRet=" + nRet);
return nRet == PackageManager.PERMISSION_GRANTED;
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 获得当前应用清单中的权限列表
*
* @param context 应用上下文
* @return
*/
public static String[] getAppPermissionsList(Context context) {
try {
PackageManager packageManager = context.getApplicationContext().getPackageManager();
String packageName = context.getApplicationContext().getPackageName();
String[] array = packageManager.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS).requestedPermissions;
return array;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 判断权限列表中是否声明了指定权限组中的权限
*
* @param permissionList 权限列表
* @param permissionGroup 权限组名
* @return 存在则返回找到的权限组权限否则返回null
*/
public static ArrayList<String> isPermissionDeclared(String[] permissionList, String permissionGroup) {
try {
if (permissionList != null && permissionGroup != null) {
String[] pmGroup = m_PermissionGroupList.get(permissionGroup);
if (pmGroup != null) {
ArrayList<String> arrayList = new ArrayList<>();
//遍历
for (int i = 0; i < pmGroup.length; i++) {
String strPermission = pmGroup[i];
for (int j = 0; j < permissionList.length; j++) {
if (strPermission.equals(permissionList[j])) {//找到指定权限组中的权限
arrayList.add(strPermission);
break;
}
}
}
if (arrayList.size() == 0) {
return null;
}
return arrayList;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 获得传入的权限名列表对应的中文名称
*
* @param permissionList 权限名列表
* @return 集合
*/
public static Set<String> getPermissionsNameByChinese(String[] permissionList) {
try {
if (permissionList != null) {
HashSet<String> nameSet = new HashSet<>();//确保集合元素不重复
String tmpName;
for (String strPermission : permissionList) {
tmpName = m_PermissionsMappingList.get(strPermission);
if (tmpName != null) {
nameSet.add(tmpName);
}
}
return nameSet;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private static void initMap() {
if (m_PermissionGroupList == null) {
m_PermissionGroupList = new HashMap<>();
m_PermissionGroupList.put(Manifest.permission_group.CALENDAR, Group_Calendar);
m_PermissionGroupList.put(Manifest.permission_group.CAMERA, Group_Camera);
m_PermissionGroupList.put(Manifest.permission_group.CONTACTS, Group_Contacts);
m_PermissionGroupList.put(Manifest.permission_group.LOCATION, Group_Location);
m_PermissionGroupList.put(Manifest.permission_group.MICROPHONE, Group_Microphone);
m_PermissionGroupList.put(Manifest.permission_group.PHONE, Group_Phone);
m_PermissionGroupList.put(Manifest.permission_group.SENSORS, Group_Sensors);
m_PermissionGroupList.put(Manifest.permission_group.SMS, Group_Sms);
m_PermissionGroupList.put(Manifest.permission_group.STORAGE, Group_Storage);
}
if (m_PermissionsMappingList == null) {
m_PermissionsMappingList = new HashMap<>();
//日历
for (String strPermission : Group_Calendar) {
m_PermissionsMappingList.put(strPermission, "日历");
}
//照相机
for (String strPermission : Group_Camera) {
m_PermissionsMappingList.put(strPermission, "摄像头");
}
//通讯录
for (String strPermission : Group_Contacts) {
m_PermissionsMappingList.put(strPermission, "通讯录");
}
//定位
for (String strPermission : Group_Location) {
m_PermissionsMappingList.put(strPermission, "位置");
}
//麦克风
for (String strPermission : Group_Microphone) {
m_PermissionsMappingList.put(strPermission, "麦克风");
}
//电话
for (String strPermission : Group_Phone) {
m_PermissionsMappingList.put(strPermission, "电话");
}
//传感器
for (String strPermission : Group_Sensors) {
m_PermissionsMappingList.put(strPermission, "传感器");
}
//短信
for (String strPermission : Group_Sms) {
m_PermissionsMappingList.put(strPermission, "短信");
}
//存储
for (String strPermission : Group_Storage) {
m_PermissionsMappingList.put(strPermission, "存储");
}
}
}
private static void showLog(String str) {
if (LOG_FLAG) {
Log.i(TAG, str);
}
}
public interface OnPermissionsListener {
/**
* 权限都已拥有时的处理
*/
void onPermissionsOwned();
/**
* 权限被禁止时的处理
*
* @param permissions 申请的全部权限
* @param grantResults 各权限的授权状态
* @param pmList 禁止申请的权限列表
*/
void onPermissionsForbidden(String[] permissions, int[] grantResults, ArrayList<String> pmList);
/**
* 权限被拒绝时的处理
*
* @param permissions
* @param grantResults
* @param pmList 可再申请的权限列表
*/
void onPermissionsDenied(String[] permissions, int[] grantResults, ArrayList<String> pmList);
/**
* 权限申请成功时的处理
*/
void onPermissionsSucceed();
}
}

View File

@@ -0,0 +1,166 @@
package com.zhidao.adas.client.utils.image;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import androidx.annotation.NonNull;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import java.security.MessageDigest;
/**
* Glide加载图片使图片变成圆角图片工具
* 基本用法Glide.with(this).load(imgUrl).apply(RequestOptions.bitmapTransform(GlideRoundedCornersTransform(this))).into(imageView)
* 如果想用多个Transform可以使用{@link com.bumptech.glide.load.MultiTransformation} 进行Transform的融合
* @author tongchenfei
*/
public class GlideRoundedCornersTransform extends CenterCrop {
private float mRadius;
private CornerType mCornerType;
private static final int VERSION = 1;
private static final String ID = "GlideRoundedCornersTransform." + VERSION;
private static final byte[] ID_BYTES = ID.getBytes(CHARSET);
/**
* 待处理的圆角枚举
*/
public enum CornerType {
ALL,
TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT,
TOP, BOTTOM, LEFT, RIGHT,
TOP_LEFT_BOTTOM_RIGHT,
TOP_RIGHT_BOTTOM_LEFT,
TOP_LEFT_TOP_RIGHT_BOTTOM_RIGHT,
TOP_RIGHT_BOTTOM_RIGHT_BOTTOM_LEFT,
TOP_LEFT_TOP_RIGHT
}
public GlideRoundedCornersTransform(float radius, CornerType cornerType) {
super();
mRadius = radius;
mCornerType = cornerType;
}
@Override
protected Bitmap transform(@NonNull BitmapPool pool,@NonNull Bitmap toTransform, int outWidth, int outHeight) {
Bitmap transform = super.transform(pool, toTransform, outWidth, outHeight);
return roundCrop(pool, transform);
}
private Bitmap roundCrop(BitmapPool pool, Bitmap source) {
if (source == null) {
return null;
}
int width = source.getWidth();
int height = source.getHeight();
Bitmap result = pool.get(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_8888);
if (result == null) {
result = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Bitmap.Config
.ARGB_8888);
}
Canvas canvas = new Canvas(result);
Paint paint = new Paint();
paint.setShader(new BitmapShader(source, BitmapShader.TileMode.CLAMP, BitmapShader
.TileMode.CLAMP));
paint.setAntiAlias(true);
Path path = new Path();
drawRoundRect(canvas, paint, path, width, height);
return result;
}
private void drawRoundRect(Canvas canvas, Paint paint, Path path, int width, int height) {
float[] rids;
switch (mCornerType) {
case ALL:
rids = new float[]{mRadius, mRadius, mRadius, mRadius, mRadius, mRadius, mRadius, mRadius};
drawPath(rids, canvas, paint, path, width, height);
break;
case TOP_LEFT:
rids = new float[]{mRadius, mRadius, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
drawPath(rids, canvas, paint, path, width, height);
break;
case TOP_RIGHT:
rids = new float[]{0.0f, 0.0f, mRadius, mRadius, 0.0f, 0.0f, 0.0f, 0.0f};
drawPath(rids, canvas, paint, path, width, height);
break;
case BOTTOM_RIGHT:
rids = new float[]{0.0f, 0.0f, 0.0f, 0.0f, mRadius, mRadius, 0.0f, 0.0f};
drawPath(rids, canvas, paint, path, width, height);
break;
case BOTTOM_LEFT:
rids = new float[]{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, mRadius, mRadius};
drawPath(rids, canvas, paint, path, width, height);
break;
case TOP:
rids = new float[]{mRadius, mRadius, mRadius, mRadius, 0.0f, 0.0f, 0.0f, 0.0f};
drawPath(rids, canvas, paint, path, width, height);
break;
case BOTTOM:
rids = new float[]{0.0f, 0.0f, 0.0f, 0.0f, mRadius, mRadius, mRadius, mRadius};
drawPath(rids, canvas, paint, path, width, height);
break;
case LEFT:
rids = new float[]{mRadius, mRadius, 0.0f, 0.0f, 0.0f, 0.0f, mRadius, mRadius};
drawPath(rids, canvas, paint, path, width, height);
break;
case RIGHT:
rids = new float[]{0.0f, 0.0f, mRadius, mRadius, mRadius, mRadius, 0.0f, 0.0f};
drawPath(rids, canvas, paint, path, width, height);
break;
case TOP_LEFT_BOTTOM_RIGHT:
rids = new float[]{mRadius, mRadius, 0.0f, 0.0f, mRadius, mRadius, 0.0f, 0.0f};
drawPath(rids, canvas, paint, path, width, height);
break;
case TOP_RIGHT_BOTTOM_LEFT:
rids = new float[]{0.0f, 0.0f, mRadius, mRadius, 0.0f, 0.0f, mRadius, mRadius};
drawPath(rids, canvas, paint, path, width, height);
break;
case TOP_LEFT_TOP_RIGHT_BOTTOM_RIGHT:
rids = new float[]{mRadius, mRadius, mRadius, mRadius, mRadius, mRadius, 0.0f, 0.0f};
drawPath(rids, canvas, paint, path, width, height);
break;
case TOP_RIGHT_BOTTOM_RIGHT_BOTTOM_LEFT:
rids = new float[]{0.0f, 0.0f, mRadius, mRadius, mRadius, mRadius, mRadius, mRadius};
drawPath(rids, canvas, paint, path, width, height);
break;
case TOP_LEFT_TOP_RIGHT:
rids = new float[]{mRadius, mRadius, mRadius, mRadius, 0.0f, 0.0f, 0.0f, 0.0f};
drawPath(rids, canvas, paint, path, width, height);
break;
default:
throw new RuntimeException("RoundedCorners type not belong to CornerType");
}
}
/**
* @param rids 圆角的半径依次为左上角xy半径右上角右下角左下角
*/
private void drawPath(float[] rids, Canvas canvas, Paint paint, Path path, int width, int height) {
path.addRoundRect(new RectF(0, 0, width, height), rids, Path.Direction.CW);
canvas.drawPath(path, paint);
}
@Override
public boolean equals(Object o) {
return o instanceof GlideRoundedCornersTransform;
}
@Override
public int hashCode() {
return ID.hashCode();
}
@Override
public void updateDiskCacheKey(MessageDigest messageDigest) {
messageDigest.update(ID_BYTES);
}
}

View File

@@ -144,26 +144,6 @@ public class ImageLoaderManager {
.into(imageView);
}
/**
* 加载字节数组
*
* @param context
* @param data
* @param imageView
*/
public static void loadByteImage(Context context, byte[] data, ImageView imageView) {
RequestOptions requestOptions = new RequestOptions()
.priority(Priority.HIGH)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.centerCrop();
Glide.with(context)
.load(data)
.apply(requestOptions)
.placeholder(imageView.getDrawable())
.into(imageView);
}
/**
* 加载高斯模糊
*

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M960,512c0,-249.6 -198.4,-448 -448,-448S64,262.4 64,512s198.4,448 448,448 448,-198.4 448,-448zM691.2,736L512,556.8 332.8,736c-12.8,12.8 -32,12.8 -44.8,0 -12.8,-12.8 -12.8,-32 0,-44.8L467.2,512 288,332.8c-12.8,-12.8 -12.8,-32 0,-44.8 12.8,-12.8 32,-12.8 44.8,0L512,467.2 691.2,288c12.8,-12.8 32,-12.8 44.8,0 12.8,12.8 12.8,32 0,44.8L556.8,512 736,691.2c12.8,12.8 12.8,32 0,44.8 -12.8,12.8 -32,12.8 -44.8,0z"
android:fillColor="#AFFFFFFF"/>
</vector>

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M998.4,262.4c0,-38.4 -32,-70.4 -70.4,-70.4H518.4L448,134.4c-6.4,-6.4 -12.8,-6.4 -12.8,-6.4h-320c-51.2,-6.4 -89.6,38.4 -89.6,89.6v569.6c0,64 51.2,108.8 108.8,108.8H672c12.8,0 25.6,-12.8 25.6,-25.6s-12.8,-25.6 -25.6,-25.6H134.4c-32,0 -64,-25.6 -64,-64V217.6c0,-25.6 19.2,-44.8 44.8,-44.8H416l230.4,185.6h307.2v428.8c0,32 -25.6,64 -64,64h-32c-12.8,0 -25.6,12.8 -25.6,25.6s12.8,25.6 25.6,25.6h32c64,0 108.8,-51.2 108.8,-108.8V262.4z"
android:fillColor="#ffffff"/>
<path
android:pathData="M249.6,460.8h-64v204.8L224,665.6v-83.2h70.4c6.4,0 12.8,-6.4 19.2,-12.8 6.4,0 12.8,-12.8 19.2,-19.2s6.4,-19.2 6.4,-32c0,-19.2 -6.4,-32 -12.8,-38.4 -6.4,-6.4 -12.8,-19.2 -25.6,-19.2h-51.2zM294.4,537.6c0,6.4 -6.4,6.4 -12.8,12.8s-19.2,0 -32,0L224,550.4v-57.6h51.2c6.4,0 12.8,6.4 19.2,6.4v38.4zM371.2,460.8h38.4v204.8h-38.4zM492.8,460.8h-38.4v198.4h38.4v-128l76.8,128h44.8L614.4,460.8L576,460.8v134.4zM838.4,550.4h-89.6v32h44.8L793.6,608c-6.4,6.4 -12.8,6.4 -19.2,12.8 -6.4,6.4 -19.2,6.4 -25.6,6.4 -19.2,0 -32,-6.4 -44.8,-19.2 -12.8,-12.8 -19.2,-32 -19.2,-51.2 0,-19.2 6.4,-38.4 12.8,-51.2 12.8,-12.8 25.6,-19.2 44.8,-19.2 12.8,0 19.2,0 32,6.4 6.4,6.4 12.8,12.8 19.2,25.6l44.8,-6.4c-6.4,-19.2 -12.8,-32 -25.6,-44.8 -12.8,-12.8 -32,-12.8 -57.6,-12.8 -19.2,0 -38.4,6.4 -51.2,12.8 -19.2,6.4 -32,19.2 -38.4,38.4 -6.4,19.2 -12.8,32 -12.8,57.6 0,19.2 6.4,38.4 12.8,51.2 6.4,19.2 19.2,32 38.4,38.4 12.8,6.4 32,12.8 57.6,12.8 19.2,0 32,0 51.2,-6.4s19.2,-19.2 25.6,-25.6v-83.2z"
android:fillColor="#ffffff"/>
</vector>

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#D81B60"
android:pathData="M998.4,262.4c0,-38.4 -32,-70.4 -70.4,-70.4H518.4L448,134.4c-6.4,-6.4 -12.8,-6.4 -12.8,-6.4h-320c-51.2,-6.4 -89.6,38.4 -89.6,89.6v569.6c0,64 51.2,108.8 108.8,108.8H672c12.8,0 25.6,-12.8 25.6,-25.6s-12.8,-25.6 -25.6,-25.6H134.4c-32,0 -64,-25.6 -64,-64V217.6c0,-25.6 19.2,-44.8 44.8,-44.8H416l230.4,185.6h307.2v428.8c0,32 -25.6,64 -64,64h-32c-12.8,0 -25.6,12.8 -25.6,25.6s12.8,25.6 25.6,25.6h32c64,0 108.8,-51.2 108.8,-108.8V262.4z" />
<path
android:fillColor="#D81B60"
android:pathData="M249.6,460.8h-64v204.8L224,665.6v-83.2h70.4c6.4,0 12.8,-6.4 19.2,-12.8 6.4,0 12.8,-12.8 19.2,-19.2s6.4,-19.2 6.4,-32c0,-19.2 -6.4,-32 -12.8,-38.4 -6.4,-6.4 -12.8,-19.2 -25.6,-19.2h-51.2zM294.4,537.6c0,6.4 -6.4,6.4 -12.8,12.8s-19.2,0 -32,0L224,550.4v-57.6h51.2c6.4,0 12.8,6.4 19.2,6.4v38.4zM371.2,460.8h38.4v204.8h-38.4zM492.8,460.8h-38.4v198.4h38.4v-128l76.8,128h44.8L614.4,460.8L576,460.8v134.4zM838.4,550.4h-89.6v32h44.8L793.6,608c-6.4,6.4 -12.8,6.4 -19.2,12.8 -6.4,6.4 -19.2,6.4 -25.6,6.4 -19.2,0 -32,-6.4 -44.8,-19.2 -12.8,-12.8 -19.2,-32 -19.2,-51.2 0,-19.2 6.4,-38.4 12.8,-51.2 12.8,-12.8 25.6,-19.2 44.8,-19.2 12.8,0 19.2,0 32,6.4 6.4,6.4 12.8,12.8 19.2,25.6l44.8,-6.4c-6.4,-19.2 -12.8,-32 -25.6,-44.8 -12.8,-12.8 -32,-12.8 -57.6,-12.8 -19.2,0 -38.4,6.4 -51.2,12.8 -19.2,6.4 -32,19.2 -38.4,38.4 -6.4,19.2 -12.8,32 -12.8,57.6 0,19.2 6.4,38.4 12.8,51.2 6.4,19.2 19.2,32 38.4,38.4 12.8,6.4 32,12.8 57.6,12.8 19.2,0 32,0 51.2,-6.4s19.2,-19.2 25.6,-25.6v-83.2z" />
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#FFFFFF"
android:pathData="M919.5,784.3l-22.2,-199.7c-0.9,-36.7 -31,-66.4 -67.9,-66.4h-35.6L793.8,116.9c0,-14.3 -11.6,-25.9 -25.9,-25.9 -14.3,0 -25.9,11.6 -25.9,25.9v401.3L534.9,518.2L534.9,117c0,-14.3 -11.6,-25.9 -25.9,-25.9 -14.3,0 -25.9,11.6 -25.9,25.9v401.3L276,518.3L276,117c0,-14.3 -11.6,-25.9 -25.9,-25.9 -14.3,0 -25.9,11.6 -25.9,25.9v401.3h-51.8c-37,0 -67.1,29.7 -67.9,66.5L81.9,800.4c-0.2,1.5 -0.2,2.9 -0.1,4.4 0,0.5 -0.1,1 -0.1,1.6v19.4c0,37.5 30.5,68 68,68h705.5c37.5,0 68,-30.5 68,-68v-19.4c0.1,-7.8 -1.3,-15.2 -3.7,-22.1zM156.2,586.3c0,-8.9 7.3,-16.2 16.2,-16.2h657c8.9,0 16.2,7.3 16.2,16.2v1.4l16.8,151c-2.3,-0.2 -4.7,-0.4 -7.1,-0.4L149.8,738.3c-3.2,0 -6.3,0.3 -9.4,0.7l15.7,-150.1 0.1,-2.6zM871.5,825.7c0,8.9 -7.3,16.2 -16.2,16.2L149.8,841.9c-8.9,0 -16.2,-7.3 -16.2,-16.2v-19.4c0,-8.9 7.3,-16.2 16.2,-16.2h705.5c8.9,0 16.2,7.3 16.2,16.2v19.4z"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:fillColor="#D81B60"
android:pathData="M919.5,784.3l-22.2,-199.7c-0.9,-36.7 -31,-66.4 -67.9,-66.4h-35.6L793.8,116.9c0,-14.3 -11.6,-25.9 -25.9,-25.9 -14.3,0 -25.9,11.6 -25.9,25.9v401.3L534.9,518.2L534.9,117c0,-14.3 -11.6,-25.9 -25.9,-25.9 -14.3,0 -25.9,11.6 -25.9,25.9v401.3L276,518.3L276,117c0,-14.3 -11.6,-25.9 -25.9,-25.9 -14.3,0 -25.9,11.6 -25.9,25.9v401.3h-51.8c-37,0 -67.1,29.7 -67.9,66.5L81.9,800.4c-0.2,1.5 -0.2,2.9 -0.1,4.4 0,0.5 -0.1,1 -0.1,1.6v19.4c0,37.5 30.5,68 68,68h705.5c37.5,0 68,-30.5 68,-68v-19.4c0.1,-7.8 -1.3,-15.2 -3.7,-22.1zM156.2,586.3c0,-8.9 7.3,-16.2 16.2,-16.2h657c8.9,0 16.2,7.3 16.2,16.2v1.4l16.8,151c-2.3,-0.2 -4.7,-0.4 -7.1,-0.4L149.8,738.3c-3.2,0 -6.3,0.3 -9.4,0.7l15.7,-150.1 0.1,-2.6zM871.5,825.7c0,8.9 -7.3,16.2 -16.2,16.2L149.8,841.9c-8.9,0 -16.2,-7.3 -16.2,-16.2v-19.4c0,-8.9 7.3,-16.2 16.2,-16.2h705.5c8.9,0 16.2,7.3 16.2,16.2v19.4z"/>
</vector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_ping_selected" android:state_selected="true" />
<item android:drawable="@drawable/ic_ping" />
</selector>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/icon_dev_status_net_disable" android:state_pressed="true" />
<item android:drawable="@drawable/icon_dev_status_net_enable" />
<item android:drawable="@drawable/icon_dev_status_net_enable" android:state_pressed="true" />
<item android:drawable="@drawable/icon_dev_status_net_disable" />
</selector>

View File

@@ -0,0 +1,38 @@
<?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="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_adas_dialog">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginStart="160dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="160dp"
android:gravity="center"
android:text="选择自动驾驶线路"
android:textColor="#333333"
android:textSize="18sp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_margin="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -24,15 +24,28 @@
android:textSize="16sp"
android:textStyle="bold" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_render"
android:id="@+id/btn_render_full_screen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_gravity="center_vertical"
android:layout_marginEnd="5dp"
android:background="@drawable/btn_bg"
android:text="渲染(全屏)"
android:textColor="@color/colorWhile"
android:textSize="16dp"
android:textStyle="bold"
android:visibility="gone" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_render"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="5dp"
android:layout_toStartOf="@id/btn_render_full_screen"
android:background="@drawable/btn_bg"
android:text="渲染"
android:textColor="@color/colorWhile"
android:textSize="16dp"

View File

@@ -17,9 +17,9 @@
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:minWidth="110dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minWidth="110dp"
android:text="@string/app_name"
android:textColor="@color/colorWhile"
android:textSize="18sp"
@@ -91,59 +91,108 @@
android:layout_width="wrap_content"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/layout_cb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layoutDirection="ltr"
android:orientation="vertical">
<CheckBox
android:id="@+id/cb_print"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:checked="true"
android:text="打印"
android:textColor="#ffffff" />
<CheckBox
android:id="@+id/cb_save"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="存储"
android:textColor="#ffffff" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_log_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layoutDirection="ltr"
android:orientation="vertical">
<TextView
android:id="@+id/log_hint"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:text="日志:"
android:textColor="#ffffff" />
android:gravity="center_vertical"
android:orientation="horizontal">
<CheckBox
android:id="@+id/cb_cut_down"
<TextView
android:id="@+id/log_hint"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="日志\t\t"
android:textColor="@color/colorWhile" />
<CheckBox
android:id="@+id/cb_cut_down"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/colorWhile"
android:checked="true"
android:text="缩短"
android:textColor="@color/colorWhile" />
<CheckBox
android:id="@+id/cb_print"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/colorWhile"
android:checked="true"
android:text="打印"
android:textColor="@color/colorWhile" />
<CheckBox
android:id="@+id/cb_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/colorWhile"
android:text="存储"
android:textColor="@color/colorWhile" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="45dp"
android:background="#CCCCCCCC" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:checked="true"
android:text="缩短"
android:textColor="#ffffff" />
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="显示:"
android:textColor="@color/colorWhile" />
<RadioGroup
android:id="@+id/rg_show_log"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rb_analysis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/colorWhile"
android:checked="true"
android:text="解析"
android:textColor="@color/colorWhile" />
<RadioButton
android:id="@+id/rb_original"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/colorWhile"
android:text="原始"
android:textColor="@color/colorWhile" />
<RadioButton
android:id="@+id/rb_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/colorWhile"
android:text="全部"
android:textColor="@color/colorWhile" />
</RadioGroup>
</LinearLayout>
</LinearLayout>
<View
@@ -155,7 +204,7 @@
android:layout_marginEnd="5dp"
android:layout_marginBottom="10dp"
android:layout_toStartOf="@+id/layout_log_hint"
android:background="#fff124" />
android:background="#CCCCCCCC" />
<LinearLayout
android:layout_width="wrap_content"
@@ -169,9 +218,10 @@
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:buttonTint="@color/colorWhile"
android:checked="true"
android:text="超时检测"
android:textColor="#ffffff" />
android:textColor="@color/colorWhile" />
<TextView
android:id="@+id/tv_connect_state"
@@ -185,15 +235,6 @@
android:textStyle="bold" />
</LinearLayout>
<View
android:id="@+id/line2"
android:layout_width="2dp"
android:layout_height="match_parent"
android:layout_marginStart="5dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="10dp"
android:background="#fff124" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/disconnect"
@@ -222,22 +263,13 @@
android:textSize="16dp"
android:textStyle="bold" />
<View
android:id="@+id/line"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginStart="5dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="10dp"
android:layout_toStartOf="@+id/connect"
android:background="#fff124" />
<RadioGroup
android:id="@+id/connection_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dp"
android:layoutDirection="ltr"
android:orientation="horizontal">
@@ -245,15 +277,17 @@
android:id="@+id/assign"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/colorWhile"
android:text="指定"
android:textColor="#ffffff" />
android:textColor="@color/colorWhile" />
<RadioButton
android:id="@+id/fixation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/colorWhile"
android:text="固定"
android:textColor="#ffffff" />
android:textColor="@color/colorWhile" />
</RadioGroup>
@@ -288,10 +322,20 @@
<ImageView
android:id="@+id/btn_router"
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_height="40dp"
android:layout_marginStart="18dp"
android:layout_marginStart="20dp"
android:src="@drawable/selector_router" />
<ImageView
android:id="@+id/btn_ping"
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:padding="3dp"
android:scaleType="centerInside"
android:src="@drawable/selector_ping" />
</LinearLayout>
</HorizontalScrollView>
</RelativeLayout>

View File

@@ -1,6 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#000" />
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBlue2">
<com.zhidao.adas.client.ui.widget.SweeperVideoView
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/btn_close"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:src="@drawable/ic_close" />
</FrameLayout>

View File

@@ -2,16 +2,18 @@
apply from: "config.gradle"
apply from: "javadoc.gradle"
buildscript {
apply from: rootProject.file('gradle/ext.gradle')
repositories {
mavenLocal()
maven { url 'https://nexus.zhidaoauto.com/repository/maven-releases/' }
maven { url 'https://nexus.zhidaoauto.com/repository/maven-public/' }
maven { url 'https://storage.zego.im/maven' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://nexus.zhidaoauto.com/repository/maven-releases/' }
maven { url 'https://nexus.zhidaoauto.com/repository/maven-public/' }
maven {
url "https://artifact.bytedance.com/repository/Volcengine/"
}
@@ -22,20 +24,21 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21'
classpath "com.alibaba:arouter-register:1.0.12-mogo"
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
classpath "com.android.tools.build:gradle:${gradle_version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "com.alibaba:arouter-register:${plugin_version}"
classpath 'com.tencent.bugly:symtabfileuploader:2.2.1'
classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
classpath "com.mogo.cloud:bizconfig:${BIZCONFIG_VERSION}"
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
classpath "com.mogo.thread.opt:plg:${THREAD_OPT_VERSION}"
classpath 'com.mogo.cloud:systrace:1.0.1'
classpath "com.bytedance.android.byteX:base-plugin:${plugin_version}"
classpath "com.mogo.cloud:hook:${plugin_version}"
classpath "com.mogo.cloud:bizconfig:${plugin_version}"
classpath 'com.volcengine:apm_insight_plugin:1.4.2'
classpath "com.mogo.thread.opt:plg:${plugin_version}"
classpath "com.mogo.cloud:systrace:${plugin_version}"
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
classpath 'com.mogo.sticky:service:1.0.8'
classpath 'io.github.knight-zxw:lancet-plugin:0.0.4.8_mogo'
classpath "com.mogo.sticky:service:${plugin_version}"
classpath "io.github.knight-zxw:lancet-plugin:${lancetx_plugin_version}"
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
classpath 'com.mogo.cloud:matrix:1.0.0'
}
// 遇无法更新依赖情况针对Snapshot无法刷新然后sync project即可刷新完成注释该代码
@@ -49,14 +52,16 @@ buildscript {
allprojects {
repositories {
mavenLocal()
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' }
maven { url 'https://storage.zego.im/maven' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
// mavenCentral()
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' }
maven {
url "https://artifact.bytedance.com/repository/Volcengine/"
}
@@ -132,3 +137,12 @@ subprojects.each {
}
}
}
boolean isAndroidTestBuild() {
for (String s : gradle.startParameter.taskNames) {
if (s.contains("AndroidTest")) {
return true
}
}
return false
}

View File

@@ -1,7 +1,8 @@
apply from: rootProject.file('gradle/ext.gradle')
ext {
time = ""
// kotlin_version = "1.4.31"
kotlin_version = "1.5.0"
kotlin_version = "1.6.21"
dependencies = [
// androidx
androidxappcompat : "androidx.appcompat:appcompat:1.3.1",
@@ -40,10 +41,10 @@ ext {
arouter : "com.alibaba:arouter-api:1.0.12-mogo",
aroutercompiler : "com.alibaba:arouter-compiler:1.0.12-mogo",
// glide
glide : 'com.github.bumptech.glide:glide:4.8.0',
glideokhttp3 : 'com.github.bumptech.glide:okhttp3-integration:4.8.0',
glideanno : 'com.github.bumptech.glide:annotations:4.8.0',
glidecompiler : 'com.github.bumptech.glide:compiler:4.8.0',
glide : 'com.github.bumptech.glide:glide:4.11.0',
glideokhttp3 : 'com.github.bumptech.glide:okhttp3-integration:4.11.0',
glideanno : 'com.github.bumptech.glide:annotations:4.11.0',
glidecompiler : 'com.github.bumptech.glide:compiler:4.11.0',
androidxannotation : "androidx.annotation:annotation:1.2.0",
okhttpinterceptor : "com.squareup.okhttp3:logging-interceptor:3.12.0",
// fresco
@@ -86,14 +87,12 @@ ext {
coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2",
coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2",
aspectj : "org.aspectj:aspectjrt:1.8.9",
adasapi : "com.zhidao.autopilot.support:adas:1.0.6.15",
adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5.2",
// obu sdk
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta5',
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta7',
// google
googlezxing : "com.google.zxing:core:3.3.3",
@@ -112,10 +111,10 @@ ext {
circleimageview : "de.hdodenhof:circleimageview:3.0.1",
//plugin
mogochainbase : "com.mogo.cloud:service-chain:${SERVICE_CHAIN_VERSION}",
mogochainplugin : "com.mogo.cloud:hook:${HOOK_LOG_VERSION}",
mogoservicebiz : "com.mogo.cloud:service-biz:${SERVICE_BIZ_VERSION}",
mogobizconfig : "com.mogo.cloud:bizconfig:${BIZCONFIG_VERSION}",
mogochainbase : "com.mogo.cloud:service-chain:${plugin_version}",
mogochainplugin : "com.mogo.cloud:hook:${plugin_version}",
mogoservicebiz : "com.mogo.cloud:service-biz:${plugin_version}",
mogobizconfig : "com.mogo.cloud:bizconfig:${plugin_version}",
//========================= 旧版本架构 Maven 版本管理 =========================
// modules
@@ -213,7 +212,7 @@ ext {
//========================= autosize ======================
androidautoSize : 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1',
thread_opt : "com.mogo.thread.opt:lib:${THREAD_OPT_VERSION}"
thread_opt : "com.mogo.thread.opt:lib:${plugin_version}"
]
android = [
launcherApplicationId : "com.mogo.launcher",

View File

@@ -3,7 +3,6 @@ plugins {
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
id 'com.alibaba.arouter'
}
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion

View File

@@ -20,6 +20,7 @@ import com.mogo.eagle.function.biz.v2x.road.LineUploadManager
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
import com.mogo.eagle.function.biz.v2x.v2n.V2XEventManager
import com.mogo.eagle.function.biz.v2x.v2n.V2XPoiLoader.Companion.v2xPoiLoader
import com.mogo.eagle.function.biz.v2x.v2n.pnc.*
import com.mogo.eagle.function.biz.v2x.vip.VipCarManager
@Route(path = MogoServicePaths.PATH_FUNC_BIZ)
@@ -47,6 +48,8 @@ class FuncBizProvider : IMoGoFuncBizProvider {
LineUploadManager.getInstance(context)?.init()
}
V2xObuEventManager.init(context)
V2NIdentifyDrawer.init()
// RedLightWarningManager.INSTANCE.listenTrafficLight()
}
@@ -105,8 +108,15 @@ class FuncBizProvider : IMoGoFuncBizProvider {
OverViewDataManager.getAllV2XEventsByLineId(MoGoAiCloudClientConfig.getInstance().sn)
}
override fun stopQueryV2XEvents() {
OverViewDataManager.stopQueryV2XEvents()
}
override fun queryV2XEvents() {
v2xPoiLoader.queryWholeRoadEvents()
if ((AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && !FunctionBuildConfig.isNewV2NData)
|| AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
v2xPoiLoader.queryWholeRoadEvents()
}
}
override fun onDestroy() {
@@ -126,6 +136,7 @@ class FuncBizProvider : IMoGoFuncBizProvider {
}
}
V2xObuEventManager.release()
V2NIdentifyDrawer.unInit()
// RedLightWarningManager.INSTANCE.onDestroy()
}
}

View File

@@ -186,8 +186,8 @@ class DispatchAutoPilotManager private constructor() :
}
}
val currentAutoPilotLine = AutopilotControlParameters.AutoPilotLine(it.lineId.toLong(),it.trajUrl,it.trajMd5,
it.stopUrl,it.stopMd5,it.timestamp,it.vehicleModel,it.trajUrl_dpqp,it.trajMd5_dpqp,it.stopUrl_dpqp,
it.stopMd5_dpqp,it.timestamp_dpqp)
it.stopUrl,it.stopMd5,it.timestamp,it.vehicleModel,it.trajUrl_dpqp,it.trajMd5_dpqp,it.stopUrl_dpqp,
it.stopMd5_dpqp,it.timestamp_dpqp)
currentAutopilot.autoPilotLine = currentAutoPilotLine
currentAutopilot.routeID = it.lineId
currentAutopilot.routeName = it.lineName

Some files were not shown because too many files have changed in this diff Show More