add new func of httpdns switch city to fit socketserver

This commit is contained in:
zhongchao
2021-07-30 17:22:37 +08:00
100 changed files with 1985 additions and 2080 deletions

View File

@@ -35,7 +35,7 @@ import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.common.entity.MarkerResponse;
import com.mogo.module.common.map.MapCenterPointStrategy;
import com.mogo.module.common.map.Scene;
import com.mogo.module.common.uploadintime.SnapshotLocationController;
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
import com.mogo.module.service.autopilot.AutoPilotRemoteController;
import com.mogo.module.service.handler.MainLooperHandler;
import com.mogo.module.service.handler.RefreshWorkThreadHandler;
@@ -1003,7 +1003,7 @@ public class MogoServices implements IMogoMapListener,
e.printStackTrace();
}
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map( data );
SnapshotLocationController.getInstance().syncAdasLocationInfo( data );
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo( data );
} catch ( Exception e ) {
e.printStackTrace();
}

View File

@@ -4,7 +4,7 @@ import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.mogo.module.common.uploadintime.SnapshotLocationController;
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.service.carinfo.CarStateInfo;
@@ -73,7 +73,7 @@ class ADASStatusIntentHandler implements IntentHandler {
data.putOpt( "acceleration", stateInfo.getValues().getAcceleration() );
data.putOpt( "yawRate", stateInfo.getValues().getYaw_rate() );
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map( data );
SnapshotLocationController.getInstance().syncAdasLocationInfo( data );
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo( data );
} catch ( Exception e ) {
e.printStackTrace();
}

View File

@@ -33,7 +33,7 @@ import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.constants.DataTypes;
import com.mogo.module.common.dialog.WMDialog;
import com.mogo.module.common.drawer.SnapshotSetDataDrawer;
import com.mogo.module.common.uploadintime.SnapshotLocationController;
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.R;
import com.mogo.module.service.status.EnvStatusManager;
@@ -341,7 +341,7 @@ public class MockIntentHandler implements IntentHandler {
MarkerServiceHandler.getApis().getRefreshStrategyControllerApi().restartAutoRefreshAtTime(duration);
IMogoMarker marker = MarkerServiceHandler.getMarkerManager().addMarker(TAG, options);
MarkerServiceHandler.getMogoStatusManager().setUserInteractionStatus(TAG, true, false);
if(!MarkerServiceHandler.getApis().getStatusManagerApi().isVrMode()){
if (!MarkerServiceHandler.getApis().getStatusManagerApi().isVrMode()) {
MarkerServiceHandler.getMapUIController().moveToCenter(mogoLatLngs.get(0));
}
WorkThreadHandler.getInstance().post(() -> marker.startSmooth(mogoLatLngs, duration));
@@ -652,7 +652,7 @@ public class MockIntentHandler implements IntentHandler {
String carsLine = roadSizeBr.readLine();
SocketDownData.LauncherSnapshotProto.Builder data = SocketDownData.LauncherSnapshotProto.newBuilder();
List<SocketDownData.CloudRoadDataProto> allList = GsonUtil.arrayFromJson(carsLine, SocketDownData.CloudRoadDataProto.class);
if(allList == null || allList.size() == 0){
if (allList == null || allList.size() == 0) {
return;
}
for (SocketDownData.CloudRoadDataProto cloudRoadData : allList) {
@@ -852,9 +852,9 @@ public class MockIntentHandler implements IntentHandler {
//改变rtk定位数据触发自车移动
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map(jo);
Log.i("mock-timer-loc-map", "cost " + (System.currentTimeMillis() - start) + "ms");
SnapshotLocationController.getInstance().syncAdasLocationInfo(jo);
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo(jo);
Log.i("mock-timer-loc", "cost " + (System.currentTimeMillis() - start) + "ms");
Log.i("mock-timer-loc-info",jo.toString());
Log.i("mock-timer-loc-info", jo.toString());
return true;
}
@@ -917,10 +917,7 @@ public class MockIntentHandler implements IntentHandler {
}
}
AdasRec adasRec = new AdasRec();
adasRec.models = allList;
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized(GsonUtil.jsonFromObject(adasRec));
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized(allList);
Log.i("mock-timer-adas", "cost " + (System.currentTimeMillis() - start) + "ms");
return true;
}
@@ -947,16 +944,9 @@ public class MockIntentHandler implements IntentHandler {
}
}
AdasRec adasRec = new AdasRec();
adasRec.models = allList;
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized(GsonUtil.jsonFromObject(adasRec));
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized(allList);
Log.i("mock-timer-adas", "cost " + (System.currentTimeMillis() - start) + "ms");
return true;
}
public static class AdasRec {
public String action = "view";
public List<ADASRecognizedResult> models;
}
}

View File

