Merge branch 'dev_robotaxi-d_231206_6.2.4' into 'master'
Dev robotaxi d 231206 6.2.4 See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!841
This commit is contained in:
@@ -548,6 +548,9 @@ public class OrderModel {
|
|||||||
clearBusStationDatas();
|
clearBusStationDatas();
|
||||||
queryBusRoutes();
|
queryBusRoutes();
|
||||||
removeTipRunnables();
|
removeTipRunnables();
|
||||||
|
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
|
||||||
|
// 取消自驾
|
||||||
|
setTrajectoryStation(null,null,-1L);
|
||||||
// startOrStopQueryPassengerWriteOff(false);
|
// startOrStopQueryPassengerWriteOff(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class BusProvider implements IMogoOCH {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String getFunctionName() {
|
public String getFunctionName() {
|
||||||
return null;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -293,10 +293,6 @@ public class BusPresenter extends Presenter<BusFragment>
|
|||||||
runOnUIThread(() -> mView.stopAnimAndUpdateBtnStatus());
|
runOnUIThread(() -> mView.stopAnimAndUpdateBtnStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAutopilotDockerInfo(@NonNull String dockerVersion) {
|
public void onAutopilotDockerInfo(@NonNull String dockerVersion) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,8 +66,8 @@ public class SlidePanelView extends View {
|
|||||||
private static int BLOCK_START_Y = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),15);
|
private static int BLOCK_START_Y = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),15);
|
||||||
private static int NORMAL_TEXT_MARGIN_LEFT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),40);
|
private static int NORMAL_TEXT_MARGIN_LEFT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),40);
|
||||||
private static int NORMAL_TEXT_MARGIN_RIGHT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),60);
|
private static int NORMAL_TEXT_MARGIN_RIGHT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),60);
|
||||||
private static int SHORT_TEXT_MARGIN_LEFT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),60);;
|
private static int SHORT_TEXT_MARGIN_LEFT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),60);
|
||||||
private static int SHORT_TEXT_MARGIN_RIGHT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),70);;
|
private static int SHORT_TEXT_MARGIN_RIGHT = AutoSizeUtils.dp2px(AbsMogoApplication.getApp(),70);
|
||||||
|
|
||||||
private int textMarginLeft = NORMAL_TEXT_MARGIN_LEFT;
|
private int textMarginLeft = NORMAL_TEXT_MARGIN_LEFT;
|
||||||
private int textMarginRight = NORMAL_TEXT_MARGIN_RIGHT;
|
private int textMarginRight = NORMAL_TEXT_MARGIN_RIGHT;
|
||||||
@@ -247,10 +247,10 @@ public class SlidePanelView extends View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startBlockBackAnim() {
|
private void startBlockBackAnim() {
|
||||||
ObjectAnimator blockBackanimator = ObjectAnimator.ofInt(this, "blockOffset", blockOffset, 0);
|
ObjectAnimator blockBackAnimator = ObjectAnimator.ofInt(this, "blockOffset", blockOffset, 0);
|
||||||
blockBackanimator.setInterpolator(new DecelerateInterpolator());
|
blockBackAnimator.setInterpolator(new DecelerateInterpolator());
|
||||||
blockBackanimator.setDuration(1000L * blockOffset / getWidth());
|
blockBackAnimator.setDuration(1000L * blockOffset / getWidth());
|
||||||
blockBackanimator.start();
|
blockBackAnimator.start();
|
||||||
lastX = 0;
|
lastX = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ public class SlidePanelView extends View {
|
|||||||
gradientMatrix.setTranslate(matrixTranslate, 0);
|
gradientMatrix.setTranslate(matrixTranslate, 0);
|
||||||
textGradient.setLocalMatrix(gradientMatrix);
|
textGradient.setLocalMatrix(gradientMatrix);
|
||||||
canvas.save();
|
canvas.save();
|
||||||
canvas.drawText(blockText, (float) (blockWidth + BLOCK_START_X + textMarginLeft), textOffset, textPaint);
|
canvas.drawText(blockText, (float) (blockWidth + BLOCK_START_X + textMarginLeft), (float) textOffset, textPaint);
|
||||||
canvas.restore();
|
canvas.restore();
|
||||||
// 画滑块
|
// 画滑块
|
||||||
canvas.drawBitmap(bmBlock, (float) (BLOCK_START_X + blockOffset), (float) BLOCK_START_Y, blockPaint);
|
canvas.drawBitmap(bmBlock, (float) (BLOCK_START_X + blockOffset), (float) BLOCK_START_Y, blockPaint);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class MogoOCHBusPassenger implements IMogoOCH {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String getFunctionName() {
|
public String getFunctionName() {
|
||||||
return null;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -632,6 +632,7 @@ class DriverM1Model {
|
|||||||
if (data != null && data.code == 0){
|
if (data != null && data.code == 0){
|
||||||
mOrderCallback?.updateReturnCarStatus(true)
|
mOrderCallback?.updateReturnCarStatus(true)
|
||||||
queryCurrentServiceStatus()
|
queryCurrentServiceStatus()
|
||||||
|
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
|
|||||||
protected final List<NaviLatLng> eList = new ArrayList<NaviLatLng>();
|
protected final List<NaviLatLng> eList = new ArrayList<NaviLatLng>();
|
||||||
protected List<NaviLatLng> mWayPointList = new ArrayList<NaviLatLng>();
|
protected List<NaviLatLng> mWayPointList = new ArrayList<NaviLatLng>();
|
||||||
private volatile ICommonNaviChangedCallback mNaviChangedCallback;
|
private volatile ICommonNaviChangedCallback mNaviChangedCallback;
|
||||||
private AtomicInteger errorCount = new AtomicInteger(0);
|
private final AtomicInteger errorCount = new AtomicInteger(0);
|
||||||
private boolean isPlay;
|
private boolean isPlay;
|
||||||
|
|
||||||
public static AmapNaviToDestinationModel getInstance(Context context) {
|
public static AmapNaviToDestinationModel getInstance(Context context) {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.mogo.och.common.module.wigets.sfv;
|
package com.mogo.och.common.module.wigets.sfv;
|
||||||
|
|
||||||
|
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
@@ -12,6 +14,8 @@ import android.os.Handler;
|
|||||||
import android.os.HandlerThread;
|
import android.os.HandlerThread;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -21,6 +25,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
* a SurfaceView which draws bitmaps one after another like frame animation
|
* a SurfaceView which draws bitmaps one after another like frame animation
|
||||||
*/
|
*/
|
||||||
public class FrameSurfaceView extends BaseSurfaceView {
|
public class FrameSurfaceView extends BaseSurfaceView {
|
||||||
|
private static final String TAG = "FrameSurfaceView";
|
||||||
public static final int INVALID_INDEX = Integer.MAX_VALUE;
|
public static final int INVALID_INDEX = Integer.MAX_VALUE;
|
||||||
private final int bufferSize = 3;
|
private final int bufferSize = 3;
|
||||||
public static final String DECODE_THREAD_NAME = "DecodingThread";
|
public static final String DECODE_THREAD_NAME = "DecodingThread";
|
||||||
@@ -320,6 +325,7 @@ public class FrameSurfaceView extends BaseSurfaceView {
|
|||||||
decodedBitmaps.put(linkedBitmap);
|
decodedBitmaps.put(linkedBitmap);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
CallerLogger.e(M_HMI + TAG, "decodeAndPutBitmap error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,6 +344,7 @@ public class FrameSurfaceView extends BaseSurfaceView {
|
|||||||
bitmap = drawnBitmaps.take();
|
bitmap = drawnBitmaps.take();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
CallerLogger.e(M_HMI + TAG, "getDrawnBitmap error");
|
||||||
}
|
}
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
@@ -354,6 +361,7 @@ public class FrameSurfaceView extends BaseSurfaceView {
|
|||||||
bitmap = decodedBitmaps.take();
|
bitmap = decodedBitmaps.take();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
CallerLogger.e(M_HMI + TAG, "getDecodedBitmap error");
|
||||||
}
|
}
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class BusRoutesResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setSite(List<BusStationBean> site) {
|
public void setSite(List<BusStationBean> site) {
|
||||||
this.sites = sites;
|
this.sites = site;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTaskTime() {
|
public long getTaskTime() {
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class BusProvider implements IMogoOCH {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String getFunctionName() {
|
public String getFunctionName() {
|
||||||
return null;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -605,6 +605,8 @@ public class OrderModel {
|
|||||||
clearBusStationDatas();
|
clearBusStationDatas();
|
||||||
queryBusRoutes();
|
queryBusRoutes();
|
||||||
removeTipRunnables();
|
removeTipRunnables();
|
||||||
|
// 取消自驾
|
||||||
|
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
|
||||||
// startOrStopQueryPassengerWriteOff(false);
|
// startOrStopQueryPassengerWriteOff(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -698,7 +700,7 @@ public class OrderModel {
|
|||||||
beanPre.setLeaving(false);
|
beanPre.setLeaving(false);
|
||||||
sites.set(currentIndex -1,beanPre);
|
sites.set(currentIndex -1,beanPre);
|
||||||
}
|
}
|
||||||
busRoutesResult.setSite(sites);
|
//busRoutesResult.setSite(sites);
|
||||||
|
|
||||||
pushCacheTransferData(busRoutesResult);
|
pushCacheTransferData(busRoutesResult);
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import androidx.lifecycle.LifecycleOwner;
|
|||||||
import com.mogo.commons.AbsMogoApplication;
|
import com.mogo.commons.AbsMogoApplication;
|
||||||
import com.mogo.commons.mvp.Presenter;
|
import com.mogo.commons.mvp.Presenter;
|
||||||
import com.mogo.commons.voice.AIAssist;
|
import com.mogo.commons.voice.AIAssist;
|
||||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
|
||||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||||
@@ -34,7 +33,6 @@ import com.mogo.och.common.module.biz.constant.LoginStatusManager;
|
|||||||
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
|
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
|
||||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -55,7 +53,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
|||||||
|
|
||||||
private static final String TAG = "BusPresenter";
|
private static final String TAG = "BusPresenter";
|
||||||
|
|
||||||
private List<BusStationBean> mStationList = new ArrayList<>();
|
private final List<BusStationBean> mStationList = new ArrayList<>();
|
||||||
private int mCurrentStation = 0;
|
private int mCurrentStation = 0;
|
||||||
|
|
||||||
public BusPresenter(BusFragment view) {
|
public BusPresenter(BusFragment view) {
|
||||||
@@ -164,10 +162,6 @@ public class BusPresenter extends Presenter<BusFragment>
|
|||||||
public void onAutopilotSNRequest() {
|
public void onAutopilotSNRequest() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAutopilotStatusResponse(int state) {
|
public void onAutopilotStatusResponse(int state) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
@@ -206,7 +200,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
|||||||
@Override
|
@Override
|
||||||
public void onCarLocationChanged(MogoLocation location) {
|
public void onCarLocationChanged(MogoLocation location) {
|
||||||
if (null != location) {
|
if (null != location) {
|
||||||
runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed()));
|
runOnUIThread(() -> mView.updateSpeedView(location.getGnssSpeed()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,9 +231,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
|||||||
* 测试使用
|
* 测试使用
|
||||||
*/
|
*/
|
||||||
public void debugAutoPilotStatus(int status) {
|
public void debugAutoPilotStatus(int status) {
|
||||||
AutopilotStatusInfo info = new AutopilotStatusInfo();
|
onAutopilotStatusResponse(status);
|
||||||
info.setState(status);
|
|
||||||
onAutopilotStatusResponse(info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -532,11 +532,6 @@ public class BusPassengerModel {
|
|||||||
|
|
||||||
private boolean arriveAtEnd = false; //乘客app专用字段
|
private boolean arriveAtEnd = false; //乘客app专用字段
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAutopilotSNRequest() {
|
public void onAutopilotSNRequest() {
|
||||||
|
|
||||||
@@ -570,6 +565,9 @@ public class BusPassengerModel {
|
|||||||
public synchronized void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {
|
public synchronized void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {
|
||||||
// CallerLogger.d(M_BUS_P + TAG, "onAutopilotRotting = "
|
// CallerLogger.d(M_BUS_P + TAG, "onAutopilotRotting = "
|
||||||
// + GsonUtil.jsonFromObject(routeList));
|
// + GsonUtil.jsonFromObject(routeList));
|
||||||
|
if(routeList == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
List<MessagePad.Location> routePoints = routeList.getWayPointsList();
|
List<MessagePad.Location> routePoints = routeList.getWayPointsList();
|
||||||
|
|
||||||
if(globalPathTruncation!=null&&!globalPathTruncation.isDisposed()){
|
if(globalPathTruncation!=null&&!globalPathTruncation.isDisposed()){
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import com.mogo.commons.AbsMogoApplication;
|
|||||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||||
import com.mogo.commons.module.status.MogoStatusManager;
|
import com.mogo.commons.module.status.MogoStatusManager;
|
||||||
import com.mogo.commons.module.status.StatusDescriptor;
|
import com.mogo.commons.module.status.StatusDescriptor;
|
||||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||||
@@ -694,11 +693,6 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
|||||||
return MoGoAiCloudClientConfig.getInstance().getSn();
|
return MoGoAiCloudClientConfig.getInstance().getSn();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotStatusResponse(@NonNull AutopilotStatusInfo autoPilotStatusInfo) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {
|
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {
|
||||||
DebugView.Companion.printInfoMsg("[MAP到站通知] 上报到站,endLocation=("
|
DebugView.Companion.printInfoMsg("[MAP到站通知] 上报到站,endLocation=("
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import android.widget.ImageView
|
|||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import chassis.Chassis.GearPosition
|
import chassis.Chassis.GearPosition
|
||||||
import chassis.Chassis.LightSwitch
|
|
||||||
import chassis.ChassisStatesOuterClass.BMSSystemStates
|
import chassis.ChassisStatesOuterClass.BMSSystemStates
|
||||||
import chassis.ChassisStatesOuterClass.SweeperFuTianTaskSystemStates
|
import chassis.ChassisStatesOuterClass.SweeperFuTianTaskSystemStates
|
||||||
import com.elegant.utils.UiThreadHandler
|
import com.elegant.utils.UiThreadHandler
|
||||||
@@ -27,7 +26,6 @@ import kotlin.math.roundToInt
|
|||||||
*/
|
*/
|
||||||
class SweeperCloudTrafficDataView : ConstraintLayout,
|
class SweeperCloudTrafficDataView : ConstraintLayout,
|
||||||
IMoGoBatteryManagementSystemListener,
|
IMoGoBatteryManagementSystemListener,
|
||||||
IMoGoChassisLamplightListener,
|
|
||||||
IMoGoChassisGearStateListener,
|
IMoGoChassisGearStateListener,
|
||||||
IMoGoSweeperFutianCleanSystemListener {
|
IMoGoSweeperFutianCleanSystemListener {
|
||||||
private var tapPositionView //方向盘下方的档位
|
private var tapPositionView //方向盘下方的档位
|
||||||
@@ -78,8 +76,6 @@ class SweeperCloudTrafficDataView : ConstraintLayout,
|
|||||||
super.onAttachedToWindow()
|
super.onAttachedToWindow()
|
||||||
//电量
|
//电量
|
||||||
CallerBatteryManagementSystemListenerManager.addListener(TAG, this)
|
CallerBatteryManagementSystemListenerManager.addListener(TAG, this)
|
||||||
//转向灯
|
|
||||||
CallerChassisLamplightListenerManager.addListener(TAG, this)
|
|
||||||
//档位
|
//档位
|
||||||
CallerChassisGearStateListenerManager.addListener(TAG, this)
|
CallerChassisGearStateListenerManager.addListener(TAG, this)
|
||||||
//清扫车相关数据接口
|
//清扫车相关数据接口
|
||||||
@@ -89,7 +85,6 @@ class SweeperCloudTrafficDataView : ConstraintLayout,
|
|||||||
override fun onDetachedFromWindow() {
|
override fun onDetachedFromWindow() {
|
||||||
super.onDetachedFromWindow()
|
super.onDetachedFromWindow()
|
||||||
CallerBatteryManagementSystemListenerManager.removeListener(TAG)
|
CallerBatteryManagementSystemListenerManager.removeListener(TAG)
|
||||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
|
||||||
CallerChassisGearStateListenerManager.removeListener(TAG)
|
CallerChassisGearStateListenerManager.removeListener(TAG)
|
||||||
CallerSweeperFutianCleanSystemListenerManager.removeListener(TAG)
|
CallerSweeperFutianCleanSystemListenerManager.removeListener(TAG)
|
||||||
}
|
}
|
||||||
@@ -127,14 +122,6 @@ class SweeperCloudTrafficDataView : ConstraintLayout,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆转向灯
|
|
||||||
* @param directionLight
|
|
||||||
*/
|
|
||||||
override fun onAutopilotLightSwitchData(lightSwitch: LightSwitch?) {
|
|
||||||
//转向灯状态 0是正常 1是左转 2是右转
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置自动驾驶状态
|
* 设置自动驾驶状态
|
||||||
*/
|
*/
|
||||||
@@ -163,14 +150,6 @@ class SweeperCloudTrafficDataView : ConstraintLayout,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 刹车灯
|
|
||||||
* @param brakeLight
|
|
||||||
*/
|
|
||||||
override fun onAutopilotBrakeLightData(brakeLight: Boolean) {
|
|
||||||
d(TAG, "刹车灯:$brakeLight")
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 方向盘下方的档位
|
* 方向盘下方的档位
|
||||||
* @param gear
|
* @param gear
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ public abstract class BaseSweeperOperateTabFragment<V extends IView, P extends P
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String format(double value) {
|
public static String format(double value) {
|
||||||
BigDecimal bd = new BigDecimal(value);
|
BigDecimal bd = BigDecimal.valueOf(value);
|
||||||
bd = bd.setScale(2, RoundingMode.HALF_UP);
|
bd = bd.setScale(2, RoundingMode.HALF_UP);
|
||||||
return bd.toString();
|
return bd.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import androidx.lifecycle.LifecycleOwner;
|
|||||||
import com.amap.api.maps.model.LatLng;
|
import com.amap.api.maps.model.LatLng;
|
||||||
import com.mogo.commons.AbsMogoApplication;
|
import com.mogo.commons.AbsMogoApplication;
|
||||||
import com.mogo.commons.mvp.Presenter;
|
import com.mogo.commons.mvp.Presenter;
|
||||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
|
||||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||||
@@ -121,10 +120,6 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
|
|||||||
public void onAutopilotRouteLineId(long lineId) {
|
public void onAutopilotRouteLineId(long lineId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAutopilotStatusResponse(int state) {
|
public void onAutopilotStatusResponse(int state) {
|
||||||
SweeperOperateTaskModel.getInstance().setAutopilotState(state);
|
SweeperOperateTaskModel.getInstance().setAutopilotState(state);
|
||||||
@@ -183,7 +178,7 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
|
|||||||
@Override
|
@Override
|
||||||
public void onCarLocationChanged(MogoLocation location) {
|
public void onCarLocationChanged(MogoLocation location) {
|
||||||
if (null != location) {
|
if (null != location) {
|
||||||
ThreadUtils.runOnUiThread(() -> mView.updateSpeedView((float) location.getGnssSpeed()));
|
ThreadUtils.runOnUiThread(() -> mView.updateSpeedView(location.getGnssSpeed()));
|
||||||
ThreadUtils.runOnUiThread(() -> mView.setCurrentLocation(location));
|
ThreadUtils.runOnUiThread(() -> mView.setCurrentLocation(location));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -216,9 +211,7 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
|
|||||||
* 测试使用
|
* 测试使用
|
||||||
*/
|
*/
|
||||||
public void debugAutoPilotStatus(int status) {
|
public void debugAutoPilotStatus(int status) {
|
||||||
AutopilotStatusInfo info = new AutopilotStatusInfo();
|
onAutopilotStatusResponse(status);
|
||||||
info.setState(status);
|
|
||||||
onAutopilotStatusResponse(info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -372,7 +365,7 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String format(double value) {
|
public static String format(double value) {
|
||||||
BigDecimal bd = new BigDecimal(value);
|
BigDecimal bd = BigDecimal.valueOf(value);
|
||||||
bd = bd.setScale(2, RoundingMode.HALF_UP);
|
bd = bd.setScale(2, RoundingMode.HALF_UP);
|
||||||
return bd.toString();
|
return bd.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public class SlidePanelView extends View {
|
|||||||
NORMAL_TEXT_MARGIN_RIGHT = (int) mTypedArray.getDimension(R.styleable.SlidePanelView_NORMAL_TEXT_MARGIN_RIGHT, NORMAL_TEXT_MARGIN_RIGHT);
|
NORMAL_TEXT_MARGIN_RIGHT = (int) mTypedArray.getDimension(R.styleable.SlidePanelView_NORMAL_TEXT_MARGIN_RIGHT, NORMAL_TEXT_MARGIN_RIGHT);
|
||||||
SHORT_TEXT_MARGIN_LEFT = (int) mTypedArray.getDimension(R.styleable.SlidePanelView_SHORT_TEXT_MARGIN_LEFT, SHORT_TEXT_MARGIN_LEFT);
|
SHORT_TEXT_MARGIN_LEFT = (int) mTypedArray.getDimension(R.styleable.SlidePanelView_SHORT_TEXT_MARGIN_LEFT, SHORT_TEXT_MARGIN_LEFT);
|
||||||
SHORT_TEXT_MARGIN_RIGHT = (int) mTypedArray.getDimension(R.styleable.SlidePanelView_SHORT_TEXT_MARGIN_RIGHT, SHORT_TEXT_MARGIN_RIGHT);
|
SHORT_TEXT_MARGIN_RIGHT = (int) mTypedArray.getDimension(R.styleable.SlidePanelView_SHORT_TEXT_MARGIN_RIGHT, SHORT_TEXT_MARGIN_RIGHT);
|
||||||
|
mTypedArray.recycle();
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@ public class SlidePanelView extends View {
|
|||||||
private ObjectAnimator matrixAnim;
|
private ObjectAnimator matrixAnim;
|
||||||
|
|
||||||
private String blockText = STRING_SLIDE_TO_RIGHT;
|
private String blockText = STRING_SLIDE_TO_RIGHT;
|
||||||
private Paint.FontMetrics blockTextMetrics = new Paint.FontMetrics();
|
private final Paint.FontMetrics blockTextMetrics = new Paint.FontMetrics();
|
||||||
|
|
||||||
private static final int GRADIENT_OFFSET = 200;
|
private static final int GRADIENT_OFFSET = 200;
|
||||||
|
|
||||||
@@ -239,10 +240,10 @@ public class SlidePanelView extends View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startBlockBackAnim() {
|
private void startBlockBackAnim() {
|
||||||
ObjectAnimator blockBackanimator = ObjectAnimator.ofInt(this, "blockOffset", blockOffset, 0);
|
ObjectAnimator blockBackAnimator = ObjectAnimator.ofInt(this, "blockOffset", blockOffset, 0);
|
||||||
blockBackanimator.setInterpolator(new DecelerateInterpolator());
|
blockBackAnimator.setInterpolator(new DecelerateInterpolator());
|
||||||
blockBackanimator.setDuration(1000 * blockOffset / getWidth());
|
blockBackAnimator.setDuration(1000L * blockOffset / getWidth());
|
||||||
blockBackanimator.start();
|
blockBackAnimator.start();
|
||||||
lastX = 0;
|
lastX = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,10 +256,10 @@ public class SlidePanelView extends View {
|
|||||||
gradientMatrix.setTranslate(matrixTranslate, 0);
|
gradientMatrix.setTranslate(matrixTranslate, 0);
|
||||||
textGradient.setLocalMatrix(gradientMatrix);
|
textGradient.setLocalMatrix(gradientMatrix);
|
||||||
canvas.save();
|
canvas.save();
|
||||||
canvas.drawText(blockText, blockWidth + BLOCK_START_X + textMarginLeft, textOffset, textPaint);
|
canvas.drawText(blockText, (float) (blockWidth + BLOCK_START_X + textMarginLeft), (float) textOffset, textPaint);
|
||||||
canvas.restore();
|
canvas.restore();
|
||||||
// 画滑块
|
// 画滑块
|
||||||
canvas.drawBitmap(bmBlock, BLOCK_START_X + blockOffset, BLOCK_START_Y, blockPaint);
|
canvas.drawBitmap(bmBlock, (float) (BLOCK_START_X + blockOffset), (float) BLOCK_START_Y, blockPaint);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnSlidePanelMoveToEndListener {
|
public interface OnSlidePanelMoveToEndListener {
|
||||||
|
|||||||
@@ -131,9 +131,10 @@ class SweeperOperateTrafficDataView : ConstraintLayout,
|
|||||||
tvBattery?.text = "${states.bmsSoc.roundToInt()}%"
|
tvBattery?.text = "${states.bmsSoc.roundToInt()}%"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆转向灯
|
* 车辆转向灯
|
||||||
* @param directionLight
|
* @param lightSwitch
|
||||||
*/
|
*/
|
||||||
override fun onAutopilotLightSwitchData(lightSwitch: LightSwitch?) {
|
override fun onAutopilotLightSwitchData(lightSwitch: LightSwitch?) {
|
||||||
//转向灯状态 0是正常 1是左转 2是右转
|
//转向灯状态 0是正常 1是左转 2是右转
|
||||||
@@ -142,13 +143,6 @@ class SweeperOperateTrafficDataView : ConstraintLayout,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 刹车灯
|
|
||||||
* @param brakeLight
|
|
||||||
*/
|
|
||||||
override fun onAutopilotBrakeLightData(brakeLight: Boolean) {
|
|
||||||
d(TAG, "刹车灯:$brakeLight")
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 方向盘下方的档位
|
* 方向盘下方的档位
|
||||||
* @param gear
|
* @param gear
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class TaxiProvider implements IMogoOCH {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String getFunctionName() {
|
public String getFunctionName() {
|
||||||
return null;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -1210,10 +1210,6 @@ public class TaxiModel {
|
|||||||
TaxiTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo);
|
TaxiTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAutopilotStatusResponse(int state) {
|
public void onAutopilotStatusResponse(int state) {
|
||||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ public class TaxiGrabOrderFragment extends BaseTaxiUIFragment implements View.On
|
|||||||
}else if (v.getId() == R.id.grab_order_tv){
|
}else if (v.getId() == R.id.grab_order_tv){
|
||||||
if (!mOrderGrabBt.getText().toString().equals("抢单中...")){
|
if (!mOrderGrabBt.getText().toString().equals("抢单中...")){
|
||||||
getOchTaxiFragment().grabOrder();
|
getOchTaxiFragment().grabOrder();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -151,7 +150,7 @@ public class TaxiGrabOrderFragment extends BaseTaxiUIFragment implements View.On
|
|||||||
}
|
}
|
||||||
mGrabSuccessAnim.start();
|
mGrabSuccessAnim.start();
|
||||||
//开启动画结束的监听
|
//开启动画结束的监听
|
||||||
long delayMillis = mGrabSuccessAnim.getDuration(0) * mGrabSuccessAnim.getNumberOfFrames();
|
long delayMillis = (long) mGrabSuccessAnim.getDuration(0) * mGrabSuccessAnim.getNumberOfFrames();
|
||||||
UiThreadHandler.postDelayed(new Runnable() {
|
UiThreadHandler.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -174,7 +173,7 @@ public class TaxiGrabOrderFragment extends BaseTaxiUIFragment implements View.On
|
|||||||
mGrabFailureAnim = (AnimationDrawable)mGrabResultAnimView.getDrawable();
|
mGrabFailureAnim = (AnimationDrawable)mGrabResultAnimView.getDrawable();
|
||||||
mGrabFailureAnim.start();
|
mGrabFailureAnim.start();
|
||||||
//开启动画结束的监听
|
//开启动画结束的监听
|
||||||
long delayMillis = mGrabFailureAnim.getDuration(0) * mGrabFailureAnim.getNumberOfFrames();
|
long delayMillis = (long) mGrabFailureAnim.getDuration(0) * mGrabFailureAnim.getNumberOfFrames();
|
||||||
UiThreadHandler.postDelayed(new Runnable() {
|
UiThreadHandler.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
@@ -68,12 +68,11 @@ public class TaxiPersonalDialogFragment extends
|
|||||||
private ViewPager mOperationViewPager;
|
private ViewPager mOperationViewPager;
|
||||||
private OrderAdapter mAdapter;
|
private OrderAdapter mAdapter;
|
||||||
private ConstraintLayout mNoDatas;
|
private ConstraintLayout mNoDatas;
|
||||||
private List<OrderQueryRespBean.Result> orders = new ArrayList<>();
|
private final List<OrderQueryRespBean.Result> orders = new ArrayList<>();
|
||||||
private String[] mTabTitles = {"在线时长","订单完成数"};
|
private final String[] mTabTitles = {"在线时长","订单完成数"};
|
||||||
private List<TaxiOperationDatasFragment> fragments = new ArrayList<>();
|
private final List<TaxiOperationDatasFragment> fragments = new ArrayList<>();
|
||||||
private int mNextPage = 1;//订单列表分页从1开始
|
private int mNextPage = 1;//订单列表分页从1开始
|
||||||
private int mPerPageSize = 10;
|
private final int mPerPageSize = 10;
|
||||||
private static TaxiFragment mTaxiFragment;
|
|
||||||
private static boolean serverHadNoData = false;
|
private static boolean serverHadNoData = false;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@@ -177,7 +176,6 @@ public class TaxiPersonalDialogFragment extends
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mOperationTab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
mOperationTab.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
@Override
|
@Override
|
||||||
public void onTabSelected(TabLayout.Tab tab) {
|
public void onTabSelected(TabLayout.Tab tab) {
|
||||||
mOperationViewPager.setCurrentItem(tab.getPosition());
|
mOperationViewPager.setCurrentItem(tab.getPosition());
|
||||||
@@ -185,7 +183,6 @@ public class TaxiPersonalDialogFragment extends
|
|||||||
fragments.get(tab.getPosition()).setmType(tab.getPosition());
|
fragments.get(tab.getPosition()).setmType(tab.getPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
@Override
|
@Override
|
||||||
public void onTabUnselected(TabLayout.Tab tab) {
|
public void onTabUnselected(TabLayout.Tab tab) {
|
||||||
changeOperationTabLayoutTabUI(tab,false);
|
changeOperationTabLayoutTabUI(tab,false);
|
||||||
@@ -311,17 +308,14 @@ public class TaxiPersonalDialogFragment extends
|
|||||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
if (viewType == ORDER_DETAIL_ITEM){
|
if (viewType == ORDER_DETAIL_ITEM){
|
||||||
View view = LayoutInflater.from(context).inflate(R.layout.taxi_orders_list_item,parent,false);
|
View view = LayoutInflater.from(context).inflate(R.layout.taxi_orders_list_item,parent,false);
|
||||||
OrderDetailViewHolder viewHolder = new OrderDetailViewHolder(view);
|
return new OrderDetailViewHolder(view);
|
||||||
return viewHolder;
|
|
||||||
}else if (viewType == DAY_GROUP_ITEM){
|
}else if (viewType == DAY_GROUP_ITEM){
|
||||||
View view = LayoutInflater.from(context).inflate(R.layout.taxi_orders_list_day_item,parent,false);
|
View view = LayoutInflater.from(context).inflate(R.layout.taxi_orders_list_day_item,parent,false);
|
||||||
DayGroupViewHolder viewHolder = new DayGroupViewHolder(view);
|
return new DayGroupViewHolder(view);
|
||||||
return viewHolder;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||||
OrderQueryRespBean.Result queryRespBean = orders.get(position);
|
OrderQueryRespBean.Result queryRespBean = orders.get(position);
|
||||||
@@ -383,8 +377,7 @@ public class TaxiPersonalDialogFragment extends
|
|||||||
String currentDate = DateTimeUtil.getYMDTime(orders.get(position).createTime);//获取当前订单时间
|
String currentDate = DateTimeUtil.getYMDTime(orders.get(position).createTime);//获取当前订单时间
|
||||||
int nextIndex = position + 1;
|
int nextIndex = position + 1;
|
||||||
String preDate = DateTimeUtil.getYMDTime(orders.get(nextIndex).createTime);
|
String preDate = DateTimeUtil.getYMDTime(orders.get(nextIndex).createTime);
|
||||||
boolean isDifferent = preDate.equals(currentDate);//订单跟后一个订单是否是同一天
|
return preDate.equals(currentDate);//一样有划分线, 不一样没有划分线
|
||||||
return isDifferent;//一样有划分线, 不一样没有划分线
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,7 +386,6 @@ public class TaxiPersonalDialogFragment extends
|
|||||||
return orders.size();
|
return orders.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
private void bindOrderDetailData(OrderQueryRespBean.Result queryRespBean, TextView orderTimeTv, TextView startStationTv, TextView endStationTv,
|
private void bindOrderDetailData(OrderQueryRespBean.Result queryRespBean, TextView orderTimeTv, TextView startStationTv, TextView endStationTv,
|
||||||
Button orderStatusBt, Button orderTypeBt, TextView orderNumTv){
|
Button orderStatusBt, Button orderTypeBt, TextView orderNumTv){
|
||||||
Calendar calendar= Calendar.getInstance();
|
Calendar calendar= Calendar.getInstance();
|
||||||
@@ -406,7 +398,6 @@ public class TaxiPersonalDialogFragment extends
|
|||||||
orderNumTv.setText("订单编号:"+String.valueOf(queryRespBean.orderNo));
|
orderNumTv.setText("订单编号:"+String.valueOf(queryRespBean.orderNo));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
private String getOrderStatus(int status, Button button){
|
private String getOrderStatus(int status, Button button){
|
||||||
TaxiOrderStatusEnum orderStatus = TaxiOrderStatusEnum.valueOf(status);
|
TaxiOrderStatusEnum orderStatus = TaxiOrderStatusEnum.valueOf(status);
|
||||||
switch (orderStatus){
|
switch (orderStatus){
|
||||||
@@ -422,7 +413,6 @@ public class TaxiPersonalDialogFragment extends
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
|
||||||
private String getOrderType(int type, Button button){
|
private String getOrderType(int type, Button button){
|
||||||
if (type == TaxiOrderTypeEnum.Reserved.getType()){
|
if (type == TaxiOrderTypeEnum.Reserved.getType()){
|
||||||
button.setBackground(context.getDrawable(R.drawable.taxi_order_button_type_reserver_bg));
|
button.setBackground(context.getDrawable(R.drawable.taxi_order_button_type_reserver_bg));
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class MogoOCHTaxiPassenger implements IMogoOCH {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String getFunctionName() {
|
public String getFunctionName() {
|
||||||
return null;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.mogo.och.taxi.bean.QueryCurrentTaskRespBean
|
|||||||
import com.mogo.och.taxi.bean.TrajectoryListRespBean
|
import com.mogo.och.taxi.bean.TrajectoryListRespBean
|
||||||
|
|
||||||
interface ITaxiTaskWithOrderCallback {
|
interface ITaxiTaskWithOrderCallback {
|
||||||
|
fun onTaskWithOrderQuerySuccess(timeMillis: Long)
|
||||||
fun onTaskWithOrderDataChanged(taskWithOrder: QueryCurrentTaskRespBean.Result?)
|
fun onTaskWithOrderDataChanged(taskWithOrder: QueryCurrentTaskRespBean.Result?)
|
||||||
fun onTaskCompleted(result: QueryCurrentTaskRespBean.Result?)
|
fun onTaskCompleted(result: QueryCurrentTaskRespBean.Result?)
|
||||||
fun onTaskStarted(result: QueryCurrentTaskRespBean.Result?)
|
fun onTaskStarted(result: QueryCurrentTaskRespBean.Result?)
|
||||||
|
|||||||
@@ -42,10 +42,12 @@ import kotlinx.android.synthetic.main.taxi_debug_order.view.currentLineId
|
|||||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrder
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrder
|
||||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderStopInfo
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderStopInfo
|
||||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderTrajectoryInfo
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderTrajectoryInfo
|
||||||
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentOrderTrajectoryTime
|
||||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentStatus
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentStatus
|
||||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentTaskType
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.currentTaskType
|
||||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.debugLogHistoryTextView
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.debugLogHistoryTextView
|
||||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.debugLogTitleTextView
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.debugLogTitleTextView
|
||||||
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.lastQuerySuccessDataTimestamps
|
||||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderEndSiteInfo
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderEndSiteInfo
|
||||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderNo
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderNo
|
||||||
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderPreLoadLines
|
import kotlinx.android.synthetic.main.taxi_debug_order.view.orderPreLoadLines
|
||||||
@@ -126,6 +128,16 @@ public class DebugView @JvmOverloads constructor(
|
|||||||
DateTimeUtil.yyyy_MM_dd_HH_mm_ss
|
DateTimeUtil.yyyy_MM_dd_HH_mm_ss
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun formatDateTimeString(timeMillis: Long): String {
|
||||||
|
if (timeMillis <= 0L) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return DateTimeUtil.formatCalendarToString(
|
||||||
|
DateTimeUtil.formatLongToCalendar(timeMillis),
|
||||||
|
DateTimeUtil.yyyy_MM_dd_HH_mm_ss
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val broadcastReceiver = object : BroadcastReceiver() {
|
private val broadcastReceiver = object : BroadcastReceiver() {
|
||||||
@@ -198,6 +210,7 @@ public class DebugView @JvmOverloads constructor(
|
|||||||
initCurrentBusinessMode()
|
initCurrentBusinessMode()
|
||||||
initViewByTaskData(TaxiTaskModel.getCurrentTaskWithOrder())
|
initViewByTaskData(TaxiTaskModel.getCurrentTaskWithOrder())
|
||||||
initDebugLogTextViewTitle()
|
initDebugLogTextViewTitle()
|
||||||
|
initLastTaskDataQuerySuccess(0L)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initCurrentBusinessMode() {
|
private fun initCurrentBusinessMode() {
|
||||||
@@ -207,11 +220,16 @@ public class DebugView @JvmOverloads constructor(
|
|||||||
"当前业务模式:${if (isRoutingVerifyMode) "自主算路验证模式" else "无人化运营流程模式"}"
|
"当前业务模式:${if (isRoutingVerifyMode) "自主算路验证模式" else "无人化运营流程模式"}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun initLastTaskDataQuerySuccess(timeMillis: Long) {
|
||||||
|
lastQuerySuccessDataTimestamps.text =
|
||||||
|
"【最新数据查询成功时间】${formatDateTimeString(timeMillis)}"
|
||||||
|
}
|
||||||
|
|
||||||
private fun initViewByTaskData(data: QueryCurrentTaskRespBean.Result?) {
|
private fun initViewByTaskData(data: QueryCurrentTaskRespBean.Result?) {
|
||||||
//release包下隐藏Mock按钮,避免司机误操作
|
//release包下隐藏Mock按钮,避免司机误操作
|
||||||
btnContainer.visibility = if (AppUtils.isAppDebug()) View.VISIBLE else View.INVISIBLE
|
btnContainer.visibility = if (AppUtils.isAppDebug()) View.VISIBLE else View.INVISIBLE
|
||||||
val curContrail = TaxiTaskModel.getCurrentTaskTrajectory()
|
val curContrail = TaxiTaskModel.getCurrentTaskTrajectory()
|
||||||
currentDataTimestamps.text = "【当前数据返回时间】${currentDateTimeString()}"
|
currentDataTimestamps.text = "【当前数据更新时间】${currentDateTimeString()}"
|
||||||
currentCarStatus.text =
|
currentCarStatus.text =
|
||||||
"【当前车辆状态】${data?.servingStatus} --> ${if (data?.servingStatus == 1) "开始接单" else "暂停接单"}"
|
"【当前车辆状态】${data?.servingStatus} --> ${if (data?.servingStatus == 1) "开始接单" else "暂停接单"}"
|
||||||
currentTaskType.text =
|
currentTaskType.text =
|
||||||
@@ -233,10 +251,12 @@ public class DebugView @JvmOverloads constructor(
|
|||||||
"【订单终点】${data?.order?.orderEndSite?.siteName} siteId=${data?.order?.orderEndSite?.siteId}"
|
"【订单终点】${data?.order?.orderEndSite?.siteName} siteId=${data?.order?.orderEndSite?.siteId}"
|
||||||
orderPreLoadLines.text =
|
orderPreLoadLines.text =
|
||||||
"【接驾任务预加载lineIds】${GsonUtil.jsonFromObject(data?.order?.planningLines)}"
|
"【接驾任务预加载lineIds】${GsonUtil.jsonFromObject(data?.order?.planningLines)}"
|
||||||
|
currentOrderTrajectoryTime.text =
|
||||||
|
"【当前任务轨迹保存时间】contrailSaveTime=${formatDateTimeString(curContrail?.contrailSaveTime ?: 0L)} , contrailSaveTimeDPQP=${formatDateTimeString(curContrail?.contrailSaveTimeDPQP ?: 0L)}"
|
||||||
currentOrderTrajectoryInfo.text =
|
currentOrderTrajectoryInfo.text =
|
||||||
"【当前任务Traj信息】TrajMd5=${curContrail?.csvFileMd5} , TrajDPQPMd5=${curContrail?.csvFileMd5DPQP}"
|
"【当前任务轨迹Traj信息】TrajMd5=${curContrail?.csvFileMd5} , TrajDPQPMd5=${curContrail?.csvFileMd5DPQP}"
|
||||||
currentOrderStopInfo.text =
|
currentOrderStopInfo.text =
|
||||||
"【当前任务Stop信息】StopMd5=${curContrail?.txtFileMd5}, StopDPQPMd5=${curContrail?.txtFileMd5DPQP}"
|
"【当前任务轨迹Stop信息】StopMd5=${curContrail?.txtFileMd5}, StopDPQPMd5=${curContrail?.txtFileMd5DPQP}"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initDebugLogTextViewTitle() {
|
private fun initDebugLogTextViewTitle() {
|
||||||
@@ -246,6 +266,10 @@ public class DebugView @JvmOverloads constructor(
|
|||||||
if (isRoutingVerifyMode) "自主算路验证模式关键节点日志(司机端)" else "无人化运营流程关键节点日志(司机端)"
|
if (isRoutingVerifyMode) "自主算路验证模式关键节点日志(司机端)" else "无人化运营流程关键节点日志(司机端)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onTaskWithOrderQuerySuccess(timeMillis: Long) {
|
||||||
|
initLastTaskDataQuerySuccess(timeMillis)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onTaskWithOrderDataChanged(taskWithOrder: QueryCurrentTaskRespBean.Result?) {
|
override fun onTaskWithOrderDataChanged(taskWithOrder: QueryCurrentTaskRespBean.Result?) {
|
||||||
d(TAG, "onTaskWithOrderDataChanged")
|
d(TAG, "onTaskWithOrderDataChanged")
|
||||||
initViewByTaskData(taskWithOrder)
|
initViewByTaskData(taskWithOrder)
|
||||||
|
|||||||
@@ -232,6 +232,9 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onTaskWithOrderQuerySuccess(timeMillis: Long) {
|
||||||
|
}
|
||||||
|
|
||||||
override fun onTaskWithOrderDataChanged(result: QueryCurrentTaskRespBean.Result?) {
|
override fun onTaskWithOrderDataChanged(result: QueryCurrentTaskRespBean.Result?) {
|
||||||
d(TAG, "onTaskWithOrderChanged = result = " + GsonUtil.jsonFromObject(result))
|
d(TAG, "onTaskWithOrderChanged = result = " + GsonUtil.jsonFromObject(result))
|
||||||
DebugView.printInfoMsg("[查询TaskWithOrder信息] 更新数据, 刷新UI")
|
DebugView.printInfoMsg("[查询TaskWithOrder信息] 更新数据, 刷新UI")
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ object TaxiTaskModel {
|
|||||||
startFailedCode: String,
|
startFailedCode: String,
|
||||||
startFailedMessage: String
|
startFailedMessage: String
|
||||||
) {
|
) {
|
||||||
DebugView.printInfoMsg("[启自驾] 执行失败,code=$startFailedCode, msg=$startFailedMessage")
|
DebugView.printErrorMsg("[启自驾] 执行失败,code=$startFailedCode, msg=$startFailedMessage")
|
||||||
TaxiAnalyticsManager.getInstance()
|
TaxiAnalyticsManager.getInstance()
|
||||||
.triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage)
|
.triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage)
|
||||||
if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode) {
|
if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode) {
|
||||||
@@ -723,6 +723,12 @@ object TaxiTaskModel {
|
|||||||
object : OchCommonServiceCallback<QueryCurrentTaskRespBean> {
|
object : OchCommonServiceCallback<QueryCurrentTaskRespBean> {
|
||||||
override fun onSuccess(data: QueryCurrentTaskRespBean?) {
|
override fun onSuccess(data: QueryCurrentTaskRespBean?) {
|
||||||
//DebugView.printInfoMsg("[查询TaskWithOrder信息] success")
|
//DebugView.printInfoMsg("[查询TaskWithOrder信息] success")
|
||||||
|
val currentTimeStamp = System.currentTimeMillis()
|
||||||
|
mTaxiTaskWithOrderCallbackMap.forEach {
|
||||||
|
val listener = it.value
|
||||||
|
listener.onTaskWithOrderQuerySuccess(currentTimeStamp)
|
||||||
|
}
|
||||||
|
|
||||||
if (data?.data == null) {
|
if (data?.data == null) {
|
||||||
d(
|
d(
|
||||||
TAG,
|
TAG,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
android:id="@+id/unmanedTaskOrderContainer"
|
android:id="@+id/unmanedTaskOrderContainer"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_10">
|
android:layout_marginTop="@dimen/dp_5">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/btnContainer"
|
android:id="@+id/btnContainer"
|
||||||
@@ -97,11 +97,18 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_10"
|
android:layout_marginTop="@dimen/dp_5"
|
||||||
android:text="车辆当前任务&订单信息"
|
android:text="车辆当前任务&订单信息"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="@dimen/dp_24" />
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/lastQuerySuccessDataTimestamps"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/currentDataTimestamps"
|
android:id="@+id/currentDataTimestamps"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -156,6 +163,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
|
android:visibility="gone"
|
||||||
android:textSize="@dimen/dp_24" />
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -193,6 +201,13 @@
|
|||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="@dimen/dp_24" />
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/currentOrderTrajectoryTime"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/currentOrderTrajectoryInfo"
|
android:id="@+id/currentOrderTrajectoryInfo"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -213,7 +228,7 @@
|
|||||||
android:id="@+id/debugLogTitleTextView"
|
android:id="@+id/debugLogTitleTextView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_10"
|
android:layout_marginTop="@dimen/dp_5"
|
||||||
android:text="无人化运营流程关键节点日志(司机端)"
|
android:text="无人化运营流程关键节点日志(司机端)"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="@dimen/dp_24" />
|
android:textSize="@dimen/dp_24" />
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class MogoOCHTaxiPassenger implements IMogoOCH {
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public String getFunctionName() {
|
public String getFunctionName() {
|
||||||
return null;
|
return TAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -0,0 +1,225 @@
|
|||||||
|
package com.mogo.launcher.lancet;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.ColorStateList;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.graphics.drawable.StateListDrawable;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import androidx.core.graphics.drawable.DrawableCompat;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import com.knightboost.lancet.api.Origin;
|
||||||
|
import com.knightboost.lancet.api.Scope;
|
||||||
|
import com.knightboost.lancet.api.annotations.Group;
|
||||||
|
import com.knightboost.lancet.api.annotations.ImplementedInterface;
|
||||||
|
import com.knightboost.lancet.api.annotations.Insert;
|
||||||
|
import com.knightboost.lancet.api.annotations.ReplaceInvoke;
|
||||||
|
import com.knightboost.lancet.api.annotations.TargetClass;
|
||||||
|
import com.knightboost.lancet.api.annotations.TargetMethod;
|
||||||
|
import com.knightboost.lancet.api.annotations.Weaver;
|
||||||
|
import com.mogo.launcher.R;
|
||||||
|
|
||||||
|
@Weaver
|
||||||
|
@Group("view_pressed_state")
|
||||||
|
public class ViewPressedStateLancet {
|
||||||
|
|
||||||
|
@TargetClass(value = "android.view.View", scope = Scope.ALL)
|
||||||
|
@TargetMethod(methodName = "setOnClickListener")
|
||||||
|
@ReplaceInvoke
|
||||||
|
public static void setOnClickListener(View view, View.OnClickListener listener) {
|
||||||
|
if (view == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Object tag = view.getTag(R.id.click_pressed_attr_id);
|
||||||
|
checkSetBgIfNeed(view, tag == null ? null : (AttributeSet) tag);
|
||||||
|
view.setOnClickListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TargetClass(value = "android.view.View", scope = Scope.ALL)
|
||||||
|
@TargetMethod(methodName = "setOnLongClickListener")
|
||||||
|
@ReplaceInvoke
|
||||||
|
public static void setOnLongClickListener(View view, View.OnLongClickListener listener) {
|
||||||
|
if (view == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Object tag = view.getTag(R.id.click_pressed_attr_id);
|
||||||
|
checkSetBgIfNeed(view, tag == null ? null : (AttributeSet) tag);
|
||||||
|
view.setOnLongClickListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ImplementedInterface(value = "android.view.LayoutInflater$Factory", scope = Scope.LEAF)
|
||||||
|
@Insert(mayCreateSuper = true)
|
||||||
|
@TargetMethod(methodName = "onCreateView")
|
||||||
|
public View onCreateView(String name, Context context, AttributeSet attrs) {
|
||||||
|
View view = (View) Origin.call();
|
||||||
|
checkSetBgIfNeed(view, attrs);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ImplementedInterface(value = "android.view.LayoutInflater$Factory2", scope = Scope.LEAF)
|
||||||
|
@Insert(mayCreateSuper = true)
|
||||||
|
@TargetMethod(methodName = "onCreateView")
|
||||||
|
public View onCreateView(View parent, String name, Context context, AttributeSet attrs) {
|
||||||
|
View view = (View) Origin.call();
|
||||||
|
checkSetBgIfNeed(view, attrs);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void checkSetBgIfNeed(View view, AttributeSet attr) {
|
||||||
|
try {
|
||||||
|
TypedArray t = null;
|
||||||
|
float alpha;
|
||||||
|
boolean enabled;
|
||||||
|
try {
|
||||||
|
if (view == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Context context = view.getContext();
|
||||||
|
if (context == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (attr == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
t = context.obtainStyledAttributes(attr, R.styleable.ClickPressedStyle);
|
||||||
|
enabled = t.getBoolean(R.styleable.ClickPressedStyle_pressed_enabled, true);
|
||||||
|
if (!enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alpha = t.getFloat(R.styleable.ClickPressedStyle_pressed_alpha, 0.6f);
|
||||||
|
if (alpha < 0.0f || alpha > 1.0f) {
|
||||||
|
throw new AssertionError("view custom attr \\'alpha\\' must be in [0.0, 1.0]");
|
||||||
|
}
|
||||||
|
view.setTag(R.id.click_pressed_attr_id, attr);
|
||||||
|
} finally {
|
||||||
|
if (t != null) {
|
||||||
|
t.recycle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (view instanceof ImageView) {
|
||||||
|
ImageView image = (ImageView) view;
|
||||||
|
Drawable replaced = checkAndReplaceDrawable(image.getBackground(), alpha);
|
||||||
|
if (replaced != null) {
|
||||||
|
ViewCompat.setBackground(image, replaced);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
replaced = checkAndReplaceDrawable(image.getDrawable(), alpha);
|
||||||
|
if (replaced != null) {
|
||||||
|
image.setImageDrawable(replaced);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (view instanceof TextView) {
|
||||||
|
TextView text = (TextView) view;
|
||||||
|
Drawable replaced = checkAndReplaceDrawable(text.getBackground(), alpha);
|
||||||
|
if (replaced != null) {
|
||||||
|
ViewCompat.setBackground(text, replaced);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ColorStateList textColor = text.getTextColors();
|
||||||
|
if (textColor != null) {
|
||||||
|
int pressed = textColor.getColorForState(new int[]{ android.R.attr.state_pressed }, Integer.MIN_VALUE);
|
||||||
|
if (pressed != Integer.MIN_VALUE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int color = textColor.getColorForState(new int[] { android.R.attr.state_enabled }, Integer.MIN_VALUE);
|
||||||
|
int defaultColor = color;
|
||||||
|
if (color == Integer.MIN_VALUE) {
|
||||||
|
defaultColor = textColor.getDefaultColor();
|
||||||
|
}
|
||||||
|
int pressedColor = Color.argb((int)(Color.alpha(defaultColor) * alpha), Color.red(defaultColor), Color.green(defaultColor), Color.blue(defaultColor));
|
||||||
|
int disableColor = textColor.getColorForState(new int[] { -android.R.attr.state_enabled }, Integer.MIN_VALUE);
|
||||||
|
int size = 2;
|
||||||
|
if (disableColor != Integer.MIN_VALUE) {
|
||||||
|
size += 1;
|
||||||
|
}
|
||||||
|
int[][] states = new int[size][1];
|
||||||
|
int[] colors = new int[size];
|
||||||
|
states[0] = new int[] { android.R.attr.state_pressed };
|
||||||
|
colors[0] = pressedColor;
|
||||||
|
if (size > 2) {
|
||||||
|
states[1] = new int[] { -android.R.attr.state_enabled };
|
||||||
|
colors[1] = disableColor;
|
||||||
|
states[2] = new int[] { android.R.attr.state_enabled };
|
||||||
|
colors[2] = defaultColor;
|
||||||
|
} else {
|
||||||
|
states[1] = new int[] { -android.R.attr.state_pressed };
|
||||||
|
colors[1] = defaultColor;
|
||||||
|
}
|
||||||
|
ColorStateList newColor = new ColorStateList(states, colors);
|
||||||
|
text.setTextColor(newColor);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Drawable replaced = checkAndReplaceDrawable(view.getBackground(), alpha);
|
||||||
|
if (replaced != null) {
|
||||||
|
ViewCompat.setBackground(view, replaced);
|
||||||
|
}
|
||||||
|
} catch (Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Drawable checkAndReplaceDrawable(Drawable old, float alpha) {
|
||||||
|
if (old == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (old instanceof StateListDrawable) {
|
||||||
|
StateListDrawable drawable = (StateListDrawable) old;
|
||||||
|
int[] states = drawable.getState();
|
||||||
|
boolean hasPressed = false;
|
||||||
|
int index = 0;
|
||||||
|
int targetIndex = -1;
|
||||||
|
for (int state : states) {
|
||||||
|
if (!hasPressed && state == android.R.attr.state_pressed) {
|
||||||
|
hasPressed = true;
|
||||||
|
}
|
||||||
|
if (targetIndex == -1 && state != -android.R.attr.state_enabled) {
|
||||||
|
targetIndex = index;
|
||||||
|
}
|
||||||
|
if (hasPressed && targetIndex != -1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
index ++;
|
||||||
|
}
|
||||||
|
if (hasPressed) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (targetIndex != -1) {
|
||||||
|
Drawable origin= null;
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
|
origin = drawable.getStateDrawable(targetIndex);
|
||||||
|
} else {
|
||||||
|
origin = drawable.getCurrent();
|
||||||
|
}
|
||||||
|
if (origin != null) {
|
||||||
|
Drawable.ConstantState constantState = origin.getConstantState();
|
||||||
|
if (constantState != null) {
|
||||||
|
Drawable pressed = DrawableCompat.wrap(constantState.newDrawable().mutate());
|
||||||
|
pressed.setAlpha((int)(255 * alpha));
|
||||||
|
drawable.addState(new int[] {android.R.attr.state_pressed}, pressed);
|
||||||
|
return drawable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Drawable.ConstantState constantState = old.getConstantState();
|
||||||
|
if (constantState != null) {
|
||||||
|
StateListDrawable result = new StateListDrawable();
|
||||||
|
result.addState(new int[] { -android.R.attr.state_pressed }, old);
|
||||||
|
Drawable pressed = DrawableCompat.wrap(constantState.newDrawable().mutate());
|
||||||
|
pressed.setAlpha((int)(255 * alpha));
|
||||||
|
result.addState(new int[] { android.R.attr.state_pressed }, pressed);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -221,7 +221,7 @@ ext {
|
|||||||
weak_network : "com.mogo.weak:network:1.0.1",
|
weak_network : "com.mogo.weak:network:1.0.1",
|
||||||
btrace : "com.bytedance.btrace:rhea-core:2.0.0",
|
btrace : "com.bytedance.btrace:rhea-core:2.0.0",
|
||||||
|
|
||||||
mofang_runtime : "com.mogo.eagle.core.mofang:runtime:2.0.7",
|
mofang_runtime : "com.mogo.eagle.core.mofang:runtime:2.0.10",
|
||||||
log_runtime : "com.mogo.eagle.core.log.record:runtime:1.0.30",
|
log_runtime : "com.mogo.eagle.core.log.record:runtime:1.0.30",
|
||||||
|
|
||||||
// 安全证书
|
// 安全证书
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class DispatchAutoPilotManager private constructor() :
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ChainLog(
|
@ChainLog(
|
||||||
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
|
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||||
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
||||||
nodeAliasCode = ChainConstant.CHAIN_CODE_DISPATCH_RECEIVE,
|
nodeAliasCode = ChainConstant.CHAIN_CODE_DISPATCH_RECEIVE,
|
||||||
paramIndexes = [0]
|
paramIndexes = [0]
|
||||||
@@ -140,7 +140,7 @@ class DispatchAutoPilotManager private constructor() :
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ChainLog(
|
@ChainLog(
|
||||||
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
|
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||||
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
||||||
nodeAliasCode = ChainConstant.CHAIN_CODE_DISPATCH_START,
|
nodeAliasCode = ChainConstant.CHAIN_CODE_DISPATCH_START,
|
||||||
paramIndexes = [-1]
|
paramIndexes = [-1]
|
||||||
@@ -348,7 +348,7 @@ class DispatchAutoPilotManager private constructor() :
|
|||||||
AIAssist.getInstance(mContext).speakTTSVoice("云调度完成,车辆已到达${it.endLocAddress}")
|
AIAssist.getInstance(mContext).speakTTSVoice("云调度完成,车辆已到达${it.endLocAddress}")
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
V2XBizTrace.onAck(M_BIZ + TAG, mapOf("arriveErrorMsg" to "不在到站距离范围内", "ArriveAtStation" to arrivalNotification, "distanceFromSelf" to distanceFromSelf))
|
V2XBizTrace.onAck(M_BIZ + TAG, mapOf("arriveErrorMsg" to "不在到站距离范围内", "ArriveAtStation" to arrivalNotification, "distanceFromSelf" to distanceFromSelf), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,45 @@
|
|||||||
package com.mogo.eagle.function.biz.v2x
|
package com.mogo.eagle.function.biz.v2x
|
||||||
|
|
||||||
import android.util.*
|
import android.util.*
|
||||||
|
import com.mogo.eagle.core.data.deva.chain.ChainCommon
|
||||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||||
import com.mogo.eagle.core.utilcode.util.*
|
|
||||||
import com.zhjt.service.chain.ChainLog
|
import com.zhjt.service.chain.ChainLog
|
||||||
|
|
||||||
class V2XBizTrace {
|
class V2XBizTrace {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
fun onAck(data: Any, data1: Any, param: Boolean = false) {
|
||||||
|
Log.d("V2X", "tag:$data, msg: $data1")
|
||||||
|
if (param) {
|
||||||
|
val cal = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||||
|
val lineId = CallerAutoPilotStatusListenerManager.getLineId()
|
||||||
|
realParamAction(data, data1, ChainCommon(cal.latitude, cal.longitude, lineId))
|
||||||
|
} else {
|
||||||
|
realAction(data, data1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ChainLog(
|
@ChainLog(
|
||||||
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
|
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||||
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
||||||
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
|
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
|
||||||
paramIndexes = [0, 1]
|
paramIndexes = [0, 1]
|
||||||
)
|
)
|
||||||
fun onAck(data: Any, data1: Any) {
|
private fun realAction(data: Any, data1: Any) {
|
||||||
Log.d("V2X", "tag:$data, msg: $data1")
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ChainLog(
|
||||||
|
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||||
|
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
||||||
|
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
|
||||||
|
paramIndexes = [0, 1, 2]
|
||||||
|
)
|
||||||
|
private fun realParamAction(data: Any, data1: Any, chainCommon: ChainCommon) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@ import com.mogo.eagle.core.data.config.*
|
|||||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_V2X_MSG
|
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_V2X_MSG
|
||||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_ADAS
|
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_ADAS
|
||||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_CLOUD
|
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_CLOUD
|
||||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_V2X
|
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_STATUS
|
||||||
import com.mogo.eagle.core.data.enums.*
|
import com.mogo.eagle.core.data.enums.*
|
||||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew.Companion.isRoadEvent
|
import com.mogo.eagle.core.data.enums.EventTypeEnumNew.Companion.isRoadEvent
|
||||||
@@ -115,7 +115,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
|||||||
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
||||||
V2XBizTrace.onAck("巡航处理 handlerMessage v2XMessageEntity", " $v2XMessageEntity")
|
V2XBizTrace.onAck("巡航处理 handlerMessage v2XMessageEntity", " $v2XMessageEntity")
|
||||||
}else{
|
}else{
|
||||||
V2XBizTrace.onAck("事件未触发,巡航处理", mapOf("roadEvent" to v2XRoadEventEntity, "distance" to distance))
|
V2XBizTrace.onAck("事件未触发,巡航处理", mapOf("roadEvent" to v2XRoadEventEntity, "distance" to distance), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,7 +147,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
|||||||
* V2XEvent事件回调
|
* V2XEvent事件回调
|
||||||
*/
|
*/
|
||||||
@ChainLog(
|
@ChainLog(
|
||||||
linkChainLog = CHAIN_TYPE_V2X,
|
linkChainLog = CHAIN_TYPE_STATUS,
|
||||||
linkCode = CHAIN_SOURCE_CLOUD,
|
linkCode = CHAIN_SOURCE_CLOUD,
|
||||||
nodeAliasCode = CHAIN_CODE_V2X_MSG,
|
nodeAliasCode = CHAIN_CODE_V2X_MSG,
|
||||||
paramIndexes = [0]
|
paramIndexes = [0]
|
||||||
@@ -173,22 +173,22 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
|||||||
if (!AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) || !FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData) {
|
if (!AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) || !FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData) {
|
||||||
handleRoadMarkerEvent(event.data.toRoadMarker())
|
handleRoadMarkerEvent(event.data.toRoadMarker())
|
||||||
}else{
|
}else{
|
||||||
V2XBizTrace.onAck("事件未触发,被开关拦截",mapOf("roadEvent" to event, "v2nMainSwitch" to FunctionBuildConfig.v2nMainSwitch,"isNewV2NData" to FunctionBuildConfig.isNewV2NData))
|
V2XBizTrace.onAck("事件未触发,被开关拦截",mapOf("roadEvent" to event, "v2nMainSwitch" to FunctionBuildConfig.v2nMainSwitch,"isNewV2NData" to FunctionBuildConfig.isNewV2NData), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
V2XBizTrace.onAck("事件未触发,不识别的新事件",mapOf("roadEvent" to event))
|
V2XBizTrace.onAck("事件未触发,不识别的新事件",mapOf("roadEvent" to event), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.N)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
@ChainLog(
|
// @ChainLog(
|
||||||
linkChainLog = CHAIN_TYPE_V2X,
|
// linkChainLog = CHAIN_TYPE_STATUS,
|
||||||
linkCode = CHAIN_SOURCE_ADAS,
|
// linkCode = CHAIN_SOURCE_ADAS,
|
||||||
nodeAliasCode = CHAIN_CODE_V2X_MSG,
|
// nodeAliasCode = CHAIN_CODE_V2X_MSG,
|
||||||
paramIndexes = [0]
|
// paramIndexes = [0]
|
||||||
)
|
// )
|
||||||
override fun onAutopilotIdentifyPlanningObj(planningObjects: List<PlanningObject>?) {
|
override fun onAutopilotIdentifyPlanningObj(planningObjects: List<PlanningObject>?) {
|
||||||
super.onAutopilotIdentifyPlanningObj(planningObjects)
|
super.onAutopilotIdentifyPlanningObj(planningObjects)
|
||||||
planningObjects?.let {
|
planningObjects?.let {
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.mogo.eagle.function.biz.v2x.v2n.alarm;
|
package com.mogo.eagle.function.biz.v2x.v2n.alarm;
|
||||||
|
|
||||||
|
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BIZ;
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||||
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
|
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
|
||||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
|
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||||
import com.mogo.eagle.function.biz.v2x.V2XBizTrace;
|
import com.mogo.eagle.function.biz.v2x.V2XBizTrace;
|
||||||
|
|
||||||
@@ -39,7 +41,7 @@ public class V2XAlarmServer {
|
|||||||
CopyOnWriteArrayList<V2XRoadEventEntity> v2XRoadEventEntityList,
|
CopyOnWriteArrayList<V2XRoadEventEntity> v2XRoadEventEntityList,
|
||||||
MogoLocation currentLocation) {
|
MogoLocation currentLocation) {
|
||||||
try {
|
try {
|
||||||
Logger.d(TAG, "getDriveFrontAlarmEvent --- 1 ---" + currentLocation );
|
CallerLogger.d(M_BIZ + TAG, "getDriveFrontAlarmEvent --- 1 ---" + currentLocation );
|
||||||
if (!showedEvents.isEmpty()) {
|
if (!showedEvents.isEmpty()) {
|
||||||
Iterator<V2XRoadEventEntity> iterator = showedEvents.iterator();
|
Iterator<V2XRoadEventEntity> iterator = showedEvents.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
@@ -56,18 +58,18 @@ public class V2XAlarmServer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Logger.d(TAG, "getDriveFrontAlarmEvent --- 2 ---" + currentLocation);
|
CallerLogger.d(M_BIZ + TAG, "getDriveFrontAlarmEvent --- 2 ---" + currentLocation);
|
||||||
if (currentLocation != null && v2XRoadEventEntityList != null) {
|
if (currentLocation != null && v2XRoadEventEntityList != null) {
|
||||||
// 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
|
// 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
|
||||||
for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
|
for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
|
||||||
// 0、道路事件必须有朝向,角度>=0;
|
// 0、道路事件必须有朝向,角度>=0;
|
||||||
//Logger.d(TAG, "entity:" + v2XRoadEventEntity.getLocation());
|
//CallerLogger.d(M_BIZ + TAG, "entity:" + v2XRoadEventEntity.getLocation());
|
||||||
if (v2XRoadEventEntity.getLocation().getAngle() >= 0) {
|
if (v2XRoadEventEntity.getLocation().getAngle() >= 0) {
|
||||||
// 计算车辆距离指定气泡的距离
|
// 计算车辆距离指定气泡的距离
|
||||||
MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
|
MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
|
||||||
// 1、判断是否到达了触发距离,20 ~ 500,
|
// 1、判断是否到达了触发距离,20 ~ 500,
|
||||||
double distance = v2XRoadEventEntity.getDistance();
|
double distance = v2XRoadEventEntity.getDistance();
|
||||||
Logger.d(TAG, "distance:" + distance + ",poiType:" + v2XRoadEventEntity.getPoiType());
|
CallerLogger.d(M_BIZ + TAG, "distance:" + distance + ",poiType:" + v2XRoadEventEntity.getPoiType());
|
||||||
if (distance <= 500) {
|
if (distance <= 500) {
|
||||||
if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
|
if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
|
||||||
if (distance > 25) {
|
if (distance > 25) {
|
||||||
@@ -78,7 +80,7 @@ public class V2XAlarmServer {
|
|||||||
double carBearing = currentLocation.getHeading();
|
double carBearing = currentLocation.getHeading();
|
||||||
double eventBearing = eventLocation.getAngle();
|
double eventBearing = eventLocation.getAngle();
|
||||||
double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing);
|
double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing);
|
||||||
Logger.d(TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
|
CallerLogger.d(M_BIZ + TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
|
||||||
if (diffAngle <= 30) {
|
if (diffAngle <= 30) {
|
||||||
// 3、计算当前车辆行驶方向与事件位置之间夹角《20度,保证道路事件在车辆前方
|
// 3、计算当前车辆行驶方向与事件位置之间夹角《20度,保证道路事件在车辆前方
|
||||||
double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
|
double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||||
@@ -89,31 +91,31 @@ public class V2XAlarmServer {
|
|||||||
(int) currentLocation.getHeading()
|
(int) currentLocation.getHeading()
|
||||||
);
|
);
|
||||||
|
|
||||||
Logger.d(TAG, "eventAngle:" + eventAngle);
|
CallerLogger.d(M_BIZ + TAG, "eventAngle:" + eventAngle);
|
||||||
if (0 <= eventAngle && eventAngle <= 25) {
|
if (0 <= eventAngle && eventAngle <= 25) {
|
||||||
if (showedEvents.contains(v2XRoadEventEntity)) {
|
if (showedEvents.contains(v2XRoadEventEntity)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Logger.d(TAG, "showed---");
|
CallerLogger.d(M_BIZ + TAG, "showed---");
|
||||||
showedEvents.add(v2XRoadEventEntity);
|
showedEvents.add(v2XRoadEventEntity);
|
||||||
return v2XRoadEventEntity;
|
return v2XRoadEventEntity;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
HashMap map = new HashMap<String,Double>();
|
HashMap map = new HashMap<String,Double>();
|
||||||
map.put("diffAngle",diffAngle);
|
map.put("diffAngle",diffAngle);
|
||||||
V2XBizTrace.Companion.onAck("事件未触发,未达到触发角度",map);
|
V2XBizTrace.Companion.onAck("事件未触发,未达到触发角度",map,true);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
HashMap map = new HashMap<String,Double>();
|
HashMap map = new HashMap<String,Double>();
|
||||||
map.put("distance",distance);
|
map.put("distance",distance);
|
||||||
V2XBizTrace.Companion.onAck("事件未触发,未达到触发距离",map);
|
V2XBizTrace.Companion.onAck("事件未触发,未达到触发距离",map,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Logger.w(TAG, "error: " + e.getMessage());
|
CallerLogger.w(M_BIZ + TAG, "error: " + e.getMessage());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
|||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
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.mogo.logger.scene.SceneConstant
|
||||||
import com.mogo.eagle.core.utilcode.util.DeviceUtils
|
import com.mogo.eagle.core.utilcode.util.DeviceUtils
|
||||||
|
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
|
||||||
|
import com.mogo.eagle.function.biz.v2x.v2n.V2XPoiLoader
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.disposables.Disposable
|
import io.reactivex.disposables.Disposable
|
||||||
import io.reactivex.schedulers.Schedulers
|
import io.reactivex.schedulers.Schedulers
|
||||||
@@ -102,7 +104,7 @@ internal class V2XRefreshModel {
|
|||||||
CallerLogger.d(SceneConstant.M_V2X + TAG, "请求成功,size为:${it.result?.v2XEventList?.size}")
|
CallerLogger.d(SceneConstant.M_V2X + TAG, "请求成功,size为:${it.result?.v2XEventList?.size}")
|
||||||
return@map it.result?.v2XEventList
|
return@map it.result?.v2XEventList
|
||||||
} else {
|
} else {
|
||||||
CallerLogger.d(SceneConstant.M_V2X + TAG, "请求失败,code为:${it.code}")
|
V2XBizTrace.onAck("${SceneConstant.M_V2X}$TAG", mapOf("v2xEventsSummaryError" to it.code), true)
|
||||||
return@map ArrayList()
|
return@map ArrayList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,35 @@
|
|||||||
package com.mogo.eagle.function.biz.v2x.v2n.pnc
|
package com.mogo.eagle.function.biz.v2x.v2n.pnc
|
||||||
|
|
||||||
import android.os.*
|
import android.os.Handler
|
||||||
import androidx.core.util.*
|
import android.os.HandlerThread
|
||||||
import com.mogo.eagle.core.data.config.*
|
import android.os.Message
|
||||||
import com.mogo.eagle.core.data.enums.*
|
import androidx.core.util.Pair
|
||||||
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
|
import com.mogo.eagle.core.data.enums.CommunicationType
|
||||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||||
|
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum.ALERT_WARNING_TOP
|
import com.mogo.eagle.core.data.enums.WarningDirectionEnum.ALERT_WARNING_TOP
|
||||||
import com.mogo.eagle.core.data.map.entity.*
|
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
|
||||||
import com.mogo.eagle.core.data.msgbox.*
|
import com.mogo.eagle.core.data.map.entity.MarkerLocation
|
||||||
|
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
|
||||||
|
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType.V2X
|
import com.mogo.eagle.core.data.msgbox.MsgBoxType.V2X
|
||||||
|
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||||
import com.mogo.eagle.core.function.angle.scenes.Default
|
import com.mogo.eagle.core.function.angle.scenes.Default
|
||||||
import com.mogo.eagle.core.function.angle.scenes.RoadEvent
|
import com.mogo.eagle.core.function.angle.scenes.RoadEvent
|
||||||
import com.mogo.eagle.core.function.api.autopilot.*
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||||
import com.mogo.eagle.core.function.api.hmi.warning.*
|
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.*
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||||
import com.mogo.eagle.core.function.call.hmi.*
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||||
import com.mogo.eagle.core.function.call.map.*
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||||
|
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
|
||||||
import com.mogo.eagle.core.utilcode.mogo.*
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.*
|
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
|
||||||
|
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||||
|
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
|
||||||
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
|
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
|
||||||
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.*
|
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker
|
||||||
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker.Marker
|
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker.Marker
|
||||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
|
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
|
||||||
import mogo.telematics.pad.MessagePad.Header
|
import mogo.telematics.pad.MessagePad.Header
|
||||||
@@ -36,22 +45,28 @@ internal object V2NIdentifyDrawer {
|
|||||||
private const val TAG = "V2NIdentifyDataSubscriber"
|
private const val TAG = "V2NIdentifyDataSubscriber"
|
||||||
|
|
||||||
private const val MSG_WHAT_DRAW_SHIGONE = 0x1010 // 道路施工
|
private const val MSG_WHAT_DRAW_SHIGONE = 0x1010 // 道路施工
|
||||||
private const val MSG_WHAT_DRAW_SHIGU = 0x1011 // 交通事故
|
private const val MSG_WHAT_DRAW_SHIGU = 0x1011 // 交通事故
|
||||||
private const val MSG_WHAT_DRAW_YONGDU = 0x1012 // 交通拥堵
|
private const val MSG_WHAT_DRAW_YONGDU = 0x1012 // 交通拥堵
|
||||||
|
|
||||||
private val callback = Handler.Callback { msg ->
|
private val callback = Handler.Callback { msg ->
|
||||||
if (msg.what == MSG_WHAT_DRAW_SHIGONE || msg.what == MSG_WHAT_DRAW_SHIGU) {
|
if (msg.what == MSG_WHAT_DRAW_SHIGONE || msg.what == MSG_WHAT_DRAW_SHIGU) {
|
||||||
val events = msg.obj as? List<*>
|
val events = msg.obj as? List<*>
|
||||||
if (events == null || events.isEmpty()) {
|
if (events == null || events.isEmpty()) {
|
||||||
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu" to ""))
|
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu" to ""), true)
|
||||||
return@Callback true
|
return@Callback true
|
||||||
}
|
}
|
||||||
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||||
val filtered = events.filterIsInstance(TrackedObject::class.java).filter { itx ->
|
val filtered = events.filterIsInstance(TrackedObject::class.java).filter { itx ->
|
||||||
DrivingDirectionUtils.getDegreeOfCar2Poi(car.longitude, car.latitude, itx.longitude, itx.latitude, car.heading.toInt()) < 90
|
DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||||
|
car.longitude,
|
||||||
|
car.latitude,
|
||||||
|
itx.longitude,
|
||||||
|
itx.latitude,
|
||||||
|
car.heading.toInt()
|
||||||
|
) < 90
|
||||||
}
|
}
|
||||||
if (filtered.isEmpty()) {
|
if (filtered.isEmpty()) {
|
||||||
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu-filter" to ""))
|
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu-filter" to ""), true)
|
||||||
return@Callback true
|
return@Callback true
|
||||||
}
|
}
|
||||||
filtered.forEach { itx ->
|
filtered.forEach { itx ->
|
||||||
@@ -60,68 +75,121 @@ internal object V2NIdentifyDrawer {
|
|||||||
AiRoadMarker().apply {
|
AiRoadMarker().apply {
|
||||||
val poiType = getPoiType(itx.type).poiType
|
val poiType = getPoiType(itx.type).poiType
|
||||||
val polygon = itx.polygonList.map { Pair.create(it.longitude, it.latitude) }
|
val polygon = itx.polygonList.map { Pair.create(it.longitude, it.latitude) }
|
||||||
marker(Marker(id, poiType, itx.latitude,itx.longitude, itx.heading, polygon, null,
|
marker(Marker(id,
|
||||||
|
poiType,
|
||||||
|
itx.latitude,
|
||||||
|
itx.longitude,
|
||||||
|
itx.heading,
|
||||||
|
polygon,
|
||||||
|
null,
|
||||||
V2XRoadEventEntity().also { e ->
|
V2XRoadEventEntity().also { e ->
|
||||||
e.poiType = poiType
|
e.poiType = poiType
|
||||||
e.location = MarkerLocation().also { l ->
|
e.location = MarkerLocation().also { l ->
|
||||||
val p = CoordinateTransform.WGS84ToGCJ02(itx.longitude, itx.latitude)
|
val p = CoordinateTransform.WGS84ToGCJ02(
|
||||||
l.lon = p[0]
|
itx.longitude,
|
||||||
l.lat = p[1]
|
itx.latitude
|
||||||
l.angle = itx.heading
|
)
|
||||||
}
|
l.lon = p[0]
|
||||||
e.noveltyInfo = MarkerExploreWay().also {
|
l.lat = p[1]
|
||||||
it.poiType = poiType
|
l.angle = itx.heading
|
||||||
it.location = e.location
|
}
|
||||||
it.polygon = polygon
|
e.noveltyInfo = MarkerExploreWay().also {
|
||||||
}
|
it.poiType = poiType
|
||||||
}), true, isDrawRoadLine(poiType))
|
it.location = e.location
|
||||||
|
it.polygon = polygon
|
||||||
|
}
|
||||||
|
}), true, isDrawRoadLine(poiType)
|
||||||
|
)
|
||||||
|
|
||||||
val distance = CoordinateUtils.calculateLineDistance(itx.longitude, itx.latitude, car.longitude, car.latitude)
|
val distance = CoordinateUtils.calculateLineDistance(
|
||||||
|
itx.longitude,
|
||||||
|
itx.latitude,
|
||||||
|
car.longitude,
|
||||||
|
car.latitude
|
||||||
|
)
|
||||||
val alertContent = getAlertContent(poiType, distance.toDouble())
|
val alertContent = getAlertContent(poiType, distance.toDouble())
|
||||||
val ttsContent = getTtsContent(poiType, distance.toDouble())
|
val ttsContent = getTtsContent(poiType, distance.toDouble())
|
||||||
V2XBizTrace.onAck(TAG,"绘制poi事件:$poiType")
|
V2XBizTrace.onAck(TAG, "绘制poi事件:$poiType")
|
||||||
saveMsgBox(MsgBoxBean(V2X, V2XMsg(poiType, alertContent, ttsContent,CommunicationType.V2N.name)))
|
saveMsgBox(
|
||||||
CallerHmiManager.warningV2X(poiType, alertContent, ttsContent, object : IMoGoWarningStatusListener {
|
MsgBoxBean(
|
||||||
override fun onShow() {
|
V2X,
|
||||||
super.onShow()
|
V2XMsg(
|
||||||
CallerVisualAngleManager.changeAngle(RoadEvent(itx.longitude, itx.latitude, itx.angle))
|
poiType,
|
||||||
}
|
alertContent,
|
||||||
|
ttsContent,
|
||||||
|
CommunicationType.V2N.name
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
CallerHmiManager.warningV2X(
|
||||||
|
poiType,
|
||||||
|
alertContent,
|
||||||
|
ttsContent,
|
||||||
|
object : IMoGoWarningStatusListener {
|
||||||
|
override fun onShow() {
|
||||||
|
super.onShow()
|
||||||
|
CallerVisualAngleManager.changeAngle(
|
||||||
|
RoadEvent(
|
||||||
|
itx.longitude,
|
||||||
|
itx.latitude,
|
||||||
|
itx.angle
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onDismiss() {
|
override fun onDismiss() {
|
||||||
super.onDismiss()
|
super.onDismiss()
|
||||||
CallerVisualAngleManager.changeAngle(Default())
|
CallerVisualAngleManager.changeAngle(Default())
|
||||||
}
|
}
|
||||||
}, ALERT_WARNING_TOP, 10000, false)
|
},
|
||||||
|
ALERT_WARNING_TOP,
|
||||||
|
10000,
|
||||||
|
false
|
||||||
|
)
|
||||||
//消息埋点
|
//消息埋点
|
||||||
V2XEventAnalyticsManager.triggerV2XEvent(poiType, alertContent, ttsContent,
|
V2XEventAnalyticsManager.triggerV2XEvent(
|
||||||
DataSourceType.AICLOUD,CommunicationType.V2N)
|
poiType, alertContent, ttsContent,
|
||||||
|
DataSourceType.AICLOUD, CommunicationType.V2N
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}.receive()
|
}.receive()
|
||||||
}
|
}
|
||||||
} else if (msg.what == MSG_WHAT_DRAW_YONGDU) {
|
} else if (msg.what == MSG_WHAT_DRAW_YONGDU) {
|
||||||
val events = msg.obj as? List<*>
|
val events = msg.obj as? List<*>
|
||||||
if (events == null || events.isEmpty()) {
|
if (events == null || events.isEmpty()) {
|
||||||
V2XBizTrace.onAck(TAG, mapOf("yongDu" to ""))
|
V2XBizTrace.onAck(TAG, mapOf("yongDu" to ""), true)
|
||||||
return@Callback true
|
return@Callback true
|
||||||
}
|
}
|
||||||
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||||
val filtered = events.filterIsInstance(MogoV2X.RTEData_PB::class.java).filter { itx ->
|
val filtered = events.filterIsInstance(MogoV2X.RTEData_PB::class.java).filter { itx ->
|
||||||
val eventLon = itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 } ?: 0.0
|
val eventLon =
|
||||||
val eventLat = itx.eventPos?.offsetLL?.positionLatLon?.lat?.let { it * 1.0 / 10_000_000 } ?: 0.0
|
itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 }
|
||||||
DrivingDirectionUtils.getDegreeOfCar2Poi(car.longitude, car.latitude, eventLon, eventLat, car.heading.toInt()) < 90
|
?: 0.0
|
||||||
|
val eventLat =
|
||||||
|
itx.eventPos?.offsetLL?.positionLatLon?.lat?.let { it * 1.0 / 10_000_000 }
|
||||||
|
?: 0.0
|
||||||
|
DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||||
|
car.longitude,
|
||||||
|
car.latitude,
|
||||||
|
eventLon,
|
||||||
|
eventLat,
|
||||||
|
car.heading.toInt()
|
||||||
|
) < 90
|
||||||
}
|
}
|
||||||
if (filtered.isEmpty()) {
|
if (filtered.isEmpty()) {
|
||||||
V2XBizTrace.onAck(TAG, mapOf("yongDu-filter" to ""))
|
V2XBizTrace.onAck(TAG, mapOf("yongDu-filter" to ""), true)
|
||||||
return@Callback true
|
return@Callback true
|
||||||
}
|
}
|
||||||
filtered.forEach { itx ->
|
filtered.forEach { itx ->
|
||||||
val id = itx.rteId.toString()
|
val id = itx.rteId.toString()
|
||||||
val lon = itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 } ?: 0.0
|
val lon = itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 }
|
||||||
val lat = itx.eventPos?.offsetLL?.positionLatLon?.lat?.let { it * 1.0 / 10_000_000 } ?: 0.0
|
?: 0.0
|
||||||
|
val lat = itx.eventPos?.offsetLL?.positionLatLon?.lat?.let { it * 1.0 / 10_000_000 }
|
||||||
|
?: 0.0
|
||||||
AiRoadMarker.aiMakers.getOrPut(id) {
|
AiRoadMarker.aiMakers.getOrPut(id) {
|
||||||
AiRoadMarker().apply {
|
AiRoadMarker().apply {
|
||||||
val poiType = getPoiType(itx.eventType).poiType
|
val poiType = getPoiType(itx.eventType).poiType
|
||||||
marker(Marker(id, poiType, lat, lon, car.heading, null, null,
|
marker(Marker(id, poiType, lat, lon, car.heading, null, null,
|
||||||
V2XRoadEventEntity().also { e ->
|
V2XRoadEventEntity().also { e ->
|
||||||
e.poiType = poiType
|
e.poiType = poiType
|
||||||
e.location = MarkerLocation().also { l ->
|
e.location = MarkerLocation().also { l ->
|
||||||
@@ -135,27 +203,59 @@ internal object V2NIdentifyDrawer {
|
|||||||
it.location = e.location
|
it.location = e.location
|
||||||
it.polygon = emptyList()
|
it.polygon = emptyList()
|
||||||
}
|
}
|
||||||
}), true, isDrawRoadLine(poiType))
|
}), true, isDrawRoadLine(poiType)
|
||||||
|
)
|
||||||
|
|
||||||
val distance = CoordinateUtils.calculateLineDistance(lon, lat, car.longitude, car.latitude)
|
val distance = CoordinateUtils.calculateLineDistance(
|
||||||
|
lon,
|
||||||
|
lat,
|
||||||
|
car.longitude,
|
||||||
|
car.latitude
|
||||||
|
)
|
||||||
val alertContent = getAlertContent(poiType, distance.toDouble())
|
val alertContent = getAlertContent(poiType, distance.toDouble())
|
||||||
val ttsContent = getTtsContent(poiType, distance.toDouble())
|
val ttsContent = getTtsContent(poiType, distance.toDouble())
|
||||||
V2XBizTrace.onAck(TAG,"绘制poi事件:$poiType")
|
V2XBizTrace.onAck(TAG, "绘制poi事件:$poiType")
|
||||||
saveMsgBox(MsgBoxBean(V2X, V2XMsg(poiType, alertContent, ttsContent,CommunicationType.V2N.name)))
|
saveMsgBox(
|
||||||
CallerHmiManager.warningV2X(poiType, alertContent, ttsContent, object : IMoGoWarningStatusListener {
|
MsgBoxBean(
|
||||||
override fun onShow() {
|
V2X,
|
||||||
super.onShow()
|
V2XMsg(
|
||||||
CallerVisualAngleManager.changeAngle(RoadEvent(lon, lat, car.heading))
|
poiType,
|
||||||
}
|
alertContent,
|
||||||
|
ttsContent,
|
||||||
|
CommunicationType.V2N.name
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
CallerHmiManager.warningV2X(
|
||||||
|
poiType,
|
||||||
|
alertContent,
|
||||||
|
ttsContent,
|
||||||
|
object : IMoGoWarningStatusListener {
|
||||||
|
override fun onShow() {
|
||||||
|
super.onShow()
|
||||||
|
CallerVisualAngleManager.changeAngle(
|
||||||
|
RoadEvent(
|
||||||
|
lon,
|
||||||
|
lat,
|
||||||
|
car.heading
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onDismiss() {
|
override fun onDismiss() {
|
||||||
super.onDismiss()
|
super.onDismiss()
|
||||||
CallerVisualAngleManager.changeAngle(Default())
|
CallerVisualAngleManager.changeAngle(Default())
|
||||||
}
|
}
|
||||||
}, ALERT_WARNING_TOP, 10000, false)
|
},
|
||||||
|
ALERT_WARNING_TOP,
|
||||||
|
10000,
|
||||||
|
false
|
||||||
|
)
|
||||||
//消息埋点
|
//消息埋点
|
||||||
V2XEventAnalyticsManager.triggerV2XEvent(poiType, alertContent, ttsContent,
|
V2XEventAnalyticsManager.triggerV2XEvent(
|
||||||
DataSourceType.AICLOUD,CommunicationType.V2N)
|
poiType, alertContent, ttsContent,
|
||||||
|
DataSourceType.AICLOUD, CommunicationType.V2N
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}.receive()
|
}.receive()
|
||||||
}
|
}
|
||||||
@@ -181,7 +281,7 @@ internal object V2NIdentifyDrawer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getAlertContent(poiType: String, distance: Double): String {
|
private fun getAlertContent(poiType: String, distance: Double): String {
|
||||||
return when(poiType) {
|
return when (poiType) {
|
||||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType -> {
|
EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType -> {
|
||||||
"前方${distance.toInt()}米道路施工"
|
"前方${distance.toInt()}米道路施工"
|
||||||
}
|
}
|
||||||
@@ -201,7 +301,10 @@ internal object V2NIdentifyDrawer {
|
|||||||
return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType == poiType
|
return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType == poiType
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getPoiType(type: Int): EventTypeEnumNew = if (type == 501 || type == 502) EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG else if (type == 13) EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU else if (type == 102) EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION else throw AssertionError("error!!!")
|
private fun getPoiType(type: Int): EventTypeEnumNew =
|
||||||
|
if (type == 501 || type == 502) EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG else if (type == 13) EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU else if (type == 102) EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION else throw AssertionError(
|
||||||
|
"error!!!"
|
||||||
|
)
|
||||||
|
|
||||||
private val handler by lazy {
|
private val handler by lazy {
|
||||||
val thread = HandlerThread("v2n_identify_drawer")
|
val thread = HandlerThread("v2n_identify_drawer")
|
||||||
@@ -225,12 +328,7 @@ internal object V2NIdentifyDrawer {
|
|||||||
|
|
||||||
override fun onAutopilotV2nCongestionEvent(header: Header, rsi: RSI_PB) {
|
override fun onAutopilotV2nCongestionEvent(header: Header, rsi: RSI_PB) {
|
||||||
super.onAutopilotV2nCongestionEvent(header, rsi)
|
super.onAutopilotV2nCongestionEvent(header, rsi)
|
||||||
try {
|
V2XBizTrace.onAck("onAutopilotV2nCongestionEvent", rsi)
|
||||||
V2XBizTrace.onAck("onAutopilotV2nCongestionEvent", rsi)
|
|
||||||
} catch (t: Throwable) {
|
|
||||||
t.printStackTrace()
|
|
||||||
}
|
|
||||||
|
|
||||||
rsi.rsiFrame?.rtes?.rteDataList?.filter {
|
rsi.rsiFrame?.rtes?.rteDataList?.filter {
|
||||||
it.eventType == 102
|
it.eventType == 102
|
||||||
}?.takeIf {
|
}?.takeIf {
|
||||||
@@ -242,7 +340,7 @@ internal object V2NIdentifyDrawer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun drawShiGong(events: List<TrackedObject>) {
|
private fun drawShiGong(events: List<TrackedObject>) {
|
||||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||||
handler.removeMessages(MSG_WHAT_DRAW_SHIGONE)
|
handler.removeMessages(MSG_WHAT_DRAW_SHIGONE)
|
||||||
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGONE, events))
|
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGONE, events))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,11 +136,11 @@ class AiRoadMarker {
|
|||||||
return@post
|
return@post
|
||||||
}
|
}
|
||||||
if (l1 == null || l2 == null) {
|
if (l1 == null || l2 == null) {
|
||||||
V2XBizTrace.onAck("$TAG -marker-3-line null return ----", "")
|
V2XBizTrace.onAck("$TAG -marker-3-line null return ----", "", true)
|
||||||
return@post
|
return@post
|
||||||
}
|
}
|
||||||
if (l1.points.isEmpty() || l2.points.isEmpty()) {
|
if (l1.points.isEmpty() || l2.points.isEmpty()) {
|
||||||
V2XBizTrace.onAck("$TAG -marker-3-line points null return ----", "")
|
V2XBizTrace.onAck("$TAG -marker-3-line points null return ----", "", true)
|
||||||
return@post
|
return@post
|
||||||
}
|
}
|
||||||
V2XBizTrace.onAck("$TAG -marker-4-l2:", l2)
|
V2XBizTrace.onAck("$TAG -marker-4-l2:", l2)
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
|||||||
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||||
if (overlayManager != null) {
|
if (overlayManager != null) {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> poiType : ", entity.getPoiType());
|
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> poiType : ", entity.getPoiType(), false);
|
||||||
if (isAiRoadEvent(entity.getPoiType())) {
|
if (isAiRoadEvent(entity.getPoiType())) {
|
||||||
MarkerExploreWay noveltyInfo = entity.getNoveltyInfo();
|
MarkerExploreWay noveltyInfo = entity.getNoveltyInfo();
|
||||||
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> noveltyInfo : ",noveltyInfo.toString());
|
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> noveltyInfo : ",noveltyInfo.toString(), false);
|
||||||
Pair<Double, Double> gpsLocation = noveltyInfo.getGpsLocation();
|
Pair<Double, Double> gpsLocation = noveltyInfo.getGpsLocation();
|
||||||
List<Pair<Double, Double>> polygons = noveltyInfo.getPolygon();
|
List<Pair<Double, Double>> polygons = noveltyInfo.getPolygon();
|
||||||
if (gpsLocation != null && polygons != null) {
|
if (gpsLocation != null && polygons != null) {
|
||||||
@@ -57,7 +57,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
|||||||
.set3DMode(true)
|
.set3DMode(true)
|
||||||
.icon3DRes(EventTypeEnumNew.getMarker3DRes(entity.getPoiType())).build(),DEFAULT);
|
.icon3DRes(EventTypeEnumNew.getMarker3DRes(entity.getPoiType())).build(),DEFAULT);
|
||||||
if (point != null) {
|
if (point != null) {
|
||||||
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> --- add Marker type: ", entity.getPoiType());
|
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> --- add Marker type: ", entity.getPoiType(), false);
|
||||||
ArrayList<Point> markers = new ArrayList<>();
|
ArrayList<Point> markers = new ArrayList<>();
|
||||||
markers.add(point);
|
markers.add(point);
|
||||||
String id = entity.getLocation().getLon() + "_" + entity.getLocation().getLat();
|
String id = entity.getLocation().getLon() + "_" + entity.getLocation().getLat();
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
|||||||
@Override
|
@Override
|
||||||
public void init(V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity) {
|
public void init(V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity) {
|
||||||
try {
|
try {
|
||||||
V2XBizTrace.Companion.onAck("v2XMessageEntity",v2XMessageEntity);
|
V2XBizTrace.Companion.onAck("v2XMessageEntity",v2XMessageEntity,false);
|
||||||
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
|
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
|
||||||
if (v2XRoadEventEntity != null) {
|
if (v2XRoadEventEntity != null) {
|
||||||
if (!isSameScenario(v2XMessageEntity)) {
|
if (!isSameScenario(v2XMessageEntity)) {
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (trafficLightResult.currentRoadTrafficLight() == null) {
|
if (trafficLightResult.currentRoadTrafficLight() == null) {
|
||||||
V2XBizTrace.onAck("$M_V2X$TAG", "vip获取到灯态,但没找到对应车道数据 trafficLight:$$trafficLightResult")
|
V2XBizTrace.onAck("$M_V2X$TAG", "vip获取到灯态,但没找到对应车道数据 trafficLight:$$trafficLightResult", true)
|
||||||
result = null
|
result = null
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -258,7 +258,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
|||||||
",crossId:${result?.crossId}" +
|
",crossId:${result?.crossId}" +
|
||||||
",bearing:$bearing" +
|
",bearing:$bearing" +
|
||||||
",controlTime:$controlTime"
|
",controlTime:$controlTime"
|
||||||
)
|
,true)
|
||||||
ToastUtils.showLong("服务异常,请稍后重试")
|
ToastUtils.showLong("服务异常,请稍后重试")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -828,7 +828,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
|||||||
* @param rsi 数据
|
* @param rsi 数据
|
||||||
*/
|
*/
|
||||||
@ChainLog(
|
@ChainLog(
|
||||||
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
|
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||||
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
||||||
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
|
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
|
||||||
paramIndexes = [0, 1]
|
paramIndexes = [0, 1]
|
||||||
@@ -848,7 +848,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
|||||||
* @param parkingViolation 违停 ---包含 静态障碍车
|
* @param parkingViolation 违停 ---包含 静态障碍车
|
||||||
*/
|
*/
|
||||||
@ChainLog(
|
@ChainLog(
|
||||||
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
|
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||||
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
||||||
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
|
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
|
||||||
paramIndexes = [0]
|
paramIndexes = [0]
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ dependencies {
|
|||||||
implementation rootProject.ext.dependencies.androidxroomruntime
|
implementation rootProject.ext.dependencies.androidxroomruntime
|
||||||
kapt rootProject.ext.dependencies.androidxroomcompiler
|
kapt rootProject.ext.dependencies.androidxroomcompiler
|
||||||
implementation rootProject.ext.dependencies.rxandroid
|
implementation rootProject.ext.dependencies.rxandroid
|
||||||
|
implementation rootProject.ext.dependencies.androidxcardview
|
||||||
implementation rootProject.ext.dependencies.androidxroomktx
|
implementation rootProject.ext.dependencies.androidxroomktx
|
||||||
implementation rootProject.ext.dependencies.protobuf_java
|
implementation rootProject.ext.dependencies.protobuf_java
|
||||||
implementation rootProject.ext.dependencies.androidxappcompat
|
implementation rootProject.ext.dependencies.androidxappcompat
|
||||||
|
|||||||
@@ -288,6 +288,13 @@ class DevaToolsProvider : IDevaToolsProvider {
|
|||||||
BadCaseManager.onReceiveBadCaseRecord(msgBoxBean, activity, countdown)
|
BadCaseManager.onReceiveBadCaseRecord(msgBoxBean, activity, countdown)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 魔方开启主动录包
|
||||||
|
*/
|
||||||
|
override fun startRecordByMoFang() {
|
||||||
|
BadCaseManager.startRecordByMoFang()
|
||||||
|
}
|
||||||
|
|
||||||
override fun showFeedbackWindow(ctx: Context) {
|
override fun showFeedbackWindow(ctx: Context) {
|
||||||
BadCaseManager.showBadCaseConfigWindow(ctx)
|
BadCaseManager.showBadCaseConfigWindow(ctx)
|
||||||
}
|
}
|
||||||
@@ -400,4 +407,8 @@ class DevaToolsProvider : IDevaToolsProvider {
|
|||||||
override fun block(): IMoGoBlockProvider? = block
|
override fun block(): IMoGoBlockProvider? = block
|
||||||
|
|
||||||
override fun usage(): IMoGoCpuUsageProvider? = usage
|
override fun usage(): IMoGoCpuUsageProvider? = usage
|
||||||
|
|
||||||
|
override fun setNetworkMode(isDebug: Boolean) {
|
||||||
|
WeakNetworkStrategy.setDebug(isDebug)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -69,8 +69,12 @@ class ApmEnvProviderImpl: IApmEnvProvider, CoroutineScope {
|
|||||||
var dockerVersionChanged = false
|
var dockerVersionChanged = false
|
||||||
val version = ApmEnvConfig.getDockerVersion()
|
val version = ApmEnvConfig.getDockerVersion()
|
||||||
if (!TextUtils.isEmpty(version) && !TextUtils.isEmpty(dockerVersion) && version != dockerVersion) {
|
if (!TextUtils.isEmpty(version) && !TextUtils.isEmpty(dockerVersion) && version != dockerVersion) {
|
||||||
dockerVersionChanged = true
|
val f1 = version?.endsWith("release", true) == true
|
||||||
ApmEnvConfig.setDockerVersion(dockerVersion)
|
val f2 = dockerVersion.endsWith("release", true)
|
||||||
|
dockerVersionChanged = if (f1 && f2) false else f1 || f2
|
||||||
|
if (dockerVersionChanged) {
|
||||||
|
ApmEnvConfig.setDockerVersion(dockerVersion)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var isFirstDockerVersionSet = false
|
var isFirstDockerVersionSet = false
|
||||||
if (TextUtils.isEmpty(version) && !TextUtils.isEmpty(dockerVersion)) {
|
if (TextUtils.isEmpty(version) && !TextUtils.isEmpty(dockerVersion)) {
|
||||||
|
|||||||
@@ -5,25 +5,40 @@ import android.app.Activity
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import androidx.lifecycle.Lifecycle.Event
|
import androidx.lifecycle.Lifecycle.Event
|
||||||
import androidx.lifecycle.LifecycleEventObserver
|
import androidx.lifecycle.LifecycleEventObserver
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||||
|
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.app.AppConfigInfo
|
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||||
|
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||||
|
import com.mogo.eagle.core.data.map.MogoLocation
|
||||||
|
import com.mogo.eagle.core.data.msgbox.FMInfoMsg
|
||||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||||
|
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||||
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||||
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||||
|
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
|
||||||
|
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||||
import com.mogo.eagle.core.utilcode.util.*
|
import com.mogo.eagle.core.utilcode.util.*
|
||||||
|
import com.mogo.eagle.core.utilcode.util.FileUtils.millis2String
|
||||||
import com.mogo.tts.base.SpeechUtils
|
import com.mogo.tts.base.SpeechUtils
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.*
|
import com.zhjt.mogo_core_function_devatools.badcase.biz.*
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||||
@@ -31,8 +46,11 @@ import com.zhjt.mogo_core_function_devatools.badcase.repository.db.entity.AutoPi
|
|||||||
import com.zhjt.mogo_core_function_devatools.ext.enqueuePop
|
import com.zhjt.mogo_core_function_devatools.ext.enqueuePop
|
||||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||||
import record_cache.RecordPanelOuterClass
|
import record_cache.RecordPanelOuterClass
|
||||||
|
import kotlin.math.abs
|
||||||
|
|
||||||
internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordListener {
|
internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordListener,
|
||||||
|
IMoGoChassisLocationGCJ02Listener, IMsgBoxListener, IMoGoDevaToolsListener,
|
||||||
|
IMogoStatusChangedListener {
|
||||||
|
|
||||||
const val TAG = "BadCase"
|
const val TAG = "BadCase"
|
||||||
|
|
||||||
@@ -44,6 +62,66 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
|||||||
fun init(context: Context) {
|
fun init(context: Context) {
|
||||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||||
SpeechUtils.init(context)
|
SpeechUtils.init(context)
|
||||||
|
//定位监听, 传false是高德坐标系
|
||||||
|
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 1, this)
|
||||||
|
//消息盒子监听,获取FM和Report信息
|
||||||
|
CallerMsgBoxListenerManager.addListener(TAG,this)
|
||||||
|
CallerDevaToolsListenerManager.addListener(TAG, this)
|
||||||
|
// 云socket连接状态
|
||||||
|
MogoStatusManager.getInstance()
|
||||||
|
.registerStatusChangedListener(TAG, StatusDescriptor.CLOUD_SOCKET, this)
|
||||||
|
checkDelete()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查删除录包记录在本地的信息
|
||||||
|
*/
|
||||||
|
private fun checkDelete(){
|
||||||
|
//获取当天时间
|
||||||
|
val currentDay = millis2String(System.currentTimeMillis(), TimeUtils.getMdFormat())
|
||||||
|
//和上次启动时间做对比,如果不是一天,则判断主动、采集和录包失败列表数量,数量过多的时候进行清除
|
||||||
|
if(BadCaseConfig.getStartTime() != currentDay){
|
||||||
|
if(BadCaseConfig.getInitiativeRecordSet().size > 190){
|
||||||
|
BadCaseConfig.getInitiativeRecordSet().clear()
|
||||||
|
}
|
||||||
|
if(BadCaseConfig.getAiDataSet().size > 190){
|
||||||
|
BadCaseConfig.getAiDataSet().clear()
|
||||||
|
}
|
||||||
|
if(BadCaseConfig.getRecordFailSet().size >190){
|
||||||
|
BadCaseConfig.getRecordFailSet().clear()
|
||||||
|
}
|
||||||
|
BadCaseConfig.setStartTime(currentDay)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 魔方开启主动录包
|
||||||
|
*/
|
||||||
|
fun startRecordByMoFang(){
|
||||||
|
if (NetworkUtils.isConnected()){
|
||||||
|
if (BadCaseConfig.dockerVersion != null){
|
||||||
|
val activity = AppStateManager.currentActivity()
|
||||||
|
if (activity !is AppCompatActivity) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ThreadUtils.runOnUiThread {
|
||||||
|
val initiativeBadCaseWindow = InitiativeBadCaseWindow(activity)
|
||||||
|
initiativeBadCaseWindow.setClickListener(object :
|
||||||
|
InitiativeBadCaseWindow.ClickListener {
|
||||||
|
override fun closeWindow() {
|
||||||
|
initiativeBadCaseWindow.hideFloatWindow()
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
initiativeBadCaseWindow.showFloatWindow(null)
|
||||||
|
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
ToastUtils.showShort("工控机连接状态异常")
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
ToastUtils.showShort("网络异常,请检查网络")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -217,6 +295,11 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
|||||||
)
|
)
|
||||||
} bag录制失败"
|
} bag录制失败"
|
||||||
)
|
)
|
||||||
|
//获取录包失败集合
|
||||||
|
val recordFail = BadCaseConfig.getRecordFailSet()
|
||||||
|
//录包失败时,保存录包失败状态
|
||||||
|
recordFail.add(recordPanel.key.toString())
|
||||||
|
BadCaseConfig.setRecordFailSet(recordFail)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -269,4 +352,36 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||||
|
mogoLocation?.let {
|
||||||
|
BadCaseConfig.currentSpeed = (abs(it.gnssSpeed) * 3.6f).toInt()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) {
|
||||||
|
if(category == MsgCategory.SYS_INFO){
|
||||||
|
//上报
|
||||||
|
BadCaseConfig.newReportEntity = msgBoxList.bean as ReportEntity
|
||||||
|
}else if(category == MsgCategory.FM_INFO){
|
||||||
|
//FM
|
||||||
|
BadCaseConfig.newFMInfoMsg = msgBoxList.bean as FMInfoMsg
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun gpsStatus(status: Boolean) {
|
||||||
|
super.gpsStatus(status)
|
||||||
|
BadCaseConfig.gpsStatus = "GPS${if (status) "正常" else "异常"}"
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun tracingStatus(status: Boolean) {
|
||||||
|
super.tracingStatus(status)
|
||||||
|
BadCaseConfig.tracingStatus = "寻迹算路${if (status) "正常" else "异常"}"
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStatusChanged(descriptor: StatusDescriptor?, isTrue: Boolean) {
|
||||||
|
BadCaseConfig.socketStatus = "云Socket连接${if (isTrue) "正常" else "异常"}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import androidx.recyclerview.widget.RecyclerView
|
|||||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||||
import com.mogo.eagle.core.data.deva.badcase.AiDataEntity
|
import com.mogo.eagle.core.data.deva.badcase.AiDataEntity
|
||||||
|
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||||
|
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
||||||
|
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||||
import com.mogo.eagle.core.function.api.devatools.badcase.BadCaseNetListener
|
import com.mogo.eagle.core.function.api.devatools.badcase.BadCaseNetListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||||
@@ -39,6 +42,7 @@ import org.json.JSONObject
|
|||||||
import record_cache.RecordPanelOuterClass
|
import record_cache.RecordPanelOuterClass
|
||||||
import java.lang.StringBuilder
|
import java.lang.StringBuilder
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
import kotlin.collections.ArrayList
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author XuXinChao
|
* @author XuXinChao
|
||||||
@@ -63,15 +67,18 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
|
|||||||
private lateinit var tvCollectCancel: TextView //取消按钮
|
private lateinit var tvCollectCancel: TextView //取消按钮
|
||||||
|
|
||||||
private var collectReason: StringBuilder = StringBuilder()
|
private var collectReason: StringBuilder = StringBuilder()
|
||||||
|
private var collectList = ArrayList<String>()
|
||||||
|
|
||||||
private var aiDataListAdapter: AiDataListAdapter?= null
|
private var aiDataListAdapter: AiDataListAdapter?= null
|
||||||
|
|
||||||
@Volatile
|
@Volatile
|
||||||
private var recordKey: String? = null //录制bag包key
|
private var recordKey: Long = 0 //录制bag包key
|
||||||
|
|
||||||
@Volatile
|
@Volatile
|
||||||
private var recordFileName: String? = null //录制文件包名
|
private var recordFileName: String? = null //录制文件包名
|
||||||
|
|
||||||
|
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
||||||
|
|
||||||
private lateinit var mFloatLayout: View
|
private lateinit var mFloatLayout: View
|
||||||
private var mInViewX = 0f
|
private var mInViewX = 0f
|
||||||
private var mInViewY = 0f
|
private var mInViewY = 0f
|
||||||
@@ -110,13 +117,6 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
|
|||||||
"时间:${millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())}"
|
"时间:${millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())}"
|
||||||
//采集结果回调监听
|
//采集结果回调监听
|
||||||
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(), this)
|
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(), this)
|
||||||
//开始录制AI数据采集Bag包
|
|
||||||
CallerAutoPilotControlManager.recordPackage(
|
|
||||||
99,
|
|
||||||
Random(SystemClock.elapsedRealtime()).nextInt(),
|
|
||||||
20,
|
|
||||||
12
|
|
||||||
)
|
|
||||||
val linearLayoutManager = LinearLayoutManager(mActivity)
|
val linearLayoutManager = LinearLayoutManager(mActivity)
|
||||||
linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
|
linearLayoutManager.orientation = LinearLayoutManager.VERTICAL
|
||||||
rvCollectList?.layoutManager = linearLayoutManager
|
rvCollectList?.layoutManager = linearLayoutManager
|
||||||
@@ -124,31 +124,44 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
|
|||||||
aiDataListAdapter?.setListener(object: AiDataListAdapter.AiDataClickListener{
|
aiDataListAdapter?.setListener(object: AiDataListAdapter.AiDataClickListener{
|
||||||
override fun onClick(reason: String, isChecked: Boolean) {
|
override fun onClick(reason: String, isChecked: Boolean) {
|
||||||
if(isChecked){
|
if(isChecked){
|
||||||
collectReason.append(reason)
|
if(!collectList.contains(reason)){
|
||||||
|
collectList.add(reason)
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
val index = collectReason.indexOf(reason)
|
if(collectList.contains(reason)){
|
||||||
collectReason.delete(index,index+reason.length)
|
collectList.remove(reason)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
rvCollectList?.adapter = aiDataListAdapter
|
rvCollectList?.adapter = aiDataListAdapter
|
||||||
//注册网络接口获取数据监听
|
//注册网络接口获取数据监听
|
||||||
CallerDevaToolsNetManager.addListener(TAG,this)
|
CallerDevaToolsNetManager.addListener(this.hashCode().toString(),this)
|
||||||
//获取数据
|
//获取数据
|
||||||
BadCaseNetManager.badCaseNetManager.getAiData()
|
BadCaseNetManager.badCaseNetManager.getAiData()
|
||||||
|
|
||||||
//上报
|
//上报
|
||||||
tvCollectReport.setOnClickListener {
|
tvCollectReport.setOnClickListener {
|
||||||
if(collectReason.isBlank()){
|
if(collectList.isEmpty()){
|
||||||
ToastUtils.showShort("请选择最少一个原因")
|
ToastUtils.showShort("请选择最少一个原因")
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
collectReason.clear()
|
||||||
|
for(index in collectList.indices){
|
||||||
|
if(index!=0){
|
||||||
|
collectReason.append("&")
|
||||||
|
}
|
||||||
|
collectReason.append(collectList[index])
|
||||||
|
}
|
||||||
|
//上报到工控机
|
||||||
|
CallerAutoPilotControlManager.recordCause(recordKey.toString(),recordFileName,"",
|
||||||
|
collectReason.toString())
|
||||||
GlobalScope.launch {
|
GlobalScope.launch {
|
||||||
val uploadResult = presenter.upload(mutableMapOf<String, String>().also { itx ->
|
val uploadResult = presenter.upload(mutableMapOf<String, String>().also { itx ->
|
||||||
itx["carLicense"] = AppConfigInfo.plateNumber ?: "" //车牌号
|
itx["carLicense"] = AppConfigInfo.plateNumber ?: "" //车牌号
|
||||||
itx["filename"] = recordFileName ?: "" //bag包文件地址
|
itx["filename"] = recordFileName ?: "" //bag包文件地址
|
||||||
itx["filesize"] = "0" //bag包文件大小
|
itx["filesize"] = "0" //bag包文件大小
|
||||||
itx["key"] = recordKey ?: "" //key
|
itx["key"] = recordKey.toString() //key
|
||||||
itx["reason"] = collectReason.toString() //采集原因
|
itx["reason"] = collectReason.toString() //采集原因
|
||||||
itx["duration"] = "20" //采集时长,固定为20S
|
itx["duration"] = "20" //采集时长,固定为20S
|
||||||
itx["startTime"] = System.currentTimeMillis().toString() //上报时间(时间戳格式)
|
itx["startTime"] = System.currentTimeMillis().toString() //上报时间(时间戳格式)
|
||||||
@@ -166,6 +179,14 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
|
|||||||
TipToast.shortTip("上报失败")
|
TipToast.shortTip("上报失败")
|
||||||
} else {
|
} else {
|
||||||
TipToast.shortTip("上报成功")
|
TipToast.shortTip("上报成功")
|
||||||
|
//将上报BI的结果同步给工控机记录保存
|
||||||
|
recordKey?.let {
|
||||||
|
val descReqEntity = BagDescriptionEntity(collectReason.toString(),false,"",true)
|
||||||
|
bagManagerEntity.reqType = 5
|
||||||
|
bagManagerEntity.keyReq = it
|
||||||
|
bagManagerEntity.descReq = descReqEntity
|
||||||
|
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||||
|
}
|
||||||
BadCaseConfig.windowNum--
|
BadCaseConfig.windowNum--
|
||||||
clickListener?.closeWindow()
|
clickListener?.closeWindow()
|
||||||
}
|
}
|
||||||
@@ -197,9 +218,14 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
|
|||||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||||
CallerLogger.d("${M_DEVA}${TAG}", "-- 收到工控机录制任务回调 -- $recordPanel")
|
CallerLogger.d("${M_DEVA}${TAG}", "-- 收到工控机录制任务回调 -- $recordPanel")
|
||||||
ThreadUtils.runOnUiThread {
|
ThreadUtils.runOnUiThread {
|
||||||
if (recordKey == null) {
|
recordKey = recordPanel.key
|
||||||
recordKey = recordPanel.key.toString()
|
//开始录制
|
||||||
|
if(recordPanel.stat == 300){
|
||||||
BadCaseConfig.recordKeyList.add(recordPanel.key)
|
BadCaseConfig.recordKeyList.add(recordPanel.key)
|
||||||
|
val aiDataSet = BadCaseConfig.getAiDataSet()
|
||||||
|
//保存录包状态
|
||||||
|
aiDataSet.add(recordPanel.key.toString())
|
||||||
|
BadCaseConfig.setAiDataSet(aiDataSet)
|
||||||
}
|
}
|
||||||
if (recordFileName == null) {
|
if (recordFileName == null) {
|
||||||
recordFileName = recordPanel.filename
|
recordFileName = recordPanel.filename
|
||||||
@@ -242,13 +268,36 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
|
|||||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight() - 950
|
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight() - 950
|
||||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||||
}
|
}
|
||||||
|
//开始录制AI数据采集Bag包
|
||||||
|
CallerAutoPilotControlManager.recordPackage(
|
||||||
|
99,
|
||||||
|
Random(SystemClock.elapsedRealtime()).nextInt(),
|
||||||
|
20,
|
||||||
|
12
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showReportBIWindow(bagInfoEntity: BagInfoEntity){
|
||||||
|
if (mFloatLayout.parent == null) {
|
||||||
|
val metrics = DisplayMetrics()
|
||||||
|
// 默认固定位置,靠屏幕右边缘的中间
|
||||||
|
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||||
|
mWindowParams!!.x = metrics.widthPixels
|
||||||
|
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight() - 950
|
||||||
|
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||||
|
}
|
||||||
|
//已经录包无需再次启动录包,只要将录包信息同步到弹窗
|
||||||
|
bagInfoEntity.let {
|
||||||
|
recordKey = it.key
|
||||||
|
recordFileName = it.bagPath
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideFloatWindow() {
|
fun hideFloatWindow() {
|
||||||
//注销采集结果回调监听
|
//注销采集结果回调监听
|
||||||
CallerAutopilotRecordListenerManager.removeListener(this.hashCode().toString())
|
CallerAutopilotRecordListenerManager.removeListener(this.hashCode().toString())
|
||||||
//注销网络接口监听
|
//注销网络接口监听
|
||||||
CallerDevaToolsNetManager.removeListener(this)
|
CallerDevaToolsNetManager.removeListener(this.hashCode().toString())
|
||||||
// 移除 ADAS车辆状态&定位 监听
|
// 移除 ADAS车辆状态&定位 监听
|
||||||
CallerChassisLocationWGS84ListenerManager.removeListener(this.hashCode().toString())
|
CallerChassisLocationWGS84ListenerManager.removeListener(this.hashCode().toString())
|
||||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import android.os.Handler
|
|||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.view.inputmethod.InputMethodManager
|
||||||
|
import android.widget.EditText
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import bag_manager.BagManagerOuterClass
|
import bag_manager.BagManagerOuterClass
|
||||||
@@ -25,6 +27,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
|||||||
import com.zhidao.loglib.download.DownloadManager
|
import com.zhidao.loglib.download.DownloadManager
|
||||||
import com.zhjt.mogo_core_function_devatools.R
|
import com.zhjt.mogo_core_function_devatools.R
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.BagManagerListAdapter
|
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.BagManagerListAdapter
|
||||||
|
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig.bagManagerList
|
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig.bagManagerList
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.record.Audition
|
import com.zhjt.mogo_core_function_devatools.badcase.record.Audition
|
||||||
import kotlinx.android.synthetic.main.layout_badcase_manager.view.*
|
import kotlinx.android.synthetic.main.layout_badcase_manager.view.*
|
||||||
@@ -50,6 +53,7 @@ class BadCaseManagerView @JvmOverloads constructor(
|
|||||||
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
||||||
private var clickListener: ClickListener? = null
|
private var clickListener: ClickListener? = null
|
||||||
private var bagUploadDialog: BagUploadDialog ?= null
|
private var bagUploadDialog: BagUploadDialog ?= null
|
||||||
|
private var recordScreenDialog: RecordScreenDialog ?= null
|
||||||
|
|
||||||
private var spaceTotal: Long = 0 //总空间
|
private var spaceTotal: Long = 0 //总空间
|
||||||
private var spaceUsed: Long = 0 //已用空间
|
private var spaceUsed: Long = 0 //已用空间
|
||||||
@@ -181,7 +185,7 @@ class BadCaseManagerView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadBI(bagInfoEntity: BagInfoEntity) {
|
override fun uploadBI(bagInfoEntity: BagInfoEntity) {
|
||||||
//展示上报弹窗
|
//展示主动上报弹窗
|
||||||
val initiativeBadCaseWindow = InitiativeBadCaseWindow(context as Activity)
|
val initiativeBadCaseWindow = InitiativeBadCaseWindow(context as Activity)
|
||||||
initiativeBadCaseWindow.setClickListener(object: InitiativeBadCaseWindow.ClickListener{
|
initiativeBadCaseWindow.setClickListener(object: InitiativeBadCaseWindow.ClickListener{
|
||||||
override fun closeWindow() {
|
override fun closeWindow() {
|
||||||
@@ -191,6 +195,18 @@ class BadCaseManagerView @JvmOverloads constructor(
|
|||||||
initiativeBadCaseWindow.showReportBIWindow(bagInfoEntity)
|
initiativeBadCaseWindow.showReportBIWindow(bagInfoEntity)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun upLoadAiData(bagInfoEntity: BagInfoEntity) {
|
||||||
|
//展示AI数据采集上报弹窗
|
||||||
|
val aiDataCollectWindow = AIDataCollectWindow(context as Activity)
|
||||||
|
aiDataCollectWindow.setClickListener(object :
|
||||||
|
AIDataCollectWindow.ClickListener {
|
||||||
|
override fun closeWindow() {
|
||||||
|
aiDataCollectWindow.hideFloatWindow()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
aiDataCollectWindow.showReportBIWindow(bagInfoEntity)
|
||||||
|
}
|
||||||
|
|
||||||
override fun editDescription(key: Long, description: BagDescriptionEntity) {
|
override fun editDescription(key: Long, description: BagDescriptionEntity) {
|
||||||
//编辑Bag包描述信息
|
//编辑Bag包描述信息
|
||||||
isNameModify = true
|
isNameModify = true
|
||||||
@@ -208,14 +224,35 @@ class BadCaseManagerView @JvmOverloads constructor(
|
|||||||
//延迟播放
|
//延迟播放
|
||||||
Handler().postDelayed({
|
Handler().postDelayed({
|
||||||
//音频文件播放
|
//音频文件播放
|
||||||
Audition.getInstance().playOrStop("${audioSavePath}${key}.wav")
|
try {
|
||||||
|
Audition.getInstance().playOrStop("${audioSavePath}${key}.wav")
|
||||||
|
}catch (e: Exception){
|
||||||
|
CallerLogger.i(M_DEVA + TAG,"playOrStop=${e}")
|
||||||
|
}
|
||||||
}, 1500)
|
}, 1500)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun lookMapScreen(key: Long) {
|
||||||
|
//打开高精地图截图对话框
|
||||||
|
if(recordScreenDialog == null){
|
||||||
|
recordScreenDialog = RecordScreenDialog(context)
|
||||||
|
}
|
||||||
|
recordScreenDialog?.show()
|
||||||
|
recordScreenDialog?.showScreenImage(key)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun startEdit(editText: EditText) {
|
||||||
|
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager?
|
||||||
|
imm?.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT)
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
val linearLayoutManager = LinearLayoutManager(context)
|
val linearLayoutManager = LinearLayoutManager(context)
|
||||||
rvBagList.layoutManager = linearLayoutManager
|
rvBagList.layoutManager = linearLayoutManager
|
||||||
rvBagList.adapter = bagManagerListAdapter
|
rvBagList.adapter = bagManagerListAdapter
|
||||||
|
bagManagerListAdapter?.setRecordSet(BadCaseConfig.getInitiativeRecordSet(),
|
||||||
|
BadCaseConfig.getAiDataSet(),BadCaseConfig.getRecordFailSet())
|
||||||
|
|
||||||
|
|
||||||
//音频文件播放
|
//音频文件播放
|
||||||
// Audition.getInstance().playOrStop("/mnt/sdcard/mogo/test.wav")
|
// Audition.getInstance().playOrStop("/mnt/sdcard/mogo/test.wav")
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.google.protobuf.ProtocolStringList;
|
||||||
import com.mogo.eagle.core.data.deva.badcase.RecordCaseEntity;
|
import com.mogo.eagle.core.data.deva.badcase.RecordCaseEntity;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||||
@@ -99,19 +100,14 @@ public class CaseListDialog extends Dialog implements IMoGoAutopilotRecordListen
|
|||||||
if(config.getRecordTypesCount()>0){
|
if(config.getRecordTypesCount()>0){
|
||||||
for(int index=0;index<config.getRecordTypesCount();index++){
|
for(int index=0;index<config.getRecordTypesCount();index++){
|
||||||
if(config.getRecordTypes(index).getId() != 99){
|
if(config.getRecordTypes(index).getId() != 99){
|
||||||
ArrayList<String> topicList = new ArrayList<>();
|
|
||||||
// TODO java.lang.IndexOutOfBoundsException: Index: 38, Size: 38
|
|
||||||
// for(int position=0;index<config.getRecordTypes(index).getTopicsCount();position++){
|
|
||||||
// topicList.add(config.getRecordTypes(index).getTopicsList().get(position));
|
|
||||||
// }
|
|
||||||
recordTypeEntityArrayList.add(new RecordCaseEntity(
|
recordTypeEntityArrayList.add(new RecordCaseEntity(
|
||||||
config.getRecordTypes(index).getId(),config.getRecordTypes(index).getDesc(),
|
config.getRecordTypes(index).getId(),config.getRecordTypes(index).getDesc(),
|
||||||
topicList));
|
config.getAllTopicsList()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(BadCaseConfig.customTopicList.size()>0){
|
if(BadCaseConfig.customTopicList.size()>0){
|
||||||
recordTypeEntityArrayList.add(new RecordCaseEntity(0,"自定义A",BadCaseConfig.customTopicList));
|
recordTypeEntityArrayList.add(new RecordCaseEntity(0,"自定义A", (ProtocolStringList) BadCaseConfig.customTopicList));
|
||||||
}
|
}
|
||||||
caseListAdapter.setData(recordTypeEntityArrayList);
|
caseListAdapter.setData(recordTypeEntityArrayList);
|
||||||
caseListAdapter.notifyDataSetChanged();
|
caseListAdapter.notifyDataSetChanged();
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ package com.zhjt.mogo_core_function_devatools.badcase.biz
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
|
import android.graphics.Bitmap
|
||||||
import android.graphics.PixelFormat
|
import android.graphics.PixelFormat
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.CountDownTimer
|
import android.os.Environment
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.SystemClock
|
import android.os.SystemClock
|
||||||
import android.util.DisplayMetrics
|
import android.util.DisplayMetrics
|
||||||
@@ -32,10 +33,14 @@ import com.mogo.eagle.core.data.deva.badcase.RecordCaseEntity
|
|||||||
import com.mogo.eagle.core.data.deva.badcase.RecordOptionEntity
|
import com.mogo.eagle.core.data.deva.badcase.RecordOptionEntity
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||||
import com.mogo.eagle.core.function.api.devatools.badcase.BadCaseNetListener
|
import com.mogo.eagle.core.function.api.devatools.badcase.BadCaseNetListener
|
||||||
|
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapScreenListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84
|
||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsNetManager
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsNetManager
|
||||||
|
import com.mogo.eagle.core.function.call.map.CallerMapScreenListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||||
@@ -58,6 +63,7 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
|||||||
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.BadCaseNetManager
|
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.BadCaseNetManager
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.store.BadCaseReasonStore
|
import com.zhjt.mogo_core_function_devatools.badcase.repository.store.BadCaseReasonStore
|
||||||
|
import com.zhjt.mogo_core_function_devatools.badcase.util.RecordBitmapUtils
|
||||||
import kotlinx.coroutines.GlobalScope
|
import kotlinx.coroutines.GlobalScope
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
@@ -66,6 +72,7 @@ import org.json.JSONObject
|
|||||||
import record_cache.RecordPanelOuterClass
|
import record_cache.RecordPanelOuterClass
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
import kotlin.collections.ArrayList
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,7 +81,7 @@ import java.util.*
|
|||||||
* @since: 2022/7/13
|
* @since: 2022/7/13
|
||||||
*/
|
*/
|
||||||
class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
|
class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||||
IMoGoAutopilotRecordListener, BadCaseNetListener {
|
IMoGoAutopilotRecordListener, BadCaseNetListener, IMoGoMapScreenListener {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val TAG = "InitiativeBadCaseWindow"
|
const val TAG = "InitiativeBadCaseWindow"
|
||||||
@@ -92,7 +99,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
|
|
||||||
private lateinit var viewAudioBg: ImageView
|
private lateinit var viewAudioBg: ImageView
|
||||||
private lateinit var viewAudioButton: ImageView
|
private lateinit var viewAudioButton: ImageView
|
||||||
private lateinit var tvAudioCountDown: TextView
|
private lateinit var viewAudioStart: ImageView
|
||||||
|
private lateinit var tvAudioResult: TextView
|
||||||
|
|
||||||
private lateinit var tvInitiativeReport: TextView
|
private lateinit var tvInitiativeReport: TextView
|
||||||
private lateinit var tvInitiativeCancel: TextView
|
private lateinit var tvInitiativeCancel: TextView
|
||||||
@@ -104,7 +112,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
private var audioFileName:String?=null //录音文件名称
|
private var audioFileName:String?=null //录音文件名称
|
||||||
|
|
||||||
private var uploadReason: StringBuilder = StringBuilder() //上报原因,标签
|
private var uploadReason: StringBuilder = StringBuilder() //上报原因,标签
|
||||||
private var reasonDetail: String ?= null //语音转写
|
private var uploadList = ArrayList<String>() //上报原因列表
|
||||||
|
private var reasonDetail: String = "" //语音转写
|
||||||
private var uploadReasonTotal: String = ""
|
private var uploadReasonTotal: String = ""
|
||||||
@Volatile
|
@Volatile
|
||||||
private var recordKey: Long = 0 //录制bag包key
|
private var recordKey: Long = 0 //录制bag包key
|
||||||
@@ -112,6 +121,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
private var recordFileName: String?=null //录制文件包名
|
private var recordFileName: String?=null //录制文件包名
|
||||||
private var receiveTime: String?= null
|
private var receiveTime: String?= null
|
||||||
private var uploadStamp: String = System.currentTimeMillis().toString()
|
private var uploadStamp: String = System.currentTimeMillis().toString()
|
||||||
|
private var screenSavePath: String ?= null //截图保存路径
|
||||||
|
|
||||||
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
||||||
|
|
||||||
@@ -158,7 +168,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
|
|
||||||
viewAudioBg = mFloatLayout.findViewById(R.id.viewAudioBg)
|
viewAudioBg = mFloatLayout.findViewById(R.id.viewAudioBg)
|
||||||
viewAudioButton = mFloatLayout.findViewById(R.id.viewAudioButton)
|
viewAudioButton = mFloatLayout.findViewById(R.id.viewAudioButton)
|
||||||
tvAudioCountDown = mFloatLayout.findViewById(R.id.tvAudioCountDown)
|
viewAudioStart = mFloatLayout.findViewById(R.id.viewAudioStart)
|
||||||
|
tvAudioResult = mFloatLayout.findViewById(R.id.tvAudioResult)
|
||||||
|
|
||||||
tvInitiativeReport = mFloatLayout.findViewById(R.id.tvInitiativeReport)
|
tvInitiativeReport = mFloatLayout.findViewById(R.id.tvInitiativeReport)
|
||||||
tvInitiativeCancel = mFloatLayout.findViewById(R.id.tvInitiativeCancel)
|
tvInitiativeCancel = mFloatLayout.findViewById(R.id.tvInitiativeCancel)
|
||||||
@@ -171,10 +182,13 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
badReasonListAdapter?.setListener(object: BadReasonListAdapter.ReasonClickListener{
|
badReasonListAdapter?.setListener(object: BadReasonListAdapter.ReasonClickListener{
|
||||||
override fun onClick(reason: String, isChecked: Boolean) {
|
override fun onClick(reason: String, isChecked: Boolean) {
|
||||||
if(isChecked){
|
if(isChecked){
|
||||||
uploadReason.append(reason)
|
if(!uploadList.contains(reason)){
|
||||||
|
uploadList.add(reason)
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
val index = uploadReason.indexOf(reason)
|
if(uploadList.contains(reason)){
|
||||||
uploadReason.delete(index,index+reason.length)
|
uploadList.remove(reason)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -192,7 +206,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
*/
|
*/
|
||||||
BadCaseNetManager.badCaseNetManager.getRecordOption(1,AppConfigInfo.iPCMacAddress)
|
BadCaseNetManager.badCaseNetManager.getRecordOption(1,AppConfigInfo.iPCMacAddress)
|
||||||
// BadCaseNetManager.badCaseNetManager.getRecordOption(1,"48:b0:2d:3a:9c:8f")
|
// BadCaseNetManager.badCaseNetManager.getRecordOption(1,"48:b0:2d:3a:9c:8f")
|
||||||
|
//高精地图屏幕截图
|
||||||
|
CallerMapScreenListenerManager.addListener(this.hashCode().toString(),this)
|
||||||
//采集结果回调监听
|
//采集结果回调监听
|
||||||
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(),this)
|
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(),this)
|
||||||
//主动录包采集原因回调监听
|
//主动录包采集原因回调监听
|
||||||
@@ -204,10 +219,17 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
|
|
||||||
//上报
|
//上报
|
||||||
tvInitiativeReport.setOnClickListener {
|
tvInitiativeReport.setOnClickListener {
|
||||||
if(uploadReason.isBlank()){
|
if(uploadList.isEmpty()){
|
||||||
ToastUtils.showShort("请选择最少一个原因")
|
ToastUtils.showShort("请选择最少一个原因")
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
uploadReason.clear()
|
||||||
|
for(index in uploadList.indices){
|
||||||
|
if(index!=0){
|
||||||
|
uploadReason.append("&")
|
||||||
|
}
|
||||||
|
uploadReason.append(uploadList[index])
|
||||||
|
}
|
||||||
tvInitiativeReport.text = "上报中..."
|
tvInitiativeReport.text = "上报中..."
|
||||||
if(audioStatus){
|
if(audioStatus){
|
||||||
audioStatus = false
|
audioStatus = false
|
||||||
@@ -218,11 +240,10 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
}else{
|
}else{
|
||||||
//停止语音听写
|
//停止语音听写
|
||||||
mIat?.stopListening()
|
mIat?.stopListening()
|
||||||
//结束倒计时
|
//结束录音
|
||||||
countDownTimer?.cancel()
|
RecordManager.getInstance().stop()
|
||||||
countDownTimer?.onFinish()
|
//结束动画
|
||||||
//将倒计时置空
|
viewAudioStart.clearAnimation()
|
||||||
countDownTimer = null
|
|
||||||
uploadAudio()
|
uploadAudio()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,7 +254,6 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
clickListener?.closeWindow()
|
clickListener?.closeWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mWindowParams = WindowManager.LayoutParams()
|
mWindowParams = WindowManager.LayoutParams()
|
||||||
mWindowManager = mActivity.windowManager
|
mWindowManager = mActivity.windowManager
|
||||||
mWindowParams?.let {
|
mWindowParams?.let {
|
||||||
@@ -313,10 +333,11 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
}
|
}
|
||||||
Log.i(TAG, "语音内容=$resultBuffer")
|
Log.i(TAG, "语音内容=$resultBuffer")
|
||||||
reasonDetail = resultBuffer.toString()
|
reasonDetail = resultBuffer.toString()
|
||||||
|
if(reasonDetail.isNotEmpty()){
|
||||||
|
tvAudioResult.text = reasonDetail
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var countDownTimer: CountDownTimer?=null
|
|
||||||
|
|
||||||
private fun setAudio(status: Boolean){
|
private fun setAudio(status: Boolean){
|
||||||
if(status){
|
if(status){
|
||||||
//开始录音
|
//开始录音
|
||||||
@@ -339,35 +360,17 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
)
|
)
|
||||||
scaleAnimation.duration = 1000
|
scaleAnimation.duration = 1000
|
||||||
scaleAnimation.repeatCount = -1
|
scaleAnimation.repeatCount = -1
|
||||||
viewAudioButton.startAnimation(scaleAnimation)
|
viewAudioButton.visibility = View.GONE
|
||||||
|
viewAudioStart.visibility = View.VISIBLE
|
||||||
tvAudioCountDown.visibility = View.VISIBLE
|
viewAudioStart.startAnimation(scaleAnimation)
|
||||||
//开始倒计时
|
tvAudioResult.text = "..."
|
||||||
if(countDownTimer==null){
|
|
||||||
countDownTimer = object : CountDownTimer(60000, 1000) {
|
|
||||||
|
|
||||||
override fun onTick(millisUntilFinished: Long) {
|
|
||||||
tvAudioCountDown.text = "${millisUntilFinished/1000}S"
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onFinish() {
|
|
||||||
tvAudioCountDown.visibility = View.GONE
|
|
||||||
//结束录音
|
|
||||||
RecordManager.getInstance().stop()
|
|
||||||
//结束动画
|
|
||||||
viewAudioButton.clearAnimation()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
countDownTimer?.start()
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
//停止语音听写
|
//停止语音听写
|
||||||
mIat?.stopListening()
|
mIat?.stopListening()
|
||||||
//结束倒计时
|
//结束录音
|
||||||
countDownTimer?.cancel()
|
RecordManager.getInstance().stop()
|
||||||
countDownTimer?.onFinish()
|
//结束动画
|
||||||
//将倒计时置空
|
viewAudioStart.clearAnimation()
|
||||||
countDownTimer = null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -430,11 +433,14 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
*/
|
*/
|
||||||
private fun upload(downloadUrl: String?){
|
private fun upload(downloadUrl: String?){
|
||||||
GlobalScope.launch{
|
GlobalScope.launch{
|
||||||
uploadReasonTotal = if(reasonDetail.isNullOrEmpty()){
|
uploadReasonTotal = if(reasonDetail.isEmpty()){
|
||||||
uploadReason.toString()
|
uploadReason.toString()
|
||||||
}else{
|
}else{
|
||||||
"$uploadReason 语音内容:$reasonDetail"
|
"$uploadReason 语音内容:$reasonDetail"
|
||||||
}
|
}
|
||||||
|
//上报到工控机
|
||||||
|
CallerAutoPilotControlManager.recordCause(recordKey.toString(),recordFileName,"",
|
||||||
|
"$uploadReason:$reasonDetail")
|
||||||
val uploadResult = presenter.upload(mutableMapOf<String, String>().also { itx ->
|
val uploadResult = presenter.upload(mutableMapOf<String, String>().also { itx ->
|
||||||
itx["carLicense"] = AppConfigInfo.plateNumber?:"" //车牌号
|
itx["carLicense"] = AppConfigInfo.plateNumber?:"" //车牌号
|
||||||
itx["filename"] = recordFileName?:"" //bag包文件地址
|
itx["filename"] = recordFileName?:"" //bag包文件地址
|
||||||
@@ -467,6 +473,10 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
bagManagerEntity.descReq = descReqEntity
|
bagManagerEntity.descReq = descReqEntity
|
||||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||||
}
|
}
|
||||||
|
//删除截图
|
||||||
|
screenSavePath?.let {
|
||||||
|
RecordBitmapUtils.deleteReportedImage(it)
|
||||||
|
}
|
||||||
val loc = getChassisLocationWGS84()
|
val loc = getChassisLocationWGS84()
|
||||||
BadCaseAnalyticsManager.bagRecordUpload(recordKey.toString(),recordFileName?:"",uploadStamp,
|
BadCaseAnalyticsManager.bagRecordUpload(recordKey.toString(),recordFileName?:"",uploadStamp,
|
||||||
"100",AppConfigInfo.plateNumber,BadCaseConfig.totalDuration.toString(),MoGoAiCloudClientConfig.getInstance().sn,
|
"100",AppConfigInfo.plateNumber,BadCaseConfig.totalDuration.toString(),MoGoAiCloudClientConfig.getInstance().sn,
|
||||||
@@ -561,6 +571,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
CallerAutopilotRecordListenerManager.removeListener(this.hashCode().toString())
|
CallerAutopilotRecordListenerManager.removeListener(this.hashCode().toString())
|
||||||
//注销采集原因回调监听
|
//注销采集原因回调监听
|
||||||
CallerDevaToolsNetManager.removeListener(this.hashCode().toString())
|
CallerDevaToolsNetManager.removeListener(this.hashCode().toString())
|
||||||
|
//注销高精地图截图监听回调
|
||||||
|
CallerMapScreenListenerManager.removeListener(this.hashCode().toString())
|
||||||
if (mFloatLayout.parent != null){
|
if (mFloatLayout.parent != null){
|
||||||
mWindowManager!!.removeView(mFloatLayout)
|
mWindowManager!!.removeView(mFloatLayout)
|
||||||
|
|
||||||
@@ -570,10 +582,18 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
|
||||||
CallerLogger.d("${M_DEVA}${TAG}", "-- 收到工控机录制任务回调 -- $recordPanel")
|
CallerLogger.d("${M_DEVA}${TAG}", "-- 收到工控机录制任务回调 -- $recordPanel")
|
||||||
ThreadUtils.runOnUiThread {
|
ThreadUtils.runOnUiThread {
|
||||||
if(recordKey==null){
|
recordKey = recordPanel.key
|
||||||
recordKey = recordPanel.key
|
//开始录制
|
||||||
|
if(recordPanel.stat == 300){
|
||||||
|
BadCaseConfig.recordKeyList.add(recordPanel.key)
|
||||||
|
//获取当前主动录包集合
|
||||||
|
val recordSet = BadCaseConfig.getInitiativeRecordSet()
|
||||||
|
//保存录包状态
|
||||||
|
recordSet.add(recordPanel.key.toString())
|
||||||
|
BadCaseConfig.setInitiativeRecordSet(recordSet)
|
||||||
|
//开启高精地图截图
|
||||||
|
CallerMapUIServiceManager.getMapUIController()?.getMapScreenShot()
|
||||||
}
|
}
|
||||||
BadCaseConfig.recordKeyList.add(recordPanel.key)
|
|
||||||
if(recordFileName==null){
|
if(recordFileName==null){
|
||||||
recordFileName = recordPanel.filename
|
recordFileName = recordPanel.filename
|
||||||
}
|
}
|
||||||
@@ -642,4 +662,48 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高精地图截图回调
|
||||||
|
*/
|
||||||
|
override fun onMapScreen(bitmap: Bitmap) {
|
||||||
|
//在截图上保存即时信息
|
||||||
|
val time = "时间:${millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())}"
|
||||||
|
val lineId = "路线ID:${CallerAutoPilotStatusListenerManager.getLineId()}"
|
||||||
|
val state = when(CallerAutoPilotStatusListenerManager.getState()){
|
||||||
|
0->"自驾状态:不可自驾"
|
||||||
|
1->"自驾状态:可自驾"
|
||||||
|
2->"自驾状态:自驾中"
|
||||||
|
7->"自驾状态:平行驾驶中"
|
||||||
|
else->"自驾状态:未知"
|
||||||
|
}
|
||||||
|
val speed = "当前车速:${BadCaseConfig.currentSpeed}"
|
||||||
|
val site = if(CallerAutoPilotStatusListenerManager.getLineStartName().isNullOrEmpty() || CallerAutoPilotStatusListenerManager.getLineEndName().isNullOrEmpty()){
|
||||||
|
"路线起始点:无"
|
||||||
|
}else{
|
||||||
|
"路线起点:${CallerAutoPilotStatusListenerManager.getLineStartName()};终点:${CallerAutoPilotStatusListenerManager.getLineEndName()}"
|
||||||
|
}
|
||||||
|
|
||||||
|
val outBitmap = RecordBitmapUtils.drawTextOnBitmap(bitmap,time,lineId,state,speed,site,
|
||||||
|
BadCaseConfig.gpsStatus,BadCaseConfig.tracingStatus,BadCaseConfig.socketStatus
|
||||||
|
,BadCaseConfig.newFMInfoMsg,BadCaseConfig.newReportEntity)
|
||||||
|
|
||||||
|
//图片保存本地
|
||||||
|
val currentDay = millis2String(System.currentTimeMillis(), TimeUtils.getMdFormat())
|
||||||
|
val fileDir: String = Environment.getExternalStorageDirectory().absolutePath + File.separator+
|
||||||
|
"MapScreen" + File.separator+ currentDay + File.separator
|
||||||
|
val fileName = "$recordKey.png"
|
||||||
|
val path = fileDir + fileName
|
||||||
|
if (!File(fileDir).exists()) {
|
||||||
|
File(fileDir).mkdirs()
|
||||||
|
}
|
||||||
|
if(outBitmap != null){
|
||||||
|
RecordBitmapUtils.bitmap2Path(outBitmap,path)
|
||||||
|
}else{
|
||||||
|
RecordBitmapUtils.bitmap2Path(bitmap,path)
|
||||||
|
}
|
||||||
|
screenSavePath = path
|
||||||
|
//遍历是否有非当日的文件并删除
|
||||||
|
RecordBitmapUtils.deleteExpiredFile(currentDay)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,23 +2,20 @@ package com.zhjt.mogo_core_function_devatools.badcase.biz
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.graphics.Color
|
import android.graphics.Bitmap
|
||||||
import android.graphics.PixelFormat
|
import android.graphics.PixelFormat
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.CountDownTimer
|
import android.os.Environment
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.util.DisplayMetrics
|
import android.util.DisplayMetrics
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.*
|
import android.view.*
|
||||||
import android.view.animation.Animation
|
import android.view.animation.Animation
|
||||||
import android.view.animation.ScaleAnimation
|
import android.view.animation.ScaleAnimation
|
||||||
import android.widget.CheckBox
|
|
||||||
import android.widget.CompoundButton
|
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.google.android.flexbox.FlexboxLayout
|
|
||||||
import com.iflytek.cloud.ErrorCode
|
import com.iflytek.cloud.ErrorCode
|
||||||
import com.iflytek.cloud.InitListener
|
import com.iflytek.cloud.InitListener
|
||||||
import com.iflytek.cloud.RecognizerListener
|
import com.iflytek.cloud.RecognizerListener
|
||||||
@@ -34,9 +31,13 @@ import com.mogo.eagle.core.data.deva.badcase.RecordOptionEntity
|
|||||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||||
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
|
||||||
import com.mogo.eagle.core.function.api.devatools.badcase.BadCaseNetListener
|
import com.mogo.eagle.core.function.api.devatools.badcase.BadCaseNetListener
|
||||||
|
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapScreenListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsNetManager
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsNetManager
|
||||||
|
import com.mogo.eagle.core.function.call.map.CallerMapScreenListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||||
@@ -57,13 +58,12 @@ import com.zhjt.mogo_core_function_devatools.badcase.BadCaseAnalyticsManager
|
|||||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.BadReasonListAdapter
|
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.BadReasonListAdapter
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.BadCaseNetManager
|
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.BadCaseNetManager
|
||||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.store.BadCaseReasonStore
|
import com.zhjt.mogo_core_function_devatools.badcase.repository.store.BadCaseReasonStore
|
||||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
import com.zhjt.mogo_core_function_devatools.badcase.util.RecordBitmapUtils
|
||||||
import org.greenrobot.eventbus.EventBus
|
import org.greenrobot.eventbus.EventBus
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
import org.json.JSONException
|
import org.json.JSONException
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.lang.Exception
|
|
||||||
import java.lang.StringBuilder
|
import java.lang.StringBuilder
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,7 +72,7 @@ import java.lang.StringBuilder
|
|||||||
* @since: 2022/7/17
|
* @since: 2022/7/17
|
||||||
*/
|
*/
|
||||||
class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
|
class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListener,
|
||||||
BadCaseNetListener {
|
BadCaseNetListener , IMoGoMapScreenListener {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val TAG = "PassiveBadCaseWindow"
|
const val TAG = "PassiveBadCaseWindow"
|
||||||
@@ -89,6 +89,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
|
||||||
|
|
||||||
private var uploadReason: StringBuilder = StringBuilder() //上报原因,标签
|
private var uploadReason: StringBuilder = StringBuilder() //上报原因,标签
|
||||||
|
private var uploadList = ArrayList<String>() //上报原因列表
|
||||||
private var recordKey: String?=null //录制bag包key
|
private var recordKey: String?=null //录制bag包key
|
||||||
private var recordFileName: String?=null //录制文件包名
|
private var recordFileName: String?=null //录制文件包名
|
||||||
private var receiveTime: String ?= null //接收时间
|
private var receiveTime: String ?= null //接收时间
|
||||||
@@ -99,6 +100,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
|
|
||||||
private lateinit var rvPassiveList : RecyclerView
|
private lateinit var rvPassiveList : RecyclerView
|
||||||
private var badReasonListAdapter: BadReasonListAdapter?= null
|
private var badReasonListAdapter: BadReasonListAdapter?= null
|
||||||
|
private var screenSavePath: String ?= null //截图保存路径
|
||||||
|
|
||||||
private var mInViewX = 0f
|
private var mInViewX = 0f
|
||||||
private var mInViewY = 0f
|
private var mInViewY = 0f
|
||||||
@@ -108,7 +110,6 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
private var mInScreenY = 0f
|
private var mInScreenY = 0f
|
||||||
|
|
||||||
private var clickListener: ClickListener? = null
|
private var clickListener: ClickListener? = null
|
||||||
var countDownTimer: CountDownTimer?=null
|
|
||||||
|
|
||||||
private lateinit var tvPassiveNum: TextView
|
private lateinit var tvPassiveNum: TextView
|
||||||
private lateinit var tvPassiveTime: TextView
|
private lateinit var tvPassiveTime: TextView
|
||||||
@@ -116,7 +117,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
|
|
||||||
private lateinit var viewAudioBg: ImageView
|
private lateinit var viewAudioBg: ImageView
|
||||||
private lateinit var viewAudioButton: ImageView
|
private lateinit var viewAudioButton: ImageView
|
||||||
private lateinit var tvAudioCountDown: TextView
|
private lateinit var viewAudioStart: ImageView
|
||||||
|
private lateinit var tvAudioResult: TextView
|
||||||
|
|
||||||
private lateinit var tvPassiveReport: TextView
|
private lateinit var tvPassiveReport: TextView
|
||||||
private lateinit var tvPassiveCancel: TextView
|
private lateinit var tvPassiveCancel: TextView
|
||||||
@@ -129,7 +131,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
// 用HashMap存储听写结果
|
// 用HashMap存储听写结果
|
||||||
private val mIatResults: HashMap<String, String> = LinkedHashMap()
|
private val mIatResults: HashMap<String, String> = LinkedHashMap()
|
||||||
|
|
||||||
private var reasonDetail: String ?= null //语音转写
|
private var reasonDetail: String = "" //语音转写
|
||||||
private var uploadReasonTotal: String = ""
|
private var uploadReasonTotal: String = ""
|
||||||
|
|
||||||
private var isUploadCos = false //是否在上传Cos操作
|
private var isUploadCos = false //是否在上传Cos操作
|
||||||
@@ -156,8 +158,9 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
tvPassiveTime = mFloatLayout.findViewById(R.id.tvPassiveTime)
|
tvPassiveTime = mFloatLayout.findViewById(R.id.tvPassiveTime)
|
||||||
tvPassiveIdentity = mFloatLayout.findViewById(R.id.tvPassiveIdentity)
|
tvPassiveIdentity = mFloatLayout.findViewById(R.id.tvPassiveIdentity)
|
||||||
viewAudioBg = mFloatLayout.findViewById(R.id.viewAudioBg)
|
viewAudioBg = mFloatLayout.findViewById(R.id.viewAudioBg)
|
||||||
|
tvAudioResult = mFloatLayout.findViewById(R.id.tvAudioResult)
|
||||||
viewAudioButton = mFloatLayout.findViewById(R.id.viewAudioButton)
|
viewAudioButton = mFloatLayout.findViewById(R.id.viewAudioButton)
|
||||||
tvAudioCountDown = mFloatLayout.findViewById(R.id.tvAudioCountDown)
|
viewAudioStart = mFloatLayout.findViewById(R.id.viewAudioStart)
|
||||||
tvPassiveReport = mFloatLayout.findViewById(R.id.tvPassiveReport)
|
tvPassiveReport = mFloatLayout.findViewById(R.id.tvPassiveReport)
|
||||||
tvPassiveCancel = mFloatLayout.findViewById(R.id.tvPassiveCancel)
|
tvPassiveCancel = mFloatLayout.findViewById(R.id.tvPassiveCancel)
|
||||||
rvPassiveList = mFloatLayout.findViewById(R.id.rvPassiveList)
|
rvPassiveList = mFloatLayout.findViewById(R.id.rvPassiveList)
|
||||||
@@ -169,10 +172,13 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
override fun onClick(reason: String, isChecked: Boolean) {
|
override fun onClick(reason: String, isChecked: Boolean) {
|
||||||
hasOperated = true
|
hasOperated = true
|
||||||
if(isChecked){
|
if(isChecked){
|
||||||
uploadReason.append(reason)
|
if(!uploadList.contains(reason)){
|
||||||
|
uploadList.add(reason)
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
val index = uploadReason.indexOf(reason)
|
if(uploadList.contains(reason)){
|
||||||
uploadReason.delete(index,index+reason.length)
|
uploadList.remove(reason)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -183,6 +189,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
*/
|
*/
|
||||||
BadCaseNetManager.badCaseNetManager.getRecordOption(2,AppConfigInfo.iPCMacAddress)
|
BadCaseNetManager.badCaseNetManager.getRecordOption(2,AppConfigInfo.iPCMacAddress)
|
||||||
// BadCaseNetManager.badCaseNetManager.getRecordOption(2,"48:b0:2d:3a:9c:8f")
|
// BadCaseNetManager.badCaseNetManager.getRecordOption(2,"48:b0:2d:3a:9c:8f")
|
||||||
|
//高精地图屏幕截图
|
||||||
|
CallerMapScreenListenerManager.addListener(this.hashCode().toString(),this)
|
||||||
CallerDevaToolsNetManager.addListener(this.hashCode().toString(),this)
|
CallerDevaToolsNetManager.addListener(this.hashCode().toString(),this)
|
||||||
if(BadCaseConfig.windowNum<1){
|
if(BadCaseConfig.windowNum<1){
|
||||||
BadCaseConfig.windowNum = 1
|
BadCaseConfig.windowNum = 1
|
||||||
@@ -199,10 +207,17 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
|
|
||||||
tvPassiveReport.setOnClickListener {
|
tvPassiveReport.setOnClickListener {
|
||||||
hasOperated = true
|
hasOperated = true
|
||||||
if(uploadReason.isEmpty()){
|
if(uploadList.isEmpty()){
|
||||||
TipToast.shortTip("请选择至少一个Case")
|
TipToast.shortTip("请选择至少一个Case")
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
uploadReason.clear()
|
||||||
|
for(index in uploadList.indices){
|
||||||
|
if(index!=0){
|
||||||
|
uploadReason.append("&")
|
||||||
|
}
|
||||||
|
uploadReason.append(uploadList[index])
|
||||||
|
}
|
||||||
tvPassiveReport.text = "上报中..."
|
tvPassiveReport.text = "上报中..."
|
||||||
if(audioStatus){
|
if(audioStatus){
|
||||||
audioStatus = !audioStatus
|
audioStatus = !audioStatus
|
||||||
@@ -213,11 +228,10 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
}else{
|
}else{
|
||||||
//停止语音听写
|
//停止语音听写
|
||||||
mIat?.stopListening()
|
mIat?.stopListening()
|
||||||
//结束倒计时
|
//结束录音
|
||||||
countDownTimer?.cancel()
|
RecordManager.getInstance().stop()
|
||||||
countDownTimer?.onFinish()
|
//结束动画
|
||||||
//将倒计时置空
|
viewAudioStart.clearAnimation()
|
||||||
countDownTimer = null
|
|
||||||
uploadAudio()
|
uploadAudio()
|
||||||
}
|
}
|
||||||
//删除记录
|
//删除记录
|
||||||
@@ -314,6 +328,9 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
}
|
}
|
||||||
Log.i(TAG, "语音内容=$resultBuffer")
|
Log.i(TAG, "语音内容=$resultBuffer")
|
||||||
reasonDetail = resultBuffer.toString()
|
reasonDetail = resultBuffer.toString()
|
||||||
|
if(reasonDetail.isNotEmpty()){
|
||||||
|
tvAudioResult.text = reasonDetail
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -339,35 +356,17 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
)
|
)
|
||||||
scaleAnimation.duration = 1000
|
scaleAnimation.duration = 1000
|
||||||
scaleAnimation.repeatCount = -1
|
scaleAnimation.repeatCount = -1
|
||||||
viewAudioButton.startAnimation(scaleAnimation)
|
viewAudioButton.visibility = View.GONE
|
||||||
|
viewAudioStart.visibility = View.VISIBLE
|
||||||
tvAudioCountDown.visibility = View.VISIBLE
|
viewAudioStart.startAnimation(scaleAnimation)
|
||||||
//开始倒计时
|
tvAudioResult.text = "..."
|
||||||
if(countDownTimer==null){
|
|
||||||
countDownTimer = object : CountDownTimer(60000, 1000) {
|
|
||||||
|
|
||||||
override fun onTick(millisUntilFinished: Long) {
|
|
||||||
tvAudioCountDown.text = "${millisUntilFinished/1000}S"
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onFinish() {
|
|
||||||
tvAudioCountDown.visibility = View.GONE
|
|
||||||
//结束录音
|
|
||||||
RecordManager.getInstance().stop()
|
|
||||||
//结束动画
|
|
||||||
viewAudioButton.clearAnimation()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
countDownTimer?.start()
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
//停止语音听写
|
//停止语音听写
|
||||||
mIat?.stopListening()
|
mIat?.stopListening()
|
||||||
//结束倒计时
|
//结束录音
|
||||||
countDownTimer?.cancel()
|
RecordManager.getInstance().stop()
|
||||||
countDownTimer?.onFinish()
|
//结束动画
|
||||||
//将倒计时置空
|
viewAudioStart.clearAnimation()
|
||||||
countDownTimer = null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -430,11 +429,15 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
*/
|
*/
|
||||||
private fun upload(downloadUrl: String?){
|
private fun upload(downloadUrl: String?){
|
||||||
GlobalScope.launch{
|
GlobalScope.launch{
|
||||||
uploadReasonTotal = if(reasonDetail.isNullOrEmpty()){
|
uploadReasonTotal = if(reasonDetail.isEmpty()){
|
||||||
uploadReason.toString()
|
uploadReason.toString()
|
||||||
}else{
|
}else{
|
||||||
"$uploadReason 语音内容:$reasonDetail"
|
"$uploadReason 语音内容:$reasonDetail"
|
||||||
}
|
}
|
||||||
|
//上报到工控机
|
||||||
|
CallerAutoPilotControlManager.recordCause(recordKey,recordFileName,"",
|
||||||
|
"$uploadReason:$reasonDetail"
|
||||||
|
)
|
||||||
val uploadResult = presenter.upload(mutableMapOf<String, String>().also { itx ->
|
val uploadResult = presenter.upload(mutableMapOf<String, String>().also { itx ->
|
||||||
itx["carLicense"] = AppConfigInfo.plateNumber //车牌号
|
itx["carLicense"] = AppConfigInfo.plateNumber //车牌号
|
||||||
itx["filename"] = recordFileName?:"" //bag包文件地址
|
itx["filename"] = recordFileName?:"" //bag包文件地址
|
||||||
@@ -468,6 +471,10 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
bagManagerEntity.descReq = descReqEntity
|
bagManagerEntity.descReq = descReqEntity
|
||||||
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
CallerAutoPilotControlManager.sendBagManagerCmd(bagManagerEntity)
|
||||||
}
|
}
|
||||||
|
//删除截图
|
||||||
|
screenSavePath?.let {
|
||||||
|
RecordBitmapUtils.deleteReportedImage(it)
|
||||||
|
}
|
||||||
//被动上报埋点统计
|
//被动上报埋点统计
|
||||||
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||||
BadCaseAnalyticsManager.bagRecordUpload(recordKey?:"",recordFileName?:"",receiveTime?:System.currentTimeMillis().toString(),
|
BadCaseAnalyticsManager.bagRecordUpload(recordKey?:"",recordFileName?:"",receiveTime?:System.currentTimeMillis().toString(),
|
||||||
@@ -535,6 +542,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
|
|
||||||
|
|
||||||
fun hideFloatWindow() {
|
fun hideFloatWindow() {
|
||||||
|
//注销高精地图截图监听回调
|
||||||
|
CallerMapScreenListenerManager.removeListener(this.hashCode().toString())
|
||||||
//注销采集原因回调监听
|
//注销采集原因回调监听
|
||||||
CallerDevaToolsNetManager.removeListener(this.hashCode().toString())
|
CallerDevaToolsNetManager.removeListener(this.hashCode().toString())
|
||||||
// 移除 ADAS车辆状态&定位 监听
|
// 移除 ADAS车辆状态&定位 监听
|
||||||
@@ -555,6 +564,8 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
recordFileName = recordBagMsg.fileName
|
recordFileName = recordBagMsg.fileName
|
||||||
receiveTime = msgBoxBean.timestamp.toString()
|
receiveTime = msgBoxBean.timestamp.toString()
|
||||||
stat = recordBagMsg.stat.toString()
|
stat = recordBagMsg.stat.toString()
|
||||||
|
//获取高精地图截图
|
||||||
|
CallerMapUIServiceManager.getMapUIController()?.getMapScreenShot()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setClickListener(clickListener: ClickListener) {
|
fun setClickListener(clickListener: ClickListener) {
|
||||||
@@ -617,4 +628,47 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高精地图截图回调
|
||||||
|
*/
|
||||||
|
override fun onMapScreen(bitmap: Bitmap) {
|
||||||
|
//在截图上保存即时信息
|
||||||
|
val time = "时间:${millis2String(System.currentTimeMillis(), TimeUtils.getHourMinSecondFormat())}"
|
||||||
|
val lineId = "路线ID:${CallerAutoPilotStatusListenerManager.getLineId()}"
|
||||||
|
val state = when(CallerAutoPilotStatusListenerManager.getState()){
|
||||||
|
0->"自驾状态:不可自驾"
|
||||||
|
1->"自驾状态:可自驾"
|
||||||
|
2->"自驾状态:自驾中"
|
||||||
|
7->"自驾状态:平行驾驶中"
|
||||||
|
else->"自驾状态:未知"
|
||||||
|
}
|
||||||
|
val speed = "当前车速:${BadCaseConfig.currentSpeed}"
|
||||||
|
val site = if(CallerAutoPilotStatusListenerManager.getLineStartName().isNullOrEmpty() || CallerAutoPilotStatusListenerManager.getLineEndName().isNullOrEmpty()){
|
||||||
|
"路线起始点:无"
|
||||||
|
}else{
|
||||||
|
"路线起点:${CallerAutoPilotStatusListenerManager.getLineStartName()};终点:${CallerAutoPilotStatusListenerManager.getLineEndName()}"
|
||||||
|
}
|
||||||
|
|
||||||
|
val outBitmap = RecordBitmapUtils.drawTextOnBitmap(bitmap,time,lineId,state,speed,site,
|
||||||
|
BadCaseConfig.gpsStatus,BadCaseConfig.tracingStatus,BadCaseConfig.socketStatus
|
||||||
|
,BadCaseConfig.newFMInfoMsg,BadCaseConfig.newReportEntity)
|
||||||
|
//图片保存本地
|
||||||
|
val currentDay = millis2String(System.currentTimeMillis(), TimeUtils.getMdFormat())
|
||||||
|
val fileDir: String = Environment.getExternalStorageDirectory().absolutePath + File.separator+
|
||||||
|
"MapScreen" + File.separator+ currentDay + File.separator
|
||||||
|
val fileName = "$recordKey.png"
|
||||||
|
val path = fileDir + fileName
|
||||||
|
if (!File(fileDir).exists()) {
|
||||||
|
File(fileDir).mkdirs()
|
||||||
|
}
|
||||||
|
if(outBitmap != null){
|
||||||
|
RecordBitmapUtils.bitmap2Path(outBitmap,path)
|
||||||
|
}else{
|
||||||
|
RecordBitmapUtils.bitmap2Path(bitmap,path)
|
||||||
|
}
|
||||||
|
screenSavePath = path
|
||||||
|
//遍历是否有非当日的文件并删除
|
||||||
|
RecordBitmapUtils.deleteExpiredFile(currentDay)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.zhjt.mogo_core_function_devatools.badcase.biz;
|
||||||
|
|
||||||
|
import static com.mogo.eagle.core.utilcode.util.FileUtils.millis2String;
|
||||||
|
import static com.mogo.eagle.core.utilcode.util.TimeUtils.getMdFormat;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.zhjt.mogo_core_function_devatools.R;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 录包时鹰眼截图查看对话框
|
||||||
|
*/
|
||||||
|
public class RecordScreenDialog extends Dialog {
|
||||||
|
|
||||||
|
private ImageView ivScreen; //截图展示
|
||||||
|
private ImageView ivScreenClose; //关闭按钮
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
public RecordScreenDialog(@NonNull Context context) {
|
||||||
|
super(context, R.style.bad_case_dialog);
|
||||||
|
mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.dialog_record_screen);
|
||||||
|
WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||||
|
params.height = 1013;
|
||||||
|
params.width = 1708;
|
||||||
|
getWindow().setAttributes(params);//向WindowManager设置属性
|
||||||
|
setCanceledOnTouchOutside(false);
|
||||||
|
init();
|
||||||
|
initEvent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init(){
|
||||||
|
ivScreen = findViewById(R.id.ivScreen);
|
||||||
|
ivScreenClose = findViewById(R.id.ivScreenClose);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initEvent(){
|
||||||
|
//关闭当前弹窗
|
||||||
|
ivScreenClose.setOnClickListener(view -> dismiss());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showScreenImage(Long recordKey){
|
||||||
|
String imagePath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator+
|
||||||
|
"MapScreen" + File.separator+ millis2String(System.currentTimeMillis(),getMdFormat()) + File.separator+recordKey+".png";
|
||||||
|
Uri imageUri = Uri.parse(imagePath);
|
||||||
|
|
||||||
|
ivScreen.setImageURI(imageUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zhjt.mogo_core_function_devatools.badcase.biz.adapter
|
package com.zhjt.mogo_core_function_devatools.badcase.biz.adapter
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import android.text.Editable
|
import android.text.Editable
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
@@ -12,9 +13,12 @@ import android.widget.TextView
|
|||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||||
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
||||||
|
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||||
import com.zhjt.mogo_core_function_devatools.R
|
import com.zhjt.mogo_core_function_devatools.R
|
||||||
|
import com.zhjt.mogo_core_function_devatools.badcase.util.RecordBitmapUtils
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author XuXinChao
|
* @author XuXinChao
|
||||||
* @description Bag包管理列表适配器
|
* @description Bag包管理列表适配器
|
||||||
@@ -26,20 +30,33 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
|||||||
private var bagClickListener: BagClickListener ?= null
|
private var bagClickListener: BagClickListener ?= null
|
||||||
private val format = DecimalFormat("0.00")
|
private val format = DecimalFormat("0.00")
|
||||||
|
|
||||||
|
private var initiativeSet: HashSet<String> ?= null //录包来源为主动录包集合
|
||||||
|
private var aiDataSet: HashSet<String> ?= null //录包来源为AI数据采集集合
|
||||||
|
private var recordFailSet: HashSet<String> ?= null //录包失败集合
|
||||||
|
|
||||||
fun setData(data: List<BagInfoEntity>?){
|
fun setData(data: List<BagInfoEntity>?){
|
||||||
this.data = data
|
this.data = data
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置录包缓存信息
|
||||||
|
*/
|
||||||
|
fun setRecordSet(initiative: HashSet<String>,aiData: HashSet<String>,recordFail: HashSet<String>){
|
||||||
|
initiativeSet = initiative
|
||||||
|
aiDataSet = aiData
|
||||||
|
recordFailSet = recordFail
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||||
if(viewType == 1){
|
return if(viewType == 1){
|
||||||
val view = LayoutInflater.from(parent.context)
|
val view = LayoutInflater.from(parent.context)
|
||||||
.inflate(R.layout.item_bag_time_title,parent,false)
|
.inflate(R.layout.item_bag_time_title,parent,false)
|
||||||
return BagTimeTitleHolder(view)
|
BagTimeTitleHolder(view)
|
||||||
}else{
|
}else{
|
||||||
val view = LayoutInflater.from(parent.context)
|
val view = LayoutInflater.from(parent.context)
|
||||||
.inflate(R.layout.item_bag_manager, parent, false)
|
.inflate(R.layout.item_bag_manager, parent, false)
|
||||||
return BagManagerListHolder(view)
|
BagManagerListHolder(view)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,18 +109,60 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
|||||||
|
|
||||||
|
|
||||||
bagInfoEntity.description?.let { des->
|
bagInfoEntity.description?.let { des->
|
||||||
if(des.reportBI){
|
if(!recordFailSet.isNullOrEmpty() && recordFailSet!!.contains(bagInfoEntity.key.toString())){
|
||||||
//已上报
|
//如果在录包失败列表中找到该Bag包,则该包为录包失败状态
|
||||||
holder.tvBagReportStatus.text = "已上报"
|
holder.tvBagReportStatus.text = "录包失败"
|
||||||
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_reported_button_bg)
|
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_reported_button_bg)
|
||||||
holder.tvBagReportStatus.isClickable = false
|
holder.tvBagReportStatus.isClickable = false
|
||||||
|
//已上报的Bag不支持再查看,图标置为灰色,并且不可点击
|
||||||
|
holder.ivMapScreen.alpha = 0.5f
|
||||||
|
holder.ivMapScreen.isClickable = false
|
||||||
}else{
|
}else{
|
||||||
//未上报
|
if(des.reportBI){
|
||||||
holder.tvBagReportStatus.text = "上报"
|
//已上报
|
||||||
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_report_button_bg)
|
holder.tvBagReportStatus.text = "已上报"
|
||||||
holder.tvBagReportStatus.isClickable = true
|
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_reported_button_bg)
|
||||||
holder.tvBagReportStatus.setOnClickListener {
|
holder.tvBagReportStatus.isClickable = false
|
||||||
bagClickListener?.uploadBI(bagInfoEntity)
|
//已上报的Bag不支持再查看,图标置为灰色,并且不可点击
|
||||||
|
holder.ivMapScreen.alpha = 0.5f
|
||||||
|
holder.ivMapScreen.isClickable = false
|
||||||
|
//已上报的Bag不能再进行编辑,编辑图标置灰,并且不可点击
|
||||||
|
holder.ivEditReason.alpha = 0.5f
|
||||||
|
holder.ivEditReason.isClickable = false
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
holder.etBagNameEdit.focusable = View.NOT_FOCUSABLE
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//未上报
|
||||||
|
holder.tvBagReportStatus.text = "上报"
|
||||||
|
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_report_button_bg)
|
||||||
|
holder.tvBagReportStatus.isClickable = true
|
||||||
|
holder.tvBagReportStatus.setOnClickListener {
|
||||||
|
if(!aiDataSet.isNullOrEmpty() && aiDataSet!!.contains(bagInfoEntity.key.toString())){
|
||||||
|
bagClickListener?.upLoadAiData(bagInfoEntity)
|
||||||
|
}else{
|
||||||
|
bagClickListener?.uploadBI(bagInfoEntity)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
holder.ivMapScreen.setOnClickListener {
|
||||||
|
bagInfoEntity.description?.let {
|
||||||
|
//查找是否有截图文件
|
||||||
|
if(RecordBitmapUtils.checkHasImage(bagInfoEntity.key)){
|
||||||
|
bagClickListener?.lookMapScreen(bagInfoEntity.key)
|
||||||
|
}else{
|
||||||
|
ToastUtils.showShort("该截图录制失败或已删除")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//编辑文字按钮
|
||||||
|
holder.ivEditReason.setOnClickListener {
|
||||||
|
holder.etBagNameEdit.requestFocus()
|
||||||
|
holder.etBagNameEdit.performClick()
|
||||||
|
//调起软键盘
|
||||||
|
bagClickListener?.startEdit(holder.etBagNameEdit)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(des.description.isEmpty()){
|
if(des.description.isEmpty()){
|
||||||
@@ -113,6 +172,24 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//录包来源:自动 or 人工 or 采集
|
||||||
|
if(!initiativeSet.isNullOrEmpty() && initiativeSet!!.contains(bagInfoEntity.key.toString())){
|
||||||
|
//在该列表中找到Bag包的Key则代表该Bag为人工录包
|
||||||
|
holder.tvBagResource.text = "人工"
|
||||||
|
holder.tvBagResource.setBackgroundResource(R.drawable.bag_artificial_button_bg)
|
||||||
|
}else if(!aiDataSet.isNullOrEmpty() && aiDataSet!!.contains(bagInfoEntity.key.toString())){
|
||||||
|
//AI数据采集
|
||||||
|
holder.tvBagResource.text = "采集"
|
||||||
|
holder.tvBagResource.setBackgroundResource(R.drawable.bag_artificial_button_bg)
|
||||||
|
//AI数据采集不显示截图播放按钮
|
||||||
|
holder.ivMapScreen.visibility = View.INVISIBLE
|
||||||
|
}else{
|
||||||
|
//自动录包
|
||||||
|
holder.tvBagResource.text = "自动"
|
||||||
|
holder.tvBagResource.setBackgroundResource(R.drawable.bag_auto_button_bg)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(bagInfoEntity.description?.hasAudio == true){
|
if(bagInfoEntity.description?.hasAudio == true){
|
||||||
holder.ivBagAudio.visibility = View.VISIBLE
|
holder.ivBagAudio.visibility = View.VISIBLE
|
||||||
@@ -139,6 +216,7 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
|||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,6 +239,9 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
|||||||
var ivBagAudio: ImageView = itemView.findViewById(R.id.ivBagAudio)
|
var ivBagAudio: ImageView = itemView.findViewById(R.id.ivBagAudio)
|
||||||
var tvBagTime: TextView = itemView.findViewById(R.id.tvBagTime)
|
var tvBagTime: TextView = itemView.findViewById(R.id.tvBagTime)
|
||||||
var tvBagSize: TextView = itemView.findViewById(R.id.tvBagSize)
|
var tvBagSize: TextView = itemView.findViewById(R.id.tvBagSize)
|
||||||
|
var ivMapScreen: ImageView = itemView.findViewById(R.id.ivMapScreen)
|
||||||
|
var tvBagResource: TextView = itemView.findViewById(R.id.tvBagResource)
|
||||||
|
var ivEditReason: ImageView = itemView.findViewById(R.id.ivEditReason)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setListener(listener: BagClickListener){
|
fun setListener(listener: BagClickListener){
|
||||||
@@ -172,10 +253,16 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
|||||||
fun onClick(bagInfoEntity: BagInfoEntity, isChecked: Boolean)
|
fun onClick(bagInfoEntity: BagInfoEntity, isChecked: Boolean)
|
||||||
//上报BI平台
|
//上报BI平台
|
||||||
fun uploadBI(bagInfoEntity: BagInfoEntity)
|
fun uploadBI(bagInfoEntity: BagInfoEntity)
|
||||||
|
//AI数据采集上报
|
||||||
|
fun upLoadAiData(bagInfoEntity: BagInfoEntity)
|
||||||
//编辑Bag包描述信息
|
//编辑Bag包描述信息
|
||||||
fun editDescription(key: Long,description: BagDescriptionEntity)
|
fun editDescription(key: Long,description: BagDescriptionEntity)
|
||||||
//听录音
|
//听录音
|
||||||
fun bagAudio(key: Long,audioUrl: String)
|
fun bagAudio(key: Long,audioUrl: String)
|
||||||
|
//查看高精地图截图
|
||||||
|
fun lookMapScreen(key: Long)
|
||||||
|
//点击按钮调起编辑Bag包信息
|
||||||
|
fun startEdit(editText: EditText)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.zhjt.mogo_core_function_devatools.badcase.consts
|
package com.zhjt.mogo_core_function_devatools.badcase.consts
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
||||||
|
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||||
|
import com.mogo.eagle.core.data.msgbox.FMInfoMsg
|
||||||
|
import com.mogo.eagle.core.utilcode.util.SPUtils
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author XuXinChao
|
* @author XuXinChao
|
||||||
@@ -29,6 +32,23 @@ object BadCaseConfig {
|
|||||||
//工控机版本
|
//工控机版本
|
||||||
@JvmField
|
@JvmField
|
||||||
var dockerVersion:String ?= null
|
var dockerVersion:String ?= null
|
||||||
|
//当前车速
|
||||||
|
@JvmField
|
||||||
|
var currentSpeed: Int = 0
|
||||||
|
//最新的上报消息
|
||||||
|
@JvmField
|
||||||
|
var newReportEntity: ReportEntity ?= null
|
||||||
|
//最新的FM消息
|
||||||
|
@JvmField
|
||||||
|
var newFMInfoMsg: FMInfoMsg ?= null
|
||||||
|
//GPS状态
|
||||||
|
@JvmField
|
||||||
|
var gpsStatus: String ?= null
|
||||||
|
//寻迹算路
|
||||||
|
@JvmField
|
||||||
|
var tracingStatus: String ?= null
|
||||||
|
//云Socket连接状态
|
||||||
|
var socketStatus: String ?= null
|
||||||
@JvmField
|
@JvmField
|
||||||
var recordKeyList:ArrayList<Long> = ArrayList()
|
var recordKeyList:ArrayList<Long> = ArrayList()
|
||||||
//自定义Topic清单列表
|
//自定义Topic清单列表
|
||||||
@@ -38,4 +58,64 @@ object BadCaseConfig {
|
|||||||
@JvmField
|
@JvmField
|
||||||
var bagManagerList: ArrayList<BagInfoEntity> = ArrayList()
|
var bagManagerList: ArrayList<BagInfoEntity> = ArrayList()
|
||||||
|
|
||||||
|
private const val resourceInitiative = "RESOURCE_INITIATIVE" //录包来源为主动录包
|
||||||
|
private const val resourceAiData = "RESOURCE_AI_DATA" //录包来源为AI数据采集
|
||||||
|
private const val recordFail = "RECORD_FAIL" //录包失败
|
||||||
|
private const val startTime = "RECORD_START_TIME" //启动时间
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上一次启动日期
|
||||||
|
*/
|
||||||
|
fun getStartTime(): String{
|
||||||
|
return SPUtils.getInstance().getString(startTime,"")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录启动日期
|
||||||
|
*/
|
||||||
|
fun setStartTime(startDay: String){
|
||||||
|
SPUtils.getInstance().put(startTime,startDay)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取主动录包集合
|
||||||
|
*/
|
||||||
|
fun getInitiativeRecordSet(): HashSet<String>{
|
||||||
|
return SPUtils.getInstance().getStringSet(resourceInitiative,HashSet<String>()) as HashSet<String>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存主动录包集合
|
||||||
|
*/
|
||||||
|
fun setInitiativeRecordSet(initiativeSet: Set<String>){
|
||||||
|
SPUtils.getInstance().put(resourceInitiative,initiativeSet)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取AI数据采集集合
|
||||||
|
*/
|
||||||
|
fun getAiDataSet(): HashSet<String>{
|
||||||
|
return SPUtils.getInstance().getStringSet(resourceAiData,HashSet<String>()) as HashSet<String>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存AI数据采集集合
|
||||||
|
*/
|
||||||
|
fun setAiDataSet(aiDataSet: Set<String>){
|
||||||
|
SPUtils.getInstance().put(resourceAiData,aiDataSet)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取录包失败集合
|
||||||
|
*/
|
||||||
|
fun getRecordFailSet(): HashSet<String>{
|
||||||
|
return SPUtils.getInstance().getStringSet(recordFail,HashSet<String>()) as HashSet<String>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存录包失败集合
|
||||||
|
*/
|
||||||
|
fun setRecordFailSet(recordFailSet: Set<String>){
|
||||||
|
SPUtils.getInstance().put(recordFail,recordFailSet)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
package com.zhjt.mogo_core_function_devatools.badcase.util
|
||||||
|
|
||||||
|
import android.graphics.Bitmap
|
||||||
|
import android.graphics.Canvas
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.Paint
|
||||||
|
import android.os.Environment
|
||||||
|
import android.util.Log
|
||||||
|
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||||
|
import com.mogo.eagle.core.data.msgbox.FMInfoMsg
|
||||||
|
import com.mogo.eagle.core.data.msgbox.MsgFmData
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||||
|
import com.mogo.eagle.core.utilcode.util.FileUtils.millis2String
|
||||||
|
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||||
|
import com.zhjt.mogo_core_function_devatools.badcase.biz.InitiativeBadCaseWindow
|
||||||
|
import java.io.File
|
||||||
|
import java.io.FileOutputStream
|
||||||
|
import java.io.OutputStream
|
||||||
|
|
||||||
|
object RecordBitmapUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将Bitmap保存到本地
|
||||||
|
*/
|
||||||
|
fun bitmap2Path(bitmap: Bitmap, path: String?): String? {
|
||||||
|
try {
|
||||||
|
val os: OutputStream = FileOutputStream(path)
|
||||||
|
bitmap.compress(Bitmap.CompressFormat.PNG, 50, os)
|
||||||
|
os.flush()
|
||||||
|
os.close()
|
||||||
|
} catch (e: java.lang.Exception) {
|
||||||
|
Log.e(InitiativeBadCaseWindow.TAG, "bitmap2Path Exception", e)
|
||||||
|
}
|
||||||
|
return path
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除过期文件夹
|
||||||
|
*/
|
||||||
|
fun deleteExpiredFile(currentDay: String){
|
||||||
|
val checkFileName = Environment.getExternalStorageDirectory().absolutePath + File.separator+ "MapScreen"
|
||||||
|
val checkFileFolder = File(checkFileName)
|
||||||
|
if(checkFileFolder.exists()){
|
||||||
|
checkFileFolder.listFiles()?.forEach {dir->
|
||||||
|
if(dir.name != currentDay && dir.isDirectory){
|
||||||
|
dir.listFiles()?.forEach { file->
|
||||||
|
file.delete()
|
||||||
|
}
|
||||||
|
dir.delete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun deleteReportedImage(path: String){
|
||||||
|
val screenFile = File(path)
|
||||||
|
if(screenFile.exists()){
|
||||||
|
screenFile.delete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun checkHasImage(recordKey: Long): Boolean{
|
||||||
|
var checkResult = false
|
||||||
|
val currentDay = millis2String(System.currentTimeMillis(), TimeUtils.getMdFormat())
|
||||||
|
val fileDir: String = Environment.getExternalStorageDirectory().absolutePath + File.separator+
|
||||||
|
"MapScreen" + File.separator+ currentDay + File.separator
|
||||||
|
val fileName = "$recordKey.png"
|
||||||
|
val path = fileDir + fileName
|
||||||
|
val file = File(path)
|
||||||
|
if(file.exists()){
|
||||||
|
checkResult = true
|
||||||
|
}
|
||||||
|
return checkResult
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在指定Bitmap中绘制文字
|
||||||
|
*/
|
||||||
|
fun drawTextOnBitmap(bitmap: Bitmap, time: String,lineId: String,state: String,currentSpeed: String,
|
||||||
|
site: String,gpsStatus: String?,tracingStatus: String?,socketStatus: String?
|
||||||
|
,fm: FMInfoMsg?,report: ReportEntity?
|
||||||
|
): Bitmap? {
|
||||||
|
val mutableBitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true)
|
||||||
|
val canvas = Canvas(mutableBitmap)
|
||||||
|
val paint = Paint()
|
||||||
|
paint.color = Color.WHITE
|
||||||
|
paint.textSize = 50f
|
||||||
|
paint.isAntiAlias = true
|
||||||
|
canvas.drawText(time, 100f, 100f, paint)
|
||||||
|
canvas.drawText(lineId,100f,200f,paint)
|
||||||
|
canvas.drawText(state,100f,300f,paint)
|
||||||
|
canvas.drawText(currentSpeed,100f,400f,paint)
|
||||||
|
canvas.drawText(site,100f,500f,paint)
|
||||||
|
|
||||||
|
gpsStatus?.let {
|
||||||
|
canvas.drawText(it,1000f,100f,paint)
|
||||||
|
}
|
||||||
|
tracingStatus?.let {
|
||||||
|
canvas.drawText(it,1000f,200f,paint)
|
||||||
|
}
|
||||||
|
socketStatus?.let {
|
||||||
|
canvas.drawText(it,1000f,300f,paint)
|
||||||
|
}
|
||||||
|
|
||||||
|
fm?.let {
|
||||||
|
canvas.drawText("FM:${MsgFmData.getFmPolicyName(it.policyCode)}",100f,600f,paint)
|
||||||
|
canvas.drawText("故障策略:${MsgFmData.getFmPolicyName(it.policyCode)}(${it.policyCode})",100f,700f,paint)
|
||||||
|
//故障原因
|
||||||
|
if(it.fmInfoList.isNullOrEmpty()){
|
||||||
|
canvas.drawText("故障原因:暂无",100f,800f,paint)
|
||||||
|
}else{
|
||||||
|
val fmFaultReason = StringBuilder()
|
||||||
|
fmFaultReason.append("故障原因:")
|
||||||
|
for((index,info) in it.fmInfoList!!.withIndex()){
|
||||||
|
fmFaultReason.append(info.faultName)
|
||||||
|
if(info.faultId.isNotBlank()){
|
||||||
|
fmFaultReason.append("(")
|
||||||
|
fmFaultReason.append(info.faultId)
|
||||||
|
fmFaultReason.append(")")
|
||||||
|
}
|
||||||
|
if(index!=(it.fmInfoList!!.size-1)){
|
||||||
|
fmFaultReason.append("/")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
canvas.drawText(fmFaultReason.toString(),100f,800f,paint)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
report?.let {
|
||||||
|
var resultStr = "上报类型:"
|
||||||
|
for (result in it.resultList) {
|
||||||
|
resultStr =
|
||||||
|
"${resultStr}${CallerAutoPilotControlManager.getReportResultDesc(result)}"
|
||||||
|
}
|
||||||
|
canvas.drawText(resultStr,100f,1000f,paint)
|
||||||
|
canvas.drawText("原因:${it.msg}",100f,1100f,paint)
|
||||||
|
canvas.drawText("消息来源:${it.src}",100f,1200f,paint)
|
||||||
|
}
|
||||||
|
return mutableBitmap
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,10 +4,10 @@ import android.content.Context
|
|||||||
import com.mogo.commons.constants.HostConst
|
import com.mogo.commons.constants.HostConst
|
||||||
import com.mogo.commons.constants.SharedPrefsConstants
|
import com.mogo.commons.constants.SharedPrefsConstants
|
||||||
import com.mogo.commons.debug.DebugConfig
|
import com.mogo.commons.debug.DebugConfig
|
||||||
|
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||||
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarInfo
|
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarInfo
|
||||||
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarRequest
|
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarRequest
|
||||||
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo
|
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo
|
||||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
|
||||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog
|
||||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog
|
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog
|
||||||
@@ -74,8 +74,19 @@ class BindingCarNetWorkManager private constructor() {
|
|||||||
.subscribe(object : Observer<BindingCarInfo> {
|
.subscribe(object : Observer<BindingCarInfo> {
|
||||||
override fun onSubscribe(d: Disposable) {}
|
override fun onSubscribe(d: Disposable) {}
|
||||||
override fun onNext(info: BindingCarInfo) {
|
override fun onNext(info: BindingCarInfo) {
|
||||||
if (info != null && info.getData() != null) {
|
if (info?.getData() != null) {
|
||||||
bindLog(mapOf("bindResult" to true,"carType" to getDefaultId(),"msg" to info))
|
if ((info.code != 0 && info.code != 200)) {
|
||||||
|
bindLog(mapOf("bindResult" to false, "msg" to info.toString()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
bindLog(
|
||||||
|
mapOf(
|
||||||
|
"bindResult" to true,
|
||||||
|
"carType" to getDefaultId(),
|
||||||
|
"msg" to info
|
||||||
|
)
|
||||||
|
)
|
||||||
SharedPrefsMgr.getInstance(context).putString(
|
SharedPrefsMgr.getInstance(context).putString(
|
||||||
SharedPrefsConstants.CAR_INFO,
|
SharedPrefsConstants.CAR_INFO,
|
||||||
GsonUtils.toJson(info.getData())
|
GsonUtils.toJson(info.getData())
|
||||||
@@ -87,15 +98,22 @@ class BindingCarNetWorkManager private constructor() {
|
|||||||
}
|
}
|
||||||
updateCarVrIconRes(info.getData().brandId)
|
updateCarVrIconRes(info.getData().brandId)
|
||||||
} else {
|
} else {
|
||||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, "")
|
SharedPrefsMgr.getInstance(context)
|
||||||
e(SceneConstant.M_DEVA + TAG, "getBindingCarInfo data = null ---getDefaultId() : ${getDefaultId()} ")
|
.putString(SharedPrefsConstants.CAR_INFO, "")
|
||||||
|
e(
|
||||||
|
SceneConstant.M_DEVA + TAG,
|
||||||
|
"getBindingCarInfo data = null ---getDefaultId() : ${getDefaultId()} "
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, "")
|
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, "")
|
||||||
bindLog(mapOf("bindResult" to false,"msg" to e.toString()))
|
bindLog(mapOf("bindResult" to false, "msg" to e.toString()))
|
||||||
e(SceneConstant.M_DEVA + TAG, "getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message + "---getDefaultId() : ${getDefaultId()}")
|
e(
|
||||||
|
SceneConstant.M_DEVA + TAG,
|
||||||
|
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message + "---getDefaultId() : ${getDefaultId()}"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {}
|
override fun onComplete() {}
|
||||||
@@ -131,14 +149,18 @@ class BindingCarNetWorkManager private constructor() {
|
|||||||
override fun onSubscribe(d: Disposable) {}
|
override fun onSubscribe(d: Disposable) {}
|
||||||
override fun onNext(info: ModifyBindingcarInfo) {
|
override fun onNext(info: ModifyBindingcarInfo) {
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
|
if ((info.code != 0 && info.code != 200)) {
|
||||||
|
bindLog(mapOf("bindingStatus" to false, "bindMsg" to info.toString()))
|
||||||
|
return
|
||||||
|
}
|
||||||
callBack.invoke(info)
|
callBack.invoke(info)
|
||||||
bindLog(mapOf("bindingStatus" to true,"bindMsg" to info))
|
bindLog(mapOf("bindingStatus" to true, "bindMsg" to info))
|
||||||
updateCarVrIconRes(info.data.brandId)
|
updateCarVrIconRes(info.data.brandId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(e: Throwable) {
|
override fun onError(e: Throwable) {
|
||||||
bindLog(mapOf("bindingStatus" to false,"bindMsg" to e.toString()))
|
bindLog(mapOf("bindingStatus" to false, "bindMsg" to e.toString()))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onComplete() {}
|
override fun onComplete() {}
|
||||||
@@ -147,7 +169,7 @@ class BindingCarNetWorkManager private constructor() {
|
|||||||
|
|
||||||
private fun updateCarVrIconRes(brandId: String?) {
|
private fun updateCarVrIconRes(brandId: String?) {
|
||||||
d(SceneConstant.M_DEVA + TAG, "CarModelChange : ${DebugConfig.isCarModelChange()}")
|
d(SceneConstant.M_DEVA + TAG, "CarModelChange : ${DebugConfig.isCarModelChange()}")
|
||||||
if(!DebugConfig.isCarModelChange()){
|
if (!DebugConfig.isCarModelChange()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (brandId == null || brandId.isEmpty()) {
|
if (brandId == null || brandId.isEmpty()) {
|
||||||
@@ -188,7 +210,7 @@ class BindingCarNetWorkManager private constructor() {
|
|||||||
nodeAliasCode = ChainConstant.CHAIN_CODE_BINDING_CAR,
|
nodeAliasCode = ChainConstant.CHAIN_CODE_BINDING_CAR,
|
||||||
paramIndexes = [0]
|
paramIndexes = [0]
|
||||||
)
|
)
|
||||||
private fun bindLog(msg:Map<String,Any>){
|
private fun bindLog(msg: Map<String, Any>) {
|
||||||
d(SceneConstant.M_DEVA + TAG, "bindLog : $msg")
|
d(SceneConstant.M_DEVA + TAG, "bindLog : $msg")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,12 +38,12 @@ class FuncConfigNetWorkModel {
|
|||||||
if (error == null) {
|
if (error == null) {
|
||||||
error = onError
|
error = onError
|
||||||
}
|
}
|
||||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
|
||||||
map["mac"] = DeviceUtils.getMacAddress()
|
|
||||||
map["channelVersion"] = AppIdentityModeUtils.getMisChannelCode(FunctionBuildConfig.appIdentityMode)
|
|
||||||
}
|
}
|
||||||
loader {
|
loader {
|
||||||
apiCall {
|
apiCall {
|
||||||
|
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||||
|
map["mac"] = DeviceUtils.getMacAddress()
|
||||||
|
map["channelVersion"] = AppIdentityModeUtils.getMisChannelCode(FunctionBuildConfig.appIdentityMode)
|
||||||
getNetWorkApi().funcConfig(map)
|
getNetWorkApi().funcConfig(map)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.mogo.commons.utils.MogoAnalyticUtils
|
|||||||
import com.mogo.eagle.core.data.config.*
|
import com.mogo.eagle.core.data.config.*
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||||
import com.mogo.eagle.core.function.call.autopilot.*
|
import com.mogo.eagle.core.function.call.autopilot.*
|
||||||
|
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||||
import com.mogo.eagle.core.utilcode.mogo.*
|
import com.mogo.eagle.core.utilcode.mogo.*
|
||||||
import com.zhjt.mogo.adas.data.bean.MogoReport.Code.Info.IMF
|
import com.zhjt.mogo.adas.data.bean.MogoReport.Code.Info.IMF
|
||||||
@@ -57,6 +58,7 @@ internal class MoFangCommandExecutor {
|
|||||||
private const val MSG_WHAT_KEY_CODE_D = 0x06
|
private const val MSG_WHAT_KEY_CODE_D = 0x06
|
||||||
private const val MSG_WHAT_KEY_CODE_E = 0x07
|
private const val MSG_WHAT_KEY_CODE_E = 0x07
|
||||||
private const val MSG_WHAT_KEY_CODE_EL = 0x08
|
private const val MSG_WHAT_KEY_CODE_EL = 0x08
|
||||||
|
private const val MSG_WHAT_KEY_CODE_BL = 0x09
|
||||||
}
|
}
|
||||||
|
|
||||||
@Volatile
|
@Volatile
|
||||||
@@ -232,6 +234,27 @@ internal class MoFangCommandExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
MSG_WHAT_KEY_CODE_BL -> {
|
||||||
|
try {
|
||||||
|
Log.d(TAG, "--- 长按录包 ---")
|
||||||
|
MoFangAnalyticUtils.track(EVENT_EXECUTE, mutableMapOf(
|
||||||
|
EVENT_EXECUTE_PARAMS_KEYCODE to (getKeycodeByWhat(msg.what) ?: ""),
|
||||||
|
EVENT_EXECUTE_PARAMS_TYPE to (getInputTypeByWhat(msg.what) ?: ""),
|
||||||
|
EVENT_EXECUTE_PARAMS_LON to location.longitude,
|
||||||
|
EVENT_EXECUTE_PARAMS_LAT to location.latitude,
|
||||||
|
EVENT_EXECUTE_PARAMS_SPEED to location.gnssSpeed,
|
||||||
|
EVENT_EXECUTE_PARAMS_ACC to location.acceleration,
|
||||||
|
EVENT_EXECUTE_PARAMS_HEADING to location.heading,
|
||||||
|
EVENT_EXECUTE_PARAMS_LINE_ID to CallerAutoPilotStatusListenerManager.getLineId(),
|
||||||
|
EVENT_EXECUTE_PARAMS_DOCKER_VERSION to (CallerAutoPilotStatusListenerManager.getDockerVersion() ?: "")
|
||||||
|
))
|
||||||
|
linkedLog?.record(mapOf("执行:${System.currentTimeMillis()}" to "$message, $msg"))
|
||||||
|
CallerDevaToolsManager.startRecordByMoFang()
|
||||||
|
} catch (t: Throwable) {
|
||||||
|
t.printStackTrace()
|
||||||
|
Log.e(TAG, "error: ${t.message}, msg-> $msg")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
@@ -266,6 +289,9 @@ internal class MoFangCommandExecutor {
|
|||||||
MSG_WHAT_KEY_CODE_E -> {
|
MSG_WHAT_KEY_CODE_E -> {
|
||||||
"单击键E->开启自驾$extra"
|
"单击键E->开启自驾$extra"
|
||||||
}
|
}
|
||||||
|
MSG_WHAT_KEY_CODE_BL -> {
|
||||||
|
"长按键B->录包$extra"
|
||||||
|
}
|
||||||
MSG_WHAT_KEY_CODE_EL -> {
|
MSG_WHAT_KEY_CODE_EL -> {
|
||||||
"长按键E->鸣笛$extra"
|
"长按键E->鸣笛$extra"
|
||||||
}
|
}
|
||||||
@@ -276,7 +302,7 @@ internal class MoFangCommandExecutor {
|
|||||||
private fun getKeycodeByWhat(what: Int): String? {
|
private fun getKeycodeByWhat(what: Int): String? {
|
||||||
return when(what) {
|
return when(what) {
|
||||||
MSG_WHAT_KEY_CODE_A, MSG_WHAT_KEY_CODE_AL -> KeyEvent.keyCodeToString(KeyEvent.KEYCODE_A)
|
MSG_WHAT_KEY_CODE_A, MSG_WHAT_KEY_CODE_AL -> KeyEvent.keyCodeToString(KeyEvent.KEYCODE_A)
|
||||||
MSG_WHAT_KEY_CODE_B -> KeyEvent.keyCodeToString(KeyEvent.KEYCODE_B)
|
MSG_WHAT_KEY_CODE_B, MSG_WHAT_KEY_CODE_BL -> KeyEvent.keyCodeToString(KeyEvent.KEYCODE_B)
|
||||||
MSG_WHAT_KEY_CODE_AB -> "${KeyEvent.keyCodeToString(KeyEvent.KEYCODE_A)},${KeyEvent.keyCodeToString(KeyEvent.KEYCODE_B)}"
|
MSG_WHAT_KEY_CODE_AB -> "${KeyEvent.keyCodeToString(KeyEvent.KEYCODE_A)},${KeyEvent.keyCodeToString(KeyEvent.KEYCODE_B)}"
|
||||||
MSG_WHAT_KEY_CODE_C -> KeyEvent.keyCodeToString(KeyEvent.KEYCODE_C)
|
MSG_WHAT_KEY_CODE_C -> KeyEvent.keyCodeToString(KeyEvent.KEYCODE_C)
|
||||||
MSG_WHAT_KEY_CODE_D -> KeyEvent.keyCodeToString(KeyEvent.KEYCODE_D)
|
MSG_WHAT_KEY_CODE_D -> KeyEvent.keyCodeToString(KeyEvent.KEYCODE_D)
|
||||||
@@ -294,7 +320,7 @@ internal class MoFangCommandExecutor {
|
|||||||
MSG_WHAT_KEY_CODE_E -> {
|
MSG_WHAT_KEY_CODE_E -> {
|
||||||
"1"
|
"1"
|
||||||
}
|
}
|
||||||
MSG_WHAT_KEY_CODE_AL,MSG_WHAT_KEY_CODE_EL -> {
|
MSG_WHAT_KEY_CODE_AL, MSG_WHAT_KEY_CODE_BL, MSG_WHAT_KEY_CODE_EL -> {
|
||||||
"2"
|
"2"
|
||||||
}
|
}
|
||||||
MSG_WHAT_KEY_CODE_AB -> {
|
MSG_WHAT_KEY_CODE_AB -> {
|
||||||
@@ -387,6 +413,15 @@ internal class MoFangCommandExecutor {
|
|||||||
})
|
})
|
||||||
linkedLog?.record(mapOf("发送[EL]:${System.currentTimeMillis()}" to "${whatToString(MSG_WHAT_KEY_CODE_EL)}"))
|
linkedLog?.record(mapOf("发送[EL]:${System.currentTimeMillis()}" to "${whatToString(MSG_WHAT_KEY_CODE_EL)}"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (keyCode == KeyEvent.KEYCODE_B) {
|
||||||
|
Log.d(TAG, "--- 长按键B --- 触发录包 ----")
|
||||||
|
handler.removeMessages(MSG_WHAT_KEY_CODE_BL)
|
||||||
|
handler.sendMessage(Message.obtain().also {
|
||||||
|
it.what = MSG_WHAT_KEY_CODE_BL
|
||||||
|
})
|
||||||
|
linkedLog?.record(mapOf("发送[BL]:${System.currentTimeMillis()}" to "${whatToString(MSG_WHAT_KEY_CODE_BL)}"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun handleCombineClick(vararg keyCodes: Int) {
|
fun handleCombineClick(vararg keyCodes: Int) {
|
||||||
|
|||||||
@@ -253,14 +253,6 @@ internal class OverViewImpl(ctx: Context) : IFlow<OverViewStatus>(ctx),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 工控机连接状态
|
|
||||||
*/
|
|
||||||
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
|
|
||||||
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
// CallerDevaToolsListenerManager.removeListener(TAG)
|
// CallerDevaToolsListenerManager.removeListener(TAG)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.zhjt.mogo_core_function_devatools.status.flow.rtk
|
package com.zhjt.mogo_core_function_devatools.status.flow.rtk
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
|
||||||
import com.mogo.eagle.core.data.map.MogoLocation
|
import com.mogo.eagle.core.data.map.MogoLocation
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||||
@@ -66,7 +65,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
|||||||
check?.takeIf { it.isActive }?.cancel()
|
check?.takeIf { it.isActive }?.cancel()
|
||||||
isOldVersion.set(false)
|
isOldVersion.set(false)
|
||||||
val info = status.healthInfoList?.find { "localization".equals(it.name, true) }
|
val info = status.healthInfoList?.find { "localization".equals(it.name, true) }
|
||||||
Log.d(TAG, "info: $info")
|
CallerLogger.d("$M_DEVA$TAG", "info: $info")
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
healthInfo.set(info)
|
healthInfo.set(info)
|
||||||
send(RTKStatus(getDesc(), getCode()))
|
send(RTKStatus(getDesc(), getCode()))
|
||||||
@@ -77,7 +76,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
|
|||||||
check?.takeIf { it.isActive }?.cancel()
|
check?.takeIf { it.isActive }?.cancel()
|
||||||
isOldVersion.set(false)
|
isOldVersion.set(false)
|
||||||
val info = statusInf.healthInfoList?.find { "localization".equals(it.name, true) }
|
val info = statusInf.healthInfoList?.find { "localization".equals(it.name, true) }
|
||||||
Log.d(TAG, "info: $info")
|
CallerLogger.d("$M_DEVA$TAG", "info: $info")
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
healthInfo.set(info)
|
healthInfo.set(info)
|
||||||
send(RTKStatus(getDesc(), getCode()))
|
send(RTKStatus(getDesc(), getCode()))
|
||||||
|
|||||||
@@ -74,8 +74,6 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
|||||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_TRAFFIC_LIGHT)
|
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_TRAFFIC_LIGHT)
|
||||||
fwBuildMap[ChainConstant.CHAIN_TYPE_ANR_LEAK] =
|
fwBuildMap[ChainConstant.CHAIN_TYPE_ANR_LEAK] =
|
||||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_ANR)
|
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_ANR)
|
||||||
fwBuildMap[ChainConstant.CHAIN_TYPE_V2X] =
|
|
||||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_V2X)
|
|
||||||
fwBuildMap[ChainConstant.CHAIN_TYPE_WEAK_NETWORK] =
|
fwBuildMap[ChainConstant.CHAIN_TYPE_WEAK_NETWORK] =
|
||||||
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_WEAK_NETWORK)
|
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_WEAK_NETWORK)
|
||||||
fwBuildMap[ChainConstant.CHAIN_TYPE_OCH] =
|
fwBuildMap[ChainConstant.CHAIN_TYPE_OCH] =
|
||||||
@@ -98,8 +96,6 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
|||||||
ChainLogParam(true, "红绿灯Union数据")
|
ChainLogParam(true, "红绿灯Union数据")
|
||||||
traceInfoCache[ChainConstant.CHAIN_TYPE_ANR_LEAK] =
|
traceInfoCache[ChainConstant.CHAIN_TYPE_ANR_LEAK] =
|
||||||
ChainLogParam(true, "ANR Record")
|
ChainLogParam(true, "ANR Record")
|
||||||
traceInfoCache[ChainConstant.CHAIN_TYPE_V2X] =
|
|
||||||
ChainLogParam(true, "V2X(V2N/V2I)")
|
|
||||||
traceInfoCache[ChainConstant.CHAIN_TYPE_WEAK_NETWORK] =
|
traceInfoCache[ChainConstant.CHAIN_TYPE_WEAK_NETWORK] =
|
||||||
ChainLogParam(true, "WeakNetWork Record")
|
ChainLogParam(true, "WeakNetWork Record")
|
||||||
|
|
||||||
|
|||||||
@@ -34,20 +34,20 @@ class IPCUpgradeNetWorkModel {
|
|||||||
fun upgradeConfirm(images: List<String>,padSn: String,releaseId: String,
|
fun upgradeConfirm(images: List<String>,padSn: String,releaseId: String,
|
||||||
onSuccess: ((String) -> Unit),onError: ((String) -> Unit)){
|
onSuccess: ((String) -> Unit),onError: ((String) -> Unit)){
|
||||||
request<BaseResponse<Any?>> {
|
request<BaseResponse<Any?>> {
|
||||||
val requestJson = JSONObject()
|
|
||||||
val imagesJsonArray = JSONArray()
|
|
||||||
images.iterator().forEach {
|
|
||||||
imagesJsonArray.put(it)
|
|
||||||
}
|
|
||||||
requestJson.put("images",imagesJsonArray)
|
|
||||||
requestJson.put("padSn",padSn)
|
|
||||||
requestJson.put("releaseId",releaseId)
|
|
||||||
val requestBody:RequestBody= RequestBody.create(
|
|
||||||
MediaType.parse("application/json; charset=utf-8"),
|
|
||||||
requestJson.toString()
|
|
||||||
)
|
|
||||||
loader{
|
loader{
|
||||||
apiCall{
|
apiCall{
|
||||||
|
val requestJson = JSONObject()
|
||||||
|
val imagesJsonArray = JSONArray()
|
||||||
|
images.iterator().forEach {
|
||||||
|
imagesJsonArray.put(it)
|
||||||
|
}
|
||||||
|
requestJson.put("images",imagesJsonArray)
|
||||||
|
requestJson.put("padSn",padSn)
|
||||||
|
requestJson.put("releaseId",releaseId)
|
||||||
|
val requestBody:RequestBody= RequestBody.create(
|
||||||
|
MediaType.parse("application/json; charset=utf-8"),
|
||||||
|
requestJson.toString()
|
||||||
|
)
|
||||||
getNetWorkApi(getBaseUrl()).upgradeConfirm(requestBody)
|
getNetWorkApi(getBaseUrl()).upgradeConfirm(requestBody)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ object WeakNetworkStrategy {
|
|||||||
private const val TAG = "WeakNetworkStrategy"
|
private const val TAG = "WeakNetworkStrategy"
|
||||||
|
|
||||||
// 记录到链路日志中的时间间隔
|
// 记录到链路日志中的时间间隔
|
||||||
private const val OUTPUT_TIME_INTERVAL = 15000
|
private const val OUTPUT_TIME_INTERVAL = 2500
|
||||||
|
|
||||||
private const val WEAK_HTTP_RTT = 1300
|
private const val WEAK_HTTP_RTT = 1300
|
||||||
|
|
||||||
@@ -23,6 +23,8 @@ object WeakNetworkStrategy {
|
|||||||
|
|
||||||
private var lastOutputTime = 0L
|
private var lastOutputTime = 0L
|
||||||
|
|
||||||
|
private var isDebug = false
|
||||||
|
|
||||||
private val lock by lazy {
|
private val lock by lazy {
|
||||||
ReentrantReadWriteLock()
|
ReentrantReadWriteLock()
|
||||||
}
|
}
|
||||||
@@ -53,6 +55,10 @@ object WeakNetworkStrategy {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setDebug(isDebug: Boolean) {
|
||||||
|
this.isDebug = isDebug
|
||||||
|
}
|
||||||
|
|
||||||
fun stopListen() {
|
fun stopListen() {
|
||||||
setListener(null)
|
setListener(null)
|
||||||
}
|
}
|
||||||
@@ -63,10 +69,13 @@ object WeakNetworkStrategy {
|
|||||||
try {
|
try {
|
||||||
val currentTime = System.currentTimeMillis()
|
val currentTime = System.currentTimeMillis()
|
||||||
if (currentTime - lastOutputTime > OUTPUT_TIME_INTERVAL) {
|
if (currentTime - lastOutputTime > OUTPUT_TIME_INTERVAL) {
|
||||||
|
if (isDebug) {
|
||||||
|
invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
|
||||||
|
}
|
||||||
if (timeStamp >= WEAK_HTTP_RTT) {
|
if (timeStamp >= WEAK_HTTP_RTT) {
|
||||||
ToastUtils.showShort("当前网络质量差!")
|
ToastUtils.showShort("当前网络质量差!")
|
||||||
} else if (timeStamp in 300 until WEAK_HTTP_RTT) {
|
} else if (timeStamp in 300 until WEAK_HTTP_RTT) {
|
||||||
invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
|
// invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
|
||||||
SdtManager.startActiveCheck()
|
SdtManager.startActiveCheck()
|
||||||
}
|
}
|
||||||
lastOutputTime = currentTime
|
lastOutputTime = currentTime
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:startColor="#E53BC593"
|
||||||
|
android:endColor="#E53BC593"
|
||||||
|
android:angle="0"
|
||||||
|
/>
|
||||||
|
<corners android:radius="8px" />
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:startColor="#E52966EC"
|
||||||
|
android:endColor="#E52966EC"
|
||||||
|
android:angle="0"
|
||||||
|
/>
|
||||||
|
<corners android:radius="8px" />
|
||||||
|
</shape>
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 926 B |
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="1708dp"
|
||||||
|
android:layout_height="1013dp"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="1586dp"
|
||||||
|
android:layout_height="@dimen/dp_893"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:cardCornerRadius="@dimen/dp_20"
|
||||||
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivScreen"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivScreenClose"
|
||||||
|
android:layout_width="@dimen/dp_84"
|
||||||
|
android:layout_height="@dimen/dp_86"
|
||||||
|
android:src="@drawable/icon_screen_close"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
android:layout_marginEnd="@dimen/dp_100"
|
||||||
|
android:layout_marginTop="@dimen/dp_100"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -17,25 +17,56 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<EditText
|
<androidx.constraintlayout.widget.Guideline
|
||||||
android:id="@+id/etBagNameEdit"
|
android:id="@+id/guideline"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintGuide_percent="0.5"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etBagNameEdit"
|
||||||
|
android:layout_width="@dimen/dp_0"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/guideline"
|
||||||
app:layout_constraintLeft_toRightOf="@id/cbBagSelect"
|
app:layout_constraintLeft_toRightOf="@id/cbBagSelect"
|
||||||
app:layout_constraintRight_toLeftOf="@id/tvBagTime"
|
app:layout_constraintRight_toLeftOf="@id/tvBagResource"
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginStart="@dimen/dp_20"
|
||||||
android:layout_marginEnd="30dp"
|
android:layout_marginEnd="@dimen/dp_25"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:drawableEnd="@drawable/icon_bag_edit"
|
|
||||||
android:drawablePadding="@dimen/dp_10"
|
|
||||||
android:textColor="#FFFFFFFF"
|
android:textColor="#FFFFFFFF"
|
||||||
android:textSize="32dp"
|
android:textSize="32dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvBagTime"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#FFFFFFFF"
|
||||||
|
android:textSize="@dimen/dp_26"
|
||||||
|
android:gravity="start"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/guideline"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/etBagNameEdit"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvBagSize"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#72FFFFFF"
|
||||||
|
android:textSize="26dp"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/tvBagTime"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/tvBagTime"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/tvBagTime"
|
||||||
|
android:layout_marginStart="@dimen/dp_20"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvBagReportStatus"
|
android:id="@+id/tvBagReportStatus"
|
||||||
android:layout_width="162dp"
|
android:layout_width="162dp"
|
||||||
@@ -59,30 +90,46 @@
|
|||||||
app:layout_constraintRight_toLeftOf="@id/tvBagReportStatus"
|
app:layout_constraintRight_toLeftOf="@id/tvBagReportStatus"
|
||||||
android:src="@drawable/icon_bag_audio"
|
android:src="@drawable/icon_bag_audio"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
android:layout_marginEnd="30dp"
|
android:layout_marginEnd="@dimen/dp_25"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/tvBagTime"
|
android:id="@+id/ivMapScreen"
|
||||||
android:layout_width="110dp"
|
android:layout_width="@dimen/dp_44"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/dp_44"
|
||||||
android:textColor="#FFFFFFFF"
|
|
||||||
android:textSize="26dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@id/ivBagAudio"
|
app:layout_constraintRight_toLeftOf="@id/ivBagAudio"
|
||||||
android:layout_marginEnd="30dp"
|
android:src="@drawable/icon_bag_look_screen"
|
||||||
android:gravity="start"
|
android:layout_marginEnd="@dimen/dp_25"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivEditReason"
|
||||||
|
android:layout_width="@dimen/dp_44"
|
||||||
|
android:layout_height="@dimen/dp_44"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintRight_toLeftOf="@id/ivMapScreen"
|
||||||
|
android:src="@drawable/icon_bag_edit"
|
||||||
|
android:layout_marginEnd="@dimen/dp_25"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvBagSize"
|
android:id="@+id/tvBagResource"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#75FFFFFF"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:textSize="26dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/tvBagTime"
|
app:layout_constraintRight_toLeftOf="@id/ivEditReason"
|
||||||
|
android:background="@drawable/bag_auto_button_bg"
|
||||||
|
android:textSize="@dimen/sp_25"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:paddingStart="@dimen/dp_15"
|
||||||
|
android:paddingEnd="@dimen/dp_15"
|
||||||
|
android:paddingTop="@dimen/dp_4"
|
||||||
|
android:paddingBottom="@dimen/dp_4"
|
||||||
|
android:layout_marginEnd="@dimen/dp_25"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -104,6 +104,23 @@
|
|||||||
android:layout_marginBottom="@dimen/dp_40"
|
android:layout_marginBottom="@dimen/dp_40"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvAudioResult"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/viewAudioBg"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/viewAudioBg"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/viewAudioBg"
|
||||||
|
app:layout_constraintRight_toLeftOf="@id/viewAudioStart"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/dp_29"
|
||||||
|
android:layout_marginStart="@dimen/dp_51"
|
||||||
|
android:layout_marginEnd="@dimen/dp_51"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="start"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/viewAudioButton"
|
android:id="@+id/viewAudioButton"
|
||||||
android:layout_width="@dimen/dp_34"
|
android:layout_width="@dimen/dp_34"
|
||||||
@@ -115,16 +132,16 @@
|
|||||||
android:background="@drawable/icon_bad_case_audio_normal"
|
android:background="@drawable/icon_bad_case_audio_normal"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/tvAudioCountDown"
|
android:id="@+id/viewAudioStart"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dp_34"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/dp_48"
|
||||||
android:textColor="#FFFFFFFF"
|
app:layout_constraintTop_toTopOf="@id/viewAudioBg"
|
||||||
android:textSize="@dimen/dp_27"
|
app:layout_constraintBottom_toBottomOf="@id/viewAudioBg"
|
||||||
app:layout_constraintTop_toTopOf="@id/viewAudioButton"
|
app:layout_constraintRight_toRightOf="@id/viewAudioBg"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/viewAudioButton"
|
android:background="@drawable/icon_bad_case_audio_normal"
|
||||||
app:layout_constraintLeft_toRightOf="@id/viewAudioButton"
|
android:layout_marginEnd="@dimen/dp_51"
|
||||||
android:layout_marginStart="@dimen/dp_30"
|
android:visibility="gone"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||||
@@ -104,6 +104,23 @@
|
|||||||
android:layout_marginBottom="@dimen/dp_40"
|
android:layout_marginBottom="@dimen/dp_40"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvAudioResult"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/viewAudioBg"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/viewAudioBg"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/viewAudioBg"
|
||||||
|
app:layout_constraintRight_toLeftOf="@id/viewAudioStart"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/dp_29"
|
||||||
|
android:layout_marginStart="@dimen/dp_51"
|
||||||
|
android:layout_marginEnd="@dimen/dp_51"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="start"
|
||||||
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/viewAudioButton"
|
android:id="@+id/viewAudioButton"
|
||||||
android:layout_width="@dimen/dp_34"
|
android:layout_width="@dimen/dp_34"
|
||||||
@@ -115,17 +132,16 @@
|
|||||||
android:background="@drawable/icon_bad_case_audio_normal"
|
android:background="@drawable/icon_bad_case_audio_normal"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/tvAudioCountDown"
|
android:id="@+id/viewAudioStart"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dp_34"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="@dimen/dp_48"
|
||||||
android:textColor="#FFFFFFFF"
|
app:layout_constraintTop_toTopOf="@id/viewAudioBg"
|
||||||
android:textSize="@dimen/dp_27"
|
app:layout_constraintBottom_toBottomOf="@id/viewAudioBg"
|
||||||
app:layout_constraintTop_toTopOf="@id/viewAudioButton"
|
app:layout_constraintRight_toRightOf="@id/viewAudioBg"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/viewAudioButton"
|
android:background="@drawable/icon_bad_case_audio_normal"
|
||||||
app:layout_constraintLeft_toRightOf="@id/viewAudioButton"
|
android:layout_marginEnd="@dimen/dp_51"
|
||||||
android:layout_marginStart="@dimen/dp_30"
|
android:visibility="gone"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||||
@@ -5,7 +5,6 @@ import android.graphics.*
|
|||||||
import android.graphics.Paint.Style.STROKE
|
import android.graphics.Paint.Style.STROKE
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.os.HandlerThread
|
import android.os.HandlerThread
|
||||||
import android.os.SystemClock
|
|
||||||
import android.util.*
|
import android.util.*
|
||||||
import android.view.SurfaceHolder
|
import android.view.SurfaceHolder
|
||||||
import android.view.SurfaceView
|
import android.view.SurfaceView
|
||||||
@@ -15,6 +14,8 @@ import com.mogo.eagle.core.function.api.lookaround.data.*
|
|||||||
import com.mogo.eagle.core.function.call.autopilot.*
|
import com.mogo.eagle.core.function.call.autopilot.*
|
||||||
import com.mogo.eagle.core.function.call.devatools.*
|
import com.mogo.eagle.core.function.call.devatools.*
|
||||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.Utils
|
import com.mogo.eagle.core.utilcode.util.Utils
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
@@ -279,12 +280,11 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
|||||||
override fun onAttachedToWindow() {
|
override fun onAttachedToWindow() {
|
||||||
super.onAttachedToWindow()
|
super.onAttachedToWindow()
|
||||||
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
|
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
|
||||||
Log.d(TAG, "--- 发起订阅 ---")
|
|
||||||
CallerAutoPilotControlManager.setIsSubscribeM1StitchedVideo(true)
|
CallerAutoPilotControlManager.setIsSubscribeM1StitchedVideo(true)
|
||||||
scope.launch(ThreadUtils.getCpuPool().asCoroutineDispatcher()) {
|
scope.launch(ThreadUtils.getCpuPool().asCoroutineDispatcher()) {
|
||||||
CallerDevaToolsManager.lookAroundProvider()?.flow()?.also { flow ->
|
CallerDevaToolsManager.lookAroundProvider()?.flow()?.also { flow ->
|
||||||
flow.onEach {
|
flow.onEach {
|
||||||
Log.d(TAG, "-- onEach ---:$it")
|
CallerLogger.d("$M_HMI$TAG", "-- onEach ---:$it")
|
||||||
if (it.isValid()) {
|
if (it.isValid()) {
|
||||||
data = it
|
data = it
|
||||||
handler.get()?.removeCallbacks(this@M1LookAroundView)
|
handler.get()?.removeCallbacks(this@M1LookAroundView)
|
||||||
@@ -307,7 +307,6 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
|||||||
override fun onDetachedFromWindow() {
|
override fun onDetachedFromWindow() {
|
||||||
super.onDetachedFromWindow()
|
super.onDetachedFromWindow()
|
||||||
CallerChassisSteeringStateListenerManager.removeListener(TAG)
|
CallerChassisSteeringStateListenerManager.removeListener(TAG)
|
||||||
Log.d(TAG, "--- 取消订阅 ---")
|
|
||||||
CallerAutoPilotControlManager.setIsSubscribeM1StitchedVideo(false)
|
CallerAutoPilotControlManager.setIsSubscribeM1StitchedVideo(false)
|
||||||
handler.get()?.looper?.quitSafely()
|
handler.get()?.looper?.quitSafely()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
|||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
|
|
||||||
import com.mogo.eagle.core.function.msgbox.MsgFmData
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
|||||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
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.hmi.CallerHmiManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
import com.mogo.eagle.core.function.msgbox.MsgFmData
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||||
import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable
|
import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import android.os.Build
|
|||||||
import android.os.Process
|
import android.os.Process
|
||||||
import android.text.Html
|
import android.text.Html
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
|
import android.util.Log
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
@@ -21,6 +22,7 @@ import androidx.core.view.MenuCompat
|
|||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import chassis.Chassis
|
import chassis.Chassis
|
||||||
|
import com.mogo.cloud.network.cronet.NetworkQualityListener
|
||||||
import com.mogo.cloud.network.cronet.QuicConfig
|
import com.mogo.cloud.network.cronet.QuicConfig
|
||||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||||
@@ -86,6 +88,7 @@ import com.mogo.eagle.core.utilcode.util.*
|
|||||||
import com.mogo.map.MogoData.Companion.mogoMapData
|
import com.mogo.map.MogoData.Companion.mogoMapData
|
||||||
import com.mogo.map.uicontroller.VisualAngleMode
|
import com.mogo.map.uicontroller.VisualAngleMode
|
||||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||||
|
import com.zhjt.service.chain.ChainLog
|
||||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import mogo.telematics.pad.MessagePad
|
import mogo.telematics.pad.MessagePad
|
||||||
@@ -773,7 +776,35 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
FunctionBuildConfig.isObuWarningFusionUnion = isChecked
|
FunctionBuildConfig.isObuWarningFusionUnion = isChecked
|
||||||
}
|
}
|
||||||
tbCronet.setOnCheckedChangeListener { _, isChecked ->
|
tbCronet.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
if (!isChecked) {
|
||||||
|
CallerDevaToolsManager.setNetworkMode(true)
|
||||||
|
}
|
||||||
QuicConfig.setEnable(context, isChecked)
|
QuicConfig.setEnable(context, isChecked)
|
||||||
|
QuicConfig.setNetworkListener(object : NetworkQualityListener {
|
||||||
|
override fun onLatencyObservation(rttMs: Int, url: String?) {
|
||||||
|
invokeCronetResult("****** Cronet Request Completed, the latency is $rttMs ms;url is $url")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onFailed(error: String?, url: String?) {
|
||||||
|
invokeCronetResult("****** Cronet Request onFailed, error is $error;url is $url")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCanceled(url: String?) {
|
||||||
|
invokeCronetResult("****** Cronet Request onFailed, url is: $url")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onRttObservation(rttMs: Int, whenMs: Long, source: Int) {
|
||||||
|
invokeCronetResult("rttMs is:$rttMs ms,source is:$source")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onThroughputObservation(
|
||||||
|
throughputKbps: Int,
|
||||||
|
whenMs: Long,
|
||||||
|
source: Int
|
||||||
|
) {
|
||||||
|
invokeCronetResult("downstream throughput is:$throughputKbps,source is:$source")
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//重启工控机所有节点
|
//重启工控机所有节点
|
||||||
@@ -2310,4 +2341,13 @@ internal class DebugSettingView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ChainLog(
|
||||||
|
linkChainLog = ChainConstant.CHAIN_TYPE_WEAK_NETWORK,
|
||||||
|
linkCode = ChainConstant.CHAIN_SOURCE_WEAK_NETWORK,
|
||||||
|
nodeAliasCode = ChainConstant.CHAIN_CODE_RECORD_WEAK_NETWORK,
|
||||||
|
paramIndexes = [0]
|
||||||
|
)
|
||||||
|
private fun invokeCronetResult(json: String) {
|
||||||
|
Log.d("CronetNetwork", json)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.hmi.ui.setting
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.util.Log
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
@@ -31,7 +30,6 @@ import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager
|
|||||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||||
import com.mogo.eagle.core.function.call.vehicle.CallerSweeperModeListenerManager
|
import com.mogo.eagle.core.function.call.vehicle.CallerSweeperModeListenerManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
import com.mogo.eagle.core.function.hmi.ui.tools.DockerRebootDialog
|
|
||||||
import com.mogo.eagle.core.function.hmi.ui.tools.SweeperModeChangedConfirmDialog
|
import com.mogo.eagle.core.function.hmi.ui.tools.SweeperModeChangedConfirmDialog
|
||||||
import com.mogo.eagle.core.function.call.unmanned.CallerUnmannedListenerManager
|
import com.mogo.eagle.core.function.call.unmanned.CallerUnmannedListenerManager
|
||||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiAction
|
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiAction
|
||||||
@@ -84,6 +82,7 @@ import kotlinx.android.synthetic.main.view_sop_setting.view.scV2nPnc
|
|||||||
import kotlinx.android.synthetic.main.view_sop_setting.view.scWeakNetSlowDown
|
import kotlinx.android.synthetic.main.view_sop_setting.view.scWeakNetSlowDown
|
||||||
import kotlinx.android.synthetic.main.view_sop_setting.view.sopLayout
|
import kotlinx.android.synthetic.main.view_sop_setting.view.sopLayout
|
||||||
import kotlinx.android.synthetic.main.view_sop_setting.view.tvOverTakeLimit
|
import kotlinx.android.synthetic.main.view_sop_setting.view.tvOverTakeLimit
|
||||||
|
import kotlinx.android.synthetic.main.view_sop_setting.view.tvPullTimeTitle
|
||||||
import kotlinx.android.synthetic.main.view_sop_setting.view.tvSpeed
|
import kotlinx.android.synthetic.main.view_sop_setting.view.tvSpeed
|
||||||
import kotlinx.android.synthetic.main.view_sop_setting.view.tvSpeedOverTakeLimit
|
import kotlinx.android.synthetic.main.view_sop_setting.view.tvSpeedOverTakeLimit
|
||||||
import kotlinx.android.synthetic.main.view_sop_setting.view.tvSpeedThresholdTitle
|
import kotlinx.android.synthetic.main.view_sop_setting.view.tvSpeedThresholdTitle
|
||||||
@@ -789,6 +788,11 @@ internal class SOPSettingView @JvmOverloads constructor(
|
|||||||
View.VISIBLE
|
View.VISIBLE
|
||||||
else
|
else
|
||||||
View.GONE
|
View.GONE
|
||||||
|
tvPullTimeTitle.visibility =
|
||||||
|
if(AppIdentityModeUtils.isTaxiDriver(FunctionBuildConfig.appIdentityMode))
|
||||||
|
View.VISIBLE
|
||||||
|
else
|
||||||
|
View.GONE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 魔方sop运营相关配置
|
* 魔方sop运营相关配置
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.mogo.eagle.core.function.hmi.ui.utils
|
package com.mogo.eagle.core.function.hmi.ui.utils
|
||||||
|
|
||||||
|
import com.mogo.eagle.core.data.deva.chain.ChainCommon
|
||||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||||
import com.zhjt.service.chain.ChainLog
|
import com.zhjt.service.chain.ChainLog
|
||||||
@@ -9,14 +12,34 @@ class HmiActionLog {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
|
fun hmiAction(data: Any, data1: Any, param: Boolean = false) {
|
||||||
|
CallerLogger.d(M_HMI + data.toString(), data1)
|
||||||
|
if (param) {
|
||||||
|
val cal = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||||
|
val lineId = CallerAutoPilotStatusListenerManager.getLineId()
|
||||||
|
realParamAction(data, data1, ChainCommon(cal.latitude, cal.longitude, lineId))
|
||||||
|
} else {
|
||||||
|
realAction(data, data1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ChainLog(
|
@ChainLog(
|
||||||
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||||
linkCode = ChainConstant.CHAIN_SOURCE_HMI,
|
linkCode = ChainConstant.CHAIN_SOURCE_HMI,
|
||||||
nodeAliasCode = ChainConstant.CHAIN_CODE_HMI_ACTIONS,
|
nodeAliasCode = ChainConstant.CHAIN_CODE_HMI_ACTIONS,
|
||||||
paramIndexes = [0, 1]
|
paramIndexes = [0, 1]
|
||||||
)
|
)
|
||||||
fun hmiAction(data: Any, data1: Any) {
|
private fun realAction(data: Any, data1: Any) {
|
||||||
CallerLogger.d(M_HMI + data.toString(), data1)
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ChainLog(
|
||||||
|
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||||
|
linkCode = ChainConstant.CHAIN_SOURCE_HMI,
|
||||||
|
nodeAliasCode = ChainConstant.CHAIN_CODE_HMI_ACTIONS,
|
||||||
|
paramIndexes = [0, 1, 2]
|
||||||
|
)
|
||||||
|
private fun realParamAction(data: Any, data1: Any, chainCommon: ChainCommon) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import android.annotation.SuppressLint
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.util.Log
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.animation.LinearInterpolator
|
import android.view.animation.LinearInterpolator
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
@@ -22,6 +21,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
|||||||
import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingActionsListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingActionsListenerManager
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingListenerManager
|
import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingListenerManager
|
||||||
import com.mogo.eagle.core.function.hmi.R
|
import com.mogo.eagle.core.function.hmi.R
|
||||||
|
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
||||||
@@ -74,9 +76,9 @@ class ParallelDriveView @JvmOverloads constructor(
|
|||||||
override fun onAttachedToWindow() {
|
override fun onAttachedToWindow() {
|
||||||
super.onAttachedToWindow()
|
super.onAttachedToWindow()
|
||||||
initView()
|
initView()
|
||||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
CallerAutoPilotStatusListenerManager.addListener("$M_HMI$TAG", this)
|
||||||
CallerParallelDrivingListenerManager.addListener(TAG, this)
|
CallerParallelDrivingListenerManager.addListener("$M_HMI$TAG", this)
|
||||||
CallerParallelDrivingActionsListenerManager.addListener(TAG, this)
|
CallerParallelDrivingActionsListenerManager.addListener("$M_HMI$TAG", this)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initView() {
|
private fun initView() {
|
||||||
@@ -88,7 +90,7 @@ class ParallelDriveView @JvmOverloads constructor(
|
|||||||
when (state) {
|
when (state) {
|
||||||
0 -> {
|
0 -> {
|
||||||
state = APP_REQUESTING
|
state = APP_REQUESTING
|
||||||
Log.d(TAG, "Click-开始请求平行驾驶")
|
HmiActionLog.hmiAction(TAG,"Click-开始请求平行驾驶")
|
||||||
updateUI(APP_REQUESTING)
|
updateUI(APP_REQUESTING)
|
||||||
reqParaDrive()
|
reqParaDrive()
|
||||||
listener?.onReqClick()
|
listener?.onReqClick()
|
||||||
@@ -96,18 +98,18 @@ class ParallelDriveView @JvmOverloads constructor(
|
|||||||
|
|
||||||
APP_REQUESTING -> {
|
APP_REQUESTING -> {
|
||||||
cancelParaDrive()
|
cancelParaDrive()
|
||||||
Log.d(TAG, "Click-请求已取消")
|
HmiActionLog.hmiAction(TAG,"Click-请求已取消")
|
||||||
ToastUtils.showShort("请求已取消!")
|
ToastUtils.showShort("请求已取消!")
|
||||||
checkAvailableAndUpdateUI()
|
checkAvailableAndUpdateUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
AD_REQUESTING -> {
|
AD_REQUESTING -> {
|
||||||
Log.d(TAG, "Click-自动驾驶正在请求平行驾驶")
|
HmiActionLog.hmiAction(TAG,"Click-自动驾驶正在请求平行驾驶")
|
||||||
ToastUtils.showShort("自动驾驶正在请求平行驾驶")
|
ToastUtils.showShort("自动驾驶正在请求平行驾驶")
|
||||||
}
|
}
|
||||||
|
|
||||||
UNAVAILABLE -> {
|
UNAVAILABLE -> {
|
||||||
Log.d(TAG, "Click-请P档驻车并松开油门刹车后请求")
|
HmiActionLog.hmiAction(TAG,"Click-请P档驻车并松开油门刹车后请求")
|
||||||
ToastUtils.showShort("请P档驻车并松开油门刹车后请求")
|
ToastUtils.showShort("请P档驻车并松开油门刹车后请求")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,7 +126,6 @@ class ParallelDriveView @JvmOverloads constructor(
|
|||||||
when (state) {
|
when (state) {
|
||||||
7 -> {
|
7 -> {
|
||||||
isAutoDriving = false
|
isAutoDriving = false
|
||||||
Log.d(TAG, "onAutopilotStatusResponse-7")
|
|
||||||
ThreadUtils.runOnUiThread({
|
ThreadUtils.runOnUiThread({
|
||||||
this.state = PARALLEL_DRIVING
|
this.state = PARALLEL_DRIVING
|
||||||
updateUI(PARALLEL_DRIVING)
|
updateUI(PARALLEL_DRIVING)
|
||||||
@@ -133,7 +134,6 @@ class ParallelDriveView @JvmOverloads constructor(
|
|||||||
|
|
||||||
2 -> {
|
2 -> {
|
||||||
isAutoDriving = true
|
isAutoDriving = true
|
||||||
Log.d(TAG, "onAutopilotStatusResponse-2")
|
|
||||||
if (this.autopilotState == 7) {
|
if (this.autopilotState == 7) {
|
||||||
ThreadUtils.runOnUiThread({
|
ThreadUtils.runOnUiThread({
|
||||||
checkAvailableAndUpdateUI()
|
checkAvailableAndUpdateUI()
|
||||||
@@ -143,7 +143,6 @@ class ParallelDriveView @JvmOverloads constructor(
|
|||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
isAutoDriving = false
|
isAutoDriving = false
|
||||||
Log.d(TAG, "onAutopilotStatusResponse-else")
|
|
||||||
if (this.autopilotState == 7) {
|
if (this.autopilotState == 7) {
|
||||||
ThreadUtils.runOnUiThread({
|
ThreadUtils.runOnUiThread({
|
||||||
checkAvailableAndUpdateUI()
|
checkAvailableAndUpdateUI()
|
||||||
@@ -158,14 +157,14 @@ class ParallelDriveView @JvmOverloads constructor(
|
|||||||
isParallelDrivingAbility: Boolean
|
isParallelDrivingAbility: Boolean
|
||||||
) {
|
) {
|
||||||
if (!isParallelDrivingAbility) {
|
if (!isParallelDrivingAbility) {
|
||||||
Log.d(TAG, "onParallelDrivingAbility-UNAVAILABLE")
|
CallerLogger.d("$M_HMI$TAG", "onParallelDrivingAbility-UNAVAILABLE")
|
||||||
ThreadUtils.runOnUiThread({
|
ThreadUtils.runOnUiThread({
|
||||||
if (state == PARALLEL_DRIVING) return@runOnUiThread
|
if (state == PARALLEL_DRIVING) return@runOnUiThread
|
||||||
state = UNAVAILABLE
|
state = UNAVAILABLE
|
||||||
updateUI(UNAVAILABLE)
|
updateUI(UNAVAILABLE)
|
||||||
}, ThreadUtils.MODE.QUEUE)
|
}, ThreadUtils.MODE.QUEUE)
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, "onParallelDrivingAbility-AVAILABLE")
|
CallerLogger.d("$M_HMI$TAG", "onParallelDrivingAbility-AVAILABLE")
|
||||||
ThreadUtils.runOnUiThread({
|
ThreadUtils.runOnUiThread({
|
||||||
if (state == PARALLEL_DRIVING) return@runOnUiThread
|
if (state == PARALLEL_DRIVING) return@runOnUiThread
|
||||||
state = 0
|
state = 0
|
||||||
@@ -176,8 +175,8 @@ class ParallelDriveView @JvmOverloads constructor(
|
|||||||
|
|
||||||
override fun onParallelDrivingResp(parallelTaskProcessNotice: ParallelTaskProcessNoticeOuterClass.ParallelTaskProcessNotice?) {
|
override fun onParallelDrivingResp(parallelTaskProcessNotice: ParallelTaskProcessNoticeOuterClass.ParallelTaskProcessNotice?) {
|
||||||
parallelTaskProcessNotice?.let {
|
parallelTaskProcessNotice?.let {
|
||||||
|
CallerLogger.d("$M_HMI$TAG", "onParallelDrivingResp-code:${it.code}")
|
||||||
ThreadUtils.runOnUiThread({
|
ThreadUtils.runOnUiThread({
|
||||||
Log.d(TAG, "onParallelDrivingResp-code:${it.code}")
|
|
||||||
when (it.code) {
|
when (it.code) {
|
||||||
"START_SYNC" -> {// 同步中
|
"START_SYNC" -> {// 同步中
|
||||||
state = SYNCHRONIZING
|
state = SYNCHRONIZING
|
||||||
@@ -452,9 +451,9 @@ class ParallelDriveView @JvmOverloads constructor(
|
|||||||
|
|
||||||
override fun onDetachedFromWindow() {
|
override fun onDetachedFromWindow() {
|
||||||
super.onDetachedFromWindow()
|
super.onDetachedFromWindow()
|
||||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
CallerAutoPilotStatusListenerManager.removeListener("$M_HMI$TAG")
|
||||||
CallerParallelDrivingListenerManager.removeListener(TAG)
|
CallerParallelDrivingListenerManager.removeListener("$M_HMI$TAG")
|
||||||
CallerParallelDrivingActionsListenerManager.removeListener(TAG)
|
CallerParallelDrivingActionsListenerManager.removeListener("$M_HMI$TAG")
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ClickEventListener {
|
interface ClickEventListener {
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ class SteeringWheelView : ConstraintLayout, IMoGoChassisSteeringStateListener,
|
|||||||
object : IMoGoAutopilotStatusListener {
|
object : IMoGoAutopilotStatusListener {
|
||||||
override fun onAutopilotStatusResponse(state: Int) {
|
override fun onAutopilotStatusResponse(state: Int) {
|
||||||
ThreadUtils.runOnUiThread {
|
ThreadUtils.runOnUiThread {
|
||||||
d("$M_BUS_P$TAG", "state = %s", state)
|
|
||||||
if (autopilotIV != null) {
|
if (autopilotIV != null) {
|
||||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||||
if (!isBus(FunctionBuildConfig.appIdentityMode)) {
|
if (!isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||||
|
|||||||
@@ -136,10 +136,7 @@ class SystemVersionView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ivHDCache.setOnClickListener {
|
ivHDCache.setOnClickListener {
|
||||||
hmiAction(
|
hmiAction("$M_HMI$TAG", mapOf("isHDCached" to isHDCached))
|
||||||
"$M_HMI$TAG",
|
|
||||||
"HD map view click , isHDCached:$isHDCached , lon:${getChassisLocationWGS84().longitude} , lat:${getChassisLocationWGS84().latitude}"
|
|
||||||
)
|
|
||||||
if (isHDCached) {// 已缓存
|
if (isHDCached) {// 已缓存
|
||||||
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
|
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
|
||||||
} else {// 未缓存
|
} else {// 未缓存
|
||||||
|
|||||||
@@ -18,13 +18,11 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
|||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener;
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener;
|
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener;
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisBrakeStateListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisBrakeStateListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager;
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager;
|
|
||||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager;
|
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager;
|
||||||
import com.mogo.eagle.core.function.hmi.R;
|
import com.mogo.eagle.core.function.hmi.R;
|
||||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||||
@@ -33,8 +31,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
|
|
||||||
import chassis.Chassis;
|
import chassis.Chassis;
|
||||||
import mogo.telematics.pad.MessagePad;
|
import mogo.telematics.pad.MessagePad;
|
||||||
import chassis.ChassisStatesOuterClass;
|
|
||||||
import planning.RoboSweeperTaskIndexOuterClass;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Jing
|
* @author Jing
|
||||||
@@ -42,7 +38,6 @@ import planning.RoboSweeperTaskIndexOuterClass;
|
|||||||
* @since: 6/24/22
|
* @since: 6/24/22
|
||||||
*/
|
*/
|
||||||
public class TrafficDataView extends ConstraintLayout implements
|
public class TrafficDataView extends ConstraintLayout implements
|
||||||
IMoGoChassisSteeringStateListener,
|
|
||||||
IMoGoChassisGearStateListener ,
|
IMoGoChassisGearStateListener ,
|
||||||
IMoGoChassisBrakeStateListener,
|
IMoGoChassisBrakeStateListener,
|
||||||
IMoGoChassisThrottleStateListener,
|
IMoGoChassisThrottleStateListener,
|
||||||
@@ -54,9 +49,6 @@ public class TrafficDataView extends ConstraintLayout implements
|
|||||||
private ImageView speedImage;
|
private ImageView speedImage;
|
||||||
private ImageView brakeStatus;
|
private ImageView brakeStatus;
|
||||||
|
|
||||||
//圆弧颜色
|
|
||||||
private int mArcColor;
|
|
||||||
|
|
||||||
private static final int MSG_SEND_UPDATE = 1;
|
private static final int MSG_SEND_UPDATE = 1;
|
||||||
private volatile double acceleration;
|
private volatile double acceleration;
|
||||||
private volatile float mBrake;
|
private volatile float mBrake;
|
||||||
@@ -114,7 +106,6 @@ public class TrafficDataView extends ConstraintLayout implements
|
|||||||
protected void onAttachedToWindow() {
|
protected void onAttachedToWindow() {
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L);
|
handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L);
|
||||||
CallerChassisSteeringStateListenerManager.INSTANCE.addListener(TAG, this);
|
|
||||||
CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this);
|
CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||||
CallerChassisBrakeStateListenerManager.INSTANCE.addListener(TAG, this);
|
CallerChassisBrakeStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||||
CallerChassisThrottleStateListenerManager.INSTANCE.addListener(TAG, this);
|
CallerChassisThrottleStateListenerManager.INSTANCE.addListener(TAG, this);
|
||||||
@@ -133,7 +124,6 @@ public class TrafficDataView extends ConstraintLayout implements
|
|||||||
@Override
|
@Override
|
||||||
protected void onDetachedFromWindow() {
|
protected void onDetachedFromWindow() {
|
||||||
super.onDetachedFromWindow();
|
super.onDetachedFromWindow();
|
||||||
CallerChassisSteeringStateListenerManager.INSTANCE.removeListener(TAG);
|
|
||||||
CallerChassisGearStateListenerManager.INSTANCE.removeListener(TAG);
|
CallerChassisGearStateListenerManager.INSTANCE.removeListener(TAG);
|
||||||
CallerChassisBrakeStateListenerManager.INSTANCE.removeListener(TAG);
|
CallerChassisBrakeStateListenerManager.INSTANCE.removeListener(TAG);
|
||||||
CallerChassisThrottleStateListenerManager.INSTANCE.removeListener(TAG);
|
CallerChassisThrottleStateListenerManager.INSTANCE.removeListener(TAG);
|
||||||
@@ -145,20 +135,8 @@ public class TrafficDataView extends ConstraintLayout implements
|
|||||||
acceleration = planningActionMsg.getDestinationAcc();
|
acceleration = planningActionMsg.getDestinationAcc();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 方向盘转向角 左+右-
|
|
||||||
* @param steering
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onAutopilotSteeringData(float steering) {
|
|
||||||
if (Math.abs(steering) < 1) {
|
|
||||||
steering = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 档位
|
* 档位
|
||||||
* @param gear
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||||
@@ -178,23 +156,6 @@ public class TrafficDataView extends ConstraintLayout implements
|
|||||||
public void onAutopilotThrottle(float throttle) {
|
public void onAutopilotThrottle(float throttle) {
|
||||||
mThrottle = throttle;
|
mThrottle = throttle;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 设置弧形颜色
|
|
||||||
*
|
|
||||||
* @param value 颜色值
|
|
||||||
*/
|
|
||||||
public void setArcColor(int value) {
|
|
||||||
mArcColor = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置数据
|
|
||||||
*
|
|
||||||
* @param value 当前绘制的值
|
|
||||||
*/
|
|
||||||
public void setValues(int value) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* value呈现
|
* value呈现
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
|||||||
import com.mogo.eagle.core.function.main.modules.MogoModulesManager
|
import com.mogo.eagle.core.function.main.modules.MogoModulesManager
|
||||||
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler
|
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler
|
||||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils
|
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
|
||||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||||
@@ -59,10 +58,6 @@ import java.io.File
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author congtaowang
|
|
||||||
* @since 2019-12-23
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 描述:加载各个模块
|
* 描述:加载各个模块
|
||||||
*/
|
*/
|
||||||
open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||||
@@ -76,7 +71,8 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
|||||||
private var isFirst = false
|
private var isFirst = false
|
||||||
private var mConnAdapter: ConnInfoAdapter? = null
|
private var mConnAdapter: ConnInfoAdapter? = null
|
||||||
private val dataList: List<AutopilotStatusInfo> = ArrayList()
|
private val dataList: List<AutopilotStatusInfo> = ArrayList()
|
||||||
private var mLastStatus = 0x00
|
// private var mLastStatus = 0x00
|
||||||
|
private var mLastStatus = 0x01
|
||||||
private var isFloatingLayerHidden = false
|
private var isFloatingLayerHidden = false
|
||||||
|
|
||||||
override fun getLayoutId(): Int {
|
override fun getLayoutId(): Int {
|
||||||
@@ -327,11 +323,11 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
|||||||
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true)
|
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
|
||||||
|
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
||||||
UiThreadHandler.post {
|
UiThreadHandler.post {
|
||||||
val status = autoPilotStatusInfo.ipcConnStatus
|
if(mLastStatus != status){
|
||||||
if (mLastStatus != status) {
|
val statusInfo = CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().clone()
|
||||||
val statusInfo = autoPilotStatusInfo.clone()
|
|
||||||
rvConnectInfo.post { updateConnectInfoView(statusInfo) }
|
rvConnectInfo.post { updateConnectInfoView(statusInfo) }
|
||||||
mLastStatus = status
|
mLastStatus = status
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2372,7 +2372,7 @@
|
|||||||
android:padding="@dimen/dp_20"
|
android:padding="@dimen/dp_20"
|
||||||
android:background="@drawable/radio_button_normal_background_right"
|
android:background="@drawable/radio_button_normal_background_right"
|
||||||
android:textColor="#000"
|
android:textColor="#000"
|
||||||
android:textOff="开启QUIC协议(服务器暂不支持)"
|
android:textOff="开启QUIC协议(目前QA环境可用)"
|
||||||
android:textOn="关闭QUIC协议"
|
android:textOn="关闭QUIC协议"
|
||||||
android:textSize="@dimen/dp_24" />
|
android:textSize="@dimen/dp_24" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -586,7 +586,7 @@
|
|||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="32dp"
|
android:textSize="32dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/scLineRoutingVerify" />
|
app:layout_constraintTop_toBottomOf="@id/scShowBagRecordWindow" />
|
||||||
|
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
android:id="@+id/rgPullTime"
|
android:id="@+id/rgPullTime"
|
||||||
|
|||||||
@@ -29,22 +29,20 @@ class AiCloudIdentifyNetWorkModel private constructor() {
|
|||||||
onError: ((String) -> Unit)
|
onError: ((String) -> Unit)
|
||||||
) {
|
) {
|
||||||
request<BaseResponse<Any>> {
|
request<BaseResponse<Any>> {
|
||||||
val map = mutableMapOf<String, Any>()
|
|
||||||
start {
|
|
||||||
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
|
||||||
map["status"] = dataReceive
|
|
||||||
map["startMetre"] = START_METRE
|
|
||||||
map["endMetre"] = END_METRE
|
|
||||||
map["type"] = 1
|
|
||||||
if (lon != 0.0) {
|
|
||||||
map["lon"] = lon
|
|
||||||
}
|
|
||||||
if (lat != 0.0) {
|
|
||||||
map["lat"] = lat
|
|
||||||
}
|
|
||||||
}
|
|
||||||
loader {
|
loader {
|
||||||
apiCall {
|
apiCall {
|
||||||
|
val map = mutableMapOf<String, Any>()
|
||||||
|
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
|
||||||
|
map["status"] = dataReceive
|
||||||
|
map["startMetre"] = START_METRE
|
||||||
|
map["endMetre"] = END_METRE
|
||||||
|
map["type"] = 1
|
||||||
|
if (lon != 0.0) {
|
||||||
|
map["lon"] = lon
|
||||||
|
}
|
||||||
|
if (lat != 0.0) {
|
||||||
|
map["lat"] = lat
|
||||||
|
}
|
||||||
getNetWorkApi().identifyRange(map)
|
getNetWorkApi().identifyRange(map)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,284 +0,0 @@
|
|||||||
package com.mogo.eagle.core.function.smp;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.BitmapFactory;
|
|
||||||
|
|
||||||
import com.amap.api.maps.AMap;
|
|
||||||
import com.amap.api.maps.CameraUpdateFactory;
|
|
||||||
import com.amap.api.maps.TextureMapView;
|
|
||||||
import com.amap.api.maps.model.BitmapDescriptor;
|
|
||||||
import com.amap.api.maps.model.BitmapDescriptorFactory;
|
|
||||||
import com.amap.api.maps.model.CameraPosition;
|
|
||||||
import com.amap.api.maps.model.LatLng;
|
|
||||||
import com.amap.api.maps.model.Marker;
|
|
||||||
import com.amap.api.maps.model.MarkerOptions;
|
|
||||||
import com.amap.api.maps.model.Polyline;
|
|
||||||
import com.autonavi.amap.mapcore.IPoint;
|
|
||||||
import com.mogo.eagle.core.function.map.R;
|
|
||||||
|
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 包名: com.amap.api.navi.core
|
|
||||||
* <p>
|
|
||||||
* 创建时间:2018/3/1
|
|
||||||
* 项目名称:AndroidNavigationSDK
|
|
||||||
*
|
|
||||||
* @author guibao.ggb
|
|
||||||
* @email guibao.ggb@alibaba-inc.com
|
|
||||||
* <p>
|
|
||||||
* 类说明:自车位置管理Overlay类
|
|
||||||
*/
|
|
||||||
public class CarOverlay {
|
|
||||||
|
|
||||||
protected static final int CAR_MOVE_ANIMATION_PERIOD = 50;
|
|
||||||
protected int carMoveAnimationFrameNum = 2;
|
|
||||||
protected boolean mIsLock = true;
|
|
||||||
protected IPoint mapAnchorBackup = null;
|
|
||||||
protected double dXOffStep;
|
|
||||||
protected double dYOffStep;
|
|
||||||
protected float dAngleOffStep;
|
|
||||||
protected int currentFrameIndex;
|
|
||||||
protected float angleStart = 0;
|
|
||||||
protected boolean isMoveStarted = false;
|
|
||||||
protected float newAngle = 0;
|
|
||||||
protected BitmapDescriptor carDescriptor = null;
|
|
||||||
protected BitmapDescriptor fourCornersDescriptor = null;
|
|
||||||
protected Marker carMarker;
|
|
||||||
protected Marker directionMarker;
|
|
||||||
protected AMap mAmap = null;
|
|
||||||
protected TextureMapView mapView;
|
|
||||||
protected boolean isDirectionVisible = true;
|
|
||||||
protected LatLng endLatLng = null;
|
|
||||||
protected Polyline leaderLine = null;
|
|
||||||
protected final int DISTANCE_OFFSET = 150;// 默认 500 偏差
|
|
||||||
|
|
||||||
// API 默认 1800 UI 默认 360
|
|
||||||
protected int angleModValue = 1800;
|
|
||||||
|
|
||||||
|
|
||||||
private ScheduledExecutorService executorService;
|
|
||||||
|
|
||||||
public CarOverlay(Context context, TextureMapView mapView) {
|
|
||||||
this.mapView = mapView;
|
|
||||||
|
|
||||||
// fourCornersDescriptor = BitmapDescriptorFactory.fromBitmap(BitmapFactory
|
|
||||||
// .decodeResource(context.getResources(),
|
|
||||||
// R.drawable.module_small_map_navi_direction));
|
|
||||||
|
|
||||||
carDescriptor = BitmapDescriptorFactory.fromBitmap(BitmapFactory
|
|
||||||
.decodeResource(context.getResources(),
|
|
||||||
R.drawable.module_small_map_view_my_location_logo));
|
|
||||||
angleModValue = 1800;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置自车状态
|
|
||||||
*
|
|
||||||
* @param lock true 锁车 false 非锁车
|
|
||||||
*/
|
|
||||||
public void setLock(boolean lock) {
|
|
||||||
mIsLock = lock;
|
|
||||||
if (carMarker == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mAmap == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (directionMarker == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
carMarker.setFlat(true);
|
|
||||||
directionMarker.setGeoPoint(carMarker.getGeoPoint());
|
|
||||||
carMarker.setGeoPoint(carMarker.getGeoPoint());
|
|
||||||
carMarker.setRotateAngle(carMarker.getRotateAngle());
|
|
||||||
if (mIsLock) {
|
|
||||||
CameraPosition cameraPosition = new CameraPosition.Builder().target(carMarker.getPosition()).bearing(newAngle).tilt(0).zoom(16).build();
|
|
||||||
mAmap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void reset() {
|
|
||||||
if (carMarker != null) {
|
|
||||||
carMarker.remove();
|
|
||||||
}
|
|
||||||
if (directionMarker != null) {
|
|
||||||
directionMarker.remove();
|
|
||||||
}
|
|
||||||
if (leaderLine != null) {
|
|
||||||
leaderLine.remove();
|
|
||||||
}
|
|
||||||
leaderLine = null;
|
|
||||||
carMarker = null;
|
|
||||||
directionMarker = null;
|
|
||||||
|
|
||||||
if (executorService != null) {
|
|
||||||
if (!executorService.isShutdown()) {
|
|
||||||
executorService.shutdown();
|
|
||||||
}
|
|
||||||
isMoveStarted = false;
|
|
||||||
|
|
||||||
executorService = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绘制自车
|
|
||||||
*
|
|
||||||
* @param aMap
|
|
||||||
* @param mLatLng
|
|
||||||
* @param bearing
|
|
||||||
*/
|
|
||||||
public void draw(AMap aMap, LatLng mLatLng, float bearing) {
|
|
||||||
if (aMap == null || mLatLng == null || carDescriptor == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mAmap = aMap;
|
|
||||||
try {
|
|
||||||
if (carMarker == null) {
|
|
||||||
carMarker = aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f).setFlat(true).icon(carDescriptor).position(mLatLng));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (directionMarker == null) {
|
|
||||||
directionMarker = aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f).setFlat(true).icon(fourCornersDescriptor).position(mLatLng));
|
|
||||||
directionMarker.setVisible(isDirectionVisible);
|
|
||||||
}
|
|
||||||
carMarker.setVisible(true);
|
|
||||||
newAngle = bearing;
|
|
||||||
IPoint resultGeoPnt = IPoint.obtain();
|
|
||||||
// resultGeoPnt = NaviUtil.lonlat2Geo(mLatLng.latitude, mLatLng.longitude, 20);
|
|
||||||
updateCarPosition(resultGeoPnt);
|
|
||||||
resultGeoPnt.recycle();
|
|
||||||
|
|
||||||
} catch (Throwable e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void updateCarPosition(IPoint p) {
|
|
||||||
carMarker.setGeoPoint(p);
|
|
||||||
carMarker.setFlat(true);
|
|
||||||
carMarker.setRotateAngle(360 - newAngle);
|
|
||||||
if (directionMarker != null) {
|
|
||||||
directionMarker.setGeoPoint(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mIsLock) {
|
|
||||||
CameraPosition cameraPosition = new CameraPosition.Builder().target(carMarker.getPosition()).bearing(newAngle).tilt(0).zoom(16).build();
|
|
||||||
mAmap.moveCamera(CameraUpdateFactory.changeBearingGeoCenter(newAngle, p));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setEndPoi(LatLng latlng) {
|
|
||||||
endLatLng = latlng;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 释放自车资源
|
|
||||||
*/
|
|
||||||
public void destroy() {
|
|
||||||
if (carMarker != null) {
|
|
||||||
carMarker.remove();
|
|
||||||
carMarker = null;
|
|
||||||
}
|
|
||||||
if (directionMarker != null) {
|
|
||||||
directionMarker.remove();
|
|
||||||
directionMarker = null;
|
|
||||||
}
|
|
||||||
carDescriptor = null;
|
|
||||||
|
|
||||||
if (executorService != null && !executorService.isShutdown()) {
|
|
||||||
executorService.shutdown();
|
|
||||||
isMoveStarted = false;
|
|
||||||
|
|
||||||
executorService = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void calculateCarSmoothMoveOffset(IPoint newCenter, float newAngle) {
|
|
||||||
if (carMarker == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
IPoint currentAnchorGeoPoint = carMarker.getGeoPoint();
|
|
||||||
if (currentAnchorGeoPoint == null || currentAnchorGeoPoint.x == 0 || currentAnchorGeoPoint.y == 0) {
|
|
||||||
currentAnchorGeoPoint = newCenter;
|
|
||||||
}
|
|
||||||
currentFrameIndex = 0;
|
|
||||||
mapAnchorBackup = currentAnchorGeoPoint;
|
|
||||||
dXOffStep = (newCenter.x - currentAnchorGeoPoint.x) / carMoveAnimationFrameNum;
|
|
||||||
dYOffStep = (newCenter.y - currentAnchorGeoPoint.y) / carMoveAnimationFrameNum;
|
|
||||||
// 获取当前的旋转角度
|
|
||||||
angleStart = carMarker.getRotateAngle();
|
|
||||||
boolean isFirst = false;
|
|
||||||
|
|
||||||
if (Float.compare(angleStart, newAngle) == 0) {
|
|
||||||
isFirst = true;
|
|
||||||
} else {
|
|
||||||
angleStart = 360 - angleStart;
|
|
||||||
}
|
|
||||||
// 校正旋转角度问题
|
|
||||||
float dAngleDelta = newAngle - angleStart;
|
|
||||||
if (isFirst) {
|
|
||||||
dAngleDelta = 0;
|
|
||||||
}
|
|
||||||
if (dAngleDelta > 180) {
|
|
||||||
dAngleDelta = dAngleDelta - 360;
|
|
||||||
}
|
|
||||||
else if (dAngleDelta < -180) {
|
|
||||||
dAngleDelta = dAngleDelta + 360;
|
|
||||||
}
|
|
||||||
dAngleOffStep = dAngleDelta / carMoveAnimationFrameNum;
|
|
||||||
isMoveStarted = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// protected void startSmoothMoveTimer() {
|
|
||||||
// if (executorService == null) {
|
|
||||||
// executorService = new ScheduledThreadPoolExecutor(1, new BasicThreadFactory.Builder().namingPattern("caroverlay-schedule-pool-%d").daemon(true).build());
|
|
||||||
//
|
|
||||||
// executorService.scheduleAtFixedRate(new Runnable() {
|
|
||||||
// long currentSeconds;
|
|
||||||
// @Override
|
|
||||||
// public void run() {
|
|
||||||
// try{
|
|
||||||
// currentSeconds = System.currentTimeMillis();
|
|
||||||
// mapSmoothMoveTimerTick();
|
|
||||||
// } catch(Throwable e){
|
|
||||||
// e.printStackTrace();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }, 0, CAR_MOVE_ANIMATION_PERIOD, TimeUnit.MILLISECONDS);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
private void mapSmoothMoveTimerTick() {
|
|
||||||
if (!isMoveStarted) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (carMarker == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mAmap == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
IPoint p = carMarker.getGeoPoint();
|
|
||||||
double newX, newY;
|
|
||||||
if (currentFrameIndex++ < carMoveAnimationFrameNum) {
|
|
||||||
newX = mapAnchorBackup.x + dXOffStep * currentFrameIndex;
|
|
||||||
newY = mapAnchorBackup.y + dYOffStep * currentFrameIndex;
|
|
||||||
newAngle = angleStart + dAngleOffStep * currentFrameIndex;
|
|
||||||
newAngle %= angleModValue;
|
|
||||||
if (newX != 0 || newY != 0) {
|
|
||||||
p = new IPoint((int)newX, (int)newY);
|
|
||||||
}
|
|
||||||
updateCarPosition(p);
|
|
||||||
}
|
|
||||||
} catch (Throwable e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -9,7 +9,7 @@ class BagInfoEntity(){
|
|||||||
var key: Long = 0// bag key值
|
var key: Long = 0// bag key值
|
||||||
var totalSize: Long = 0// 所有子包或合并后的包的总大小
|
var totalSize: Long = 0// 所有子包或合并后的包的总大小
|
||||||
var timestamp: String = ""// 时间戳
|
var timestamp: String = ""// 时间戳
|
||||||
var bagPath: String ?= null// bag所在路径
|
var bagPath: String = ""// bag所在路径
|
||||||
var mergeStat: Boolean = false// 合并状态
|
var mergeStat: Boolean = false// 合并状态
|
||||||
var uploadStat: Boolean = false// 上传cos桶状态
|
var uploadStat: Boolean = false// 上传cos桶状态
|
||||||
var description: BagDescriptionEntity?= null// 包描述信息
|
var description: BagDescriptionEntity?= null// 包描述信息
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
package com.mogo.eagle.core.data.deva.badcase
|
package com.mogo.eagle.core.data.deva.badcase
|
||||||
|
|
||||||
data class RecordCaseEntity(var caseId: Int,var caseName: String,var topicList: ArrayList<String>)
|
import com.google.protobuf.ProtocolStringList
|
||||||
|
|
||||||
|
data class RecordCaseEntity(
|
||||||
|
var caseId: Int,
|
||||||
|
var caseName: String,
|
||||||
|
var topicList: ProtocolStringList
|
||||||
|
)
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.mogo.eagle.core.data.deva.chain
|
||||||
|
|
||||||
|
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||||
|
|
||||||
|
data class ChainCommon(val lat:Double, val lon:Double, val lineId:Long, val eagleVersionCode:Int = AppConfigInfo.appVersionCode) {
|
||||||
|
}
|
||||||
@@ -22,14 +22,13 @@ class ChainConstant {
|
|||||||
const val CHAIN_SOURCE_OCH = 13
|
const val CHAIN_SOURCE_OCH = 13
|
||||||
|
|
||||||
//业务类型与下方文件名一一对应
|
//业务类型与下方文件名一一对应
|
||||||
const val CHAIN_TYPE_STATUS = 0 // 各个业务初始化信息,配置信息.链接状态,点击信息
|
const val CHAIN_TYPE_STATUS = 0 // 记录所有业务信息(正常调用,异常数据)
|
||||||
const val CHAIN_TYPE_GNSS = 1 // 工控定位数据
|
const val CHAIN_TYPE_GNSS = 1 // 工控定位数据
|
||||||
const val CHAIN_TYPE_SOCKET_AUTOPILOT = 2 // 包括自动驾驶状态,reportMsg,planning数据,全局路径数据,FM
|
const val CHAIN_TYPE_SOCKET_AUTOPILOT = 2 // 包括自动驾驶状态,reportMsg,planning数据,全局路径数据,FM
|
||||||
const val CHAIN_TYPE_SOCKET_DATA_TRACKED = 3 // 感知数据,现阶段记录云端漫游
|
const val CHAIN_TYPE_SOCKET_DATA_TRACKED = 3 // 感知数据,现阶段记录云端漫游
|
||||||
const val CHAIN_TYPE_SOCKET_TRAJECTORY = 4 // 前车引导线,用于调试
|
const val CHAIN_TYPE_SOCKET_TRAJECTORY = 4 // 前车引导线,用于调试
|
||||||
const val CHAIN_TYPE_SOCKET_VEHICLE = 5 // 底盘数据
|
const val CHAIN_TYPE_SOCKET_VEHICLE = 5 // 底盘数据
|
||||||
const val CHAIN_TYPE_SOCKET_TRAFFIC_LIGHT = 6 // 多元红绿灯聚合数据
|
const val CHAIN_TYPE_SOCKET_TRAFFIC_LIGHT = 6 // 多元红绿灯聚合数据
|
||||||
const val CHAIN_TYPE_V2X = 100 // V2X(V2I、V2N)
|
|
||||||
const val CHAIN_TYPE_ANR_LEAK = 300
|
const val CHAIN_TYPE_ANR_LEAK = 300
|
||||||
const val CHAIN_TYPE_WEAK_NETWORK = 400
|
const val CHAIN_TYPE_WEAK_NETWORK = 400
|
||||||
const val CHAIN_TYPE_OCH = 500
|
const val CHAIN_TYPE_OCH = 500
|
||||||
@@ -42,7 +41,6 @@ class ChainConstant {
|
|||||||
const val CHAIN_LINK_LOG_ADAS_TRAJECTORY = "-adasTrajectory"
|
const val CHAIN_LINK_LOG_ADAS_TRAJECTORY = "-adasTrajectory"
|
||||||
const val CHAIN_LINK_LOG_ADAS_VEHICLE = "-adasVehicle"
|
const val CHAIN_LINK_LOG_ADAS_VEHICLE = "-adasVehicle"
|
||||||
const val CHAIN_LINK_LOG_ADAS_TRAFFIC_LIGHT = "-UnionTrafficLight"
|
const val CHAIN_LINK_LOG_ADAS_TRAFFIC_LIGHT = "-UnionTrafficLight"
|
||||||
const val CHAIN_LINK_LOG_V2X = "-eagleCloudWSV2X"
|
|
||||||
const val CHAIN_LINK_LOG_RECORD_ANR = "-eagleRecordANR"
|
const val CHAIN_LINK_LOG_RECORD_ANR = "-eagleRecordANR"
|
||||||
const val CHAIN_LINK_LOG_RECORD_WEAK_NETWORK = "-eagleRecordWeakNetwork"
|
const val CHAIN_LINK_LOG_RECORD_WEAK_NETWORK = "-eagleRecordWeakNetwork"
|
||||||
const val CHAIN_LINK_LOG_OCH = "-eagleOch"
|
const val CHAIN_LINK_LOG_OCH = "-eagleOch"
|
||||||
@@ -102,8 +100,8 @@ class ChainConstant {
|
|||||||
const val CHAIN_CODE_HTTP_DNS_CITY_CODE = "CHAIN_CODE_HTTP_DNS_CITY_CODE"
|
const val CHAIN_CODE_HTTP_DNS_CITY_CODE = "CHAIN_CODE_HTTP_DNS_CITY_CODE"
|
||||||
const val CHAIN_CODE_HTTP_DNS_ERROR_REASON = "CHAIN_CODE_HTTP_DNS_ERROR_REASON"
|
const val CHAIN_CODE_HTTP_DNS_ERROR_REASON = "CHAIN_CODE_HTTP_DNS_ERROR_REASON"
|
||||||
|
|
||||||
|
const val CHAIN_CODE_DATA_CENTER = "CHAIN_CODE_DATA_CENTER"
|
||||||
const val CHAIN_CODE_V2X_MSG = "CHAIN_CODE_V2X_MSG"
|
const val CHAIN_CODE_V2X_MSG = "CHAIN_CODE_V2X_MSG"
|
||||||
const val CHAIN_CODE_MSG_BOX = "CHAIN_CODE_MSG_BOX"
|
|
||||||
const val CHAIN_CODE_HD_MAP_CALL = "CHAIN_CODE_HD_MAP_CALL"
|
const val CHAIN_CODE_HD_MAP_CALL = "CHAIN_CODE_HD_MAP_CALL"
|
||||||
const val CHAIN_CODE_HD_MAP_ROAD_CROSS = "CHAIN_CODE_HD_MAP_ROAD_CROSS"
|
const val CHAIN_CODE_HD_MAP_ROAD_CROSS = "CHAIN_CODE_HD_MAP_ROAD_CROSS"
|
||||||
const val CHAIN_CODE_HD_MAP_ICON_SET = "CHAIN_CODE_HD_MAP_ICON_SET"
|
const val CHAIN_CODE_HD_MAP_ICON_SET = "CHAIN_CODE_HD_MAP_ICON_SET"
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class MarkerUserInfo implements Serializable {
|
|||||||
int year = cal.get(Calendar.YEAR);
|
int year = cal.get(Calendar.YEAR);
|
||||||
|
|
||||||
//2020-30=1990
|
//2020-30=1990
|
||||||
double ageDiffer = year - getAgeNumber();
|
double ageDiffer = (double) (year - getAgeNumber());
|
||||||
String ageStr = "" + ageDiffer;
|
String ageStr = "" + ageDiffer;
|
||||||
char[] ageChars = ageStr.toCharArray();
|
char[] ageChars = ageStr.toCharArray();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
package com.mogo.eagle.core.function.msgbox
|
package com.mogo.eagle.core.data.msgbox
|
||||||
|
|
||||||
import com.zhjt.mogo.adas.data.bean.MogoReport
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FM信息对照表
|
* FM信息对照表
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.mogo.eagle.core.function.api.autopilot
|
package com.mogo.eagle.core.function.api.autopilot
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
|
||||||
import mogo.telematics.pad.MessagePad
|
import mogo.telematics.pad.MessagePad
|
||||||
import mogo_msg.MogoReportMsg
|
import mogo_msg.MogoReportMsg
|
||||||
import system_master.*
|
import system_master.*
|
||||||
@@ -12,14 +11,6 @@ import system_master.*
|
|||||||
*/
|
*/
|
||||||
interface IMoGoAutopilotStatusListener {
|
interface IMoGoAutopilotStatusListener {
|
||||||
|
|
||||||
/**
|
|
||||||
* 自动驾驶状态信息
|
|
||||||
*
|
|
||||||
* @param autoPilotStatusInfo 状态信息
|
|
||||||
*/
|
|
||||||
@Deprecated("3.3.0之后不建议使用此种回调方式,按需回调,主界面暂时使用用于check检查信息透出")
|
|
||||||
fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动驾驶状态信息
|
* 自动驾驶状态信息
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -113,6 +113,11 @@ interface IDevaToolsProvider : IProvider {
|
|||||||
*/
|
*/
|
||||||
fun onReceiveBadCaseRecord(msgBoxBean: MsgBoxBean,activity: Activity,countdown: Boolean)
|
fun onReceiveBadCaseRecord(msgBoxBean: MsgBoxBean,activity: Activity,countdown: Boolean)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 魔方开启主动录包
|
||||||
|
*/
|
||||||
|
fun startRecordByMoFang()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 展示录包配置
|
* 展示录包配置
|
||||||
*/
|
*/
|
||||||
@@ -244,4 +249,6 @@ interface IDevaToolsProvider : IProvider {
|
|||||||
* 各线程CPU使用率
|
* 各线程CPU使用率
|
||||||
*/
|
*/
|
||||||
fun usage(): IMoGoCpuUsageProvider?
|
fun usage(): IMoGoCpuUsageProvider?
|
||||||
|
|
||||||
|
fun setNetworkMode(isDebug: Boolean)
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user