替换主动获取自动驾驶状态的调用方式

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2022-02-07 17:12:29 +08:00
parent e787cba3be
commit 8233e69f99
11 changed files with 21 additions and 115 deletions

View File

@@ -9,7 +9,6 @@ import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotControlCmdParameter;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.network.utils.GsonUtil;
@@ -67,24 +66,6 @@ public class MogoADASController implements IMogoADASController {
if (mAdasDataListener == null) {
mAdasDataListener = new IAdasDataListener() {
@Override
public void autopilotArrive(AutopilotStationInfo autopilotArriveModel) {
if (autopilotArriveModel == null) {
Logger.d(TAG, "autopilotArrive autopilotArriveModel is null");
return;
}
if (!mAdasOCHCallback.isEmpty()) {
for (IMogoAdasOCHCallback cb : mAdasOCHCallback) {
cb.onArriveAt(new AutopilotStationInfo(
autopilotArriveModel.getType(),
autopilotArriveModel.getLon(),
autopilotArriveModel.getLat())
);
}
}
}
@Override
public void ownerCarStateInfo(String ownerCarStateInfo) {
// 接收 adas 定位数据线程
@@ -141,30 +122,6 @@ public class MogoADASController implements IMogoADASController {
mMogoAdasCarDataCallback = carDataCallback;
}
@Override
public void addAdasOCHCallback(IMogoAdasOCHCallback callback) {
if (mAdasOCHCallback.contains(callback)) {
return;
}
mAdasOCHCallback.add(callback);
}
@Override
public void removeAdasOCHCallback() {
mAdasOCHCallback.clear();
}
@Override
public int getAutopilotStatus() {
int status = IMogoAdasOCHCallback.STATUS_AUTOPILOT_DISABLE;
try {
status = adasProvider.autopilotStateCall().getState();
} catch (Exception e) {
e.printStackTrace();
}
return status;
}
}