[2.13.0-arch-opt] Volatile

This commit is contained in:
zhongchao
2023-03-07 19:03:23 +08:00
parent c6cf58f77a
commit d1cd2a0c3f
7 changed files with 32 additions and 29 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

@@ -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添加新的字段 所以临时保留

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

@@ -10,6 +10,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
import mogo_msg.MogoReportMsg
@@ -69,29 +70,30 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
*工控机监控节点上报
*/
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
guardianInfo?.let{
if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|| it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|| it.resultList.contains(RESULT_REMOTEPILOT_DISABLE)
|| it.resultList.contains(RESULT_AUTOPILOT_INFERIOR)
|| it.resultList.contains(RESULT_SHOW_WARNING)
|| it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){
val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
}
ThreadUtils.runOnUiThread {
guardianInfo?.let{
if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|| it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|| it.resultList.contains(RESULT_REMOTEPILOT_DISABLE)
|| it.resultList.contains(RESULT_AUTOPILOT_INFERIOR)
|| it.resultList.contains(RESULT_SHOW_WARNING)
|| it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){
val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()),
it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
}
if (reportList.size > 49) {
reportList.removeLast()
}
reportList.add(
0,
ReportEntity(
TimeUtils.millis2String(System.currentTimeMillis()),
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
if (reportList.size > 49) {
reportList.removeLast()
}
reportList.add(
0,
ReportEntity(
TimeUtils.millis2String(System.currentTimeMillis()),
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
)
)
)
reportListFloatWindow?.refreshData(reportList)
reportListFloatWindow?.refreshData(reportList)
// //Error 弹窗并有提示音
// if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
@@ -128,6 +130,7 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
// }
// }
// }
}
}
}

View File

@@ -117,6 +117,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

View File

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

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() {
}