Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0

# Conflicts:
#	core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/report/IPCReportManager.kt
This commit is contained in:
bxb
2023-03-08 19:25:46 +08:00
87 changed files with 1765 additions and 583 deletions

View File

@@ -117,8 +117,8 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
private IOCHTaxiPassengerADASStatusCallback mADASStatusCallback; //Model->Presenter自动驾驶状态相关
private IOCHTaxiPassengerAutopilotPlanningCallback mAutopilotPlanningCallback; //Model->Presenter自动驾驶线路规划
private Map<String,IOCHTaxiPassengerOrderStatusCallback> mOrderStatusCallbackMap = new ConcurrentHashMap<>();
private Map<String,IOCHTaxiPassengerControllerStatusCallback> mControllerStatusCallbackMap = new ConcurrentHashMap<>();
private final Map<String,IOCHTaxiPassengerOrderStatusCallback> mOrderStatusCallbackMap = new ConcurrentHashMap<>();
private final Map<String,IOCHTaxiPassengerControllerStatusCallback> mControllerStatusCallbackMap = new ConcurrentHashMap<>();
private ITaxiPassengerVeloctityCallback mVeloctityCallback;//道路限速返回
@@ -130,7 +130,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
private double mLongitude, mLatitude;
private MogoLocation mLocation = null;
private List<MogoLocation> mLocationsModels = new ArrayList<>();
private final List<MogoLocation> mLocationsModels = new ArrayList<>();
private TaxiPassengerModel() {
}
@@ -517,7 +517,6 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
@Override
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
if (autopilotStatusInfo == null) return;
int state = autopilotStatusInfo.getState();
// CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "state = %s", state );
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {

View File

@@ -149,6 +149,7 @@ android {
packagingOptions {
exclude 'META-INF/proguard/coroutines.pro'
exclude 'META-INF/*'
exclude "/lib/armeabi-v7a/*.so"
}
signingConfigs {

View File

@@ -1,6 +1,7 @@
package com.mogo.launcher.lancet
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import androidx.annotation.*
import com.knightboost.lancet.api.Origin
@@ -29,4 +30,25 @@ class CrashFix {
null
}
}
/**
* https://console.volcengine.com/apmplus/app/crash/detail/java/bb387ccd9c1a3c6ad2ede4e6f501a5e7?aid=302368&date=%7B%22granularity%22%3A%221h%22%2C%22duration%22%3A%22recently%22%2C%22range%22%3A%221w%22%7D&filters=%7B%22type%22%3A%22and%22%2C%22sub_conditions%22%3A%5B%7B%22dimension%22%3A%22os%22%2C%22op%22%3A%22in%22%2C%22type%22%3A%22expression%22%2C%22values%22%3A%5B%22Android%22%5D%7D%5D%7D&org_id=2100068151&os=Android&page_number=6&status=%5B%22pending%22%2C%22processing%22%2C%22solved%22%2C%22reopen%22%5D
* java.lang.IllegalArgumentException: Invalid audio buffer size.
* at android.media.AudioTrack.audioBuffSizeCheck(AudioTrack.java:1857)
at android.media.AudioTrack.<init>(AudioTrack.java:812)
at android.media.AudioTrack.<init>(AudioTrack.java:754)
at android.media.AudioTrack.<init>(AudioTrack.java:708)
at android.media.AudioTrack.<init>(AudioTrack.java:649)
at com.aispeech.lite.tts.a.a(SourceFile:70)
*/
@Insert
@TargetClass("com.aispeech.lite.tts.a")
@TargetMethod(methodName = "a")
fun fixAiSpeechCrash(context: Context, arg1: Int, arg2: Int) {
try {
Origin.callVoid()
} catch (t: Throwable) {
t.printStackTrace()
}
}
}

View File

@@ -130,6 +130,7 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation rootProject.ext.dependencies.gson
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation project(':libraries:mogo-adas')
implementation project(':libraries:mogo-adas-data')
implementation project(':libraries:mogo-obu')

View File

@@ -9,7 +9,6 @@ import com.zhidao.adas.client.bean.ObuMap;
import com.zhidao.adas.client.bean.ObuRsi;
import com.zhidao.adas.client.bean.ObuRsm;
import com.zhidao.adas.client.bean.ObuSpat;
import com.zhidao.adas.client.bean.OriginalPointCloudData;
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
import com.zhidao.adas.client.bean.PlanningDecisionState;
import com.zhidao.adas.client.bean.PlanningObjects;
@@ -119,6 +118,7 @@ public class DataDistribution {
public final List<DataShow> listPlanningDecisionState = new ArrayList<>();
public final List<DataShow> listChassisStates = new ArrayList<>();
public final List<DataShow> listFSMFunctionStates = new ArrayList<>();
public final List<DataShow> listBackCameraVideo = new ArrayList<>();
public final List<DataShow> listRoboSweeperTaskIndex = new ArrayList<>();
public final List<DataShow> listBagManagerCmd = new ArrayList<>();
public final List<DataShow> listObuSpat = new ArrayList<>();
@@ -146,6 +146,7 @@ public class DataDistribution {
private long listPlanningDecisionStateSize = 0;
private long listChassisStatesSize = 0;
private long listFSMFunctionStatesSize = 0;
private long listBackCameraVideoSize = 0;
private long listRoboSweeperTaskIndexSize = 0;
private long listBagManagerCmdSize = 0;
private long listObuSpatSize = 0;
@@ -175,6 +176,7 @@ public class DataDistribution {
listPlanningDecisionStateSize = 1;
listChassisStatesSize = 1;
listFSMFunctionStatesSize = 1;
listBackCameraVideoSize = 1;
listRoboSweeperTaskIndexSize = 1;
listBagManagerCmdSize = 1;
listObuSpatSize = 1;
@@ -423,14 +425,6 @@ public class DataDistribution {
if (listener != null && Constants.TITLE.RECEIVE_ERROR.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof OriginalPointCloudData) {
listOriginalPointCloud.add(0, new DataShow(listOriginalPointCloudSize++, time + str));
if (listOriginalPointCloud.size() > LIST_SIZE) {
listOriginalPointCloud.remove(listOriginalPointCloud.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(listener.first)) {
listener.second.onRefresh();
}
}
} else {
MessagePad.MessageType messageType = data.header.getMsgType();
@@ -590,6 +584,22 @@ public class DataDistribution {
if (listener != null && Constants.TITLE.RECEIVE_FUNCTION_STATES.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypePointCloud) {
listOriginalPointCloud.add(0, new DataShow(listOriginalPointCloudSize++, time + str));
if (listOriginalPointCloud.size() > LIST_SIZE) {
listOriginalPointCloud.remove(listOriginalPointCloud.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_POINT_CLOUD_ORIGINAL.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (messageType == MessagePad.MessageType.MsgTypeBackCameraVideo) {
listBackCameraVideo.add(0, new DataShow(listBackCameraVideoSize++, time + str));
if (listBackCameraVideo.size() > LIST_SIZE) {
listBackCameraVideo.remove(listBackCameraVideo.size() - 1);
}
if (listener != null && Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO.equals(listener.first)) {
listener.second.onRefresh();
}
} else if (data instanceof PerceptionTrafficLight) {
listPerceptionTrafficLight.add(0, new DataShow(listPerceptionTrafficLightSize++, time + str));
if (listPerceptionTrafficLight.size() > LIST_SIZE) {

View File

@@ -18,7 +18,11 @@ public abstract class BaseInfo {
this.action = action;
this.payloadLen = len;
nowTime = System.currentTimeMillis();
this.len = 8 + header.getSerializedSize() + len;
int headerSize = 0;
if (header != null) {
headerSize = header.getSerializedSize();
}
this.len = 8 + headerSize + len;
this.header = header;
this.sdf = sdf;
}
@@ -33,8 +37,12 @@ public abstract class BaseInfo {
@Override
public String toString() {
return "原始数据长度:" + len + "\tPayload数据长度" + payloadLen + "\nHeader:[" + "MessageID:" + header.getMsgID() +
" MessageType:" + header.getMsgType() + " 发送时间:" + sdf.format(new Date((long) (header.getTimestamp() * 1000)))
+ " 数据源时间:" + sdf.format(new Date((long) (header.getSourceTimestamp() * 1000))) + "]\n";
String str = "原始数据长度:" + len + "\tPayload数据长度" + payloadLen + '\n';
if (header != null) {
str += "Header:[" + "MessageID:" + header.getMsgID() +
" MessageType:" + header.getMsgType() + " 发送时间:" + sdf.format(new Date((long) (header.getTimestamp() * 1000)))
+ " 数据源时间:" + sdf.format(new Date((long) (header.getSourceTimestamp() * 1000))) + "]\n";
}
return str;
}
}

View File

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

View File

@@ -1,24 +0,0 @@
package com.zhidao.adas.client.bean;
import com.google.protobuf.TextFormat;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
import rule_segement.MogoPointCloudOuterClass;
public class MyPointCloud extends BaseInfo {
public final MogoPointCloudOuterClass.MogoPointCloud bean;
public MyPointCloud(MessagePad.Header header, MogoPointCloudOuterClass.MogoPointCloud bean, SimpleDateFormat sdf) {
super("接收", bean.getSerializedSize(), header, sdf);
this.bean = bean;
}
@Override
public String toString() {
return super.toString() + TextFormat.printer().escapingNonAscii(false).printToString(bean);
}
}

View File

@@ -1,17 +0,0 @@
package com.zhidao.adas.client.bean;
import com.zhidao.support.adas.high.common.ByteUtil;
public class OriginalPointCloudData extends BaseInfo {
private final byte[] pointCloud;
public OriginalPointCloudData(byte[] pointCloud) {
super("接收", pointCloud.length);
this.pointCloud = pointCloud;
}
@Override
public String toString() {
return "\n" + ByteUtil.byteArrToHex(pointCloud);
}
}

View File

@@ -0,0 +1,23 @@
package com.zhidao.adas.client.bean;
import com.zhidao.support.adas.high.common.ByteUtil;
import java.text.SimpleDateFormat;
import mogo.telematics.pad.MessagePad;
public class ReceiveBytesData extends BaseInfo {
public final byte[] data;
public ReceiveBytesData(MessagePad.Header header, byte[] data, SimpleDateFormat sdf) {
super("接收", data.length, header, sdf);
this.data = data;
}
@Override
public String toString() {
return super.toString() + "Payload原始数据" + ByteUtil.byteArrToHex(data);
}
}

View File

@@ -0,0 +1,201 @@
package com.zhidao.adas.client.ui;
import android.app.Activity;
import android.graphics.PixelFormat;
import android.os.Handler;
import android.os.Message;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import com.zhidao.adas.client.R;
import com.zhidao.adas.client.utils.SysBarUtil;
import com.zhidao.adas.client.utils.image.ImageLoaderManager;
import java.lang.ref.WeakReference;
/**
* 摄像头数据展示
*
* @author xuxinchao
* @description
* @since: 2022/4/20
*/
public class BackCameraFloatWindow implements View.OnTouchListener {
private final Activity mContext;
private WindowManager.LayoutParams mWindowParams;
private WindowManager mWindowManager;
private View mFloatLayout;
private float mInViewX;
private float mInViewY;
private float mDownInScreenX;
private float mDownInScreenY;
private float mInScreenX;
private float mInScreenY;
private ImageView image_view;
public BackCameraFloatWindow(Activity context) {
this.mContext = context;
initHandler();
initFloatWindow();
}
private void initFloatWindow() {
LayoutInflater inflater = LayoutInflater.from(mContext);
if (inflater == null)
return;
mFloatLayout = (View) inflater.inflate(R.layout.layout_back_camera, null);
image_view = mFloatLayout.findViewById(R.id.image_view);
mFloatLayout.setOnTouchListener(this);
mWindowParams = new WindowManager.LayoutParams();
// mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
// if (Build.VERSION.SDK_INT >= 26) {//8.0新特性
// mWindowParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
// }else{
// mWindowParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
// }
mWindowManager = mContext.getWindowManager();
mWindowParams.format = PixelFormat.RGBA_8888;
mWindowParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
mWindowParams.gravity = Gravity.START | Gravity.TOP;
// mWindowParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
// mWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
mWindowParams.width = 1280;
mWindowParams.height = 720;
// mWindowParams.alpha = 0.9F;
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
return floatLayoutTouch(motionEvent);
}
private boolean floatLayoutTouch(MotionEvent motionEvent) {
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
// 获取相对View的坐标即以此View左上角为原点
mInViewX = motionEvent.getX();
mInViewY = motionEvent.getY();
// 获取相对屏幕的坐标,即以屏幕左上角为原点
mDownInScreenX = motionEvent.getRawX();
mDownInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
mInScreenX = motionEvent.getRawX();
mInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
break;
case MotionEvent.ACTION_MOVE:
// 更新浮动窗口位置参数
mInScreenX = motionEvent.getRawX();
mInScreenY = motionEvent.getRawY() - SysBarUtil.getSysBarHeight(mContext);
mWindowParams.x = (int) (mInScreenX - mInViewX);
mWindowParams.y = (int) (mInScreenY - mInViewY);
// 手指移动的时候更新小悬浮窗的位置
mWindowManager.updateViewLayout(mFloatLayout, mWindowParams);
break;
case MotionEvent.ACTION_UP:
// 如果手指离开屏幕时xDownInScreen和xInScreen相等且yDownInScreen和yInScreen相等则视为触发了单击事件。
if (mDownInScreenX == mInScreenX && mDownInScreenY == mInScreenY) {
}
break;
}
return true;
}
public void showFloatWindow(float y) {
if (mFloatLayout.getParent() == null) {
DisplayMetrics metrics = new DisplayMetrics();
// 默认固定位置,靠屏幕右边缘的中间
mWindowManager.getDefaultDisplay().getMetrics(metrics);
mWindowParams.x = metrics.widthPixels;
mWindowParams.y = (int) (y);
mWindowManager.addView(mFloatLayout, mWindowParams);
}
}
public void hideFloatWindow() {
if (mFloatLayout.getParent() != null)
mWindowManager.removeView(mFloatLayout);
}
public void setFloatLayoutAlpha(boolean alpha) {
if (alpha)
mFloatLayout.setAlpha((float) 0.5);
else
mFloatLayout.setAlpha(1);
}
public void onBackCameraVideo(byte[] data) {
Message msg = Message.obtain();
msg.obj = data;
msg.what = 1;
getHandler().sendMessage(msg);
}
private BaseHandler mBaseHandler;
/**
* 初始化一个Handler如果需要使用Handler先调用此方法
* 然后可以使用postRunnable(Runnable runnable)
* sendMessage在handleMessageMessage msg中接收msg
*/
public void initHandler() {
mBaseHandler = new BaseHandler(this);
}
/**
* 返回Handler在此之前确定已经调用initHandler
*
* @return Handler
*/
public Handler getHandler() {
return mBaseHandler;
}
/**
* 同Handler 的 handleMessage
* getHandler.sendMessage,发送的Message在此接收
* 在此之前确定已经调用initHandler
*
* @param msg
*/
protected void handleMessage(Message msg) {
switch (msg.what) {
case 1:
ImageLoaderManager.loadByteImage(mContext, (byte[]) msg.obj, image_view);
break;
}
}
protected static class BaseHandler extends Handler {
private final WeakReference<BackCameraFloatWindow> mObjects;
public BaseHandler(BackCameraFloatWindow mPresenter) {
mObjects = new WeakReference<BackCameraFloatWindow>(mPresenter);
}
@Override
public void handleMessage(Message msg) {
BackCameraFloatWindow mPresenter = mObjects.get();
if (mPresenter != null)
mPresenter.handleMessage(msg);
}
}
}

View File

@@ -32,6 +32,7 @@ public class InfoFragment extends BaseFragment {
private DataShowAdapter adapter;
private TextView tvTitle;
private String subTitle;
private BackCameraFloatWindow backCameraFloatWindow;
public InfoFragment() {
}
@@ -65,6 +66,27 @@ public class InfoFragment extends BaseFragment {
}
}
@Override
public void onPause() {
super.onPause();
hideFloatWindow();
}
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
if (hidden) {
hideFloatWindow();
}
}
private void hideFloatWindow() {
if (backCameraFloatWindow != null) {
backCameraFloatWindow.hideFloatWindow();
backCameraFloatWindow = null;
}
}
private void initView(View view) {
tvTitle = view.findViewById(R.id.tv_title);
RecyclerView rvInfo = view.findViewById(R.id.rv_info);
@@ -76,6 +98,23 @@ public class InfoFragment extends BaseFragment {
subTitle = null;
}
tvTitle.setGravity(Gravity.CENTER);
if (Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO.equals(title)) {
Button button = view.findViewById(R.id.btn_render);
button.setVisibility(View.VISIBLE);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (backCameraFloatWindow == null) {
backCameraFloatWindow = new BackCameraFloatWindow(getActivity());
final int[] location = new int[2];
button.getLocationOnScreen(location);
backCameraFloatWindow.showFloatWindow(location[1]);
} else {
hideFloatWindow();
}
}
});
}
//创建默认的线性LayoutManager 横向的GridLayoutManager
MyLinearLayoutManager linearLayoutManager = new MyLinearLayoutManager(this.getContext());
// linearLayoutManager.setStackFromEnd(true);//列表再底部开始展示,反转后由上面开始展示
@@ -162,6 +201,8 @@ public class InfoFragment extends BaseFragment {
adapter.setData(DataDistribution.getInstance().listPlanningDecisionState);
} else if (Constants.TITLE.RECEIVE_FUNCTION_STATES.equals(title)) {
adapter.setData(DataDistribution.getInstance().listFSMFunctionStates);
} else if (Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO.equals(title)) {
adapter.setData(DataDistribution.getInstance().listBackCameraVideo);
} else if (Constants.TITLE.RECEIVE_SWEEPER_TASK_INDEX_DATA.equals(title)) {
adapter.setData(DataDistribution.getInstance().listRoboSweeperTaskIndex);
} else {
@@ -197,4 +238,10 @@ public class InfoFragment extends BaseFragment {
adapter.refreshView();
}
}
public void onBackCameraVideo(byte[] data) {
if (backCameraFloatWindow != null) {
backCameraFloatWindow.onBackCameraVideo(data);
}
}
}

View File

@@ -57,8 +57,8 @@ import com.zhidao.adas.client.bean.ObuMap;
import com.zhidao.adas.client.bean.ObuRsi;
import com.zhidao.adas.client.bean.ObuRsm;
import com.zhidao.adas.client.bean.ObuSpat;
import com.zhidao.adas.client.bean.OriginalPointCloudData;
import com.zhidao.adas.client.bean.PerceptionTrafficLight;
import com.zhidao.adas.client.bean.ReceiveBytesData;
import com.zhidao.adas.client.bean.ReceiveData;
import com.zhidao.adas.client.bean.SpecialVehicleBean;
import com.zhidao.adas.client.bean.StatusInfo;
@@ -84,6 +84,8 @@ import com.zhidao.support.adas.high.common.ProtocolStatus;
import com.zhidao.support.adas.high.common.ReceiveTimeoutManager;
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
import org.jetbrains.annotations.NotNull;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
@@ -644,6 +646,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
titleFragmentData.add(Constants.TITLE.RECEIVE_OBU_RSM);
titleFragmentData.add(Constants.TITLE.RECEIVE_OBU_MAP);
titleFragmentData.add(Constants.TITLE.RECEIVE_SWEEPER_TASK_INDEX_DATA);
titleFragmentData.add(Constants.TITLE.RECEIVE_BACK_CAMERA_VIDEO);
titleFragmentData.add(Constants.TITLE.RECEIVE_WARN);
titleFragmentData.add(Constants.TITLE.RECEIVE_ERROR);
@@ -919,25 +922,31 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
//// LogSave.getInstance().saveLog("转换数据=" + data);
// }
// @Override
// public void onPointCloud(byte[] pointCloud) {
//// try {
//// MogoPointCloudOuterClass.MogoPointCloud pointCloud1 = MogoPointCloudOuterClass.MogoPointCloud.parseFrom(pointCloud);
//// HeaderOuterClass.Time time = pointCloud1.getHeader().getStamp();
//// int s = time.getSec();
//// int ns = time.getNsec();
//// long t = (long) (s * 1000L) + (long) (ns / 1000000.d);
//// Log.i(TAG, "PointCloud=" + sdf.format(new Date(t)));
//// } catch (InvalidProtocolBufferException e) {
//// e.printStackTrace();
//// }
//// try {
//// MogoPointCloudOuterClass.MogoPointCloud bean = MogoPointCloudOuterClass.MogoPointCloud.parseFrom(pointCloud);
//// Log.i("ddd","MogoPointCloud="+ TextFormat.printer().escapingNonAscii(false).printToString(bean));
//// } catch (InvalidProtocolBufferException e) {
//// e.printStackTrace();
//// }
// ReceiveBytesData base = new ReceiveBytesData(null, pointCloud, sdf);
// DataDistribution.getInstance().addData(base);
// }
//
@Override
public void onPointCloud(byte[] pointCloud) {
// try {
// MogoPointCloudOuterClass.MogoPointCloud pointCloud1 = MogoPointCloudOuterClass.MogoPointCloud.parseFrom(pointCloud);
// HeaderOuterClass.Time time = pointCloud1.getHeader().getStamp();
// int s = time.getSec();
// int ns = time.getNsec();
// long t = (long) (s * 1000L) + (long) (ns / 1000000.d);
// Log.i(TAG, "PointCloud=" + sdf.format(new Date(t)));
// } catch (InvalidProtocolBufferException e) {
// e.printStackTrace();
// }
// try {
// MogoPointCloudOuterClass.MogoPointCloud bean = MogoPointCloudOuterClass.MogoPointCloud.parseFrom(pointCloud);
// Log.i("ddd","MogoPointCloud="+ TextFormat.printer().escapingNonAscii(false).printToString(bean));
// } catch (InvalidProtocolBufferException e) {
// e.printStackTrace();
// }
OriginalPointCloudData base = new OriginalPointCloudData(pointCloud);
public void onPointCloud(MessagePad.Header header, byte[] pointCloud) {
ReceiveBytesData base = new ReceiveBytesData(header, pointCloud, sdf);
DataDistribution.getInstance().addData(base);
}
@@ -1041,6 +1050,16 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
DataDistribution.getInstance().addData(base);
}
@Override
public void onBackCameraVideo(@NotNull MessagePad.Header header, @NotNull byte[] data) {
if (fromFragment instanceof InfoFragment) {
InfoFragment fragment = (InfoFragment) fromFragment;
fragment.onBackCameraVideo(data);
}
ReceiveBytesData base = new ReceiveBytesData(header, data, sdf);
DataDistribution.getInstance().addData(base);
}
@Override
public void onSweeperTaskIndexData(MessagePad.Header header, RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex roboSweeperTaskIndex) {
ReceiveData base = new ReceiveData(header, roboSweeperTaskIndex, sdf);

View File

@@ -153,6 +153,7 @@ public class Constants {
String RECEIVE_CHASSIS_STATES = MessageType.TYPE_RECEIVE_CHASSIS_STATES.desc;
String RECEIVE_AUTOPILOT_STATE = MessageType.TYPE_RECEIVE_AUTOPILOT_STATE.desc;
String RECEIVE_FUNCTION_STATES = MessageType.TYPE_RECEIVE_FUNCTION_STATES.desc;
String RECEIVE_BACK_CAMERA_VIDEO = MessageType.TYPE_RECEIVE_BACK_CAMERA_VIDEO.desc;
String RECEIVE_REPORT_MESSAGE = MessageType.TYPE_RECEIVE_REPORT_MESSAGE.desc;
String RECEIVE_PERCEPTION_TRAFFIC_LIGHT = MessageType.TYPE_RECEIVE_PERCEPTION_TRAFFIC_LIGHT.desc;
String RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY = MessageType.TYPE_RECEIVE_PREDICTION_OBSTACLE_TRAJECTORY.desc;

View File

@@ -0,0 +1,99 @@
package com.zhidao.adas.client.utils.image;
/**
* Copyright (C) 2018 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import androidx.annotation.NonNull;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
import java.security.MessageDigest;
/**
* 高斯模糊
*/
public class BlurTransformation extends BitmapTransformation {
private static final int VERSION = 1;
private static final String ID ="com.zhidao.adas.client.utils.image.BlurTransformation." + VERSION;
private static int MAX_RADIUS = 25;
private static int DEFAULT_DOWN_SAMPLING = 1;
private int radius;
private int sampling;
public BlurTransformation() {
this(MAX_RADIUS, DEFAULT_DOWN_SAMPLING);
}
public BlurTransformation(int radius) {
this(radius, DEFAULT_DOWN_SAMPLING);
}
public BlurTransformation(int radius, int sampling) {
this.radius = radius;
this.sampling = sampling;
}
@Override
public String toString() {
return "BlurTransformation(radius=" + radius + ", sampling=" + sampling + ")";
}
@Override
protected Bitmap transform(@NonNull BitmapPool pool, @NonNull Bitmap toTransform, int outWidth, int outHeight) {
int width = toTransform.getWidth();
int height = toTransform.getHeight();
int scaledWidth = width / sampling;
int scaledHeight = height / sampling;
Bitmap bitmap = pool.get(scaledWidth, scaledHeight, Bitmap.Config.ARGB_4444);
Canvas canvas = new Canvas(bitmap);
canvas.scale(1 / (float) sampling, 1 / (float) sampling);
Paint paint = new Paint();
paint.setFlags(Paint.FILTER_BITMAP_FLAG);
canvas.drawBitmap(toTransform, 0, 0, paint);
bitmap = FastBlur.blur(bitmap, radius, true);
return bitmap;
}
@Override
public boolean equals(Object o) {
return o instanceof BlurTransformation &&
((BlurTransformation) o).radius == radius &&
((BlurTransformation) o).sampling == sampling;
}
@Override
public int hashCode() {
return ID.hashCode() + radius * 1000 + sampling * 10;
}
@Override
public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
messageDigest.update((ID + radius + sampling).getBytes(CHARSET));
}
}

View File

@@ -0,0 +1,257 @@
package com.zhidao.adas.client.utils.image;
import android.graphics.Bitmap;
/**
* Copyright (C) 2018 Wasabeef
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class FastBlur {
public static Bitmap blur(Bitmap sentBitmap, int radius, boolean canReuseInBitmap) {
// Stack Blur v1.0 from
// http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html
//
// Java Author: Mario Klingemann <mario at quasimondo.com>
// http://incubator.quasimondo.com
// created Feburary 29, 2004
// Android port : Yahel Bouaziz <yahel at kayenko.com>
// http://www.kayenko.com
// ported april 5th, 2012
// This is a compromise between Gaussian Blur and Box blur
// It creates much better looking blurs than Box Blur, but is
// 7x faster than my Gaussian Blur implementation.
//
// I called it Stack Blur because this describes best how this
// filter works internally: it creates a kind of moving stack
// of colors whilst scanning through the image. Thereby it
// just has to add one new block of color to the right side
// of the stack and remove the leftmost color. The remaining
// colors on the topmost layer of the stack are either added on
// or reduced by one, depending on if they are on the right or
// on the left side of the stack.
//
// If you are using this algorithm in your code please add
// the following line:
//
// Stack Blur Algorithm by Mario Klingemann <mario@quasimondo.com>
Bitmap bitmap;
if (canReuseInBitmap) {
bitmap = sentBitmap;
} else {
bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
}
if (radius < 1) {
return (null);
}
int w = bitmap.getWidth();
int h = bitmap.getHeight();
int[] pix = new int[w * h];
bitmap.getPixels(pix, 0, w, 0, 0, w, h);
int wm = w - 1;
int hm = h - 1;
int wh = w * h;
int div = radius + radius + 1;
int r[] = new int[wh];
int g[] = new int[wh];
int b[] = new int[wh];
int rsum, gsum, bsum, x, y, i, p, yp, yi, yw;
int vmin[] = new int[Math.max(w, h)];
int divsum = (div + 1) >> 1;
divsum *= divsum;
int dv[] = new int[256 * divsum];
for (i = 0; i < 256 * divsum; i++) {
dv[i] = (i / divsum);
}
yw = yi = 0;
int[][] stack = new int[div][3];
int stackpointer;
int stackstart;
int[] sir;
int rbs;
int r1 = radius + 1;
int routsum, goutsum, boutsum;
int rinsum, ginsum, binsum;
for (y = 0; y < h; y++) {
rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;
for (i = -radius; i <= radius; i++) {
p = pix[yi + Math.min(wm, Math.max(i, 0))];
sir = stack[i + radius];
sir[0] = (p & 0xff0000) >> 16;
sir[1] = (p & 0x00ff00) >> 8;
sir[2] = (p & 0x0000ff);
rbs = r1 - Math.abs(i);
rsum += sir[0] * rbs;
gsum += sir[1] * rbs;
bsum += sir[2] * rbs;
if (i > 0) {
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
} else {
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
}
}
stackpointer = radius;
for (x = 0; x < w; x++) {
r[yi] = dv[rsum];
g[yi] = dv[gsum];
b[yi] = dv[bsum];
rsum -= routsum;
gsum -= goutsum;
bsum -= boutsum;
stackstart = stackpointer - radius + div;
sir = stack[stackstart % div];
routsum -= sir[0];
goutsum -= sir[1];
boutsum -= sir[2];
if (y == 0) {
vmin[x] = Math.min(x + radius + 1, wm);
}
p = pix[yw + vmin[x]];
sir[0] = (p & 0xff0000) >> 16;
sir[1] = (p & 0x00ff00) >> 8;
sir[2] = (p & 0x0000ff);
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
rsum += rinsum;
gsum += ginsum;
bsum += binsum;
stackpointer = (stackpointer + 1) % div;
sir = stack[(stackpointer) % div];
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
rinsum -= sir[0];
ginsum -= sir[1];
binsum -= sir[2];
yi++;
}
yw += w;
}
for (x = 0; x < w; x++) {
rinsum = ginsum = binsum = routsum = goutsum = boutsum = rsum = gsum = bsum = 0;
yp = -radius * w;
for (i = -radius; i <= radius; i++) {
yi = Math.max(0, yp) + x;
sir = stack[i + radius];
sir[0] = r[yi];
sir[1] = g[yi];
sir[2] = b[yi];
rbs = r1 - Math.abs(i);
rsum += r[yi] * rbs;
gsum += g[yi] * rbs;
bsum += b[yi] * rbs;
if (i > 0) {
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
} else {
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
}
if (i < hm) {
yp += w;
}
}
yi = x;
stackpointer = radius;
for (y = 0; y < h; y++) {
// Preserve alpha channel: ( 0xff000000 & pix[yi] )
pix[yi] = (0xff000000 & pix[yi]) | (dv[rsum] << 16) | (dv[gsum] << 8) | dv[bsum];
rsum -= routsum;
gsum -= goutsum;
bsum -= boutsum;
stackstart = stackpointer - radius + div;
sir = stack[stackstart % div];
routsum -= sir[0];
goutsum -= sir[1];
boutsum -= sir[2];
if (x == 0) {
vmin[y] = Math.min(y + r1, hm) * w;
}
p = x + vmin[y];
sir[0] = r[p];
sir[1] = g[p];
sir[2] = b[p];
rinsum += sir[0];
ginsum += sir[1];
binsum += sir[2];
rsum += rinsum;
gsum += ginsum;
bsum += binsum;
stackpointer = (stackpointer + 1) % div;
sir = stack[stackpointer];
routsum += sir[0];
goutsum += sir[1];
boutsum += sir[2];
rinsum -= sir[0];
ginsum -= sir[1];
binsum -= sir[2];
yi += w;
}
}
bitmap.setPixels(pix, 0, w, 0, 0, w, h);
return (bitmap);
}
}

View File

@@ -0,0 +1,199 @@
package com.zhidao.adas.client.utils.image;
import android.content.Context;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.bumptech.glide.request.RequestOptions;
import java.io.File;
/**
* create by libo
* create on 2018/12/26
* description Glide图片加载工具类
*/
public class ImageLoaderManager {
/**
* 默认加载方式
*
* @param context
* @param url
* @param imageView
*/
public static void loadImage(Context context, String url, ImageView imageView) {
RequestOptions requestOptions = new RequestOptions()
.priority(Priority.HIGH)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.dontAnimate();
Glide.with(context)
.load(url)
.apply(requestOptions)
.transition(DrawableTransitionOptions.withCrossFade())
.into(imageView);
}
/**
* 加载圆形图片
*
* @param context
* @param url
* @param imageView
*/
public static void loadCircleImage(Context context, String url, ImageView imageView) {
RequestOptions requestOptions = new RequestOptions()
.priority(Priority.HIGH)
.dontAnimate()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.bitmapTransform(new CircleCrop());
Glide.with(context)
.load(url)
.apply(requestOptions)
.transition(DrawableTransitionOptions.withCrossFade())
.into(imageView);
}
/**
* 加载圆角图片
*
* @param context
* @param url
* @param imageView
* @param radius 圆角大小
*/
public static void loadRoundImage(Context context, String url, ImageView imageView, int radius) {
RequestOptions requestOptions = new RequestOptions()
.priority(Priority.HIGH)
.dontAnimate()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.transforms(new CenterCrop(), new RoundedCorners(radius));
Glide.with(context)
.load(url)
.apply(requestOptions)
.transition(DrawableTransitionOptions.withCrossFade())
.into(imageView);
}
/**
* 加载图片指定大小
*
* @param context
* @param url
* @param imageView
* @param width
* @param height
*/
public static void loadSizeImage(Context context, String url, ImageView imageView, int width, int height) {
RequestOptions requestOptions = new RequestOptions()
.priority(Priority.HIGH)
.override(width, height)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE);
Glide.with(context)
.load(url)
.apply(requestOptions)
.transition(DrawableTransitionOptions.withCrossFade())
.into(imageView);
}
/**
* 加载资源文件
*
* @param context
* @param resId
* @param imageView
*/
public static void loadImage(Context context, int resId, ImageView imageView) {
RequestOptions requestOptions = new RequestOptions()
.priority(Priority.HIGH)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.centerCrop();
Glide.with(context)
.load(resId)
.apply(requestOptions)
.into(imageView);
}
/**
* 加载本地图片文件
*
* @param context
* @param file
* @param imageView
*/
public static void loadFileImage(Context context, File file, ImageView imageView) {
RequestOptions requestOptions = new RequestOptions()
.priority(Priority.HIGH)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.centerCrop();
Glide.with(context)
.load(file)
.apply(requestOptions)
.into(imageView);
}
/**
* 加载字节数组
*
* @param context
* @param data
* @param imageView
*/
public static void loadByteImage(Context context, byte[] data, ImageView imageView) {
RequestOptions requestOptions = new RequestOptions()
.priority(Priority.HIGH)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.centerCrop();
Glide.with(context)
.load(data)
.apply(requestOptions)
.placeholder(imageView.getDrawable())
.into(imageView);
}
/**
* 加载高斯模糊
*
* @param context
* @param url
* @param imageView
* @param radius 模糊级数 最大25
*/
public static void loadBlurImage(Context context, String url, ImageView imageView, int radius) {
RequestOptions requestOptions = new RequestOptions()
.override(300)
.transforms(new BlurTransformation(radius));
Glide.with(context)
.load(url)
.apply(requestOptions)
.transition(DrawableTransitionOptions.withCrossFade())
.into(imageView);
}
/**
* 加载gif图
*
* @param context
* @param url
* @param imageView
*/
public static void loadGifImage(Context context, String url, ImageView imageView) {
Glide.with(context)
.load(url)
.into(imageView);
}
}

View File

@@ -24,6 +24,21 @@
android:textSize="16sp"
android:textStyle="bold" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_render"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_gravity="center_vertical"
android:layout_marginEnd="5dp"
android:background="@drawable/btn_bg"
android:text="渲染"
android:textColor="@color/colorWhile"
android:textSize="16dp"
android:textStyle="bold"
android:visibility="gone" />
</RelativeLayout>
<LinearLayout

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#000" />

View File

@@ -26,6 +26,7 @@ import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.AppCompatButton;
import androidx.recyclerview.widget.GridLayoutManager;
@@ -45,11 +46,13 @@ import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.AdasOptions;
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.common.ProtocolStatus;
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
import org.jetbrains.annotations.NotNull;
import java.net.Inet4Address;
import java.net.InetAddress;
@@ -500,7 +503,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
@Override
public void onPointCloud(byte[] pointCloud) {
public void onPointCloud(MessagePad.Header header, byte[] pointCloud) {
}
@Override
@@ -573,6 +576,11 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
}
@Override
public void onBackCameraVideo(@NonNull MessagePad.Header header, @NonNull byte[] data) {
}
@Override
public void onSweeperTaskIndexData(MessagePad.Header header, RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex roboSweeperTaskIndex) {

View File

@@ -226,9 +226,9 @@ ext {
commonIndependentAmapApiValue : "1c3fbc5f5e183619ffb1e7bc01e6751f",
compileSdkVersion : 29,
buildToolsVersion : "29.0.2",
minSdkVersion : 27,
minSdkVersion : 23,
targetSdkVersion : 27,
minSdkVersionPadLenovo : 27,
minSdkVersionPadLenovo : 23,
targetSdkVersionPadLenovo : 27,
koomxhook : "com.kuaishou.koom:xhook-static:2.2.0",
]

View File

@@ -14,7 +14,7 @@ interface IDispatchAdasApiService {
* @return [BaseData]
*/
@FormUrlEncoded
@POST("eagle-eye-dns/eagle-eye-dns/dataService/autoDriver/receiveCarPreSetPath")
@POST("eagle-eye-dns/dataService/autoDriver/receiveCarPreSetPath")
fun uploadAutopilotRoute(@FieldMap parameters: Map<String, String>): Observable<BaseData>
/**

View File

@@ -10,7 +10,7 @@ import retrofit2.http.POST
interface ILineUploadApi {
@Headers("Content-type:application/json;charset=UTF-8" )
@POST( "/yycp-data-center-service/carTrack/receiveCarTrack/" )
@POST( "eagle-eye-dns/yycp-data-center-service/carTrack/receiveCarTrack/" )
fun uploadLineId(@Body lineId: LineUploadData): Observable<BaseData>
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.function.biz.v2x.road
import android.content.Context
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.HostConst.DATA_CENTER_HOST
import com.mogo.commons.constants.HostConst.getEagleHost
import com.mogo.eagle.core.data.v2x.LineUploadData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
@@ -54,7 +55,7 @@ class LineUploadManager private constructor(context: Context) : IMoGoAutopilotSt
private fun uploadLine(lineId: Long) {
val lineUploadData = LineUploadData(lineId, MoGoAiCloudClientConfig.getInstance().sn)
disposable = MoGoRetrofitFactory.getInstance(DATA_CENTER_HOST)
disposable = MoGoRetrofitFactory.getInstance(getEagleHost())
.create(ILineUploadApi::class.java)
.uploadLineId(lineUploadData)
.subscribeOn(Schedulers.io())

View File

@@ -159,9 +159,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
handleWarningTargetEvent(event.data)
}
is V2XEvent.RoadAI -> {
if (FunctionBuildConfig.isV2NFromCar) {
return
}
handleRoadMarkerEvent(event.data.toRoadMarker())
}
is V2XEvent.RoadEventX -> {
@@ -173,12 +170,16 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
}
}
@SuppressLint("NewApi")
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_CLOUD_V2N,
linkCode = CHAIN_LINK_CLOUD,
endpoint = TracingConstants.Endpoint.PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_CLOUD_V2N,
paramIndexes = [0],
clientPkFileName = "sn"
)
override fun onAutopilotIdentifyPlanningObj(planningObjects: List<MessagePad.PlanningObject>?) {
super.onAutopilotIdentifyPlanningObj(planningObjects)
if (!FunctionBuildConfig.isV2NFromCar) {
return
}
planningObjects?.let {
if (it.isNotEmpty()) {
val first = it.stream()

View File

@@ -12,6 +12,7 @@ class AiCloudSocketBizProvider : IMoGoFunctionServerProvider {
get() = "AiCloudSocketBizProvider"
override fun init(context: Context?) {
//todo bus加载
context?.let {
SocketManager.getInstance().init(it, 0.0, 0.0)
SocketManager.getInstance().registerOnMessageListener(401012, V2XMessageListener401012())

View File

@@ -134,8 +134,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
if (gnssInfo != null) {
if (1 == FunctionBuildConfig.gpsProvider) {
// 同步给MAP地图
//CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(gnssInfo)
// 同步更新经纬度和系统时间至 AutoPilotStatusListener
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(
gnssInfo.satelliteTime,
@@ -146,7 +144,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
}
/**
* 老底盘信息,透传底盘状态pb参考底盘
* TODO 目前由于M1车型不会在新底盘PB添加新的字段 所以临时保留
@@ -369,7 +366,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
//他车轨迹预测
}
override fun onPointCloud(pointCloud: ByteArray?) {
override fun onPointCloud(header: MessagePad.Header, pointCloud: ByteArray?) {
//点云数据透传
CallerAutopilotPointCloudListenerManager.invokeAutopilotPointCloudDataUpdate(pointCloud)
}
@@ -595,6 +592,16 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
}
/**
* 清扫车后部摄像头视频 10Hz
*
* @param header 头
* @param data 数据
*/
override fun onBackCameraVideo(header: MessagePad.Header, data: ByteArray) {
CallerSweeperFutianBackCameraVideoListenerManager.invokeSweeperFutianBackCameraVideo(data)
}
/**
* 清扫车指标数据
*

View File

@@ -6,8 +6,6 @@ import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuProvider
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.CommonUtils
@@ -24,13 +22,12 @@ class MoGoObuProvider : IMoGoObuProvider {
get() = TAG
override fun onDestroy() {
MogoObuDcCombineManager.INSTANCE.destoryListener()
}
override fun init(context: Context) {
//obu融合数据
MogoObuDcCombineManager.INSTANCE.init(context)
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
//bus乘客版本obu功能去掉大理项目需要全部车辆接收不再限制
mContext = context

View File

@@ -56,19 +56,27 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
override fun onMoGoObuRsiWarning(rsiWarningData: ObuScene.RsiWarningData) {
onMogoObuDcRsiWarning(rsiWarningData)
if (HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcRsiWarning(rsiWarningData)
}
}
override fun onMoGoObuRsmWarning(rsmWarningData: ObuScene.RsmWarningData) {
onMogoObuDcRsmWarning(rsmWarningData)
if (HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcRsmWarning(rsmWarningData)
}
}
override fun onMoGoObuSpatWarning(spatWarningData: ObuScene.SpatWarningData) {
onMogoObuDcSpatWarning(spatWarningData)
if (HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcSpatWarning(spatWarningData)
}
}
override fun onMoGoObuMapMath(mapMatchData: ObuScene.MapMatchData) {
onMogoObuMapMath(mapMatchData)
if (HmiBuildConfig.isShowObuV2iView) {
onMogoObuMapMath(mapMatchData)
}
}
/**
@@ -119,13 +127,13 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //事件才有影响范围
alertContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
}
@@ -202,11 +210,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //标牌是没有影响范围的
alertContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString()
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString()
)
}
@@ -217,13 +225,13 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //事件才有影响范围
alertContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
}
@@ -237,16 +245,18 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${rsiWarningData.warningMsgList[0].distance} ---eventRadius = ${rsiWarningData.warningMsgList[0].eventRadius} --speedMaxLimit = ${rsiWarningData.warningMsgList[0].speedMaxLimit}"
)
"MogoObuDcCombineManager ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${rsiWarningData.warningMsgList[0].distance} ---eventRadius = ${rsiWarningData.warningMsgList[0].eventRadius} --speedMaxLimit = ${rsiWarningData.warningMsgList[0].speedMaxLimit}")
when (status) {
// 添加
MogoObuConstants.STATUS.ADD -> {
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuToDcData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
//大于10m才提示rsi
if (Math.round(rsiWarningData.warningMsgList[0].distance) > 10) {
saveObuToDcData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
}
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
@@ -380,33 +390,31 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
* 地图匹配 是OBU算法输出地图匹配结果主车匹配道路哪条路或者哪条车道
*/
fun onMogoObuMapMath(data: ObuScene.MapMatchData?) {
if (HmiBuildConfig.isShowObuLimitSpeedView) {
if (data != null) {
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${
Math.round(
(data.speedMaxLimit * 0.02 * 3.6)
)
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
)
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
CallerLimitingVelocityListenerManager.invokeUnion(
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
DataSourceType.OBU
)
}
if (data != null) {
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${
Math.round(
(data.speedMaxLimit * 3.6)
)
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
)
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
CallerLimitingVelocityListenerManager.invokeUnion(
(data.speedMaxLimit * 3.6).roundToInt(),
DataSourceType.OBU
)
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
}
MogoObuConstants.STATUS.DELETE -> { // 删除
CallerLimitingVelocityListenerManager.invokeUnion(
-1,
DataSourceType.OBU
)
}
MogoObuConstants.STATUS.DELETE -> { // 删除
CallerLimitingVelocityListenerManager.invokeUnion(
-1,
DataSourceType.OBU
)
}
}
}
@@ -521,15 +529,15 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
"MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
)
val adviceSpeed =
"${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${
"${Math.round(currentLight.suggestMinSpeed * 3.6)} - ${
Math.round(
currentLight.suggestMaxSpeed * 3.6 * 0.02
currentLight.suggestMaxSpeed * 3.6
)
}"
val adviceSpeedTts =
"${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${
"${Math.round(currentLight.suggestMinSpeed * 3.6)} - ${
Math.round(
currentLight.suggestMaxSpeed * 3.6 * 0.02
currentLight.suggestMaxSpeed * 3.6
)
}"
@@ -566,7 +574,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
// 红灯
2, 3 -> {
val red = (currentLight.countDown / 10).toInt()
val red = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.RED,
red,
@@ -575,7 +583,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
// 绿灯
4, 5, 6 -> {
val green = (currentLight.countDown / 10).toInt()
val green = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.GREEN,
green,
@@ -584,7 +592,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
// 黄灯
7, 8 -> {
val yellow = (currentLight.countDown / 10).toInt()
val yellow = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.YELLOW,
yellow,

View File

@@ -407,6 +407,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
alertContent = EventTypeEnumNew.getWarningContent(appId)
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //标牌是没有影响范围的
alertContent,
Math.round(data.warningMsgList[0].distance).toString()
@@ -455,8 +456,11 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
//大于10m才提示rsi
if (Math.round(data.warningMsgList[0].distance) > 10) {
saveObuData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
}
// 更新数据
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)
@@ -661,7 +665,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
/**
* 构造对应展示数据和场景 根据obu的场景add change delete确定是否展示
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容
* @see com.mogo.module.common.enums.EventTypeEnumNew
* EventTypeEnumNew在定义的id为了防止重复和原始数据是不一样的有对应关系
*/
@@ -806,7 +810,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType
}
}
when (status) {

View File

@@ -50,9 +50,11 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight
private var mContext: Context? = null
//是否有AI获取红绿灯灯态
@Volatile
private var hasAiLightStatus: Boolean = false
//obu数据
@Volatile
private var hasObuLightStatus: Boolean = false
fun initServer(context: Context) {

View File

@@ -1,26 +1,35 @@
package com.mogo.eagle.core.function.msgbox
import android.annotation.SuppressLint
import android.content.Context
import android.os.Looper
import com.mogo.eagle.core.data.deva.report.ReportEntity
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.deva.report.ReportEntity
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb
import com.mogo.eagle.core.function.msgbox.db.MsgBoxInfo
import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.ProcessUtils
import com.mogo.eagle.core.utilcode.util.SPUtils
import com.mogo.eagle.core.utilcode.util.Utils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.io.File
import java.text.SimpleDateFormat
import java.util.*
object DataManager {
// private val msgBoxMap: EnumMap<MsgBoxType, MutableList<MsgBoxBean>> = EnumMap(MsgBoxType::class.java)
const val TAG = "DataManager"
// 消失时间5000ms
const val DISMISS_TIME = 5000L
@@ -148,6 +157,10 @@ object DataManager {
* 从本地数据库中查询数据
*/
fun queryAllMessages(context: Context) {
if (!ProcessUtils.isMainProcess(context)) {
return
}
clearMessageBoxTable(context)
scope.launch {
initCache()
try {
@@ -158,6 +171,38 @@ object DataManager {
}
}
@SuppressLint("SimpleDateFormat")
private fun clearMessageBoxTable(context: Context) {
Thread {
val lastLaunchTimeStr = SPUtils.getInstance().getString("last_launch", "")
val format = SimpleDateFormat("yyyy-MM-dd")
val currDate = Date(System.currentTimeMillis())
val currTimeStr = format.format(currDate)
try {
if (lastLaunchTimeStr != null && lastLaunchTimeStr.isNotEmpty()) {
val isSameDay = currTimeStr == lastLaunchTimeStr
// 超过一天需要清除消息盒子中的数据并把时间戳存入SP
if (!isSameDay) {
val file: File = context.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME)
if (file != null && file.exists()) {
context.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME)
}
SPUtils.getInstance().put("last_launch", currTimeStr)
}
} else {
// 首次使用App或中途仅删除sp文件
val file: File = context.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME)
if (file != null && file.exists()) {
context.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME)
}
SPUtils.getInstance().put("last_launch", currTimeStr)
}
} catch (e: Exception) {
e(TAG, e.message)
}
}.start()
}
private fun initCache() {
if (cacheNotifyList.isNotEmpty()) {
cacheNotifyList.clear()
@@ -170,86 +215,87 @@ object DataManager {
}
}
private suspend fun getCacheMessages(context: Context): List<MsgBoxBean> = withContext(Dispatchers.IO) {
delay(2000)
return@withContext MsgBoxDb.getDb(context)
.monitorDao()
.getAllCachedMessages()
.map { msgInfo ->
val json = msgInfo.bean2Json
when (msgInfo.obj2JsonType) {
MsgBoxType.V2X.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.V2X,
GsonUtils.fromJson(json, V2XMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
private suspend fun getCacheMessages(context: Context): List<MsgBoxBean> =
withContext(Dispatchers.IO) {
delay(2000)
return@withContext MsgBoxDb.getDb(context)
.monitorDao()
.getAllCachedMessages()
.map { msgInfo ->
val json = msgInfo.bean2Json
when (msgInfo.obj2JsonType) {
MsgBoxType.V2X.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.V2X,
GsonUtils.fromJson(json, V2XMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
}
MsgBoxType.OBU.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.OBU,
GsonUtils.fromJson(json, V2XMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
MsgBoxType.OBU.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.OBU,
GsonUtils.fromJson(json, V2XMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
}
MsgBoxType.OPERATION.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.OPERATION,
GsonUtils.fromJson(json, OperationMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
MsgBoxType.OPERATION.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.OPERATION,
GsonUtils.fromJson(json, OperationMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
}
MsgBoxType.REPORT.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.REPORT,
GsonUtils.fromJson(json, ReportEntity::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheSysInfoList.add(this@apply)
MsgBoxType.REPORT.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.REPORT,
GsonUtils.fromJson(json, ReportEntity::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheSysInfoList.add(this@apply)
}
}
}
}
MsgBoxType.RECORD.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.RECORD,
GsonUtils.fromJson(json, RecordBagMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheRecordList.add(this@apply)
MsgBoxType.RECORD.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.RECORD,
GsonUtils.fromJson(json, RecordBagMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheRecordList.add(this@apply)
}
}
}
}
MsgBoxType.NOTICE.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.NOTICE,
GsonUtils.fromJson(json, NoticeFrCloudMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
MsgBoxType.NOTICE.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.NOTICE,
GsonUtils.fromJson(json, NoticeFrCloudMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
}
else -> {
return@map MsgBoxBean(MsgBoxType.V2X, V2XMsg())
else -> {
return@map MsgBoxBean(MsgBoxType.V2X, V2XMsg())
}
}
}
}
}
}
/**
* 存储到本地数据库
@@ -298,7 +344,8 @@ object DataManager {
fun delMsgBoxBean(context: Context, msgBoxBean: MsgBoxBean) {
scope.launch {
withContext(Dispatchers.Default) {
val msgBoxInfo = MsgBoxInfo(msgBoxBean.bean2Json, msgBoxBean.type.ordinal, msgBoxBean.timestamp)
val msgBoxInfo =
MsgBoxInfo(msgBoxBean.bean2Json, msgBoxBean.type.ordinal, msgBoxBean.timestamp)
MsgBoxDb.getDb(context)
.monitorDao()
.deleteMsg(msgBoxInfo)

View File

@@ -173,9 +173,6 @@ class DevaToolsProvider : IDevaToolsProvider {
override fun updateUpgradeProgress() {
upgradeManager.updateUpgradeProgress(mContext!!)
}
override fun updateObuUpgradeStatus() {
upgradeManager.updateObuUpgradeStatus(mContext!!)
}

View File

@@ -86,10 +86,18 @@ class BindingCarNetWorkManager private constructor() {
SharedPrefsConstants.CAR_INFO,
GsonUtils.toJson(info.getData())
)
} else {
// SharedPrefsMgr.getInstance(context).putString(
// SharedPrefsConstants.CAR_INFO, "null")
e(
SceneConstant.M_BINDING + TAG, "getBindingCarInfo data = null "
)
}
}
override fun onError(e: Throwable) {
// SharedPrefsMgr.getInstance(context).putString(
// SharedPrefsConstants.CAR_INFO, e.message.toString())
e(
SceneConstant.M_BINDING + TAG,
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message

View File

@@ -9,6 +9,7 @@ import android.content.Intent
import android.content.IntentFilter
import android.view.KeyEvent
import com.mogo.commons.context.ContextHolderUtil
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.deva.mofang.MfConstants
import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorChangeLaneLeft
@@ -46,7 +47,6 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
private lateinit var mBluetoothAdapter: BluetoothAdapter
private var isMfConnect: Boolean = false //添加状态判断
private val isShowToast = false //toast 控制,自测使用
private var startPressTime: Long = 0 //开始按键时间
private var isPressEnd = false //按键是否结束
@Volatile
@@ -171,23 +171,23 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
startPressTime = System.currentTimeMillis()
}
e(M_F + "MoFangManager",
"dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ")
"dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ---HmiBuildConfig.isShowMfToastView = ${HmiBuildConfig.isShowMfToastView}")
if (keyCode == KeyEvent.KEYCODE_A) { //单击 -1长按无操作AB组合-2
if (action == KeyEvent.ACTION_DOWN) {
pressADownTime = System.currentTimeMillis()
d(M_F + "MoFangManager",
"dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime)
if (pressADownTime - startPressTime in (clickTimeInterval + 1) until longPressTime && pressBDownTime > 0) {
if (isShowToast) {
ToastUtils.showShort("方块 A 按AB组合 +1 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 A 按AB组合 +1 timeInterval: ${pressADownTime - startPressTime}ms---$pressBDownTime")
}
sendAcc(true, +1.0)
isCombinationKey = 3
}
if (isCombinationKey != 3 && isCombinationKey != 1) {
if (pressADownTime - startPressTime > longPressTimeInterval) {
if (isShowToast) {
ToastUtils.showShort("方块 长按A -2 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 长按A -2 timeInterval: ${pressADownTime - startPressTime}ms")
}
sendAcc(true, -2.0)
isCombinationKey = 2
@@ -199,8 +199,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
"dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime + "---isCombinationKey = $isCombinationKey")
if (pressAUpTime - startPressTime < clickTime && isCombinationKey != 3) {
isCombinationKey = 1
if (isShowToast) {
ToastUtils.showShort("方块 单击A -1 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 单击A -1 timeInterval: ${pressAUpTime - startPressTime}ms")
}
sendAcc(true, -1.0)
}
@@ -215,16 +215,16 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
"dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime
)
if (pressBDownTime - startPressTime > clickTimeInterval && pressBDownTime - startPressTime < longPressTime && pressADownTime > 0) {
if (isShowToast) {
ToastUtils.showShort("方块 B 按AB组合 +1 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 B 按AB组合 +1 timeInterval: ${pressBDownTime - startPressTime}ms ---pressADownTime = $pressADownTime ")
}
sendAcc(true, +1.0)
isCombinationKey = 3
}
if (isCombinationKey != 3 && isCombinationKey != 1) {
if (pressBDownTime - startPressTime > longPressTimeInterval) {
if (isShowToast) {
ToastUtils.showShort("方块 长按B 无操作 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 长按B 无操作 timeInterval: ${pressBDownTime - startPressTime}ms")
}
isCombinationKey = 2
}
@@ -234,8 +234,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime + "----isCombinationKey = $isCombinationKey")
if (pressBUpTime - startPressTime < clickTime && isCombinationKey != 3) {
if (isShowToast) {
ToastUtils.showShort("方块 单击B 0 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 单击B 0 timeInterval: ${pressBUpTime - startPressTime}ms")
}
sendAcc(false, 0.0)
isCombinationKey = 1
@@ -250,8 +250,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 长按C 无操作 time dif = " + (pressCDownTime - startPressTime))
if (pressCDownTime - startPressTime > longPressTimeInterval) {
if (isShowToast) {
ToastUtils.showShort("方块 长按C 无操作 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 长按C 无操作 timeInterval: ${pressCDownTime - startPressTime}ms")
}
}
} else if (action == KeyEvent.ACTION_UP) {
@@ -260,8 +260,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 单击C ← 向左变道 time dif = " + (pressCUpTime - startPressTime))
if (pressCUpTime - startPressTime < clickTime) {
if (isShowToast) {
ToastUtils.showShort("方块 单击C ← 向左变道 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 单击C ← 向左变道 timeInterval: ${pressCUpTime - startPressTime}ms")
}
sendOperatorChangeLaneLeft()
}
@@ -272,8 +272,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 长按D 无操作 time dif = " + (pressDDownTime - startPressTime))
if (pressDDownTime - startPressTime > longPressTimeInterval) {
if (isShowToast) {
ToastUtils.showShort("方块 长按D 无操作 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 长按D 无操作 timeInterval: ${pressDDownTime - startPressTime}ms")
}
}
} else if (action == KeyEvent.ACTION_UP) {
@@ -282,8 +282,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 单击D → 向右变道 time dif = " + (pressDUpTime - startPressTime))
if (pressDUpTime - startPressTime < clickTime) {
if (isShowToast) {
ToastUtils.showShort("方块 单击D → 向右变道 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 单击D → 向右变道 timeInterval: ${pressDUpTime - startPressTime}ms")
}
sendOperatorChangeLaneRight()
}
@@ -294,8 +294,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 长按E 鸣笛 time dif = " + (pressEDownTime - startPressTime))
if (pressEDownTime - startPressTime > longPressTimeInterval) {
if (isShowToast) {
ToastUtils.showShort("方块 长按E 鸣笛 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 长按E 鸣笛 timeInterval: ${pressEDownTime - startPressTime}ms")
}
sendOperatorSetHorn(1.0)
if (timerHorn == null) {
@@ -314,8 +314,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"方块 单击E 开启自动驾驶 time dif = " + (pressEUpTime - startPressTime))
if (pressEUpTime - startPressTime < clickTime) {
if (isShowToast) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 ")
if (HmiBuildConfig.isShowMfToastView) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 timeInterval: ${pressEUpTime - startPressTime}ms")
}
startAutoPilot(getAutoPilotStatusInfo().autopilotControlParameters)
}

View File

@@ -83,7 +83,7 @@ class SceneManager {
}
}
//call back
CallerDevaToolsListenerManager.invokeDevaToolsModuleLogChanges(sceneModuleTAG.map)
// CallerDevaToolsListenerManager.invokeDevaToolsModuleLogChanges(sceneModuleTAG.map)
}
}

View File

@@ -1,8 +1,6 @@
package com.zhjt.mogo_core_function_devatools.upgrade
import android.app.NotificationManager
import android.content.Context
import androidx.core.app.NotificationCompat
import com.elegant.utils.UiThreadHandler
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.function.api.devatools.IMogoDevaToolsUpgradeListener
@@ -128,31 +126,20 @@ class UpgradeManager : IDownload {
}
/**
* 鹰眼app下载监听 liyz
* 鹰眼app下载监听
*/
fun updateUpgradeProgress(context: Context) {
val builder = NotificationCompat.Builder(context)
// builder.setSmallIcon(R.mipmap.icon1001);//todo emArrow 更换图标,去除地图下载图标的依赖关系
builder.setContentTitle("下载")
builder.setContentText("正在下载")
val manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
CallerDevaToolsUpgradeListenerManager.addListener(
TAG,
object : IMogoDevaToolsUpgradeListener {
override fun onStart(url: String?) {}
override fun onPause(url: String?) {}
override fun onProgress(url: String?, length: Int) {
builder.setProgress(100, length, false)
manager.notify(0x3, builder.build())
//下载进度提示
builder.setContentText("已下载$length%")
updateStatusBarDownloadView(true, "download", length)
}
override fun onFinished(url: String?) {
builder.setContentText("已下载" + 100 + "%")
UiThreadHandler.postDelayed({
manager.cancel(0x3)
updateStatusBarDownloadView(false, "download", 100)
}, 1000)
}

View File

@@ -98,20 +98,20 @@
</activity>
<activity
android:name="com.mogo.eagle.core.function.main.VideoAdAtc"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
android:enabled="true"
android:exported="true"
android:process=":video_ad"
android:resizeableActivity="false"
android:resumeWhilePausing="true"
android:screenOrientation="landscape"
android:stateNotNeeded="true"
android:theme="@style/Main"
android:windowSoftInputMode="adjustPan|stateHidden">
<!-- <activity-->
<!-- android:name="com.mogo.eagle.core.function.main.VideoAdAtc"-->
<!-- android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"-->
<!-- android:enabled="true"-->
<!-- android:exported="true"-->
<!-- android:process=":video_ad"-->
<!-- android:resizeableActivity="false"-->
<!-- android:resumeWhilePausing="true"-->
<!-- android:screenOrientation="landscape"-->
<!-- android:stateNotNeeded="true"-->
<!-- android:theme="@style/Main"-->
<!-- android:windowSoftInputMode="adjustPan|stateHidden">-->
</activity>
<!-- </activity>-->
<activity
android:name="com.mogo.eagle.core.function.main.AppListActivity"

View File

@@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.data.msgbox.OperationMsg
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
@@ -62,6 +63,16 @@ class MMsgBoxBubbleView @JvmOverloads constructor(
mMsgBoxBubbleAdapter?.setData(dataList)
}
}
if(msgBoxList.type == MsgBoxType.OPERATION){
if((msgBoxList.bean as OperationMsg).type == 2){
MsgBoxConfig.noticeList.add(msgBoxList)
if(isShowData){
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
dataList.add(msgBoxList)
mMsgBoxBubbleAdapter?.setData(dataList)
}
}
}
}
}
}

View File

@@ -10,6 +10,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.data.msgbox.OperationMsg
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
@@ -64,6 +65,15 @@ class MMsgBoxListView @JvmOverloads constructor(
mMsgBoxListAdapter?.setData(it)
}
}
if(msgBoxList.type == MsgBoxType.OPERATION){
if((msgBoxList.bean as OperationMsg).type == 2){
noticeList?.add(0,msgBoxList)
noticeList?.let {
mMsgBoxListAdapter?.setData(it)
}
}
}
}
}
}

View File

@@ -367,7 +367,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
TimeUtils.millis2String(it[position].timestamp, getHourMinFormat())
holder.tvV2XContent.text = v2XMsg.content
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type))
)
}
}

View File

@@ -28,6 +28,7 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
private val notice: Int = 1
private val v2x: Int = 2
private val summary: Int = 3
private val operation: Int = 4
var countDownTimer: CountDownTimer?=null
@@ -49,6 +50,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_summary,parent,false)
BubbleSummaryHolder(view)
}
operation -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_operation,parent,false)
BubbleOperationHolder(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_box_v2x,parent,false)
BubbleV2XHolder(view)
@@ -120,6 +125,13 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
}
}
}
is BubbleOperationHolder ->{
data?.let {
val operationMsg = it[position].bean as OperationMsg
holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMOperationContent.text = operationMsg.content
}
}
}
val msgBoxBean: MsgBoxBean = data!![position]
@@ -146,6 +158,8 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
summary
}else if(data!![position].type == MsgBoxType.OPERATION){
operation
} else{
v2x
}
@@ -175,4 +189,10 @@ class MMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView.Adapter
var tvMSummaryTime: TextView = itemView.findViewById(R.id.tvMSummaryTime)
}
//通知消息
class BubbleOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvMOperationTime: TextView = itemView.findViewById(R.id.tvMOperationTime)
var tvMOperationContent: TextView = itemView.findViewById(R.id.tvMOperationContent)
}
}