@@ -9,7 +9,7 @@ import android.os.Bundle;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.uploadintime.SnapshotLocationController;
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
import com.mogo.service.locationinfo.CloudLocationInfo;
import com.mogo.utils.logger.Logger;
@@ -74,7 +74,7 @@ public class MogoRTKLocation {
cloudLocationInfo.setSystemTime(System.currentTimeMillis());
cloudLocationInfo.setTileId(String.valueOf(MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController()
.getTileId(location.getLongitude(), location.getLatitude())));
SnapshotLocationController.getInstance().syncLocationInfo(cloudLocationInfo);
SnapshotLocationDataCenter.getInstance().syncLocationInfo(cloudLocationInfo);
}
} else {
Logger.e(TAG, "location == null");

View File

@@ -2,8 +2,6 @@ package com.mogo.module.service.marker;
import android.content.Context;
import android.graphics.Rect;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
@@ -17,6 +15,7 @@ import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.api.CallChatApi;
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
import com.mogo.module.common.drawer.MarkerDrawer;
@@ -43,12 +42,12 @@ import com.mogo.realtime.api.MoGoAiCloudRealTime;
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import com.mogo.service.connection.IMogoLifecycleListener;
import com.mogo.service.module.IMogoBizActionDoneListener;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.ViewUtils;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import com.zhidao.carchattingprovider.ICallChatResponse;
@@ -147,19 +146,38 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
MoGoAiCloudRealTime.registerOnMsgListener(new IMogoCloudOnMsgListener() {
@Override
public void onMsgSend(long id) {
DebugConfig.setStatus(DebugConfig.sDownloadLink, true);
}
@Override
public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) {
DebugConfig.setStatus(DebugConfig.sDownloadSnapshot, true);
SnapshotSetDataDrawer.getInstance().renderSnapshotData(mogoSnapshotSetData);
// SnapshotSetDataDrawer.getInstance().renderSnapshotData(mogoSnapshotSetData);
// Message msg = mSnapshotHandler.obtainMessage();
// msg.obj = mogoSnapshotSetData;
// msg.what = MSG_SNAPSHOT;
// msg.sendToTarget();
}
});
MogoApisHandler.getInstance()
.getApis()
.getSocketManagerApi(context)
.registerLifecycleListener(10020, new IMogoLifecycleListener() {
@Override
public void onConnectFailure() {
DebugConfig.setStatus(DebugConfig.sDownloadLink, false);
}
@Override
public void onConnectSuccess() {
DebugConfig.setStatus(DebugConfig.sDownloadLink, true);
}
@Override
public void onConnectLost() {
DebugConfig.setStatus(DebugConfig.sDownloadLink, false);
}
});
// adas 每隔一定频率传递过来的数据
MarkerServiceHandler.getApis().getAdasControllerApi().addAdasRecognizedDataCallback(resultList -> {

View File

@@ -5,6 +5,7 @@ import android.graphics.Color;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.TextView;
@@ -14,6 +15,9 @@ import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.wm.WindowManagerView;
import com.mogo.module.service.R;
import com.mogo.utils.NetworkUtils;
import static com.mogo.utils.CommonUtils.getVersionName;
/*
@@ -65,13 +69,16 @@ public class EnvStatusManager {
private void renderStatus() {
String[] sStatusName = {
"定位",
"近景",
"下发",
"AUTO",
"长链",
"工控机定位",
"ADAS近景感知",
"云端远景感知",
"自动驾驶状态",
"socket长链",
"经度",
"纬度"
"纬度",
"网络状态",
"App版本",
"Map版本"
};
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < sStatusName.length; i++) {
@@ -80,6 +87,15 @@ public class EnvStatusManager {
stringBuilder.append(DebugConfig.getAutoPilotStatus()).append("\n");
} else if (i == 5 || i == 6) {
stringBuilder.append(DebugConfig.getStatusData(i)).append("\n");
} else if (i == 7) {
stringBuilder.append(NetworkUtils.isConnected(mContext)).append("\n");
} else if (i == 8) {
stringBuilder.append(getVersionName(mContext, "com.mogo.launcher.f")).append("\n");
} else if (i == 9) {
String mapVersion = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapVersion();
if (!TextUtils.isEmpty(mapVersion)) {
stringBuilder.append(mapVersion).append("\n");
}
} else {
stringBuilder.append("true".equals(DebugConfig.getStatus(i, true)) ? "正常" : "异常").append("\n");
}
@@ -97,7 +113,10 @@ public class EnvStatusManager {
}
}
private Context mContext;
public void showPanel(Context context) {
mContext = context;
if (mPanelView == null) {
mPanelView = new WindowManagerView.Builder(context)
.contentView(R.layout.module_services_status_panel)

View File

@@ -13,7 +13,7 @@ import com.mogo.cloud.socket.entity.SocketDownData;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.uploadintime.SnapshotLocationController;
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.network.TimeDelayApiService;
import com.mogo.module.service.network.bean.MockSocketReceiverData;
@@ -100,7 +100,7 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
e.printStackTrace();
}
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map(jo);
SnapshotLocationController.getInstance().syncAdasLocationInfo(jo);
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo(jo);
mockHandler.sendEmptyMessageDelayed(MOCK_MSG, 50);
}
}