remove networkold api and union the adasapis and adasstatus lat lon data

This commit is contained in:
zhongchao
2022-03-29 19:09:35 +08:00
parent 66cde2ea81
commit acbde6411e
43 changed files with 129 additions and 732 deletions

View File

@@ -11,7 +11,6 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_STATUS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_TRAJECTORY
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_VEHICLE
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_WARN
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_CAR_STATE
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
@@ -19,6 +18,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeArriveAtStation
@@ -37,8 +37,6 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showAdUpgradeStatu
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showDockerRebootResult
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.module.common.MogoApisHandler
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.OnAdasListener
import com.zhidao.support.adas.high.bean.IPCUpgradeStateInfo
@@ -125,21 +123,13 @@ class MoGoAdasListenerImpl : OnAdasListener {
)
override fun onGnssInfo(header: MessagePad.Header, gnssInfo: MessagePad.GnssInfo?) {
invokeAutopilotCarStateData(gnssInfo)
// 同步给MAP地图
if (gnssInfo != null) {
MogoApisHandler.getInstance().apis.adasControllerApi.lastLat = gnssInfo.latitude
MogoApisHandler.getInstance().apis.adasControllerApi.lastLon = gnssInfo.longitude
MogoApisHandler.getInstance().apis.adasControllerApi.satelliteTime =
java.lang.Double.valueOf(gnssInfo.satelliteTime).toLong()
if (1 == FunctionBuildConfig.gpsProvider) {
CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(
gnssInfo
)
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo(gnssInfo)
// 同步给MAP地图
CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(gnssInfo)
// 同步更新经纬度和系统时间至 AutoPilotStatusListener
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(gnssInfo.satelliteTime.toLong(),gnssInfo.longitude, gnssInfo.latitude)
}
//根据加速度判断 是否刹车
CallerAutopilotVehicleStateListenerManager.invokeAutopilotBrakeLightByAcceleration(gnssInfo.acceleration)
}
}

View File

@@ -1,13 +1,18 @@
package com.mogo.eagle.core.function.autopilot.adapter;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
@@ -24,12 +29,11 @@ import chassis.Chassis;
import mogo.telematics.pad.MessagePad;
import record_cache.RecordPanelOuterClass;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
public class MoGoHandAdasMsgManager implements
IMoGoAutopilotIdentifyListener,
IMoGoAutopilotVehicleStateListener,
IMoGoAutopilotCarConfigListener{
IMoGoAutopilotCarConfigListener,
IMoGoAutopilotCarStateListener {
private final String TAG = "AdasEventManager";
@@ -39,6 +43,7 @@ public class MoGoHandAdasMsgManager implements
CallerAutopilotIdentifyListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotCarConfigListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotCarStatusListenerManager.INSTANCE.addListener(TAG, this);
}
public static MoGoHandAdasMsgManager getInstance() {
@@ -91,17 +96,13 @@ public class MoGoHandAdasMsgManager implements
} else {
isShowTurnLight = false;
}
// CallerLogger.INSTANCE.d(M_DEVA + TAG, "onAutopilotLightSwitchData -- newState:" + state + ",oldState:" + lightSwitch.getNumber());
CallerHmiManager.INSTANCE.showTurnLight(state);
}
}
@Override
public void onAutopilotBrakeLightData(boolean brakeLight) {
// CallerLogger.INSTANCE.d(M_DEVA + TAG, "onAutopilotBrakeLightData -- brakeLight = $brakeLight ---$isShowTurnLight");
// if (!isShowTurnLight) {
// CallerHmiManager.INSTANCE.showBrakeLight(brakeLight ? 1 : 0);
// }
}
@Override
@@ -137,22 +138,20 @@ public class MoGoHandAdasMsgManager implements
}
}
/**
* 根据加速度判断是否刹车
* @param acceleration
*/
@Override
public void onAutopilotBrakeLightByAcceleration(double acceleration) {
//设置刹车信息
if (acceleration < -2.5) {
brakeLight = 1;
} else {
brakeLight = 0;
public void onAutopilotCarStateData(@Nullable MessagePad.GnssInfo gnssInfo) {
//根据加速度判断 是否刹车
if (gnssInfo != null) {
//设置刹车信息
if (gnssInfo.getAcceleration() < -2.5) {
brakeLight = 1;
} else {
brakeLight = 0;
}
if (!isShowTurnLight) {
ThreadUtils.runOnUiThread(() -> CallerHmiManager.INSTANCE.showBrakeLight(brakeLight));
}
}
// CallerLogger.INSTANCE.d(M_DEVA + TAG, "onAutopilotBrakeLightByAcceleration -- acceleration = " + acceleration);
if (!isShowTurnLight) {
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
}
}
}