Merge branch 'master' into release_robosweeper-d_100-sweeper_220830_1.0.0.1_merge
# Conflicts: # app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java # core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt # core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt # core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java # core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapPointCloudSubscriber.kt # core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt # gradle.properties # libraries/mogo-adas-data/src/main/proto/message_pad.proto # libraries/mogo-adas-data/src/main/proto/special_vehicle_task_cmd.proto # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java
This commit is contained in:
@@ -83,7 +83,7 @@ message Trajectory
|
||||
// message definition for MsgTypeTrackedObjects
|
||||
message SubSource
|
||||
{
|
||||
uint32 source = 1; //[default = 0] v2v_bsm = 1 v2i_rsm = 2 v2v_ssm = 3 v2n_rsm = 4
|
||||
uint32 source = 1; //[default = 0] v2v_bsm = 1(v2x他车自车信息) v2i_rsm = 2(v2x路侧感知交通参与者信息) v2v_ssm = 3(v2x他车感知信息) v2n_cloud = 4(v2x云端感知信息)
|
||||
string id = 2; //HEX_string
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
private DispatchHandler dispatchHandlerPointCloud;//原始的点云数据分发
|
||||
private Timer checkCompatibilityTimer;//检查版本兼容性定时器 连接成功后5秒内等待工控机发送配置信息
|
||||
private int seqSpecialVehicle = 0;//特种车辆命令发送次数
|
||||
|
||||
/**
|
||||
* 与工控机链接状态
|
||||
*/
|
||||
@@ -326,6 +327,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
byte[] bytes = new byte[len];
|
||||
System.arraycopy(raw.originalData.toByteArray(), raw.getOffsetValue(), bytes, 0, len);
|
||||
mAdasListener.onPointCloud(bytes);
|
||||
CupidLogUtils.i(TAG, "收到点云数据" + raw.getPackageLengthValue());
|
||||
} else {
|
||||
if (rawUnpack != null) {
|
||||
if (raw.getProtocolStatus() == ProtocolStatus.SUCCEED) {
|
||||
@@ -509,7 +511,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
private void updateConnectStatus(@Define.IPCConnectionStatus int status, @Nullable String reason) {
|
||||
ipcConnectionStatus.set(status);
|
||||
if (status == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
startDispatchHandler();
|
||||
|
||||
startCheckCompatibility();
|
||||
} else {
|
||||
stopCheckCompatibility();
|
||||
@@ -524,15 +526,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
CupidLogUtils.i(TAG, "工控机连接状态 status=" + status + " reason=" + reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startDispatchHandler() {
|
||||
if (dispatchHandler != null) {
|
||||
dispatchHandler.start();
|
||||
}
|
||||
if (dispatchHandlerPointCloud != null) {
|
||||
dispatchHandlerPointCloud.start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopDispatchHandler() {
|
||||
@@ -1041,7 +1034,6 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return subscribeInterface != null && subscribeInterface.subscribeInterface(role, type, messageType);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 福田清扫车业务指令下发
|
||||
*
|
||||
@@ -1096,5 +1088,88 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
return sendPBMessage(MessageType.TYPE_SEND_SPECIAL_VEHICLE_TASK_CMD.typeCode, cmdBuild.build().toByteArray());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 向左变道
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendOperatorCmdChangeLaneLeft() {
|
||||
MessagePad.OperatorCmdReq req = MessagePad.OperatorCmdReq
|
||||
.newBuilder()
|
||||
.setCmdType(MessagePad.OperatorCmdType.OPERATOR_CMD_CHANGE_LANE)
|
||||
.setValue(1)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_OPERATOR_CMD_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 向右变道
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendOperatorCmdChangeLaneRight() {
|
||||
MessagePad.OperatorCmdReq req = MessagePad.OperatorCmdReq
|
||||
.newBuilder()
|
||||
.setCmdType(MessagePad.OperatorCmdType.OPERATOR_CMD_CHANGE_LANE)
|
||||
.setValue(2)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_OPERATOR_CMD_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送设置加速度
|
||||
*
|
||||
* @param acc acc>0加速 acc<0减速 acc=0复位
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendOperatorCmdSetAcceleratedSpeed(double acc) {
|
||||
MessagePad.OperatorCmdReq req = MessagePad.OperatorCmdReq
|
||||
.newBuilder()
|
||||
.setCmdType(MessagePad.OperatorCmdType.OPERATOR_CMD_SET_ACCELERATED_SPEED)
|
||||
.setValue(acc)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_OPERATOR_CMD_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 鸣笛
|
||||
*
|
||||
* @param value 1: honk 2: stop honking
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendOperatorCmdSetHorn(double value) {
|
||||
MessagePad.OperatorCmdReq req = MessagePad.OperatorCmdReq
|
||||
.newBuilder()
|
||||
.setCmdType(MessagePad.OperatorCmdType.OPERATOR_CMD_SET_HORN)
|
||||
.setValue(value)
|
||||
.build();
|
||||
return sendPBMessage(MessageType.TYPE_SEND_OPERATOR_CMD_REQ.typeCode, req.toByteArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始鸣笛
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendOperatorCmdStartHonking() {
|
||||
return sendOperatorCmdSetHorn(1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止鸣笛
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean sendOperatorCmdStopHonking() {
|
||||
return sendOperatorCmdSetHorn(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -218,12 +218,6 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startDispatchHandler() {
|
||||
if (mChannel != null) {
|
||||
mChannel.startDispatchHandler();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopDispatchHandler() {
|
||||
@@ -580,6 +574,38 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel != null && mChannel.sendSpecialVehicleTaskCmd(cmdBuild);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean sendOperatorCmdChangeLaneLeft() {
|
||||
return mChannel != null && mChannel.sendOperatorCmdChangeLaneLeft();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendOperatorCmdChangeLaneRight() {
|
||||
return mChannel != null && mChannel.sendOperatorCmdChangeLaneRight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendOperatorCmdSetAcceleratedSpeed(double acc) {
|
||||
return mChannel != null && mChannel.sendOperatorCmdSetAcceleratedSpeed(acc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendOperatorCmdSetHorn(double value) {
|
||||
return mChannel != null && mChannel.sendOperatorCmdSetHorn(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendOperatorCmdStartHonking() {
|
||||
return mChannel != null && mChannel.sendOperatorCmdStartHonking();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendOperatorCmdStopHonking() {
|
||||
return mChannel != null && mChannel.sendOperatorCmdStopHonking();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取工控机固定IP列表
|
||||
*
|
||||
|
||||
@@ -300,6 +300,50 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
boolean sendSpecialVehicleTaskCmd(SpecialVehicleTaskCmdOuterClass.SpecialVehicleTaskCmd.Builder cmdBuild);
|
||||
|
||||
|
||||
/**
|
||||
* 向左变道
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendOperatorCmdChangeLaneLeft();
|
||||
|
||||
/**
|
||||
* 向右变道
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendOperatorCmdChangeLaneRight();
|
||||
|
||||
/**
|
||||
* 发送设置加速度
|
||||
*
|
||||
* @param acc acc>0加速 acc<0减速 acc=0复位
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendOperatorCmdSetAcceleratedSpeed(double acc);
|
||||
|
||||
/**
|
||||
* 鸣笛
|
||||
*
|
||||
* @param value 1: honk 2: stop honking
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendOperatorCmdSetHorn(double value);
|
||||
|
||||
/**
|
||||
* 开始鸣笛
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendOperatorCmdStartHonking();
|
||||
|
||||
/**
|
||||
* 停止鸣笛
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
boolean sendOperatorCmdStopHonking();
|
||||
// TODO 需求暂停 待讨论
|
||||
// boolean getRoutes();
|
||||
|
||||
@@ -319,10 +363,6 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
void decoderRaw(byte[] bytes);
|
||||
|
||||
/**
|
||||
* 启动分发线程
|
||||
*/
|
||||
void startDispatchHandler();
|
||||
|
||||
/**
|
||||
* 停止分发线程
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CupidLogUtils {
|
||||
* @param isEnableLog true开启 false关闭
|
||||
*/
|
||||
public static void setEnableLog(boolean isEnableLog) {
|
||||
mIsEnableLog = isEnableLog;
|
||||
// mIsEnableLog = isEnableLog; TODO 临时注释
|
||||
}
|
||||
|
||||
public static boolean isEnableLog() {
|
||||
|
||||
@@ -45,11 +45,12 @@ public enum MessageType {
|
||||
TYPE_SEND_STATUS_QUERY_REQ(MessagePad.MessageType.MsgTypeStatusQueryReq, "状态查询请求"),
|
||||
TYPE_RECEIVE_STATUS_QUERY_RESP(MessagePad.MessageType.MsgTypeStatusQueryResp, "状态查询应答"),
|
||||
TYPE_SEND_SET_RAIN_MODE_REQ(MessagePad.MessageType.MsgTypeSetRainModeReq, "设置雨天模式"),
|
||||
TYPE_SEND_OPERATOR_CMD_REQ(MessagePad.MessageType.MsgTypeOperatorCmdReq, "操控指令"),
|
||||
TYPE_SEND_RECORD_DATA_CONFIG_REQ(MessagePad.MessageType.MsgTypeRecordDataConfigReq, "数据采集配置查询"),
|
||||
TYPE_RECEIVE_RECORD_DATA_CONFIG_RESP(MessagePad.MessageType.MsgTypeRecordDataConfigResp, "数据采集配置"),
|
||||
TYPE_SEND_SUBSCRIBE_DATA_REQ(MessagePad.MessageType.MsgTypeSubscribeDataReq, "数据订阅、取消订阅请求"),
|
||||
TYPE_SEND_SPECIAL_VEHICLE_TASK_CMD(MessagePad.MessageType.MsgTypeSpecialVehicleTaskCmd, "特种车辆命令"),
|
||||
//透传 原始pb文件中不存在以下type。由于Java中无法强转所以在ADAS_DATA message_pad.proto中放开注释
|
||||
//透传 原始pb文件中不存在以下type。由于Java中无法强转所以在mogo-adas-data message_pad.proto中放开注释
|
||||
TYPE_RECEIVE_PLANNING_DECISION_STATE(MessagePad.MessageType.MsgTypePlanningDecisionState, "Planning决策状态");
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class FpgaSocket implements IWebSocket {
|
||||
private static final String TAG = FpgaSocket.class.getSimpleName();
|
||||
private OkHttpClient client;
|
||||
|
||||
private WebSocket mWebSocket;
|
||||
private volatile WebSocket mWebSocket;
|
||||
|
||||
private EchoWebSocketListener listener;
|
||||
private IWebSocketConnectListener mWebSocketConnectListener;
|
||||
@@ -68,6 +68,10 @@ public class FpgaSocket implements IWebSocket {
|
||||
* 是否是被动关闭
|
||||
*/
|
||||
private final AtomicBoolean isPassiveClose = new AtomicBoolean(false);
|
||||
/**
|
||||
* 是否已经连接成功
|
||||
*/
|
||||
private final AtomicBoolean isConnected = new AtomicBoolean(false);
|
||||
|
||||
/**
|
||||
* 接收数据超时原因 null时表示不是接收数据超时的原因
|
||||
@@ -111,14 +115,14 @@ public class FpgaSocket implements IWebSocket {
|
||||
connect("连接中");
|
||||
}
|
||||
|
||||
private void connect(String msg) {
|
||||
private synchronized void connect(String msg) {
|
||||
if (mWebSocket == null) {
|
||||
if (mWebSocketConnectListener != null)
|
||||
mWebSocketConnectListener.onConnecting(msg);
|
||||
Request request = new Request.Builder()
|
||||
.url(wsHost)
|
||||
.build();
|
||||
client.newWebSocket(request, listener);
|
||||
mWebSocket = client.newWebSocket(request, listener);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +155,7 @@ public class FpgaSocket implements IWebSocket {
|
||||
|
||||
@Override
|
||||
public boolean sendDataWebSocket(String data) {
|
||||
if (mWebSocket != null) {
|
||||
if (mWebSocket != null && isConnected.get()) {
|
||||
boolean result = mWebSocket.send(data);
|
||||
CupidLogUtils.i(TAG, "WebSocket send String= " + data + ", result= " + result);
|
||||
return result;
|
||||
@@ -161,7 +165,7 @@ public class FpgaSocket implements IWebSocket {
|
||||
|
||||
@Override
|
||||
public boolean sendDataWebSocket(ByteString data) {
|
||||
if (mWebSocket != null) {
|
||||
if (mWebSocket != null && isConnected.get()) {
|
||||
boolean result = mWebSocket.send(data);
|
||||
CupidLogUtils.i(TAG, "WebSocket send ByteString=" + ByteUtil.byteArrToHex(data.toByteArray()) + ", result= " + result);
|
||||
return result;
|
||||
@@ -200,8 +204,9 @@ public class FpgaSocket implements IWebSocket {
|
||||
@Override
|
||||
public void onOpen(@NonNull WebSocket webSocket, @NonNull Response response) {
|
||||
super.onOpen(webSocket, response);
|
||||
mWebSocket = webSocket;
|
||||
// mWebSocket = webSocket;
|
||||
boolean isConnect = response.code() == 101;
|
||||
isConnected.set(isConnect);
|
||||
if (!isConnect) {
|
||||
onPassiveClose(1001, "協議不匹配");
|
||||
} else {
|
||||
@@ -342,6 +347,7 @@ public class FpgaSocket implements IWebSocket {
|
||||
* @param code code
|
||||
*/
|
||||
private void close(boolean isInitiative, int code) {
|
||||
isConnected.set(false);
|
||||
String closeReason = null;
|
||||
if (isInitiative) {
|
||||
closeReason = "用户主动关闭";
|
||||
|
||||
@@ -31,14 +31,6 @@ public class DispatchHandler {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (mThread == null) {
|
||||
mThread = new HandlerThread(name);
|
||||
mThread.start();
|
||||
initHandler(mThread.getLooper());
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
if (mBaseHandler != null) {
|
||||
mBaseHandler.removeCallbacksAndMessages(null);
|
||||
@@ -51,12 +43,15 @@ public class DispatchHandler {
|
||||
}
|
||||
|
||||
public void sendRawMessage(RawData raw) {
|
||||
if (mBaseHandler != null) {
|
||||
Message msg = Message.obtain();
|
||||
msg.what = WHAT_DISPATCH_RAW;
|
||||
msg.obj = raw;
|
||||
mBaseHandler.sendMessage(msg);
|
||||
if (mThread == null) {
|
||||
mThread = new HandlerThread(name);
|
||||
mThread.start();
|
||||
initHandler(mThread.getLooper());
|
||||
}
|
||||
Message msg = Message.obtain();
|
||||
msg.what = WHAT_DISPATCH_RAW;
|
||||
msg.obj = raw;
|
||||
mBaseHandler.sendMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ import java.util.List;
|
||||
*/
|
||||
public class MogoPolylineOptions {
|
||||
|
||||
public boolean useFacade = false;
|
||||
public float maxIndex = Float.MIN_VALUE;
|
||||
private List<MogoLatLng> mPoints;
|
||||
private float mWidth = 10.0F;
|
||||
private int mColor = Color.BLACK;
|
||||
@@ -156,6 +158,11 @@ public class MogoPolylineOptions {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MogoPolylineOptions maxIndex(float maxIndex) {
|
||||
this.maxIndex = maxIndex;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置透明度
|
||||
*
|
||||
@@ -182,6 +189,12 @@ public class MogoPolylineOptions {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MogoPolylineOptions useFacade(boolean useFacade) {
|
||||
this.useFacade = useFacade;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param isAboveMaskLayer
|
||||
* @return
|
||||
@@ -240,6 +253,11 @@ public class MogoPolylineOptions {
|
||||
return mIsGradient;
|
||||
}
|
||||
|
||||
public boolean useFacade() {
|
||||
return useFacade;
|
||||
}
|
||||
|
||||
|
||||
public float getTransparency() {
|
||||
return mTransparency;
|
||||
}
|
||||
|
||||
@@ -313,4 +313,20 @@ public interface IMogoMapUIController {
|
||||
* @return angle
|
||||
*/
|
||||
Double getRoadAngle(Double lon,Double lat,float angle);
|
||||
|
||||
/**
|
||||
* 设置锁屏模式
|
||||
*/
|
||||
void setLockMode(boolean isLock);
|
||||
|
||||
/**
|
||||
* 设置手势滑动失效
|
||||
*/
|
||||
void setScrollGesturesEnable(boolean isEnable);
|
||||
|
||||
/**
|
||||
* 设置所有的滑动失效
|
||||
*/
|
||||
void setAllGesturesEnabled(boolean isEnable);
|
||||
|
||||
}
|
||||
|
||||
@@ -48,6 +48,9 @@ dependencies {
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
// 高精地图
|
||||
implementation rootProject.ext.dependencies.mogocustommap
|
||||
// 高德地图
|
||||
api rootProject.ext.dependencies.amaplocation
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
|
||||
@@ -171,6 +171,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
//设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放
|
||||
options.setZoomGesturesEnabled(true);
|
||||
options.setScaleVRMode(true);
|
||||
// options.setAllGesturesEnabled(false); //禁止全部手势
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(true);
|
||||
}
|
||||
@@ -358,17 +359,22 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
|
||||
Log.d("XXXX", "--- 2 -----");
|
||||
MapAutoViewHelper mapAutoViewHelper = mMapView.getMapAutoViewHelper();
|
||||
if (mapAutoViewHelper != null) {
|
||||
Log.d("XXXX", "--- 3 -----");
|
||||
mVisualAngleMode = angelMode;
|
||||
if (angelMode == MODE_CLOSE_SIGHT) {
|
||||
Log.d("XXXX", "--- 4 -----");
|
||||
if (mogoLatLng == null) {
|
||||
Log.d("XXXX", "--- 5 -----");
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "切换地图近景需要传入要移动的经纬度数据");
|
||||
return;
|
||||
}
|
||||
// 近景传入经纬度为点击地图上静态marker经纬度数据,为GPS坐标点。
|
||||
mapAutoViewHelper.setNearViewAnglePosition(new LonLatPoint(mogoLatLng.lon, mogoLatLng.lat), true);
|
||||
} else {
|
||||
Log.d("XXXX", "--- 6 -----");
|
||||
mapAutoViewHelper.setMapViewVisualAngle(angelMode.getCode());
|
||||
}
|
||||
}
|
||||
@@ -424,7 +430,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是VR模式
|
||||
*
|
||||
* @return true-是,false=不是
|
||||
*/
|
||||
@@ -643,6 +648,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
/**
|
||||
* 设置转向灯和刹车灯
|
||||
*
|
||||
* @param type :车尾灯类型 time: 闪烁时间 最小500ms 小于500ms 默认为500ms
|
||||
* @param time
|
||||
*/
|
||||
@@ -671,6 +677,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void changeMapViewAngle(int type) {
|
||||
Log.d("XXXX", "--- 1 -----");
|
||||
if (checkAMapView()) {
|
||||
//mMapView.getMapAutoViewHelper().testMapViewAngle(type);
|
||||
}
|
||||
@@ -748,9 +755,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
sysLocation.setSpeed(location.getSpeed());
|
||||
|
||||
// 将有效经纬度暂存本地,提供给下一次的Http-DNS使用,防止首次请求位置获取不到
|
||||
if (location.getLat() > 0) {
|
||||
SharedPrefsMgr.getInstance(mMapView.getContext())
|
||||
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, location.getCityCode());
|
||||
if (location.getLat() > 0 && location.getLon() > 0) {
|
||||
if (location.getCityCode() != null && !location.getCityCode().isEmpty()) {
|
||||
SharedPrefsMgr.getInstance(mMapView.getContext())
|
||||
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, location.getCityCode());
|
||||
}
|
||||
SharedPrefsMgr.getInstance(mMapView.getContext())
|
||||
.putString(SharedPrefsConstants.LOCATION_LATITUDE, String.valueOf(location.getLat()));
|
||||
SharedPrefsMgr.getInstance(mMapView.getContext())
|
||||
@@ -1000,7 +1009,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
bean.setAcceleration(gnssInfo.getAcceleration());
|
||||
bean.setAlt(gnssInfo.getAltitude());
|
||||
bean.setSystemTime(Double.valueOf(gnssInfo.getSystemTime()).longValue());
|
||||
bean.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime()*1000).longValue());
|
||||
bean.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime() * 1000).longValue());
|
||||
bean.setLon(gnssInfo.getLongitude());
|
||||
bean.setLat(gnssInfo.getLatitude());
|
||||
bean.setGnss_speed(((float) gnssInfo.getGnssSpeed()));
|
||||
@@ -1053,7 +1062,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getRoadAngle(Double lon,Double lat,float angle) {
|
||||
public Double getRoadAngle(Double lon, Double lat, float angle) {
|
||||
return MapDataApi.INSTANCE.getRoadRectInfo(lon, lat, angle).getAngle();
|
||||
}
|
||||
|
||||
@@ -1107,4 +1116,25 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}, 1000L);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockMode(boolean isLock) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setLockMode(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScrollGesturesEnable(boolean isEnable) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setScrollGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAllGesturesEnabled(boolean isEnable) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Point;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.marker.AMapInfoWindowAdapter;
|
||||
import com.mogo.map.marker.AMapMarkerWrapper;
|
||||
@@ -114,13 +115,13 @@ public class AMapWrapper implements IMogoMap {
|
||||
markerOptionsArrayList.add(markerOptions);
|
||||
}
|
||||
});
|
||||
MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList, false, 8.0f, 1, 100, 1);
|
||||
MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList, false, FunctionBuildConfig.isBeautyMode ? 8.0f : 0f, 1, 100, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String addPreVehicleModel(int type, int modelRes) {
|
||||
try {
|
||||
return MarkerHelper.INSTANCE.addPreVehicleModel(type, modelRes);
|
||||
return MarkerHelper.INSTANCE.addPreVehicleModel(type, modelRes);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -354,6 +354,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
initDelegate();
|
||||
@@ -403,4 +404,28 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockMode(boolean isLock) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setLockMode(isLock);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScrollGesturesEnable(boolean isEnable) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setScrollGesturesEnable(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAllGesturesEnabled(boolean isEnable) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.mogo.map.location;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.amap.api.location.AMapLocation;
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
import com.amap.api.location.AMapLocationClientOption;
|
||||
import com.amap.api.location.AMapLocationListener;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
|
||||
public class GDLocationClient implements AMapLocationListener {
|
||||
|
||||
private volatile static GDLocationClient gdLocationClient;
|
||||
private static final byte[] obj = new byte[0];
|
||||
|
||||
public static GDLocationClient getInstance(Context context) {
|
||||
if (gdLocationClient == null) {
|
||||
synchronized (obj) {
|
||||
if (gdLocationClient == null) {
|
||||
gdLocationClient = new GDLocationClient(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
return gdLocationClient;
|
||||
}
|
||||
|
||||
//声明LocationClient对象
|
||||
private final AMapLocationClient mLocationClient;
|
||||
private String mCityCode;
|
||||
|
||||
private GDLocationClient(Context context) {
|
||||
mLocationClient = new AMapLocationClient(context);
|
||||
//初始化定位参数
|
||||
//声明mLocationOption对象
|
||||
AMapLocationClientOption mLocationOption = new AMapLocationClientOption();
|
||||
//设置定位监听
|
||||
mLocationClient.setLocationListener(this);
|
||||
//设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
|
||||
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
|
||||
//设置定位间隔,单位毫秒,默认为2000ms
|
||||
mLocationOption.setInterval(1000);
|
||||
//设置定位参数
|
||||
mLocationClient.setLocationOption(mLocationOption);
|
||||
}
|
||||
|
||||
public void start() {
|
||||
mLocationClient.startLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(AMapLocation aMapLocation) {
|
||||
if (aMapLocation != null) {
|
||||
String cityCode = aMapLocation.getCityCode();
|
||||
if (cityCode != null && !cityCode.isEmpty()) {
|
||||
mCityCode = aMapLocation.getCityCode();
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getLastCityCode() {
|
||||
return mCityCode;
|
||||
}
|
||||
}
|
||||
@@ -340,4 +340,25 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockMode(boolean isLock) {
|
||||
if (mClient != null) {
|
||||
mClient.setLockMode(isLock);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScrollGesturesEnable(boolean isEnable) {
|
||||
if (mClient != null) {
|
||||
mClient.setScrollGesturesEnable(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAllGesturesEnabled(boolean isEnable) {
|
||||
if (mClient != null) {
|
||||
mClient.setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,6 +479,10 @@ public class ObjectUtils {
|
||||
target.zIndex(options.getZIndex());
|
||||
target.setColor(options.getColor());
|
||||
target.useGradient(options.isGradient());
|
||||
target.useFacade(options.useFacade);
|
||||
if (options.maxIndex >= 0f) {
|
||||
target.maxIndex = options.maxIndex;
|
||||
}
|
||||
if (options.getColorValues() != null) {
|
||||
target.colorValues(options.getColorValues());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user