View File

@@ -9,10 +9,7 @@ import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
import com.mogo.eagle.core.function.hmi.R
@@ -28,6 +25,7 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
private val notice: Int = 1
private val v2x: Int = 2
private val summary: Int = 3
private val operation: Int = 4
fun setData(data: List<MsgBoxBean>){
this.data = data
@@ -44,6 +42,10 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_summary,parent,false)
ListSummaryHolder(view)
}
operation -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_operation,parent,false)
ListOperationHolder(view)
}
else -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_m_msg_list_v2x,parent,false)
ListV2XHolder(view)
@@ -111,6 +113,13 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
}
}
}
is ListOperationHolder -> {
data?.let {
val operationMsg = it[position].bean as OperationMsg
holder.tvMOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvMOperationContent.text = operationMsg.content
}
}
}
}
@@ -121,7 +130,9 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
notice
}else if(data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY){
summary
} else{
}else if(data!![position].type == MsgBoxType.OPERATION){
operation
}else{
v2x
}
}
@@ -149,4 +160,10 @@ class MMsgBoxListAdapter(private val activity: Activity): RecyclerView.Adapter<R
var tvMSummaryTime: TextView = itemView.findViewById(R.id.tvMSummaryTime)
}
//运营消息
class ListOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvMOperationTime: TextView = itemView.findViewById(R.id.tvMOperationTime)
var tvMOperationContent: TextView = itemView.findViewById(R.id.tvMOperationContent)
}
}

