add tileId in uploadData
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package com.mogo.service.impl.adas;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.utils.MortonCode;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarRectModel;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
@@ -10,68 +12,71 @@ import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public
|
||||
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/10/25
|
||||
*
|
||||
* 对象转换类
|
||||
*/
|
||||
class AdasObjectUtils {
|
||||
public class AdasObjectUtils {
|
||||
|
||||
public static ADASWarnMessage fromAdasObject( WarnMessageInfo info ) {
|
||||
if ( info == null ) {
|
||||
public static ADASWarnMessage fromAdasObject(WarnMessageInfo info) {
|
||||
if (info == null) {
|
||||
return null;
|
||||
}
|
||||
ADASWarnMessage warnMessage = new ADASWarnMessage();
|
||||
warnMessage.content = info.getContent();
|
||||
warnMessage.level = info.getLevel();
|
||||
try {
|
||||
warnMessage.type = Integer.parseInt( info.getType() );
|
||||
} catch ( NumberFormatException e ) {
|
||||
warnMessage.type = Integer.parseInt(info.getType());
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
warnMessage.value = info.getValue();
|
||||
return warnMessage;
|
||||
}
|
||||
|
||||
public static List<ADASRecognizedResult> regroupData(List< AdasAIDLOwnerCarRectModel > datums ) {
|
||||
if ( datums == null || datums.isEmpty() ) {
|
||||
public static List<ADASRecognizedResult> regroupData(List<AdasAIDLOwnerCarRectModel> datums) {
|
||||
if (datums == null || datums.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
List< ADASRecognizedResult > recognizedListResults = new ArrayList<>();
|
||||
for ( AdasAIDLOwnerCarRectModel model : datums ) {
|
||||
if ( model == null ) {
|
||||
List<ADASRecognizedResult> recognizedListResults = new ArrayList<>();
|
||||
for (AdasAIDLOwnerCarRectModel model : datums) {
|
||||
if (model == null) {
|
||||
continue;
|
||||
}
|
||||
ADASRecognizedResult recognizedListResult = fromAdasObject( model );
|
||||
if ( recognizedListResult != null ) {
|
||||
recognizedListResults.add( recognizedListResult );
|
||||
ADASRecognizedResult recognizedListResult = fromAdasObject(model);
|
||||
if (recognizedListResult != null) {
|
||||
recognizedListResults.add(recognizedListResult);
|
||||
}
|
||||
}
|
||||
return recognizedListResults;
|
||||
}
|
||||
|
||||
public static ADASRecognizedResult fromAdasObject( AdasAIDLOwnerCarRectModel model ) {
|
||||
if ( model == null ) {
|
||||
public static ADASRecognizedResult fromAdasObject(AdasAIDLOwnerCarRectModel model) {
|
||||
if (model == null) {
|
||||
return null;
|
||||
}
|
||||
ADASRecognizedResult result = new ADASRecognizedResult();
|
||||
result.uuid = model.getUuid();
|
||||
|
||||
result.lat = model.getLat();
|
||||
result.lon = model.getLon();
|
||||
result.type = Integer.parseInt( model.getType() );
|
||||
result.type = Integer.parseInt(model.getType());
|
||||
result.heading = model.getHeading();
|
||||
result.systemTime = Long.parseLong( model.getSystemTime() );
|
||||
result.satelliteTime = Long.parseLong( model.getSatelliteTime() );
|
||||
result.systemTime = Long.parseLong(model.getSystemTime());
|
||||
result.satelliteTime = Long.parseLong(model.getSatelliteTime());
|
||||
result.alt = model.getAlt();
|
||||
result.color = model.getColor();
|
||||
result.speed = model.getSpeed();
|
||||
result.carId = model.getCarId();
|
||||
result.dataAccuracy = model.dataAccuracy;
|
||||
result.distance = model.distance;
|
||||
result.mortonCode = MortonCode.wrapEncodeMorton( result.lon, result.lat );
|
||||
result.mortonCode = MortonCode.wrapEncodeMorton(result.lon, result.lat);
|
||||
IMogoMapUIController mogoMapUIController = ARouter.getInstance().navigation(IMogoServiceApis.class).getMapServiceApi().getMapUIController();
|
||||
if (mogoMapUIController != null) {
|
||||
result.tileId = String.valueOf(mogoMapUIController.getTileId(result.lon, result.lat));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING)
|
||||
public class V2XManager implements IV2XProvider {
|
||||
private Map<String, CopyOnWriteArrayList<IV2XListener>> mListeners = new ConcurrentHashMap<>();
|
||||
private final Map<String, CopyOnWriteArrayList<IV2XListener>> mListeners = new ConcurrentHashMap<>();
|
||||
|
||||
@Override
|
||||
public void registerIntentListener(String intent, IV2XListener listener) {
|
||||
@@ -50,9 +50,7 @@ public class V2XManager implements IV2XProvider {
|
||||
public void warningChangedForListenerWithDirection(int direction, String command) {
|
||||
List<IV2XListener> listeners = mListeners.get(command);
|
||||
if (listeners != null && !listeners.isEmpty()) {
|
||||
Iterator<IV2XListener> iterator = listeners.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
IV2XListener listener = iterator.next();
|
||||
for (IV2XListener listener : listeners) {
|
||||
if (listener != null) {
|
||||
listener.warningChangedWithDirection(direction);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user