Merge branch 'dev_arch_opt_3.0' into dev_opt_2.15.0

This commit is contained in:
lixiaopeng
2023-03-21 11:05:40 +08:00
8 changed files with 102 additions and 101 deletions

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.setting
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
@@ -71,20 +72,18 @@ internal class SOPSettingView @JvmOverloads constructor(
}
/**
* obu弱势交通控制
* obu弱势交通控制, 默认开启
*/
// tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
// tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
// // 默认开启
// HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
// }
tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
HmiBuildConfig.isShowObuWeaknessTrafficView = isChecked
}
/**
* 云端弱势交通控制
* 云端弱势交通控制 默认关闭
*/
tbCloudWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowCloudWeaknessTrafficView
tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
// 默认关闭
HmiBuildConfig.isShowCloudWeaknessTrafficView = isChecked
}
@@ -93,7 +92,6 @@ internal class SOPSettingView @JvmOverloads constructor(
*/
tbObuV2vView.isChecked = HmiBuildConfig.isShowObuV2vView
tbObuV2vView.setOnCheckedChangeListener { _, isChecked ->
// 默认关闭
HmiBuildConfig.isShowObuV2vView = isChecked
}
@@ -105,14 +103,6 @@ internal class SOPSettingView @JvmOverloads constructor(
HmiBuildConfig.isShowObuV2iView = isChecked
}
/**
* obu 数据通过dc 传输V2i事件 开关 TODO pm确定下开关功能 HmiBuildConfig.isShowObuToDcV2iView
*/
tbObuToDcView.setOnCheckedChangeListener { _, isChecked ->
// 默认开启
HmiBuildConfig.isShowObuToDcV2iView = !isChecked
}
//红绿灯标识
tbTrafficLight.isChecked = HmiBuildConfig.isShowTrafficLightView
tbTrafficLight.setOnCheckedChangeListener { _, isChecked ->

View File

@@ -141,7 +141,12 @@ class SystemVersionView @JvmOverloads constructor(
}
}
updateHDDataCacheStatus(CallerMapUIServiceManager.isCityDataCached())
ThreadUtils.getIoPool().execute {
val isCached = CallerMapUIServiceManager.isCityDataCached()
UiThreadHandler.post {
updateHDDataCacheStatus(isCached)
}
}
if(AdUpgradeStateHelper.isConfirmUpgrade()){
//将角标改为“下载中”

View File

@@ -163,22 +163,6 @@
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"
android:scaleX="1.2"
app:layout_constraintTop_toBottomOf="@id/tbObuV2vView"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
/>
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/tbObuWeaknessTrafficSop"
android:layout_width="wrap_content"

View File

@@ -324,6 +324,50 @@ public class MogoLocation implements Cloneable {
return this;
}
public MogoLocation copy(MogoLocation lastLocation, double longitude, double latitude) {
MogoLocation mogoLocation = new MogoLocation();
mogoLocation.accuracy = lastLocation.accuracy;
mogoLocation.adCode = lastLocation.adCode;
mogoLocation.address = lastLocation.address;
mogoLocation.aoiName = lastLocation.aoiName;
mogoLocation.buildingId = lastLocation.buildingId;
mogoLocation.cityCode = lastLocation.cityCode;
mogoLocation.cityName = lastLocation.cityName;
mogoLocation.description = lastLocation.description;
mogoLocation.district = lastLocation.district;
mogoLocation.errorCode = lastLocation.errorCode;
mogoLocation.errorInfo = lastLocation.errorInfo;
mogoLocation.floor = lastLocation.floor;
mogoLocation.gpsAccuracyStatus = lastLocation.gpsAccuracyStatus;
mogoLocation.lastReceiveTime = lastLocation.lastReceiveTime;
mogoLocation.locationDetail = lastLocation.locationDetail;
mogoLocation.locType = lastLocation.locType;
mogoLocation.poiName = lastLocation.poiName;
mogoLocation.provider = lastLocation.provider;
mogoLocation.province = lastLocation.province;
mogoLocation.satellite = lastLocation.satellite;
mogoLocation.street = lastLocation.street;
mogoLocation.streetNum = lastLocation.streetNum;
MessagePad.GnssInfo gnssInfo =
MessagePad.GnssInfo.newBuilder()
.setLongitude(longitude) //经度
.setLatitude(latitude)//纬度
.setAltitude(lastLocation.gnssInfo.getAltitude()) //海拔
.setHeading(lastLocation.gnssInfo.getHeading()) //航向角
.setAcceleration(lastLocation.gnssInfo.getAcceleration()) //加速度
.setYawRate(lastLocation.gnssInfo.getYawRate()) //曲率
.setGnssSpeed(lastLocation.gnssInfo.getGnssSpeed()) //惯导车速 m/s
.setVehicleSpeed(lastLocation.gnssInfo.getVehicleSpeed()) //车辆车速 m/s
.setSatelliteTime(lastLocation.gnssInfo.getSatelliteTime()) //gps时间 单位秒s
.setSystemTime(lastLocation.gnssInfo.getSystemTime()) //系统时间 单位秒s
.build();
mogoLocation.gnssInfo = gnssInfo;
return mogoLocation;
}
public long getLastReceiveTime() {
return lastReceiveTime;
}

View File

@@ -18,7 +18,7 @@ object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocati
private const val TAG = "CallerChassisLocationGCJ20ListenerManager"
@Volatile
private var mGnssInfo: MogoLocation? = null
private var mGnssInfo: MogoLocation = MogoLocation()
/**
* 添加监听并指定回掉频率
@@ -35,8 +35,8 @@ object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocati
setListenerHz(tag, callBackHz)
}
fun getChassisLocationGCJ02(): MogoLocation? {
return mGnssInfo
fun getChassisLocationGCJ02(): MogoLocation {
return mGnssInfo.clone()
}
/**
@@ -46,46 +46,42 @@ object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocati
@Synchronized
fun invokeChassisLocationGCJ02(gnssInfo: MogoLocation?, sourceType: DataSourceType) {
gnssInfo?.let {
// 克隆定位数据,防止原数据被篡改导致位置跳变
mGnssInfo = gnssInfo.clone()
// 转换 WGS84-->GCJ02 坐标
val gcj20Location =
CoordinateTransform.WGS84ToGCJ02(gnssInfo.longitude, gnssInfo.latitude)
mGnssInfo?.let {
mGnssInfo!!.longitude = gcj20Location[0]
mGnssInfo!!.latitude = gcj20Location[1]
// 克隆定位数据,防止原数据被篡改导致位置跳变
mGnssInfo = gnssInfo.copy(gnssInfo, gcj20Location[0], gcj20Location[1])
M_LISTENERS.forEach {
val tag = it.key
// 获取数据监听需要的HZ
val hz = M_LISTENERS_HZ[tag]
if (hz != null && hz > 0) {
val hzTime = (1.0 / hz.toDouble()) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
M_LISTENERS.forEach {
val tag = it.key
// 获取数据监听需要的HZ
val hz = M_LISTENERS_HZ[tag]
if (hz != null && hz > 0) {
val hzTime = (1.0 / hz.toDouble()) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, mGnssInfo, sourceType)
}
} else {
//Logger.d(TAG, "没设置监听频率使用默认5HZ")
val hzTime = (1.0 / 5) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
syncLocationCallback(tag, it, mGnssInfo, sourceType)
}
} else {
//Logger.d(TAG, "没设置监听频率使用默认5HZ")
val hzTime = (1.0 / 5) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, mGnssInfo, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo, sourceType)
}
}
}

View File

@@ -17,7 +17,7 @@ object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocati
private var mGnssInfo: MogoLocation = MogoLocation()
fun getChassisLocationWGS84(): MogoLocation {
return mGnssInfo
return mGnssInfo.clone()
}
/**

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.10
MOGO_NETWORK_VERSION=1.4.6.4
# 鉴权
MOGO_PASSPORT_VERSION=1.4.5.10
MOGO_PASSPORT_VERSION=1.4.6.4
# 常链接
MOGO_SOCKET_VERSION=1.4.5.10
MOGO_SOCKET_VERSION=1.4.6.4
# 数据采集
MOGO_REALTIME_VERSION=1.4.5.10
MOGO_REALTIME_VERSION=1.4.6.4
# 探路,道路事件发布,获取
MOGO_TANLU_VERSION=1.4.5.10
MOGO_TANLU_VERSION=1.4.6.4
# 直播推流
MOGO_LIVE_VERSION=1.4.5.10
MOGO_LIVE_VERSION=1.4.6.4
# 直播拉流
MOGO_TRAFFICLIVE_VERSION=1.4.5.10
MOGO_TRAFFICLIVE_VERSION=1.4.6.4
# 定位服务
MOGO_LOCATION_VERSION=1.4.5.10
MOGO_LOCATION_VERSION=1.4.6.4
# 远程通讯模块
MOGO_TELEMATIC_VERSION=1.4.5.10
MOGO_TELEMATIC_VERSION=1.4.6.4
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.10.0.9

View File

@@ -25,7 +25,6 @@ import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import com.mogo.commons.debug.DebugConfig;
@@ -35,7 +34,7 @@ import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.data.map.MapRoadInfo;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager;
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager;
@@ -214,28 +213,11 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onStopLineInfo(@androidx.annotation.Nullable StopLine stopLine) {
MogoLocation carLoc = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02();
MogoLocation carLoc = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84();
if (stopLine != null && stopLine.road_id != null && !stopLine.road_id.isEmpty() && stopLine.points != null && stopLine.points.size() > 0) {
ArrayList<LonLatPoint> points = stopLine.points;
if (carLoc != null) {
/**
* //地图组提供的高德坐标切到WGS84坐标系
* var cal = LonLatPoint(point!!.lon, point!!.lat)
* if(!point!!.provider.equals(MapAutoApi.GPS_FLAG)){
* cal = MapTools.switchLonLatWGS84(cal)
* }
*/
String provider = carLoc.getProvider();
//CallerLogger.INSTANCE.d(M_MAP + TAG, "car_loc: " + carLoc + "");
if (!MapAutoApi.GPS_FLAG.equals(provider)) {
//CallerLogger.INSTANCE.d(M_MAP + TAG, "convert before: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
LonLatPoint p = new LonLatPoint(carLoc.getLongitude(), carLoc.getLatitude());
p = MapTools.INSTANCE.switchLonLatWGS84(p);
carLoc.setLongitude(p.longitude);
carLoc.setLatitude(p.latitude);
//CallerLogger.INSTANCE.d(M_MAP + TAG, "convert after: car_loc: {lon: " + carLoc.getLongitude() + ", lat: " + carLoc.getLatitude() + "}");
}
//CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
// //CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
MapRoadInfo.StopLine stopInfo = convert(stopLine);
LonLatPoint p1 = points.get(0);
LonLatPoint p2 = points.get(points.size() - 1);