Merge branch 'dev_arch_opt_3.0' into dev_opt_2.15.0
This commit is contained in:
@@ -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 ->
|
||||
|
||||
@@ -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()){
|
||||
//将角标改为“下载中”
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocati
|
||||
private var mGnssInfo: MogoLocation = MogoLocation()
|
||||
|
||||
fun getChassisLocationWGS84(): MogoLocation {
|
||||
return mGnssInfo
|
||||
return mGnssInfo.clone()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user