View File

@@ -9,6 +9,7 @@ import android.graphics.Color
import android.os.Build
import android.text.Html
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.annotation.RequiresApi
@@ -21,6 +22,7 @@ import chassis.Chassis
import chassis.ChassisStatesOuterClass
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.app.AppConfigInfo
@@ -76,6 +78,8 @@ import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import kotlinx.android.synthetic.main.view_debug_setting.view.tbRouteDynamicEffect
import kotlinx.android.synthetic.main.view_sop_setting.view.*
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
@@ -123,6 +127,7 @@ internal class DebugSettingView @JvmOverloads constructor(
private var logInfoView: LogInfoView? = null
private var logViewAttach = false
@Volatile
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
private var mGnssInfo: MogoLocation? = null
@@ -132,15 +137,19 @@ internal class DebugSettingView @JvmOverloads constructor(
private var accelerationThresholdNum: Double = 0.0
// 感知识别「已知类型」数据个数
@Volatile
private var mIdentifyDataSize = 0
// 感知识别「未知类型」数据个数
@Volatile
private var mUnknownIdentifyDataSize = 0
// 引导线点个数
@Volatile
private var mTrajectoryInfoSize = 0
// 全局路径规划点个数
@Volatile
private var mRouteInfoSize = 0
//日志过滤标签集合
@@ -208,7 +217,6 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerChassisGearStateListenerManager.addListener(TAG, this)
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
CallerChassisThrottleStateListenerManager.addListener(TAG, this)
//添加 开发套件工具接口 监听
CallerDevaToolsListenerManager.addListener(TAG, this)
//添加 底盘灯光数据 监听
@@ -259,6 +267,7 @@ internal class DebugSettingView @JvmOverloads constructor(
CallerChassisLamplightListenerManager.removeListener(TAG)
// 移除 obu获取信息 监听
CallerObuInfoListenerManager.removeListener(TAG)
// 移除 业务配置监听
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(
FuncBizConfig.FOUNDATION,
@@ -296,21 +305,22 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
/**
* 魔戒控制
*/
tbMojie.setOnCheckedChangeListener { buttonView, isChecked ->
if (isChecked) {
buttonView.setCompoundDrawables(null, null, iconDown, null)
btnOpenAllGestures.visibility = View.VISIBLE
tbOpenMfView.visibility = View.VISIBLE
} else {
buttonView.setCompoundDrawables(null, null, iconRight, null)
btnOpenAllGestures.visibility = View.GONE
tbOpenMfView.visibility = View.GONE
}
}
btnOpenAllGestures.setOnClickListener {
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
/**
* 蘑方控制 默认关闭
*/
tbOpenMfView.isChecked = HmiBuildConfig.isShowMfToastView
tbOpenMfView.setOnCheckedChangeListener { _, isChecked ->
HmiBuildConfig.isShowMfToastView = isChecked
}
/**
@@ -361,6 +371,7 @@ internal class DebugSettingView @JvmOverloads constructor(
swDevelopMode.visibility = View.GONE
}
}
/**
* 开发者模式
*/
@@ -634,12 +645,6 @@ internal class DebugSettingView @JvmOverloads constructor(
FunctionBuildConfig.isBeautyMode = isChecked
}
tbV2NFromCar.isChecked = FunctionBuildConfig.isV2NFromCar
//v2n车端预警
tbV2NFromCar.setOnCheckedChangeListener { _, isChecked ->
FunctionBuildConfig.isV2NFromCar = isChecked
}
tbDrawAiCloudFusion.isChecked = FunctionBuildConfig.isDrawAiCloudFusion
//云端感知绘制
tbDrawAiCloudFusion.setOnCheckedChangeListener { _, isChecked ->
@@ -1597,6 +1602,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tvAutopilotInfo.text = autopilotJson
tvIpcInfo.text = autopilotJson
tvIpcInfoKey.text = autopilotJson
tvCmdbCarInfoContent.text = SharedPrefsMgr.getInstance(context).getString(SharedPrefsConstants.CAR_INFO)
tvCarInfo.text =
"GPS时间${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
@@ -2056,4 +2062,5 @@ internal class DebugSettingView @JvmOverloads constructor(
override fun onObuDeviceId(obuDeviceId: String) {
mObuDeviceId = obuDeviceId
}
}

View File

@@ -73,11 +73,11 @@ internal class SOPSettingView @JvmOverloads constructor(
/**
* obu弱势交通控制
*/
tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
// 默认开启
HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
}
// tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
// tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
// // 默认开启
// HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
// }
/**
* 云端弱势交通控制
@@ -88,14 +88,6 @@ internal class SOPSettingView @JvmOverloads constructor(
HmiBuildConfig.isShowCloudWeaknessTrafficView = isChecked
}
/**
* 限速数据来源开关
*/
tbRoadLimitSpeedSop.setOnCheckedChangeListener { _, isChecked ->
// 默认关闭
HmiBuildConfig.isShowObuLimitSpeedView = isChecked
}
/**
* obu V2V开关默认打开
*/

View File

@@ -1,36 +0,0 @@
package com.mogo.eagle.core.function.hmi.ui.setting
import android.content.Context
import android.util.AttributeSet
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
/**
* @author XuXinChao
* @description fix java.lang.IndexOutOfBoundsException检测到不一致。视图持有者适配器positionViewHolder无效
* @since: 2022/6/7
*/
class WrapContentLinearLayoutManager : LinearLayoutManager {
constructor(context: Context?) : super(context) {}
constructor(context: Context?, orientation: Int, reverseLayout: Boolean) : super(
context,
orientation,
reverseLayout
) {}
constructor(
context: Context?,
attrs: AttributeSet?,
defStyleAttr: Int,
defStyleRes: Int
) : super(context, attrs, defStyleAttr, defStyleRes) {}
override fun onLayoutChildren(recycler: RecyclerView.Recycler?, state: RecyclerView.State?) {
try {
super.onLayoutChildren(recycler, state)
} catch (e: IndexOutOfBoundsException) {
e.printStackTrace()
}
}
}

View File

@@ -51,6 +51,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
private var clickListener: ClickListener? = null
private var keyBoardUtil: KeyBoardUtil? = null
@Volatile
private var connectStatus = false
private var lastTime = 0L

View File

@@ -40,6 +40,7 @@ class PncActionsView @JvmOverloads constructor(
@Volatile
private var mTrafficLightResult: TrafficLightResult? = null
@Volatile
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
private val bgResources: Int

View File

@@ -11,6 +11,7 @@ import android.view.View
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import kotlin.math.abs
@@ -139,17 +140,19 @@ class BatteryView : View , IMoGoSkinModeChangeListener {
}
override fun onSkinModeChange(skinMode: Int) {
when (skinMode) {
0 -> {
batteryColor = resources.getColor(R.color.color_27FFFFFF)
powerColor = Color.WHITE
}
1 -> {
batteryColor = resources.getColor(R.color.color_1E111111)
powerColor = resources.getColor(R.color.color_2C2E30)
ThreadUtils.runOnUiThread {
when (skinMode) {
0 -> {
batteryColor = resources.getColor(R.color.color_27FFFFFF)
powerColor = Color.WHITE
}
1 -> {
batteryColor = resources.getColor(R.color.color_1E111111)
powerColor = resources.getColor(R.color.color_2C2E30)
}
}
invalidate()
}
invalidate()
}
override fun onAttachedToWindow() {

View File

@@ -29,7 +29,9 @@ class CheckSystemView @JvmOverloads constructor(
const val TAG = "CheckSystemView"
}
@Volatile
private var connectStatus = false //是否连接工控机
@Volatile
private var autopilotStatus: Int? = null //自动驾驶状态 0代表不可自动驾驶,1代表可自动驾驶,2代表自动驾驶中
private var dockerRebootDialog: DockerRebootDialog? = null

View File

@@ -27,6 +27,7 @@ class SpeedPanelView @JvmOverloads constructor(
var mContext: Context
var mSpeedChartView: SpeedChartView
@Volatile
var mLatLng: MogoLocation? = null
init {

View File

@@ -14,6 +14,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import kotlinx.android.synthetic.main.view_status_bar.view.*
import java.util.concurrent.CopyOnWriteArrayList
@@ -55,9 +56,11 @@ class StatusBarView @JvmOverloads constructor(
}
override fun onSkinModeChange(skinMode: Int) {
when (skinMode) {
0 -> setStatusBarDarkOrLight(false)
1 -> setStatusBarDarkOrLight(true)
ThreadUtils.runOnUiThread {
when (skinMode) {
0 -> setStatusBarDarkOrLight(false)
1 -> setStatusBarDarkOrLight(true)
}
}
}

View File

@@ -31,6 +31,7 @@ class VersionNameView @JvmOverloads constructor(
const val TAG = "VersionNameView"
}
@Volatile
private var dockerVersion: String? = null //工控机版本
init{

View File

@@ -293,11 +293,13 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
}
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
val status = autoPilotStatusInfo.ipcConnStatus
if (mLastStatus != status) {
val statusInfo = autoPilotStatusInfo.clone()
rvConnectInfo.post { updateConnectInfoView(statusInfo) }
mLastStatus = status
UiThreadHandler.post {
val status = autoPilotStatusInfo.ipcConnStatus
if (mLastStatus != status) {
val statusInfo = autoPilotStatusInfo.clone()
rvConnectInfo.post { updateConnectInfoView(statusInfo) }
mLastStatus = status
}
}
}

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.main;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Process;
@@ -18,20 +17,15 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
import com.mogo.eagle.core.utilcode.util.SPUtils;
import java.io.File;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 默认初始化一些基础服务配置 todo 分离 msgBox去自己的模块中 --- 扶风
* 默认初始化一些基础服务配置
*/
public abstract class MainMoGoApplication extends AbsMogoApplication {
@@ -50,12 +44,8 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
initLogConfig();
initTipToast();
initModules();
if (ProcessUtils.isMainProcess(this)) {
clearMessageBoxTable();
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
}
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
CallerDevaToolsManager.INSTANCE.updateUpgradeProgress();
CallerDevaToolsManager.INSTANCE.updateObuUpgradeStatus();
}
@Override
@@ -64,38 +54,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
return true;
}
@SuppressLint("SimpleDateFormat")
private void clearMessageBoxTable() {
new Thread(() -> {
String lastLaunchTimeStr = SPUtils.getInstance().getString("last_launch", "");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date currDate = new Date(System.currentTimeMillis());
String currTimeStr = format.format(currDate);
try {
if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) {
boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr);
// 超过一天需要清除消息盒子中的数据并把时间戳存入SP
if (!isSameDay) {
File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME);
if (file != null && file.exists()) {
this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME);
}
SPUtils.getInstance().put("last_launch", currTimeStr);
}
} else {
// 首次使用App或中途仅删除sp文件
File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME);
if (file != null && file.exists()) {
this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME);
}
SPUtils.getInstance().put("last_launch", currTimeStr);
}
} catch (Exception e) {
CallerLogger.INSTANCE.e(TAG, e.getMessage());
}
}).start();
}
/**
* 初始化异常采集配置
*/
@@ -126,11 +84,11 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
// BIZ
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_FUNC_BIZ, "IMoGoNoticeProvider"));
// todo 后置 车聊聊IM
// 后置 车聊聊IM
MogoModulePaths.addModuleFunctionServer(new MogoModule(ChatConsts.CHAT_PROVIDER_PATH, ChatConsts.CHAT_MODULE_NAME));
// 司机身份专属
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
// todo 后置 地图数据收集模块
// 后置 地图数据收集模块
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector"));
}
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
@@ -141,7 +99,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
super.attachBaseContext(base);
/*如果是主进程**/
// if (ProcessUtils.isMainProcess(this)) {
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.COLD_START);
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.COLD_START);
// }
BoostMultiDex.install(base);
AbsMogoApplication.sApp = this;

View File

@@ -11,19 +11,19 @@ import com.mogo.eagle.core.widget.TextureVideoView
*/
class VideoAdAtc : AppCompatActivity() {
private lateinit var svpFrame: TextureVideoView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_video_ad_atc)
svpFrame = findViewById(R.id.svp_frame)
val url = "android.resource://" + packageName + "/" + R.raw.mogo_ad
svpFrame.videoPath = url
svpFrame.start()
BarUtils.hideStatusBarAndSticky(this.window)
}
// private lateinit var svpFrame: TextureVideoView
//
// override fun onCreate(savedInstanceState: Bundle?) {
// super.onCreate(savedInstanceState)
// setContentView(R.layout.activity_video_ad_atc)
//
// svpFrame = findViewById(R.id.svp_frame)
//
// val url = "android.resource://" + packageName + "/" + R.raw.mogo_ad
// svpFrame.videoPath = url
// svpFrame.start()
//
// BarUtils.hideStatusBarAndSticky(this.window)
// }
}

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="450dp"
android:layout_height="110dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#FFFFFFFF"
app:roundLayoutRadius="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10">
<ImageView
android:id="@+id/ivMOperationImage"
android:layout_width="@dimen/dp_83"
android:layout_height="@dimen/dp_83"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="@dimen/dp_13"
android:src="@drawable/icon_msg_box_operation_stop"
/>
<TextView
android:id="@+id/tvMOperationTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:textColor="#99203555"
android:textSize="18dp"
android:layout_marginEnd="@dimen/dp_20"
/>
<TextView
android:id="@+id/tvMOperationContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/ivMOperationImage"
app:layout_constraintRight_toLeftOf="@id/tvMOperationTime"
android:gravity="start"
android:textColor="#FF203555"
android:textSize="20dp"
android:layout_marginStart="@dimen/dp_13"
android:layout_marginEnd="@dimen/dp_13"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_100"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ImageView
android:id="@+id/ivMOperationImage"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_68"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginStart="@dimen/dp_16"
android:src="@drawable/icon_msg_box_operation_stop"
/>
<TextView
android:id="@+id/tvMOperationTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:textColor="#FF4A5B76"
android:textSize="@dimen/dp_18"
android:layout_marginEnd="@dimen/dp_10"
/>
<TextView
android:id="@+id/tvMOperationContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/ivMOperationImage"
app:layout_constraintRight_toLeftOf="@id/tvMOperationTime"
android:gravity="start"
android:textColor="#FF203555"
android:textSize="@dimen/dp_20"
android:layout_marginStart="@dimen/dp_16"
android:layout_marginEnd="@dimen/dp_16"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -206,6 +206,29 @@
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvCmdbCarInfo"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="车辆信息: " />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvCmdbCarInfoContent"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="5" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<ToggleButton
android:id="@+id/tbIsDemoMode"
android:layout_width="match_parent"
@@ -242,18 +265,6 @@
android:textOn="关闭感知优化模式"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbV2NFromCar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启车端V2N预警"
android:textOn="关闭车端V2N预警"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbDrawAiCloudFusion"
android:layout_width="match_parent"
@@ -298,21 +309,22 @@
android:background="@drawable/radio_button_normal_background_right"
android:drawableEnd="@drawable/icon_right"
android:padding="@dimen/dp_20"
android:textOff="魔戒控制"
android:textOn="魔戒控制"
android:textOff="蘑方控制"
android:textOn="蘑方控制"
android:textSize="@dimen/dp_24" />
<Button
android:id="@+id/btnOpenAllGestures"
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbOpenMfView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_20"
android:text="开启手势滑动"
android:textSize="@dimen/dp_24"
android:text="打开蘑方按键Toast"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:layout_marginLeft="10dp"
android:scaleY="1"
android:scaleX="1"
/>
<Button
android:id="@+id/btnIpcReboot"

View File

@@ -163,11 +163,13 @@
app:layout_constraintRight_toRightOf="parent"
/>
<!--这个后面产品会统一去掉-->
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbObuToDcView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OBU到工控机V2I显示"
android:visibility="gone"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
@@ -200,7 +202,7 @@
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObuToDcView"
app:layout_constraintTop_toBottomOf="@id/tbObuV2vView"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
@@ -214,23 +216,9 @@
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObuToDcView"
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
app:layout_constraintRight_toRightOf="parent"
/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbRoadLimitSpeedSop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="路侧限速提醒"
android:paddingTop="25dp"
android:paddingBottom="25dp"
android:scaleY="1.2"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbObuWeaknessTrafficSop"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
app:layout_constraintLeft_toLeftOf="parent"
/>
<TextView
@@ -238,7 +226,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbRoadLimitSpeedSop"
app:layout_constraintTop_toBottomOf="@id/tbIPCReport"
android:text="变道速度阈值:"
android:textSize="@dimen/dp_36"
android:textColor="#1A1A1A"

View File

@@ -23,7 +23,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
private final static String TAG = "SpeedLimitDataManager";
private static volatile SpeedLimitDataManager instance;
private MogoLocation mLocation;
private volatile MogoLocation mLocation;
private SpeedLimitDataManager() {
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.business.ai.net
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.HostConst
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.BaseResponse
import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyDataManager.Companion.END_METRE
@@ -27,7 +28,7 @@ class AiCloudIdentifyNetWorkModel {
return host
}
private fun getNetWorkApi(baseUrl: String = getHost()): IAiCloudIdentifyApiService {
private fun getNetWorkApi(baseUrl: String = HostConst.getEagleHost()): IAiCloudIdentifyApiService {
return MoGoRetrofitFactory.getInstanceNoCallAdapter(baseUrl)
.create(IAiCloudIdentifyApiService::class.java)
}

View File

@@ -8,6 +8,6 @@ import retrofit2.http.POST
interface IAiCloudIdentifyApiService {
@Headers("Content-type:application/json;charset=UTF-8")
@POST("yycp-c-v2x-service/dataFusion/remoteDrivingSet")
@POST("eagle-eye-dns/yycp-c-v2x-service/dataFusion/remoteDrivingSet")
suspend fun identifyRange(@Body map: MutableMap<String, Any>): BaseResponse<Any>
}

View File

@@ -1,10 +1,10 @@
package com.mogo.eagle.core.function.smp
import android.content.Context
import android.util.Log
import com.amap.api.maps.CoordinateConverter
import com.amap.api.maps.model.LatLng
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import io.reactivex.Observable
import io.reactivex.ObservableOnSubscribe
import io.reactivex.android.schedulers.AndroidSchedulers
@@ -35,7 +35,7 @@ object MarkerDrawerManager {
var lastArrivedIndex: Int = -1
@Volatile
var lonLat = Pair(0.0, 0.0)
var lonLatHeading = Triple(0.0, 0.0, 0.0)
var callback: Callback? = null
@@ -59,16 +59,17 @@ object MarkerDrawerManager {
private fun getLoopCalCarObservable(): Observable<Int> {
return Observable.create(ObservableOnSubscribe { emitter ->
if (emitter.isDisposed) return@ObservableOnSubscribe
loopRouteAndWipe(planningPoints, lonLat.first, lonLat.second)
loopRouteAndWipe(planningPoints, lonLatHeading.first, lonLatHeading.second, lonLatHeading.third)
emitter.onComplete()
})
}
private fun loopRouteAndWipe(routePoints: List<LatLng>?, lon: Double, lat: Double) {
private fun loopRouteAndWipe(routePoints: List<LatLng>?, lon: Double, lat: Double, heading: Double) {
if (routePoints != null && routePoints.isNotEmpty()) {
val arrivedIndex: Int = getArrivedPointIndex(routePoints, lon, lat)
val newPointList = ArrayList<LatLng>()
val arrivedIndex: Int = getArrivedPointIndex(routePoints, newPointList, lon, lat, heading)
if (arrivedIndex != -1 && lastArrivedIndex != arrivedIndex) {
callback?.onLocationChanged(routePoints, arrivedIndex)
callback?.onLocationChanged(newPointList, arrivedIndex)
lastArrivedIndex = arrivedIndex
}
}
@@ -90,8 +91,10 @@ object MarkerDrawerManager {
*/
private fun getArrivedPointIndex(
routePoints: List<LatLng>,
newPoints: MutableList<LatLng>,
realLon: Double,
realLat: Double
realLat: Double,
heading: Double
): Int {
var currentIndex = 0 //记录疑似点
if (routePoints.isNotEmpty()) {
@@ -100,6 +103,7 @@ object MarkerDrawerManager {
var baseDiffDis = CoordinateUtils.calculateLineDistance(
realLon, realLat, baseLatLng.longitude, baseLatLng.latitude
) // lon,lat, prelon, prelat
// val lastIndex = if (lastArrivedIndex >= 1 && lastArrivedIndex <= routePoints.size - 1) lastArrivedIndex else 1
for (i in 1 until routePoints.size) {
val latLng = routePoints[i]
val diff = CoordinateUtils.calculateLineDistance(
@@ -107,12 +111,17 @@ object MarkerDrawerManager {
)
if (baseDiffDis > diff) {
baseDiffDis = diff
currentIndex = i
// 距离最近的时候判断是否走过
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(realLon, realLat, latLng.longitude, latLng.latitude, heading) >= 90) {
currentIndex = i
}
}
}
return currentIndex
newPoints.addAll(routePoints)
newPoints.add(currentIndex + 1, LatLng(realLat, realLon))
return currentIndex + 1
}
return currentIndex
return 0
}
/**

View File

@@ -4,7 +4,6 @@ import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.MotionEvent
import android.widget.RelativeLayout
@@ -52,6 +51,7 @@ class SmallMapView @JvmOverloads constructor(
private var mContext: Context? = null
private var mLocation: MogoLocation? = null
@Volatile
private var autoPilotStatus = 0
companion object {
@@ -216,7 +216,7 @@ class SmallMapView @JvmOverloads constructor(
uiSettings?.setAllGesturesEnabled(false) // 所有手势
uiSettings?.isMyLocationButtonEnabled = false // 显示默认的定位按钮
uiSettings?.setLogoBottomMargin(-150) //设置Logo下边界距离屏幕底部的边距,设置为负值即可
mAMap?.setOnMapLoadedListener(AMap.OnMapLoadedListener {
mAMap?.setOnMapLoadedListener {
CallerLogger.d(
SceneConstant.M_MAP + TAG,
"smp---onMapLoaded"
@@ -237,7 +237,7 @@ class SmallMapView @JvmOverloads constructor(
mAMapNaviView!!.width / 2,
mAMapNaviView!!.height / 2
)
})
}
}
private fun coordinateConverterFrom84(mContext: Context?, mogoLatLng: MogoLatLng): LatLng {
@@ -283,36 +283,39 @@ class SmallMapView @JvmOverloads constructor(
if (mCarMarker == null) {
return
}
val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude)
val bearing = floor(mLocation!!.heading).toFloat()
//更新车辆位置
mCarMarker!!.position = currentLatLng
if (mCoordinatesLatLng.size > 1) {
// 结束位置
val endLatLng = mCoordinatesLatLng[mCoordinatesLatLng.size - 1]
val calculateDistance = CoordinateUtils.calculateLineDistance(
endLatLng.latitude, endLatLng.longitude,
currentLatLng.latitude, currentLatLng.longitude
)
CallerLogger.d(
SceneConstant.M_MAP + TAG,
"calculateDistance=$calculateDistance"
)
if (calculateDistance <= 5) {
UiThreadHandler.post {
val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude)
val bearing = floor(mLocation!!.heading).toFloat()
//更新车辆位置
mCarMarker!!.position = currentLatLng
if (mCoordinatesLatLng.size > 1) {
// 结束位置
val endLatLng = mCoordinatesLatLng[mCoordinatesLatLng.size - 1]
val calculateDistance = CoordinateUtils.calculateLineDistance(
endLatLng.latitude, endLatLng.longitude,
currentLatLng.latitude, currentLatLng.longitude
)
CallerLogger.d(
SceneConstant.M_MAP + TAG, "onChassisLocationGCJ02 -----> calculateDistance <= 5 ")
clearPolyline()
mCoordinatesLatLng.clear()
SceneConstant.M_MAP + TAG,
"calculateDistance=$calculateDistance"
)
if (calculateDistance <= 5) {
CallerLogger.d(
SceneConstant.M_MAP + TAG, "onChassisLocationGCJ02 -----> calculateDistance <= 5 ")
clearPolyline()
mCoordinatesLatLng.clear()
}
}
val cameraPosition: CameraPosition =
CameraPosition.Builder()
.target(mCarMarker!!.position)
.tilt(0f)
.bearing(bearing)
.zoom(zoomLevel.toFloat())
.build()
mAMap?.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
}
val cameraPosition: CameraPosition =
CameraPosition.Builder()
.target(mCarMarker!!.position)
.tilt(0f)
.bearing(bearing)
.zoom(zoomLevel.toFloat())
.build()
mAMap?.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
}
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {

View File

@@ -36,7 +36,7 @@ import com.mogo.eagle.core.function.smp.MakerWithCount
import com.mogo.eagle.core.function.smp.MarkerDrawerManager
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.callback
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.coordinateConverterWgsToGcj
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lonLat
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lonLatHeading
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.planningPoints
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.startLoopCalCarLocation
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.updateRoutePoints
@@ -636,6 +636,8 @@ class OverMapView @JvmOverloads constructor(
texIndexList.clear()
}
for (i in coordinates.indices) {
// 线段数比点数少一个
if (i == 0) continue
if (i <= locIndex) {
if (isClearArrived) {
textureList.add(transparentBitmap)
@@ -647,7 +649,7 @@ class OverMapView @JvmOverloads constructor(
// 未走过的纹理
textureList.add(unArrivedBitmap)
}
texIndexList.add(i)
texIndexList.add(i - 1)
}
if (mAMap != null && coordinates.size > 2) {
//设置线段纹理
@@ -670,7 +672,7 @@ class OverMapView @JvmOverloads constructor(
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
mLocation = it
lonLat = Pair(it.longitude, it.latitude)
lonLatHeading = Triple(it.longitude, it.latitude, it.heading)
drawCarMarker(it)
if (isFirstLocation) {
displayCustomOverView()

View File

@@ -49,14 +49,6 @@ object FunctionBuildConfig {
@JvmField
var detouringSpeed = 3
/**
* 是否从车端融合过来的v2n事件
* 默认关闭开启后接收车端融合预警关闭云端长链V2N
*/
@Volatile
@JvmField
var isV2NFromCar = false
/**
* 是否是感知优化模式
* 默认开启

View File

@@ -50,11 +50,11 @@ object HmiBuildConfig {
var isShowCloudWeaknessTrafficView = false
/**
* 是否展示obu的限速
* 是否展示蘑方的toast
*/
@JvmField
@Volatile
var isShowObuLimitSpeedView = false
var isShowMfToastView = false
/**
* 是否展示obu的v2v

View File

@@ -5,7 +5,7 @@ package com.mogo.eagle.core.data.enums
enum class DataSourceType(name: String) {
DEFAULT("defalut"),
OBU("OBU"),
MAP("MAP"),
MAP("HDMAP"),
TELEMATIC("TELEMATIC"),
AICLOUD("AI云"),
SUMMARY("汇总");// V2X事件汇总
@@ -15,7 +15,7 @@ enum class DataSourceType(name: String) {
fun getName(type :DataSourceType):String{
return when(type){
OBU -> "OBU"
MAP -> "MAP"
MAP -> "HDMAP"
TELEMATIC -> "TELEMATIC"
AICLOUD -> "AI云"
SUMMARY -> "汇总"

View File

@@ -0,0 +1,11 @@
package com.mogo.eagle.core.function.api.autopilot
/**
* 清扫车(福田)后摄像头视频数据
*/
interface IMoGoSweeperFutianBackCameraVideoListener {
/**
* 清扫车(福田)后摄像头视频数据 10Hz 每一帧为一张图片
*/
fun onSweeperFutianBackCameraVideo(data: ByteArray)
}

View File

@@ -125,11 +125,6 @@ interface IDevaToolsProvider : IProvider {
*/
fun updateUpgradeProgress()
/**
* obu下载进度
*/
fun updateObuUpgradeStatus()
/**
* 展示状态栏
*/

View File

@@ -0,0 +1,23 @@
package com.mogo.eagle.core.function.call.autopilot
import chassis.ChassisStatesOuterClass
import chassis.VehicleStateOuterClass
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianBackCameraVideoListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 清扫车(福田)后摄像头视频数据
*/
object CallerSweeperFutianBackCameraVideoListenerManager : CallerBase<IMoGoSweeperFutianBackCameraVideoListener>() {
/**
* 后摄像头视频数据
*/
fun invokeSweeperFutianBackCameraVideo(data: ByteArray) {
M_LISTENERS.forEach {
val listener = it.value
listener.onSweeperFutianBackCameraVideo(data)
}
}
}

View File

@@ -169,13 +169,6 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.updateUpgradeProgress()
}
/**
* obu下载状态
*/
fun updateObuUpgradeStatus() {
devaToolsProviderApi?.updateObuUpgradeStatus()
}
/**
* 展示状态栏
*/

View File

@@ -39,7 +39,7 @@ object MultiDisplayUtils {
// 获取除了内置屏幕(主屏幕)的其它屏幕
val displays = mDisplayManager.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION)
// 初始化新的集合进行接收排序后的屏幕信息,防止数组越界初始化列表相同的集合集合中会有null需要在使用判断null即没有连接屏幕
var displaysList = arrayOfNulls<Display>(lcd_sub_port_six_lcd_mode.size)
var displaysList = arrayOf<Display?>()
Log.d(TAG, "displays:$displays")
// 判断副屏个数
@@ -67,10 +67,10 @@ object MultiDisplayUtils {
// 处理EB5副屏幕
else {
if (mDisplayManager.displays.isNotEmpty()) {
displaysList = arrayOfNulls(1)
// EB5目前副屏幕ID为固定4096
for (i in mDisplayManager.displays.indices) {
if (mDisplayManager.displays[i].displayId == 4096) {
displaysList = arrayOfNulls(1)
displaysList[0] = mDisplayManager.displays[i]
}
}

View File

@@ -14,7 +14,7 @@ public class MogoLocationInfoServices {
private static final String TAG = "MogoLocationInfoServices-sdk";
private static volatile MogoLocationInfoServices sInstance;
private MogoLocation mLocation;
private volatile MogoLocation mLocation;
private MogoLocationInfoServices() {
}

View File

@@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4
LOGLIB_VERSION=1.5.11
######## MogoAiCloudSDK Version ########
# 网络请求LOGLIB_VERSION
MOGO_NETWORK_VERSION=1.4.5.6
MOGO_NETWORK_VERSION=1.4.5.7
# 鉴权
MOGO_PASSPORT_VERSION=1.4.5.6
MOGO_PASSPORT_VERSION=1.4.5.7
# 常链接
MOGO_SOCKET_VERSION=1.4.5.6
MOGO_SOCKET_VERSION=1.4.5.7
# 数据采集
MOGO_REALTIME_VERSION=1.4.5.6
MOGO_REALTIME_VERSION=1.4.5.7
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.4.5.6
MOGO_TANLU_VERSION=1.4.5.7
# 直播推流
MOGO_LIVE_VERSION=1.4.5.6
MOGO_LIVE_VERSION=1.4.5.7
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.5.6
MOGO_TRAFFICLIVE_VERSION=1.4.5.7
# 定位服务
MOGO_LOCATION_VERSION=1.4.5.6
MOGO_LOCATION_VERSION=1.4.5.7
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.5.6
MOGO_TELEMATIC_VERSION=1.4.5.7
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.10.0.9

View File

@@ -6,7 +6,7 @@ import "geometry.proto";
enum ProtocolVersion
{
Defaultver = 0;
CurrentVersion = 10; //每次修改proto文件增加1
CurrentVersion = 12; //每次修改proto文件增加1
}
enum MessageType
@@ -30,6 +30,7 @@ enum MessageType
MsgTypeOBU = 0x1000a; //OBU
MsgTypeChassisStates = 0x1000b; //重构后的底盘状态, 透传
MsgTypeFunctionStates = 0x1000c; //重构后的功能状态, 透传
MsgTypeBackCameraVideo = 0x1000d; //清扫车后部摄像头视频 10hz
MsgTypeBasicInfoReq = 0x10100; //自动驾驶设备基础信息请求
MsgTypeBasicInfoResp = 0x10101; //自动驾驶设备基础信息应答
@@ -60,6 +61,7 @@ enum MessageType
MsgTypeTripInfoEvent = 0x1011a; //行程信息
MsgTypeBagManagerCmd = 0x1011b; //bag管理
MsgTypePlanningCmd = 0x1011c; //给planning的指令
MsgTypeSetParamReqV2 = 0x1011d; //设置参数命令V2
}
message Header
@@ -139,9 +141,16 @@ message TrackedObject
string strUuid = 101;//String类型车辆ID
}
message BlindAreaData
{
float angleResolution = 1;
repeated int32 distances = 2;
}
message TrackedObjects
{
repeated TrackedObject objs = 1;
BlindAreaData blindAreaData = 2;
}
// message definition for MsgTypeGnssInfo
@@ -598,4 +607,8 @@ message PlanningCmd
PullOverCmd pullOverCmd = 1;
}
//message definition for MsgTypeSetParamReqV2
//refer to param_set_cmd.proto for details
//message definition for MsgTypeBackCameraVideo
//payload:jpeg data

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
package mogo.telematics;
enum ParamSetType
{
ParamSetTypeNone = 0;
ParamSetTypeBlindArea = 1;
}
message ParamSetCmd
{
uint32 src = 1; // 0: none, 1:pad, 2:aicloud
ParamSetType type = 2;
oneof Value {
bool boolValue = 3;
int64 intValue = 4;
double floatValue = 5;
string stringValue = 6;
}
}

View File

@@ -21,7 +21,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.protobuf.InvalidProtocolBufferException;
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
import com.zhidao.support.adas.high.bean.VersionCompatibility;
import com.zhidao.support.adas.high.common.AutopilotReview;
import com.zhidao.support.adas.high.common.ByteUtil;
@@ -45,6 +44,7 @@ import com.zhidao.support.adas.high.socket.FpgaSocket;
import com.zhidao.support.adas.high.subscribe.SubscribeInterface;
import com.zhidao.support.adas.high.subscribe.SubscribeInterfaceOptions;
import com.zhidao.support.adas.high.thread.DispatchHandler;
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
import com.zhjt.service.chain.ChainLog;
import com.zhjt.service.chain.TracingConstants;
@@ -251,7 +251,8 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
// dispatchHandlers.put(MessagePad.MessageType.MsgTypeRecordDataConfigResp, new DispatchHandler(MessagePad.MessageType.MsgTypeRecordDataConfigResp, this));
//Planning决策状态
// dispatchHandlers.put(MessagePad.MessageType.MsgTypePlanningDecisionState, new DispatchHandler(MessagePad.MessageType.MsgTypePlanningDecisionState, this));
//清扫车后摄像头数据
dispatchHandlers.put(MessagePad.MessageType.MsgTypeBackCameraVideo, new DispatchHandler(MessagePad.MessageType.MsgTypeBackCameraVideo, this));
}
/**
@@ -446,32 +447,17 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
public void onDispatchRaw(MessagePad.MessageType type, RawData raw) {
// CupidLogUtils.i(TAG, "onDispatchRaw=" + Thread.currentThread().getName() + " TID=" + android.os.Process.myTid());
try {
//分发点云原始数据
if (type == MessagePad.MessageType.MsgTypePointCloud) {
int len = raw.getPackageLengthValue() - raw.getOffsetValue();
byte[] bytes = new byte[len];
System.arraycopy(raw.originalData.toByteArray(), raw.getOffsetValue(), bytes, 0, len);
calculateTimeConsumingOnDispatchRaw("3D点云", raw.receiveTime);
long nowTime = 0;
if (CupidLogUtils.isEnableLog())
nowTime = SystemClock.elapsedRealtime();
mAdasListener.onPointCloud(bytes);
calculateTimeConsumingBusiness("3D点云", nowTime);
} else {
if (rawUnpack != null) {
if (raw.getProtocolStatus() == ProtocolStatus.SUCCEED) {
MessagePad.Header header = raw.getHeader();
MessagePad.MessageType messageType = header.getMsgType();
IMsg iMsg = myMessageFactory.createMessage(messageType);
if (iMsg == null) {
callError(ProtocolStatus.MESSAGE_TYPE_UNKNOWN, raw.originalData.toByteArray());
return;
}
iMsg.handlerMsg(raw, mAdasListener);
} else {
callError(raw.getProtocolStatus(), raw.originalData.toByteArray());
}
if (raw.getProtocolStatus() == ProtocolStatus.SUCCEED) {
MessagePad.Header header = raw.getHeader();
MessagePad.MessageType messageType = header.getMsgType();
IMsg iMsg = myMessageFactory.createMessage(messageType);
if (iMsg == null) {
callError(ProtocolStatus.MESSAGE_TYPE_UNKNOWN, raw.originalData.toByteArray());
return;
}
iMsg.handlerMsg(raw, mAdasListener);
} else {
callError(raw.getProtocolStatus(), raw.originalData.toByteArray());
}
} catch (Exception e) {
callError(ProtocolStatus.BUSINESS_DATA_PARSE_FAILED, raw.originalData.toByteArray());

View File

@@ -1,15 +1,16 @@
package com.zhidao.support.adas.high;
import com.mogo.support.obu.ObuScene;
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
import com.zhidao.support.adas.high.common.ProtocolStatus;
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
import org.jetbrains.annotations.NotNull;
import bag_manager.BagManagerOuterClass;
import chassis.ChassisStatesOuterClass;
import chassis.VehicleStateOuterClass;
import function_state_management.FunctionStates;
import mogo.telematics.pad.MessagePad;
import mogo.v2x.ObuWarningEvent;
import mogo_msg.MogoReportMsg;
import perception.TrafficLightOuterClass;
import planning.RoboSweeperTaskIndexOuterClass;
@@ -108,9 +109,10 @@ public interface OnAdasListener {
/**
* 透传的点云数据
*
* @param header 头
* @param pointCloud 原始数据 只包含PointCloud数据
*/
void onPointCloud(byte[] pointCloud);
void onPointCloud(MessagePad.Header header, byte[] pointCloud);
/**
* planning障碍物
@@ -231,10 +233,18 @@ public interface OnAdasListener {
* 重构后的功能状态
*
* @param header 头
* @param functionStates
* @param functionStates 数据
*/
void onFunctionStates(MessagePad.Header header, FunctionStates.FSMFunctionStates functionStates);
/**
* 清扫车后部摄像头视频 10Hz
*
* @param header 头
* @param data 数据
*/
void onBackCameraVideo(@NotNull MessagePad.Header header, @NotNull byte[] data);
/**
* 清扫车指标数据
*

View File

@@ -25,6 +25,7 @@ public enum MessageType {
TYPE_RECEIVE_PLANNING_OBJECTS(MessagePad.MessageType.MsgTypePlanningObjects, "Planning障碍物"),
TYPE_RECEIVE_CHASSIS_STATES(MessagePad.MessageType.MsgTypeChassisStates, "底盘状态"),
TYPE_RECEIVE_FUNCTION_STATES(MessagePad.MessageType.MsgTypeFunctionStates, "重构后功能状态"),
TYPE_RECEIVE_BACK_CAMERA_VIDEO(MessagePad.MessageType.MsgTypeBackCameraVideo, "清扫车后摄像头"),
TYPE_RECEIVE_BASIC_INFO_REQ(MessagePad.MessageType.MsgTypeBasicInfoReq, "自动驾驶设备基础信息请求"),
TYPE_SEND_BASIC_INFO_RESP(MessagePad.MessageType.MsgTypeBasicInfoResp, "自动驾驶设备基础信息应答"),

View File

@@ -0,0 +1,33 @@
package com.zhidao.support.adas.high.msg;
import android.os.SystemClock;
import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.AdasChannel;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.protocol.RawData;
/**
* 清扫车后摄像头
*/
public class BackCameraVideoMessage extends MyAbstractMessageHandler {
public BackCameraVideoMessage() {
}
@Override
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
int len = raw.getPackageLengthValue() - raw.getOffsetValue();
byte[] data = new byte[len];
System.arraycopy(raw.originalData.toByteArray(), raw.getOffsetValue(), data, 0, len);
AdasChannel.calculateTimeConsumingOnDispatchRaw("清扫车后摄像头", raw.receiveTime);
long nowTime = 0;
if (CupidLogUtils.isEnableLog())
nowTime = SystemClock.elapsedRealtime();
if (adasListener != null) {
adasListener.onBackCameraVideo(raw.getHeader(), data);
}
AdasChannel.calculateTimeConsumingBusiness("清扫车后摄像头", nowTime);
}
}

View File

@@ -36,6 +36,8 @@ public class MyMessageFactory implements IMyMessageFactory {
private IMsg functionStatesMessage;//重构后的功能状态
private IMsg sweeperTaskIndexDataMessage;//清扫车指标数据
private IMsg bagManagerMessage;//Bag管理应答
private IMsg backCameraVideoMessage;//清扫车后摄像头
private IMsg pointCloudMessage;//3D点云
private final AutopilotReview autopilotReview;
@@ -99,6 +101,12 @@ public class MyMessageFactory implements IMyMessageFactory {
predictionObstacleTrajectoryMessage = new PredictionObstacleTrajectoryMessage();
}
return predictionObstacleTrajectoryMessage;
} else if (messageType == MessageType.TYPE_RECEIVE_POINT_CLOUD.typeCode) {
//3D点云
if (pointCloudMessage == null) {
pointCloudMessage = new PointCloudMessage();
}
return pointCloudMessage;
} else if (messageType == MessageType.TYPE_RECEIVE_PLANNING_OBJECTS.typeCode) {
//planning障碍物
if (planningObjectsMessage == null) {
@@ -183,6 +191,12 @@ public class MyMessageFactory implements IMyMessageFactory {
bagManagerMessage = new BagManagerMessage();
}
return bagManagerMessage;
} else if (messageType == MessageType.TYPE_RECEIVE_BACK_CAMERA_VIDEO.typeCode) {
//清扫车后摄像头
if (backCameraVideoMessage == null) {
backCameraVideoMessage = new BackCameraVideoMessage();
}
return backCameraVideoMessage;
} else {
//MessageType.TYPE_DEFAULT.typeCode
return null;

View File

@@ -0,0 +1,34 @@
package com.zhidao.support.adas.high.msg;
import android.os.SystemClock;
import com.google.protobuf.InvalidProtocolBufferException;
import com.zhidao.support.adas.high.AdasChannel;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.protocol.RawData;
/**
* 3D点云原始数据
*/
public class PointCloudMessage extends MyAbstractMessageHandler {
public PointCloudMessage() {
}
@Override
public void handlerMsg(RawData raw, OnAdasListener adasListener) throws InvalidProtocolBufferException {
int len = raw.getPackageLengthValue() - raw.getOffsetValue();
byte[] data = new byte[len];
System.arraycopy(raw.originalData.toByteArray(), raw.getOffsetValue(), data, 0, len);
AdasChannel.calculateTimeConsumingOnDispatchRaw("3D点云", raw.receiveTime);
long nowTime = 0;
if (CupidLogUtils.isEnableLog())
nowTime = SystemClock.elapsedRealtime();
if (adasListener != null) {
adasListener.onPointCloud(raw.getHeader(), data);
}
AdasChannel.calculateTimeConsumingBusiness("3D点云", nowTime);
}
}

View File

@@ -120,6 +120,9 @@ public class AMapWrapper implements IMogoMap {
if (!checkAMap()) {
return;
}
if(optionsArrayList == null || optionsArrayList.size() == 0){
return;
}
ArrayList<MarkerSimpleData> markerOptionsArrayList = new ArrayList<>();
optionsArrayList.forEach((s, trackedObject) -> {
MarkerSimpleData markerOptions = ObjectUtils.fromTrafficData(trackedObject);
@@ -127,6 +130,9 @@ public class AMapWrapper implements IMogoMap {
markerOptionsArrayList.add(markerOptions);
}
});
if(markerOptionsArrayList.size() == 0){
return;
}
long time = markerOptionsArrayList.get(0).getTime();
MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList, false, FunctionBuildConfig.isBeautyMode ? 8.0f : 0f, 1, time, 1);
}

View File

@@ -29,6 +29,8 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.tts.base.IMogoTTS;
import com.mogo.tts.base.IMogoTTSCallback;
import com.mogo.tts.base.LangTtsEntity;
import com.mogo.tts.base.LanguageType;
import com.mogo.tts.base.MultiLangTtsEntity;
import com.mogo.tts.base.PreemptType;
import com.zhidao.auto.platform.voice.VoiceClient;
@@ -443,9 +445,11 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
@MainThread
public void speakTTSVoiceWithLevel(String text, int ttsLevel, IMogoTTSCallback callBack) {
if (mHasAuth && mEngine != null) {
mSpeakVoiceMap.put(text, callBack);
if (callBack != null) {
mSpeakVoiceMap.put(text, callBack);
}
speakTTSVoiceWithLevel(text, ttsLevel);
}
speakTTSVoiceWithLevel(text, ttsLevel);
}
// 降序插入Tts(目前Level0、1可排队)
@@ -508,7 +512,15 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
@Override
public void speakMultiLangTTSWithLevel(MultiLangTtsEntity ttsEntity, int level, IMogoTTSCallback callback) {
if (mHasAuth && mEngine != null) {
LangTtsEntity entity;
if ((entity = ttsEntity.ttsNext()) != null && entity.getLanguage() == LanguageType.CHINESE) {
if (callback != null) {
mSpeakVoiceMap.put(entity.getTtsContent(), callback);
}
speakTTSVoiceWithLevel(entity.getTtsContent(), level);
}
}
}
/**