Merge branch 'dev/dev_eagle_architecture_upgrade' into dev/dev_eagle_wuhan_sikua_obu

This commit is contained in:
董宏宇
2021-10-18 11:13:01 +08:00
62 changed files with 483 additions and 685 deletions

3
.idea/gradle.xml generated
View File

@@ -4,7 +4,7 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="PLATFORM" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
@@ -81,7 +81,6 @@
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

2
.idea/misc.xml generated
View File

@@ -17,12 +17,14 @@
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_autopilot_status.xml" value="0.25833333333333336" />
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_check_status.xml" value="1.0" />
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml" value="0.26614583333333336" />
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_perspective_switch.xml" value="0.24947916666666667" />
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_traffic_light_vr.xml" value="1.0" />
<entry key="modules/mogo-module-adas/src/main/res/drawable/module_adas_left_corner_bg.xml" value="0.22125" />
<entry key="modules/mogo-module-adas/src/main/res/layout/dialog_adas_dispatch_remind.xml" value="0.22658490296325878" />
<entry key="modules/mogo-module-apps/src/main/res/layout/module_apps_fragment_apps.xml" value="0.28125" />
<entry key="modules/mogo-module-apps/src/main/res/layout/module_apps_fragment_apps_navigator.xml" value="0.27395833333333336" />
<entry key="modules/mogo-module-apps/src/main/res/layout/module_apps_item_app.xml" value="0.28125" />
<entry key="modules/mogo-module-extensions/src/main/res/layout-xhdpi-2000x1080/include_navi_info_panle.xml" value="0.3640625" />
<entry key="modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml" value="0.375" />
<entry key="modules/mogo-module-hmi/src/main/res/layout/fragment_warning.xml" value="0.34427083333333336" />
<entry key="modules/mogo-module-hmi/src/main/res/layout/module_hmi_warning_v2x.xml" value="0.246875" />

View File

@@ -4,6 +4,19 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'android-aspectjx'
////apply ByteX宿主
//apply plugin: 'bytex'
//ByteX {
// enable true
// enableInDebug true
// logLevel "DEBUG"
//}
//
//apply plugin: 'chain.log.hook'
//hooklog{
// enableLoggerToServer true
//}
Properties properties = new Properties();
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
@@ -132,7 +145,6 @@ aspectjx {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
//Crash日志收集
implementation rootProject.ext.dependencies.crashSdk
implementation rootProject.ext.dependencies.androidxappcompat

View File

@@ -267,20 +267,19 @@ public class MogoApplication extends AbsMogoApplication {
if (DebugConfig.isLauncher()) {
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_BACK, MogoServicePaths.PATH_BACK));
}
MogoModulePaths.addModule(new MogoModule(ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_WIDGETS, MogoServicePaths.PATH_WIDGETS));
if (DebugConfig.isMapBased()) {
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
}
MogoModulePaths.addBaseModule(new MogoModule(ShareConstants.TAG, ShareConstants.MODEL_NAME));
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_TANLU_API, "TanluApi"));
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_SHARE, "ShareControl"));
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_TRAFFIC_UPLOAD, "TrafficUpload"));
MogoModulePaths.addModule(new MogoModule(LeftPanelConst.PATH_NAME, LeftPanelConst.MODULE_NAME));
MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_TTS_CONFIG, ServiceConst.PATH_TTS_CONFIG));
MogoModulePaths.addBaseModule(new MogoModule(ShareConstants.TAG, ShareConstants.MODEL_NAME));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_TANLU_API, "TanluApi"));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_TRAFFIC_UPLOAD, "TrafficUpload"));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_SHARE, "ShareControl"));
MogoModulePaths.addBaseModule(new MogoModule(ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY));
MogoModulePaths.addBaseModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.MODULE_NAME));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_STRATEGY_SHARE, "StrategyShare"));
@@ -288,24 +287,24 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor"));
// 域控制器模块(新)
MogoModulePaths.addModuleFunction(new MogoModule(MogoServicePaths.PATH_AUTO_PILOT, "IMoGoAutoPilotProvider"));
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_AUTO_PILOT, "IMoGoAutoPilotProvider"));
// OBU 模块
MogoModulePaths.addModuleFunction(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
// 小地图模块
MogoModulePaths.addModuleFunction(new MogoModule(MogoServicePaths.PATH_SMALL_MAP, "IMogoSmallMapProvider"));
// widgets 模块
MogoModulePaths.addModuleFunction(new MogoModule(MogoServicePaths.PATH_V2X_WARNING, "IMoGoWaringProvider"));
// 自动驾驶系统检测模块
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_CHECK, "CheckProvider"));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_CHECK, "CheckProvider"));
// 推送模块
MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, PushUIConstants.NAME));
// 碰撞报警模块
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING, "IMogoCrashWarnProvider"));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING, "IMogoCrashWarnProvider"));
// ADAS模块慢慢被 域控制器模块 替换掉)
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_ADAS, "AdasProvider"));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_ADAS, "AdasProvider"));
// 前方碰撞预警
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING, "IV2XManagerProvider"));
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_FRONT_CRASH_WARNING, "IV2XManagerProvider"));
// 全局语音唤醒
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake"));

View File

@@ -4,6 +4,7 @@ apply from: "javadoc.gradle"
buildscript {
repositories {
// maven { url "https://artifact.bytedance.com/repository/byteX/" }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }
@@ -18,6 +19,8 @@ buildscript {
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31'
classpath "com.alibaba:arouter-register:1.0.2"
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
// classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
// classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
}
@@ -26,6 +29,7 @@ buildscript {
allprojects {
repositories {
maven { url "https://artifact.bytedance.com/repository/byteX/" }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }

View File

@@ -241,6 +241,9 @@ ext {
mogoaicloudtrafficlive : "com.mogo.cloud:trafficlive:${MOGO_TRAFFICLIVE_VERSION}",
mogoaicloudlocation : "com.mogo.cloud:location:${MOGO_LOCATION_VERSION}",
//plugin
mogochainbase : "com.mogo.cloud:service-chain:${SERVICE_CHAIN_VERSION}",
mogochainplugin : "com.mogo.cloud:hook:${HOOK_LOG_VERSION}",
]
}

View File

@@ -16,6 +16,11 @@ import com.zhidao.support.adas.high.AdasManager
*/
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
class MoGoAutoPilotProvider : IMoGoAutoPilotProvider {
private val TAG = "MoGoAutoPilotProvider"
override val functionName: String
get() = TAG
override fun init(context: Context) {
// 初始化ADAS 域控制器
@@ -66,7 +71,4 @@ class MoGoAutoPilotProvider : IMoGoAutoPilotProvider {
return AdasManager.getInstance().recordPackage()
}
companion object {
private const val TAG = "MogoAutoPilotProvider"
}
}

View File

@@ -5,7 +5,6 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.Log;
@@ -17,25 +16,15 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import com.elegant.network.ParamsBuilder;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.eagle.core.function.check.R;
import com.mogo.eagle.core.function.check.api.ICheckResultCallBack;
import com.mogo.eagle.core.function.check.net.CheckApiServiceFactory;
import com.mogo.eagle.core.function.check.net.CheckNetWork;
import com.mogo.eagle.core.function.check.net.CheckResultData;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.module.common.view.ImageViewClipBounds;
import com.mogo.module.common.view.SpacesItemDecoration;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.NetworkStatusUtil;
import java.math.BigDecimal;
import java.util.Map;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* @author liujing
@@ -102,6 +91,7 @@ public class CheckActivity extends AppCompatActivity {
mRecyclerView.setAdapter(mCheckAdapter);
}
private void checkAction() {
CheckNetWork.INSTANCE.checkNetWork(this.getApplicationContext(), new ICheckResultCallBack() {
@Override

View File

@@ -5,8 +5,8 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.LogUtils
@@ -64,14 +64,14 @@ class AutoPilotStatusView @JvmOverloads constructor(
CallerHmiListenerManager.invokeCheckAutoPilotBtnListener(false)
}
}
// startAutoPilot();
startAutoPilot();
}
private fun startAutoPilot() {
val currentAutopilot =
AutoPilotControlParameters()
currentAutopilot.isSpeakVoice = false
currentAutopilot.startLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.194795425,116.724476409);
currentAutopilot.endLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.199730,116.735687);
currentAutopilot.startLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.199157289445921,116.73675895051454);
currentAutopilot.endLatLon = AutoPilotControlParameters.AutoPilotLonLat(40.199255159538758,116.73274535677977);
currentAutopilot.vehicleType = 10
MogoApisHandler.getInstance().apis.adasControllerApi.aiCloudToAdasData(currentAutopilot)
}

View File

@@ -0,0 +1,25 @@
package com.mogo.eagle.core.function.hmi.ui.widget
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.FrameLayout
import com.mogo.eagle.core.function.hmi.R
/**
*@author xiaoyuzhou
*@date 2021/10/15 11:34 上午
* 视角切换按钮
*/
class PerspectiveSwitchView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : FrameLayout(context, attrs, defStyleAttr) {
init {
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
}
}

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/module_switch_model_layout"
android:layout_width="@dimen/module_switch_map"
android:layout_height="@dimen/module_switch_map_height"
android:background="@drawable/module_switch_map_bg"
android:elevation="@dimen/dp_10"
android:padding="@dimen/dp_20">
<LinearLayout
android:id="@+id/module_switch_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/module_switch_model_icon"
android:layout_width="@dimen/module_switch_image"
android:layout_height="@dimen/module_switch_image"
android:layout_gravity="left|center_vertical"
android:paddingLeft="@dimen/module_switch_margin_left"
android:src="@drawable/module_switch_map_angle" />
<TextView
android:id="@+id/module_switch_model_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right|center"
android:paddingLeft="@dimen/module_switch_margin_left"
android:text="@string/module_map_model_normal"
android:textColor="@color/module_ext_color_voice_text"
android:textSize="@dimen/module_switch_text_size" />
</LinearLayout>
</FrameLayout>

View File

@@ -1,17 +0,0 @@
package com.mogo.eagle.core.function.notice;
import android.content.Context;
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider;
/**
* @author xiaoyuzhou
* @date 2021/9/18 11:44 上午
* 处理云端下发通知、公告类的逻辑的接口
*/
public class MoGoNoticeProvider implements IMoGoNoticeProvider {
@Override
public void init(Context context) {
}
}

View File

@@ -0,0 +1,18 @@
package com.mogo.eagle.core.function.notice
import android.content.Context
import com.mogo.eagle.core.function.api.notice.IMoGoNoticeProvider
/**
* @author xiaoyuzhou
* @date 2021/9/18 11:44 上午
* 处理云端下发通知、公告类的逻辑的接口
*/
class MoGoNoticeProvider : IMoGoNoticeProvider {
private val TAG = "MoGoNoticeProvider"
override val functionName: String
get() = TAG
override fun init(context: Context) {}
}

View File

@@ -18,6 +18,10 @@ class MoGoObuProvider : IMoGoObuProvider {
private var mContext: Context? = null
override val functionName: String
get() = TAG
override fun init(context: Context) {
LogUtils.dTag(TAG, "初始化蘑菇自研OBU……")
mContext = context
@@ -34,4 +38,5 @@ class MoGoObuProvider : IMoGoObuProvider {
}
}
}

View File

@@ -16,6 +16,7 @@ import androidx.annotation.Nullable;
import com.amap.api.maps.AMap;
import com.amap.api.maps.CameraUpdate;
import com.amap.api.maps.CameraUpdateFactory;
import com.amap.api.maps.CoordinateConverter;
import com.amap.api.maps.TextureMapView;
import com.amap.api.maps.UiSettings;
import com.amap.api.maps.model.BitmapDescriptorFactory;
@@ -67,7 +68,7 @@ public class SmallMapDirectionView
private List<MogoLatLng> mCoordinatesLatLngCurrent = new ArrayList<>();
private Polyline mPolyline;
private CameraUpdate mCameraUpdate;
private Context mContext;
public SmallMapDirectionView(Context context) {
this(context, null);
}
@@ -86,6 +87,7 @@ public class SmallMapDirectionView
}
private void initView(Context context) {
mContext = context;
View smpView = LayoutInflater.from(context).inflate(R.layout.module_small_map_view, this);
mAMapNaviView = (TextureMapView)smpView.findViewById(R.id.aMapNaviView);
@@ -110,6 +112,7 @@ public class SmallMapDirectionView
);
return false;
});
}
@Override
@@ -188,36 +191,36 @@ public class SmallMapDirectionView
}
if (mCoordinatesLatLng.size() > 1) {
mCoordinatesLatLngCurrent.clear();
for (LatLng lng : mCoordinatesLatLng) {
MogoLatLng mogoLatLng = new MogoLatLng(lng.latitude, lng.longitude);
mCoordinatesLatLngCurrent.add(mogoLatLng);
}
// 结束位置
LatLng endLatLng = mCoordinatesLatLng.get(mCoordinatesLatLng.size() - 1);
// 与结束位置进行 GeoHash 0-12
// GeoHash endGeoHash = GeoHash.withCharacterPrecision(endLatLng.latitude, endLatLng.longitude, 7);
// GeoHash currentGeoHash = GeoHash.withCharacterPrecision(currentLatLng.latitude, currentLatLng.longitude, 7);
// Log.d(MODULE_NAME, "currentGeoHash=" + currentGeoHash);
// Log.d(MODULE_NAME, "endGeoHash=" + endGeoHash);
float calculateDistance = CoordinateUtils.calculateLineDistance(
endLatLng.latitude, endLatLng.longitude,
currentLatLng.latitude, currentLatLng.longitude
);
Log.d(MODULE_NAME, "calculateDistance=" + calculateDistance);
if (calculateDistance <= 20) {
clearPolyline();
} else {
drawablePolyline(mCoordinatesLatLngCurrent);
}
} else {
//设置希望展示的地图缩放级别
mAMap.moveCamera(CameraUpdateFactory.newLatLngZoom(currentLatLng, zoomLevel));
}
// if (mCoordinatesLatLng.size() > 1) {
// mCoordinatesLatLngCurrent.clear();
// for (LatLng lng : mCoordinatesLatLng) {
// MogoLatLng mogoLatLng = new MogoLatLng(lng.latitude, lng.longitude);
// mCoordinatesLatLngCurrent.add(mogoLatLng);
// }
//
// // 结束位置
// LatLng endLatLng = mCoordinatesLatLng.get(mCoordinatesLatLng.size() - 1);
// // 与结束位置进行 GeoHash 0-12
//// GeoHash endGeoHash = GeoHash.withCharacterPrecision(endLatLng.latitude, endLatLng.longitude, 7);
//// GeoHash currentGeoHash = GeoHash.withCharacterPrecision(currentLatLng.latitude, currentLatLng.longitude, 7);
//// Log.d(MODULE_NAME, "currentGeoHash=" + currentGeoHash);
//// Log.d(MODULE_NAME, "endGeoHash=" + endGeoHash);
//
// float calculateDistance = CoordinateUtils.calculateLineDistance(
// endLatLng.latitude, endLatLng.longitude,
// currentLatLng.latitude, currentLatLng.longitude
// );
//
// Log.d(MODULE_NAME, "calculateDistance=" + calculateDistance);
// if (calculateDistance <= 20) {
// clearPolyline();
// } else {
// drawablePolyline(mCoordinatesLatLngCurrent);
// }
// } else {
// //设置希望展示的地图缩放级别
// mAMap.moveCamera(CameraUpdateFactory.newLatLngZoom(currentLatLng, zoomLevel));
// }
CameraPosition cameraPosition = new CameraPosition.Builder().target(mCarMarker.getPosition()).bearing(latLng.getBearing()).tilt(0).zoom(zoomLevel).build();
mAMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
}
@@ -230,12 +233,13 @@ public class SmallMapDirectionView
@Override
public void drawablePolyline(List<MogoLatLng> coordinates) {
clearPolyline();
mCoordinatesLatLng.clear();
for (MogoLatLng coordinate : coordinates) {
mCoordinatesLatLng.add(new LatLng(coordinate.getLat(), coordinate.getLon()));
}
// mCoordinatesLatLng.clear();
List<LatLng> latLngs = CoordinateConverterFrom84ForList(mContext,coordinates);
mCoordinatesLatLng.addAll(latLngs);
// for (LatLng coordinate : mCoordinatesLatLng) {
//// mCoordinatesLatLng.add(new LatLng(coordinate.getLat(), coordinate.getLon()));
//// Log.e("",coordinate.latitude+":"+coordinate.longitude);
// }
if (mAMap != null) {
if (mCoordinatesLatLng.size() > 2) {
// 设置开始结束Marker位置
@@ -253,7 +257,6 @@ public class SmallMapDirectionView
}
//第二个参数为四周留空宽度
mAMap.animateCamera(CameraUpdateFactory.newLatLngBoundsRect(boundsBuilder.build(), 65, 65, 65, 65));
// 绘制线
mPolyline = mAMap.addPolyline(
new PolylineOptions()
@@ -268,6 +271,23 @@ public class SmallMapDirectionView
}
}
public LatLng CoordinateConverterFrom84(Context mContext, MogoLatLng mogoLatLng){
CoordinateConverter mCoordinateConverter = new CoordinateConverter(mContext);
mCoordinateConverter.from(CoordinateConverter.CoordType.GPS);
mCoordinateConverter.coord(new LatLng(mogoLatLng.lat,mogoLatLng.lon));
LatLng latLng = mCoordinateConverter.convert();
return latLng;
}
public List<LatLng> CoordinateConverterFrom84ForList(Context mContext, List<MogoLatLng> mogoLatLngList){
List<LatLng> list = new ArrayList<>();
for (MogoLatLng m:mogoLatLngList) {
LatLng mogoLatLng = CoordinateConverterFrom84(mContext,m);
list.add(mogoLatLng);
}
return list;
}
@Override
public void clearPolyline() {
mCoordinatesLatLng.clear();
@@ -305,4 +325,10 @@ public class SmallMapDirectionView
mAMapNaviView.onDestroy();
}
}
public void setRouteList(List<MogoLatLng> coordinates) {
// mCoordinatesLatLng.clear();
// List<LatLng> latLngs = CoordinateConverterFrom84ForList(mContext,coordinates);
// mCoordinatesLatLng.addAll(latLngs);
}
}

View File

@@ -45,6 +45,7 @@ public class SmallMapFragment extends Fragment {
public void drawablePolyline(List<MogoLatLng> coordinates) {
if (mSmallMapDirectionView != null) {
mSmallMapDirectionView.setRouteList(coordinates);
mSmallMapDirectionView.drawablePolyline(coordinates);
}
}

View File

@@ -40,7 +40,7 @@ public class SmallMapProvider implements IMogoSmallMapProvider, IMogoStatusChang
mActivity = activity;
mContainerId = containerId;
SmpServiceManager.init(mActivity);
//MogoApisHandler.getInstance().getApis().getAdasControllerApi().addAdasAutopilotRouteCallBack(this);
MogoApisHandler.getInstance().getApis().getAdasControllerApi().addAdasAutopilotRouteCallBack(this);
}
@Override
@@ -63,7 +63,7 @@ public class SmallMapProvider implements IMogoSmallMapProvider, IMogoStatusChang
MogoServicePaths.PATH_SMALL_MAP,
StatusDescriptor.MAIN_PAGE_RESUME,
this);
MogoApisHandler.getInstance().getApis().getAdasControllerApi().addAdasAutopilotRouteCallBack(this);
// MogoApisHandler.getInstance().getApis().getAdasControllerApi().addAdasAutopilotRouteCallBack(this);
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
showPanel();
@@ -132,6 +132,7 @@ public class SmallMapProvider implements IMogoSmallMapProvider, IMogoStatusChang
@Override
public void routeResult(List<MogoLatLng> routeList) {
Log.e("lianglihui","SmallMapProvider");
if (routeList != null && routeList.size() > 0) {
drawablePolyline(routeList);
} else {

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.api.base
import android.util.Log
import com.alibaba.android.arouter.facade.template.IProvider
/**
@@ -8,5 +9,17 @@ import com.alibaba.android.arouter.facade.template.IProvider
* 处理没有页面的服务及交互逻辑的提供者
*/
interface IMoGoFunctionServerProvider : IProvider {
/**
* 功能模块唯一标识
*
* @return 功能模块名称
*/
val functionName: String
/**
* 功能销毁回调
*/
fun onDestroy() {
Log.d("IMoGoFunctionServerProvider", "onDestroy")
}
}

View File

@@ -0,0 +1,15 @@
package com.mogo.eagle.core.function.api.map.hd
/**
*@author xiaoyuzhou
*@date 2021/10/15 12:18 下午
* 地图样式改变回调监听
*/
interface IMoGoMapStyleChangeListener {
/**
* 地图样式改变回调监听
*/
fun onMapStyleModeChange(styleMode: Int)
}

View File

@@ -0,0 +1,77 @@
package com.mogo.eagle.core.function.call.map
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapStyleChangeListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
/**
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
* 地图 监听管理
*/
object CallerMapListenerManager : CallerBase() {
private val TAG = "CallerMapListenerManager"
// 记录地图样式
private var mMapStyleMode = 0
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val mMapStyleChangeListeners: HashMap<String, IMoGoMapStyleChangeListener> = HashMap()
/**
* 添加 地图样式改变 监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
fun addMapStyleChangeListener(
@Nullable tag: String,
@Nullable listener: IMoGoMapStyleChangeListener
) {
mMapStyleChangeListeners[tag] = listener
listener.onMapStyleModeChange(mMapStyleMode)
}
/**
* 删除 地图样式改变 监听
* @param tag 标记,用来注销监听使用
*/
fun removeMapStyleChangeListener(@Nullable tag: String) {
mMapStyleChangeListeners.remove(tag)
}
/**
* 删除 地图样式改变 监听
* @param listener 要删除的监听对象
*/
fun removeMapStyleChangeListener(@Nullable listener: IMoGoMapStyleChangeListener) {
mMapStyleChangeListeners.forEach {
if (it.value == listener) {
mMapStyleChangeListeners.remove(it.key)
}
}
}
/**
* 触发 地图样式改变 监听
*/
fun invokeMapStyleChangeListener() {
invokeMapStyleChangeListener(mMapStyleMode)
}
/**
* 触发 地图样式改变 监听
* @param mapStyleMode 选中状态
*/
fun invokeMapStyleChangeListener(mapStyleMode: Int) {
LogUtils.dTag(TAG, "mapStyleMode:$mapStyleMode")
mMapStyleMode = mapStyleMode
mMapStyleChangeListeners.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onMapStyleModeChange(mMapStyleMode)
}
}
}

View File

@@ -22,21 +22,21 @@ object CallerObuListenerManager : CallerBase() {
private val mObuStatusListeners: HashMap<String, IMoGoObuStatusListener> = HashMap()
/**
* 查询OBU状态
* 查询 OBU状态
*/
fun getObuStatusInfo(): ObuStatusInfo {
return mObuStatusInfo
}
/**
* 查询OBU状态
* 查询 OBU状态
*/
fun getObuStatusInfoJsonString(): String {
return GsonUtils.toJson(mObuStatusInfo)
}
/**
* 添加自动驾驶按钮选中监听
* 添加 OBU状态 监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
@@ -49,7 +49,7 @@ object CallerObuListenerManager : CallerBase() {
}
/**
* 删除 监听
* 删除 OBU状态 监听
* @param tag 标记,用来注销监听使用
*/
fun removeListener(@Nullable tag: String) {
@@ -57,7 +57,7 @@ object CallerObuListenerManager : CallerBase() {
}
/**
* 删除自动驾驶按钮选中监听
* 删除 OBU状态 监听
* @param listener 要删除的监听对象
*/
fun removeListener(@Nullable listener: IMoGoObuStatusListener) {
@@ -69,19 +69,18 @@ object CallerObuListenerManager : CallerBase() {
}
/**
* 触发自动驾驶按钮选中监听
* 触发 OBU状态 监听
*/
fun invokeListener() {
LogUtils.dTag(TAG, "isChecked:$mObuStatusInfo")
invokeListener(mObuStatusInfo)
}
/**
* 触发自动驾驶按钮选中监听
* 触发 OBU状态 监听
* @param obuStatusInfo 选中状态
*/
fun invokeListener(obuStatusInfo: ObuStatusInfo) {
LogUtils.dTag(TAG, "isChecked:$obuStatusInfo")
LogUtils.dTag(TAG, "obuStatusInfo:$obuStatusInfo")
mObuStatusInfo = obuStatusInfo
mObuStatusListeners.forEach {
val tag = it.key

View File

@@ -32,4 +32,13 @@
<dimen name="module_hmi_btn_text_size">44px</dimen>
<dimen name="module_switch_map">279px</dimen>
<dimen name="module_switch_map_height">119px</dimen>
<dimen name="module_switch_margin_left">22px</dimen>
<dimen name="module_switch_text_size">36px</dimen>
<dimen name="module_switch_image">50px</dimen>
<dimen name="module_switch_image_circle">60px</dimen>
</resources>

View File

@@ -5,4 +5,6 @@
<color name="module_switch_map_bg">#323C6F</color>
<color name="module_ext_color_voice_text">#FFFFFF</color>
</resources>

View File

@@ -32,4 +32,13 @@
<dimen name="module_hmi_btn_text_size">33px</dimen>
<dimen name="module_switch_map">190px</dimen>
<dimen name="module_switch_map_height">76px</dimen>
<dimen name="module_switch_margin_left">16px</dimen>
<dimen name="module_switch_text_size">24px</dimen>
<dimen name="module_switch_image">35px</dimen>
<dimen name="module_switch_image_circle">38px</dimen>
</resources>

View File

@@ -4,4 +4,7 @@
<string name="VideoView_info_text_video_not_supported">"不支持该视频。"</string>
<string name="file_not_support">此文件不支持播放</string>
<string name="module_map_model_normal">近距视角</string>
<string name="module_map_model_faster">远距视角</string>
</resources>

View File

@@ -45,6 +45,22 @@ USERNAME=xintai
PASSWORD=xintai2018
# 编译模式: false - 依赖本地版本, true - 依赖 maven 版本
RELEASE=false
##plugin 插件
#android.enableR8.libraries=false
#android.enableR8=false
#android.enableD8=true
#android.enableD8.desugaring=true
#android.enableDesugar=true
#bytex.enableHtmlLog=true
#bytex.forbidUseLenientMutationDuringGetArtifact=true
#bytex.verifyProguardConfigurationChanged=false
#bytex.ASM_API=ASM7
HOOK_LOG_VERSION=1.4.63
SERVICE_CHAIN_VERSION=1.0.22
# 模块版本
## 工程内模块
MOGO_COMMONS_VERSION=2.0.58

View File

@@ -61,7 +61,9 @@ dependencies {
implementation project(':foudations:mogo-utils')
implementation project(':libraries:mogo-map-api')
implementation project(':foudations:mogo-commons')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-function-call')
}
implementation rootProject.ext.dependencies.mogocustommap
}

View File

@@ -17,7 +17,6 @@ import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import android.widget.TextView;
import com.mogo.commons.FunctionBuildConfig;
@@ -33,7 +32,6 @@ import com.mogo.map.impl.custom.utils.ObjectUtils;
import com.mogo.map.impl.custom.utils.PointInterpolatorUtil;
import com.mogo.map.impl.custom.utils.ResIdCache;
import com.mogo.map.listener.MogoMapListenerHandler;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.uicontroller.CarCursorOption;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
@@ -458,9 +456,7 @@ public class AMapViewWrapper implements IMogoMapView,
if (visible && NaviClient.getInstance(getContext()).isNaviing()) {
return;
}
// if (DebugConfig.isDebug()) {
// Logger.d(TAG, Log.getStackTraceString(new Throwable()));
// }
if (checkAMapView()) {
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
if (visible) {
@@ -504,9 +500,6 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void recoverLockMode() {
if (checkAMapView()) {
// if ( DebugConfig.isDebug() ) {
// Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
// }
if (mCurrentUI == EnumMapUI.Type_VR) {
return;
}
@@ -562,7 +555,7 @@ public class AMapViewWrapper implements IMogoMapView,
try {
return ObjectUtils.fromAMap(MapTools.INSTANCE.getVisibleRegion().getLeftBottomPoint());
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@@ -572,7 +565,7 @@ public class AMapViewWrapper implements IMogoMapView,
try {
return ObjectUtils.fromAMap(mMapView.getMapAutoViewHelper().getCenter());
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@@ -594,6 +587,7 @@ public class AMapViewWrapper implements IMogoMapView,
try {
return MapTools.INSTANCE.toScreenLocation(ObjectUtils.fromMogo(latLng));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@@ -607,38 +601,13 @@ public class AMapViewWrapper implements IMogoMapView,
return ObjectUtils.fromAMap(
MapTools.INSTANCE.fromScreenLocation(point));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
return null;
}
@Override
public void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator,
long duration) {
if (marker == null || high <= 0.0f || interpolator == null || duration < 0) {
return;
}
try {
// final LatLng latLng = ObjectUtils.fromMogo2( marker.getPosition() );
// Point point = mMapView.getMap().getProjection().toScreenLocation( latLng );
// point.y -= WindowUtils.dip2px( getContext(), high );
// LatLng target = mMapView.getMap().getProjection().fromScreenLocation( point );
// //使用TranslateAnimation,填写一个需要移动的目标点
// Animation animation = new TranslateAnimation( target );
// animation.setInterpolator( interpolator );
// //整个移动所需要的时间
// animation.setDuration( duration );
// //设置动画
// if ( marker instanceof AMapMarkerWrapper ) {
// ( ( AMapMarkerWrapper ) marker ).getMarker().setAnimation( animation );
// ( ( AMapMarkerWrapper ) marker ).getMarker().startAnimation();
// }
} catch (Exception e) {
Logger.e(TAG, e, "error.");
}
}
@Override
public void setRenderFps(int fps) {
if (checkAMapView()) {
@@ -833,14 +802,6 @@ public class AMapViewWrapper implements IMogoMapView,
//showSelfSpeed(location.getSpeed());
}
private int mDrawlevel;
@Override
public void setAdasRecognizedResult(int drawlevel) {
mDrawlevel = drawlevel;
}
private TextView mSpeedView = null;
private int mLastYOffset = 20;
@@ -936,7 +897,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onMapStatusChanged(int type, int value) {
// Logger.i( TAG, "mapop--onMapStatusChanged-: " + type + "," + value );
//Logger.i(TAG, "mapop--onMapStatusChanged-: " + type + "," + value);
}
@Override
@@ -961,7 +922,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onCameraChange(int type, int value) {
// Logger.i( TAG, "mapop--onCameraChange-: " + type + "," + value );
//Logger.i(TAG, "mapop--onCameraChange-: " + type + "," + value);
}
@Override
@@ -977,24 +938,11 @@ public class AMapViewWrapper implements IMogoMapView,
}
}
@Override
public void setAnchorScale(float x, float y) {
mMapView.getMapAutoViewHelper().setAnchorScale(x, y);
}
@Override
public void setAnchorRate(float rate) {
mMapView.getMapAutoViewHelper().setAnchorRate(rate);
}
@Override
public void emphasizeMyLocation() {
}
//目前切换完vr之后会立即回调其他样式这里做一个判断
// private boolean mVrModeAutoChangedFlag = false;
@Override
public void onChangeMapStyle(int i) {
@@ -1012,11 +960,6 @@ public class AMapViewWrapper implements IMogoMapView,
// 进入vr模式的时候自动切换到车头朝上
change2CarUp();
}
// else if ( i == MapAutoApi.MAP_PERSPECTIVE_2D ) {
// mCurrentUI = EnumMapUI.CarUp_2D;
// } else if ( i == MapAutoApi.MAP_PERSPECTIVE_3D ) {
// mCurrentUI = EnumMapUI.CarUp_3D;
// }
if (last == mCurrentUI) {
Logger.d(TAG, "currentUI is same as last = %s", mCurrentUI);
@@ -1024,17 +967,11 @@ public class AMapViewWrapper implements IMogoMapView,
}
// vr 模式切换到普通模式下,保持之前的白天模式 wtf.
if (last == EnumMapUI.Type_VR
&& mCurrentUI != last
&& mCurrentUI != EnumMapUI.Type_Light) {
if (last == EnumMapUI.Type_VR && mCurrentUI != EnumMapUI.Type_Light) {
if (mIsLightStyle) {
changeMapMode(EnumMapUI.Type_Light);
return;
}
// if ( mVrModeAutoChangedFlag ) {
// mVrModeAutoChangedFlag = false;
// return;
// }
}
Logger.d(TAG, Log.getStackTraceString(new Throwable()));
if (mCurrentUI != null) {
@@ -1066,7 +1003,6 @@ public class AMapViewWrapper implements IMogoMapView,
if (isVrMode) {
if (mCurrentUI != EnumMapUI.Type_VR) {
Logger.d(TAG, "自动切换为vr模式");
// mVrModeAutoChangedFlag = true;
changeMapMode(EnumMapUI.Type_VR);
}
} else {

View File

@@ -4,10 +4,8 @@ import android.graphics.Point;
import android.graphics.Rect;
import android.location.Location;
import android.view.View;
import android.view.animation.Interpolator;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.uicontroller.CarCursorOption;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
@@ -221,13 +219,6 @@ public class AMapUIController implements IMogoMapUIController {
return null;
}
@Override
public void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator,
long duration) {
if (mClient != null) {
mClient.startJumpAnimation(marker, high, interpolator, duration);
}
}
@Override
public void setRenderFps(int fps) {
@@ -308,21 +299,11 @@ public class AMapUIController implements IMogoMapUIController {
return MapAutoApi.INSTANCE.getTileID(lon, lat, 13); // 13为默认获取瓦片层级级别
}
@Override
public void setAnchorScale(float x, float y) {
}
@Override
public void emphasizeMyLocation() {
}
@Override
public void setAnchorRate(float rate) {
}
@Override
public void rtkEnable(boolean enable) {
if (mClient != null) {
@@ -374,10 +355,4 @@ public class AMapUIController implements IMogoMapUIController {
}
}
@Override
public void setAdasRecognizedResult(int drawlevel) {
if (mClient != null) {
mClient.setAdasRecognizedResult(drawlevel);
}
}
}

View File

@@ -172,20 +172,6 @@ public interface IMogoMapUIController {
*/
MogoLatLng getLocationMogoLatLngInScreen(Point point);
/**
* marker 跳跃动画
* <p>
* Deprecated, instead of by {@link IMogoMarker#startJumpAnimation(float, long, Interpolator, OnMarkerAnimationListener)}
*
* @param marker 跳跃的 marker
* @param high 跳跃的高度
* @param interpolator 插值器
* @param duration 动画时间
*/
@Deprecated
void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator,
long duration);
/**
* 设置刷新帧率
*/
@@ -250,8 +236,6 @@ public interface IMogoMapUIController {
*/
void changeBearing(float bearing);
void setAdasRecognizedResult(int drawlevel);
/**
* 获取瓦片id
*
@@ -262,13 +246,6 @@ public interface IMogoMapUIController {
long getTileId(double lon, double lat);
default void setAnchorScale(float x, float y) {
}
default void setAnchorRate(float rate) {
}
default void testGpsData() {

View File

@@ -4,10 +4,8 @@ import android.graphics.Point;
import android.graphics.Rect;
import android.location.Location;
import android.view.View;
import android.view.animation.Interpolator;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.uicontroller.CarCursorOption;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.map.uicontroller.IMogoMapUIController;
@@ -255,14 +253,6 @@ public class MogoMapUIController implements IMogoMapUIController {
return null;
}
@Override
public void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator, long duration) {
initDelegate();
if (mDelegate != null) {
mDelegate.startJumpAnimation(marker, high, interpolator, duration);
}
}
@Override
public void setRenderFps(int fps) {
initDelegate();
@@ -420,12 +410,4 @@ public class MogoMapUIController implements IMogoMapUIController {
mDelegate.clearRoadCacheById(id);
}
}
@Override
public void setAdasRecognizedResult(int drawlevel) {
initDelegate();
if (mDelegate != null) {
mDelegate.setAdasRecognizedResult(drawlevel);
}
}
}

View File

@@ -101,19 +101,6 @@ public class AdasProvider implements IProvider {
}
//原ADAS sdk中为空实现
public void settingCarModelListInfo(String msg) {
}
//原ADAS sdk中为空实现
public void setSettingStatus(boolean show) {
}
//原ADAS sdk中为空实现
public void setUseAlgorithm(boolean open) {
}
public AdasAIDLAutopilotStateModel autopilotStateCall() {
return adasEventManager.autopilotStateCall();
}

View File

@@ -21,18 +21,6 @@ public interface IAdasDataListener {
}
default void selectCarModelUrl(String carStyleUrl) {
}
default void requestGetCarModelListInfo() {
}
default void clickSettingBack() {
}
default void showToast(String msg) {
}
/**
* 自动驾驶到达站点回调接口

View File

@@ -73,6 +73,9 @@ dependencies {
implementation project(':core:mogo-core-function-call')
}
// implementation rootProject.ext.dependencies.mogochainbase
// implementation rootProject.ext.dependencies.mogochainplugin
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
}

View File

@@ -22,6 +22,8 @@ public class MogoModulePaths {
private static final List<MogoModule> mModuleFunctions = new ArrayList<>();
private static final List<MogoModule> mModuleFunctionServers = new ArrayList<>();
/**
* 地图模块 fragment 路径
*/
@@ -38,17 +40,6 @@ public class MogoModulePaths {
*/
public static final String PATH_ENTRANCE = "/extension/entrance";
/**
* 添加卡片模块
*
* @param path
*/
@Deprecated
public static void addModule(String path) {
throw new IllegalArgumentException("this method can't be invoked.");
}
/**
* 添加卡片模块
*
@@ -73,6 +64,18 @@ public class MogoModulePaths {
mModuleFunctions.add(module);
}
/**
* 添加 功能服务, 不带UI Fragment的
*
* @param module 功能模块
*/
public static void addModuleFunctionServer(MogoModule module) {
if (module == null || TextUtils.isEmpty(module.getPath().replace(" ", ""))) {
throw new IllegalArgumentException("module path can't be empty or null or blank");
}
mModuleFunctionServers.add(module);
}
/**
* 添加基础模块
*
@@ -96,4 +99,8 @@ public class MogoModulePaths {
public static List<MogoModule> getModuleFunctions() {
return mModuleFunctions;
}
public static List<MogoModule> getModuleFunctionServers() {
return mModuleFunctionServers;
}
}

View File

@@ -29,7 +29,6 @@ import com.mogo.utils.ViewUtils;
import com.mogo.utils.logger.Logger;
import com.zhidao.carchattingprovider.ICarsChattingProvider;
import com.zhidao.carchattingprovider.MogoDriverInfo;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -138,12 +137,15 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
*
* @param data 自车周边数据
*/
// @ChainLog(endpoint = TracingConstants.Endpoint.PAD,
// nodeAliasCode = "PAD_YINGYAN_SHOW",
// paramIndexes = 0,
// clientPkFileName = "sn")
public void renderSnapshotData(SocketDownData.LauncherSnapshotProto data) {
final long start = System.nanoTime();
if (clear(data)) {
return;
}
if (!MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
return;
}
@@ -222,7 +224,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
while (iterator.hasNext()) {
IMogoMarker result = iterator.next();
SocketDownData.CloudRoadDataProto proto = ((SocketDownData.CloudRoadDataProto) result.getObject());
if(proto == null){ // 后续有业务数据在操作,更新数据,不做处理
if (proto == null) { // 后续有业务数据在操作,更新数据,不做处理
continue;
}
long internal = Long.parseLong(adasControllerApi.getSatelliteTime()) - proto.getSatelliteTime();

View File

@@ -22,7 +22,6 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -49,8 +48,6 @@ import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.api.check.IMogoCheckListener;
import com.mogo.eagle.core.function.call.check.CallerCheckManager;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.listener.MogoMapListenerHandler;
import com.mogo.map.location.IMogoLocationClient;
@@ -70,7 +67,6 @@ import com.mogo.module.common.dialog.WMDialog;
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
import com.mogo.module.common.map.CustomNaviInterrupter;
import com.mogo.module.common.map.MapCenterPointStrategy;
import com.mogo.module.common.map.MyLocationUtil;
import com.mogo.module.common.map.Scene;
import com.mogo.module.common.view.OnPreventFastClickListener;
import com.mogo.module.extensions.R;
@@ -84,7 +80,6 @@ import com.mogo.module.extensions.utils.EntranceViewHolder;
import com.mogo.module.extensions.utils.NoMapTopViewShaderHelper;
import com.mogo.module.extensions.utils.TopViewAnimHelper;
import com.mogo.module.extensions.utils.TopViewNoLinkageAnimHelper;
import com.mogo.module.service.receiver.MogoReceiver;
import com.mogo.module.share.manager.ServiceApisManager;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.analytics.IMogoAnalytics;
@@ -360,9 +355,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
initDebugPanel();
// 根据本地配置设置自车图标
MyLocationUtil.setMyLocationIconUrl(getContext());
clTrafficLight = (ConstraintLayout) findViewById(R.id.cl_traffic_light);
tvYellow = (TextView) findViewById(R.id.tv_yellow);
tvRed = (TextView) findViewById(R.id.tv_red);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

View File

@@ -2,12 +2,4 @@
<resources>
<dimen name="module_ext_top_view_width_in_vr_mode">1100px</dimen>
<dimen name="module_switch_map">279px</dimen>
<dimen name="module_switch_map_height">119px</dimen>
<dimen name="module_switch_margin_left">22px</dimen>
<dimen name="module_switch_text_size">36px</dimen>
<dimen name="module_switch_image">50px</dimen>
<dimen name="module_switch_image_circle">60px</dimen>
</resources>

View File

@@ -184,11 +184,4 @@
<dimen name="module_switch_map">190px</dimen>
<dimen name="module_switch_map_height">76px</dimen>
<dimen name="module_switch_margin_left">16px</dimen>
<dimen name="module_switch_text_size">24px</dimen>
<dimen name="module_switch_image">35px</dimen>
<dimen name="module_switch_image_circle">38px</dimen>
</resources>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="module_ext_color_voice_text">#FFFFFF</color>
<color name="module_ext_weather_bkg_color">#BF30334C</color>
<color name="module_ext_weather_text_color">#fff</color>
<color name="module_ext_vr_mode_left_notice_content_text_color">#f1f1f1</color>

View File

@@ -244,12 +244,4 @@
<dimen name="module_video_window_width_content">400px</dimen>
<dimen name="module_video_window_height_content">300px</dimen>
<dimen name="module_switch_map">190px</dimen>
<dimen name="module_switch_map_height">76px</dimen>
<dimen name="module_switch_margin_left">16px</dimen>
<dimen name="module_switch_text_size">24px</dimen>
<dimen name="module_switch_image">35px</dimen>
<dimen name="module_switch_image_circle">38px</dimen>
</resources>

View File

@@ -69,7 +69,5 @@
<item>提前看看出行路况,试试唤醒小智说,“中关村路况怎么样”</item>
</string-array>
<string name="module_map_model_normal">近距视角</string>
<string name="module_map_model_faster">远距视角</string>
</resources>

View File

@@ -29,6 +29,11 @@ public interface MogoModulesHandler {
*/
void loadFunctionModules();
/**
* 架构升级v1.1加载功能模块
*/
void loadFunctionModulesServer();
/**
* 加载地图
*

View File

@@ -5,8 +5,10 @@ import android.content.Context;
import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
@@ -43,6 +45,10 @@ public class MogoModulesManager implements MogoModulesHandler {
private Map< MogoModule, IMoGoFunctionProvider> mModuleFunctionProviders = new HashMap<>();
private Map< String, IMoGoFunctionProvider> mModuleNameFunctionProviders = new HashMap<>();
// 架构升级后的加载功能模块的方式
private Map< MogoModule, IMoGoFunctionServerProvider> mModuleFunctionServerProviders = new HashMap<>();
private Map< String, IMoGoFunctionServerProvider> mModuleNameFunctionServerProviders = new HashMap<>();
private static volatile MogoModulesManager sInstance;
private MogoModulesManager() {
@@ -121,6 +127,21 @@ public class MogoModulesManager implements MogoModulesHandler {
}
}
@Override
public void loadFunctionModulesServer() {
final List< MogoModule > modules = MogoModulePaths.getModuleFunctionServers();
if ( modules != null && !modules.isEmpty() ) {
for ( MogoModule module : modules ) {
Logger.d( TAG, "module.getPath():" + module.getPath() + " name: " + module.getName() );
IMoGoFunctionServerProvider provider = loadFunctionServer( module.getPath() );
if ( provider != null ) {
mModuleFunctionServerProviders.put( module, provider );
mModuleNameFunctionServerProviders.put( module.getName(), provider );
}
}
}
}
@Override
public void loadMapModule( int containerId ) {
Logger.d( TAG, "loadMapModule" );
@@ -168,7 +189,7 @@ public class MogoModulesManager implements MogoModulesHandler {
continue;
}
Logger.d( TAG, "加载基本模块:%s", baseModule.getPath() );
load( baseModule.getPath() );
loadBaseProvider( baseModule.getPath() );
}
}
@@ -181,6 +202,15 @@ public class MogoModulesManager implements MogoModulesHandler {
}
private IProvider loadBaseProvider(String path ) {
try {
return ( IProvider ) ARouter.getInstance().build( path ).navigation( getContext() );
} catch ( Exception e ) {
e.printStackTrace();
return null;
}
}
private IMogoModuleProvider load( String path ) {
try {
return ( IMogoModuleProvider ) ARouter.getInstance().build( path ).navigation( getContext() );
@@ -199,6 +229,15 @@ public class MogoModulesManager implements MogoModulesHandler {
}
}
private IMoGoFunctionServerProvider loadFunctionServer(String path ) {
try {
return ( IMoGoFunctionServerProvider ) ARouter.getInstance().build( path ).navigation( getContext() );
} catch ( Exception e ) {
e.printStackTrace();
return null;
}
}
private void addFragment( IMogoModuleProvider provider, int containerId ) {
if ( provider == null ) {
Logger.e( TAG, "add fragment fail cause provider == null, container is %s", ResourcesHelper.getResNameById( getApplicationContext(), containerId ) );
@@ -272,6 +311,23 @@ public class MogoModulesManager implements MogoModulesHandler {
if ( mModuleFunctionProviders != null ) {
mModuleFunctionProviders.clear();
}
if ( mModuleFunctionServerProviders != null ) {
Collection< IMoGoFunctionServerProvider > modules = mModuleFunctionServerProviders.values();
if ( modules != null ) {
for ( IMoGoFunctionServerProvider module : modules ) {
try {
Logger.d( TAG, "destroy module: " + module.getFunctionName() );
module.onDestroy();
} catch ( Exception e ) {
Logger.e( TAG, e, "onDestroy" );
}
}
}
mModuleNameFunctionProviders.clear();
}
if ( mModuleFunctionServerProviders != null ) {
mModuleFunctionServerProviders.clear();
}
mActivity = null;
}
}

View File

@@ -452,12 +452,12 @@ public class MogoServices implements IMogoMapListener,
return;
}
List< MogoModule > modules = MogoModulePaths.getModules();
if ( modules.isEmpty() || modules == null ) {
if (modules.isEmpty()) {
return;
}
mAIAssistReceiver = new MogoReceiver( context );
IntentFilter filter = new IntentFilter();
if ( modules != null && !modules.isEmpty() ) {
if (!modules.isEmpty()) {
for ( MogoModule module : modules ) {
if ( TextUtils.isEmpty( module.getBroadcastAction() ) ) {
continue;

View File

@@ -111,7 +111,6 @@ abstract class StatusChangedAdapter implements IMogoStatusChangedListener {
}
MogoApisHandler.getInstance().getApis().getShareManager().dismissShareDialog();
MogoApisHandler.getInstance().getApis().getOnlineCarPanelApi().hidePanel();
MogoApisHandler.getInstance().getApis().getAdasControllerApi().setSettingStatus(false);
MogoApisHandler.getInstance().getApis().getEventPanelManager().hidePanel();
if (mCarsChattingProvider == null) {
mCarsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation();

View File

@@ -18,6 +18,7 @@ import com.mogo.cloud.socket.entity.SocketDownDataHelper;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
@@ -31,14 +32,13 @@ import com.mogo.map.search.geo.MogoRegeocodeResult;
import com.mogo.map.search.geo.query.MogoRegeocodeQuery;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.constants.DataTypes;
import com.mogo.module.common.datacenter.SnapshotLocationDataCenter;
import com.mogo.module.common.dialog.WMDialog;
import com.mogo.module.common.drawer.SnapshotSetDataDrawer;
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;
import com.mogo.module.service.timedelay.TimeDelayUploadManager;
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
import com.mogo.service.adas.entity.ADASCarStateInfo;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import com.mogo.service.entrance.ButtonIndex;
@@ -162,9 +162,6 @@ public class MockIntentHandler implements IntentHandler {
query.setRadius(1000);
geoSearch.getFromLocationAsyn(query);
break;
case 11:// 控制ADAS中的设置页面
MarkerServiceHandler.getADASController().setSettingStatus(intent.getBooleanExtra("status", false));
break;
case 12: {// 控制ADAS显示隐藏
boolean status2 = intent.getBooleanExtra("status", false);
if (status2) {

View File

@@ -20,6 +20,7 @@ import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
import com.mogo.module.common.drawer.MarkerDrawer;
import com.mogo.module.common.drawer.OnlineCarDrawer;
import com.mogo.module.common.drawer.RoadConditionDrawer;
import com.mogo.module.common.drawer.SnapshotSetDataDrawer;
import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
import com.mogo.module.common.drawer.marker.OnlineCarMarkerView;
@@ -147,7 +148,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
@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;

View File

@@ -21,6 +21,10 @@ public class MogoRouteOverlayManager implements IMogoCarLocationChangedListener2
}
public void init() {
MogoApisHandler.getInstance()
.getApis()
.getRegisterCenterApi()
.registerCarLocationChangedListener( "MogoRouteOverlayManager",this);
MogoApisHandler.getInstance().getApis().getAdasControllerApi().addAdasAutopilotRouteCallBack(new IMogoAdasRouteCallBack(){
@Override

View File

@@ -1,6 +1,7 @@
package com.mogo.module.service.routeoverlay;
import android.content.Context;
import android.util.Log;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.map.location.MogoLocation;
@@ -87,18 +88,20 @@ public class RouteOverlayDrawer {
}
}else {
// 将当前车辆位置放进去
mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude()));
// mPolylinePointList.add(new MogoLatLng(carLocal.getLatitude(), carLocal.getLongitude()));
for (MogoLatLng polyline : routelist) {
// Log.e("IMogoPolyline",polyline.getLat()+":"+polyline.lon);
//需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃
if (LocationUtils.isPointOnCarFront(carLocal, polyline)) {
mPolylinePointList.add(polyline);
}
mPolylinePointList.add(polyline);
//需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃
// Log.e("lianglihui",polyline.getLat()+":"+polyline.getLon());
}
}
// 过滤后台推送的推荐路线集合
mPolylineOptions.setGps(true);
mPolylineColors.addAll(ColorUtils.getGradientAlpha("#002965ED", "#FF2965ED", "#002965ED", mPolylinePointList.size()));
// 替换路径集合
mPolylineOptions.points(mPolylinePointList);

View File

@@ -92,6 +92,8 @@ public class EnvStatusManager {
stringBuilder.append(sStatusName[i]).append(":");
if (i == 3) {
stringBuilder.append(DebugConfig.getAutoPilotStatus()).append("\n");
} else if (i == 4) {
stringBuilder.append("true".equals(DebugConfig.getStatus(i, false)) ? "正常" : "异常").append("\n");
} else if (i == 5 || i == 6) {
stringBuilder.append(DebugConfig.getStatusData(i)).append("\n");
} else if (i == 7) {

View File

@@ -96,7 +96,6 @@ public class GlobalUnwakeManager implements IProvider, IMogoIntentListener, IMog
* @param type 面板位置索引
*/
private void showPanelByStatus(String target, int type){
MogoApisHandler.getInstance().getApis().getAdasControllerApi().setSettingStatus(false);
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageOnResume() ) {
MogoApisHandler.getInstance().getApis().getEventPanelManager().showPanelWithSelectedItem(type);
} else {

View File

@@ -36,20 +36,6 @@ public interface IMogoADASController extends IProvider {
*/
void killADAS();
/**
* adas 设置页面控制
*
* @param show
*/
void setSettingStatus(boolean show);
/**
* 控制算法
*
* @param open
*/
void setUseAlgorithm(boolean open);
void release();
/**
@@ -59,13 +45,6 @@ public interface IMogoADASController extends IProvider {
*/
void changeAdasControlMode(EnumMapUI ui);
/**
* 反向设置 adas 对可见性的控制
*
* @param visible
*/
void changeAdasControlVisibleMode(boolean visible);
/**
* 获取当前皮肤状态
*
@@ -80,7 +59,6 @@ public interface IMogoADASController extends IProvider {
*/
void aiCloudToAdasData(AutoPilotControlParameters result);
/**
* 添加adas数据回调接口
*
@@ -125,12 +103,14 @@ public interface IMogoADASController extends IProvider {
/**
* 添加adas自动驾驶路线回调
*
* @param callBack
*/
void addAdasAutopilotRouteCallBack(IMogoAdasRouteCallBack callBack);
/**
* 移除adas自动驾驶路线回调
*
* @param callBack
*/
void removeAdasAutopilotRouteCallBack(IMogoAdasRouteCallBack callBack);

View File

@@ -1,98 +0,0 @@
package com.mogo.service.impl.adas;
import android.content.Context;
import android.os.Environment;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
/**
* Adas上报日志本地保存帮助类
*
* @author tongchenfei
*/
public class AdasLogWriter extends Thread {
private static final String TAG = "AdasLogWritter";
private String path;
private final String dir;
public AdasLogWriter( Context context) {
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) || !Environment.isExternalStorageRemovable()) {
dir = context.getExternalCacheDir().getPath()+"/mogoAdasLog";
} else {
dir = context.getCacheDir().getPath()+"/mogoAdasLog";
}
Logger.d(TAG, "log dir: " + dir);
}
private final BlockingQueue<String> logLine = new LinkedBlockingQueue<>();
public void write(String log) {
if (!isWritting) {
start();
}
logLine.offer(log == null ? System.currentTimeMillis() + ",null\r\n" : System.currentTimeMillis() + "," + log + "\r\n");
}
public void write(Object object){
if (!isWritting) {
start();
}
String json = GsonUtil.jsonFromObject( object );
if ( json != null ) {
logLine.offer( json );
}
}
private volatile boolean isWritting = false;
@Override
public synchronized void start() {
if(!isWritting) {
isWritting = true;
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.CHINA);
path = dir + "/log_" + format.format(new Date());
super.start();
}
}
public synchronized void stopLog() {
isWritting = false;
interrupt();
}
@Override
public void run() {
super.run();
File fileDir = new File(dir);
File logFile = new File(path);
if (!fileDir.exists()) {
fileDir.mkdirs();
}
try (FileOutputStream outputStream = new FileOutputStream(logFile)) {
while (isWritting) {
if (isInterrupted()) {
break;
}
String log = logLine.take();
outputStream.write(log.getBytes());
}
} catch (InterruptedException e) {
Logger.w(TAG, "writter interrupt: " + e.getMessage());
e.printStackTrace();
} catch (IOException e) {
Logger.w(TAG, "writter io exp: " + e.getMessage());
e.printStackTrace();
}
}
}

View File

@@ -1,105 +0,0 @@
package com.mogo.service.impl.adas;
import android.os.Handler;
import android.os.Message;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.network.utils.GsonUtil;
import java.io.File;
import java.io.FileWriter;
import java.util.Random;
public
/**
* @author congtaowang
* @since 2021/1/22
*
* 描述
*/
class LogWriter {
public static final int MAX_SIZE = 6 * 1024 * 1924;
private final String path;
private Handler writeHandler = null;
public LogWriter( String path ) {
this.path = path;
File file = new File( path );
if ( !file.exists() ) {
try {
if ( !file.getParentFile().exists() ) {
file.getParentFile().mkdirs();
}
file.createNewFile();
} catch ( Exception e ) {
e.printStackTrace();
}
}
writeHandler = new Handler( WorkThreadHandler.newInstance( "Logger-Writer" + new Random().nextLong() ).getLooper() ) {
@Override
public void handleMessage( Message msg ) {
super.handleMessage( msg );
if ( msg.what == 100 ) {
writeImpl( msg.obj );
} else if ( msg.what == 101 ) {
writeImpl( msg.obj, msg.arg1 );
}
}
};
}
private void writeImpl( Object log, int time ) {
try {
FileWriter fw = new FileWriter( path, true );
fw.append( time + " - " );
if ( log instanceof CharSequence ) {
fw.append( ( ( CharSequence ) log ) );
} else {
fw.append( GsonUtil.jsonFromObject( log ) );
}
fw.append( "\n" );
fw.flush();
fw.close();
} catch ( Exception e ) {
e.printStackTrace();
}
}
private void writeImpl( Object log ) {
try {
FileWriter fw = new FileWriter( path, true );
fw.append( System.currentTimeMillis() + " - " );
if ( log instanceof CharSequence ) {
fw.append( ( ( CharSequence ) log ) );
} else {
fw.append( GsonUtil.jsonFromObject( log ) );
}
fw.append( "\n" );
fw.flush();
fw.close();
} catch ( Exception e ) {
e.printStackTrace();
}
}
public void write( Object log ) {
if ( log == null ) {
return;
}
Message msg = Message.obtain();
msg.obj = log;
msg.what = 100;
writeHandler.sendMessage( msg );
}
public void write( Object log, long recTime ) {
Message msg = Message.obtain();
msg.obj = log;
msg.what = 101;
msg.arg1 = ( int ) ( System.currentTimeMillis() - recTime );
writeHandler.sendMessage( msg );
}
}

View File

@@ -10,16 +10,17 @@ import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
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.constants.MogoServicePaths;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.adas.AdasProvider;
import com.mogo.module.adas.IAdasDataListener;
import com.mogo.module.adas.IAdasStatusListener;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.adas.IMogoAdasCarDataCallback;
import com.mogo.service.adas.IMogoAdasDataCallback;
@@ -27,29 +28,20 @@ import com.mogo.service.adas.IMogoAdasOCHCallback;
import com.mogo.service.adas.IMogoAdasRecognizedDataCallback;
import com.mogo.service.adas.IMogoAdasRouteCallBack;
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
import com.mogo.eagle.core.data.autopilot.AutoPilotControlParameters;
import com.mogo.service.adas.entity.ADASCarStateInfo;
import com.mogo.service.adas.entity.ADASRecognizedResult;
import com.mogo.service.adas.entity.ADASWarnMessage;
import com.mogo.eagle.core.data.autopilot.AutoPilotStationInfo;
import com.mogo.service.adas.entity.CarModelListResponse;
import com.mogo.service.datamanager.IMogoDataManager;
import com.mogo.service.impl.singleton.SingletonsHolder;
import com.mogo.service.network.IMogoNetwork;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.TipToast;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
import com.mogo.utils.storage.SharedPrefsMgr;
import com.zhidao.adasconfig.api.AdasConfigApiController;
import com.zhidao.adasconfig.common.config.EnumCarChatIncognitoMode;
import com.zhidao.adasconfig.common.config.EnumCarHeading;
import com.zhidao.adasconfig.common.config.EnumSkinStyle;
import com.zhidao.autopilot.support.api.AutopilotServiceManage;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotArriveModel;
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarRectModel;
import com.zhidao.support.adas.high.bean.AutopilotRoute;
import com.zhidao.support.adas.high.bean.AutopilotStatus;
import com.zhidao.support.adas.high.bean.RectInfo;
@@ -58,14 +50,10 @@ import com.zhidao.support.adas.high.bean.WarnMessageInfo;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import io.reactivex.schedulers.Schedulers;
@Route(path = MogoServicePaths.PATH_ADAS_CONTROLLER)
public class MogoADASController implements IMogoADASController {
@@ -111,8 +99,6 @@ public class MogoADASController implements IMogoADASController {
private IMogoAdasCarDataCallback mMogoAdasCarDataCallback;
private List<AdasAIDLOwnerCarRectModel> mLastFrameDatums;
private double mLastLon;
private double mLastLat;
private double mSpeed;
@@ -161,7 +147,6 @@ public class MogoADASController implements IMogoADASController {
super.handleMessage(msg);
final long start = System.currentTimeMillis();
ADASCarStateInfo stateInfo = GsonUtil.objectFromJson(((String) msg.obj), ADASCarStateInfo.class);
if (stateInfo == null || stateInfo.getValues() == null) {
// Logger.d(TAG, "ADAS-LOC-timer", "upd 到 aidl 传输数据 stateInfo or stateInfo.getValues() is null");
@@ -224,7 +209,6 @@ public class MogoADASController implements IMogoADASController {
}
}
private volatile boolean needEmphasizeMyLocation = false;
@Override
public void showADAS() {
@@ -309,53 +293,14 @@ public class MogoADASController implements IMogoADASController {
});
}
@Override
public void selectCarModelUrl(String carStyleUrl) {
Logger.d(TAG, "selectCarModelUrl: " + carStyleUrl);
needEmphasizeMyLocation = true;
// 修改自车图标展示
SharedPrefsMgr.getInstance(context).putString("MY_LOCATION_CONFIG", carStyleUrl);
SingletonsHolder.get(IMogoDataManager.class).syncData("ADAS", carStyleUrl);
}
@Override
public void requestGetCarModelListInfo() {
Logger.d(TAG, "requestGetCarModelListInfo ");
if (DebugConfig.isMapBased()) {
Logger.d(TAG, "requestGetCarModelListInfo");
// 向adas发送车模list
String carModelList = SharedPrefsMgr.getInstance(context).getString("CAR_MODEL_LIST", "");
if (carModelList != null && !carModelList.isEmpty()) {
adasProvider.settingCarModelListInfo(carModelList);
}
// 此处进行网络请求请求成功后再通知一次adas
requestCarModelList();
}
}
@Override
public void clickSettingBack() {
if (needEmphasizeMyLocation) {
SingletonsHolder.get(IMogoDataManager.class).syncData("ADAS", null);
}
needEmphasizeMyLocation = false;
useTestSn = !useTestSn;
}
@Override
public void showToast(String msg) {
UiThreadHandler.post(() -> TipToast.tip(msg));
}
@Override
public void autopilotArrive(AdasAIDLAutopilotArriveModel autopilotArriveModel) {
Logger.d(TAG, "autopilotArriveModel " + autopilotArriveModel);
if (autopilotArriveModel == null) {
Logger.d(TAG,"autopilotArrive autopilotArriveModel is null");
Logger.d(TAG, "autopilotArrive autopilotArriveModel is null");
return;
}
Logger.d(TAG,"autopilotArrive : " + autopilotArriveModel.toString());
Logger.d(TAG, "autopilotArrive : " + autopilotArriveModel.toString());
if (!mAdasOCHCallback.isEmpty()) {
for (IMogoAdasOCHCallback cb : mAdasOCHCallback) {
cb.onArriveAt(new AutoPilotStationInfo(
@@ -408,7 +353,6 @@ public class MogoADASController implements IMogoADASController {
}
}
private boolean useTestSn = false;
private void invokeShowADASOperation() {
int delay = 0;
@@ -475,23 +419,11 @@ public class MogoADASController implements IMogoADASController {
app.sendBroadcast(intent);
}
private Context context;
@Override
public void init(Context context) {
mIsReleased = false;
adasProvider = ARouter.getInstance().navigation(AdasProvider.class);
this.context = context;
}
@Override
public void setSettingStatus(boolean show) {
adasProvider.setSettingStatus(show);
}
@Override
public void setUseAlgorithm(boolean open) {
adasProvider.setUseAlgorithm(open);
}
@Override
@@ -526,22 +458,9 @@ public class MogoADASController implements IMogoADASController {
}
}
@Override
public void changeAdasControlVisibleMode(boolean visible) {
Logger.d(TAG, "new visibility: " + visible);
AdasConfigApiController.getInstance().setUserCarChatIncognitoModel(visible ? EnumCarChatIncognitoMode.OPEN : EnumCarChatIncognitoMode.CLOSE);
}
@Override
public EnumMapUI getCurrentSkinMode() {
if (!DebugConfig.isMapBased()) {
return EnumMapUI.Type_Night;
}
boolean white = AdasConfigApiController.getInstance().isShowUISkinWhiteModel();
if (!white) {
return EnumMapUI.Type_Night;
}
return EnumMapUI.Type_Light;
return EnumMapUI.Type_VR;
}
@Override
@@ -567,49 +486,12 @@ public class MogoADASController implements IMogoADASController {
}
}
private void requestCarModelList() {
Map<String, String> params = new HashMap<>(8);
params.put("sn", MoGoAiCloudClientConfig.getInstance().getSn());
SingletonsHolder.get(IMogoNetwork.class).create(CarModelInfoNetApiServices.class, CarModelInfoNetApiServices.getBaseUrl()).
requestCarModelList(params).
subscribeOn(Schedulers.io()).
observeOn(Schedulers.io()).
subscribe(new SubscribeImplTemporary<CarModelListResponse>(RequestOptions.create(context)) {
@Override
public void onSuccess(CarModelListResponse o) {
super.onSuccess(o);
Logger.d(TAG, "请求车模列表成功: " + o);
// 保存到sp中
String value = GsonUtil.jsonFromObject(o.getResult());
SharedPrefsMgr.getInstance(context).putString("CAR_MODEL_LIST", value);
if (value != null && !value.isEmpty()) {
adasProvider.settingCarModelListInfo(value);
}
}
@Override
public void onError(Throwable e) {
super.onError(e);
Logger.e(TAG, e, "请求自车模型失败");
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
Logger.e(TAG, "请求自车模型失败: " + message);
}
});
}
@Override
public void release() {
mIsReleased = true;
adasProvider.removeAdasEventListener(mAdasDataListener);
adasProvider.removeAdasStatusListener();
//AutopilotServiceManage.getInstance().release();
//关闭定时任务
// if (mDisposable != null) mDisposable.dispose();
AutopilotServiceManage.getInstance().release();
}
@Override

View File

@@ -15,52 +15,52 @@ public
* @author congtaowang
* @since 2020/10/22
*
* 描述
* 适配ADAS 回调监听分发
*/
abstract class OnAdasListenerAdapter implements OnAdasListener {
@Override
public void onWarnMessage( WarnMessageInfo warnMessageInfo ) {
public void onWarnMessage(WarnMessageInfo warnMessageInfo) {
}
@Override
public void onVideoSize( int width, int height ) {
public void onVideoSize(int width, int height) {
}
@Override
public void onRectData( RectInfo rectInfo ) {
public void onRectData(RectInfo rectInfo) {
}
@Override
public void onCarStateData( CarStateInfo carStateInfo ) {
public void onCarStateData(CarStateInfo carStateInfo) {
}
@Override
public void onLightStateData( LightStatueInfo lightStatueInfo ) {
public void onLightStateData(LightStatueInfo lightStatueInfo) {
}
@Override
public void onObstaclesInfo( ObstaclesInfo obstaclesInfo ) {
public void onObstaclesInfo(ObstaclesInfo obstaclesInfo) {
}
@Override
public void onCarLaneInfo( CarLaneInfo carLaneInfo ) {
public void onCarLaneInfo(CarLaneInfo carLaneInfo) {
}
@Override
public void autopilotStatus( AutopilotStatus autopilotStatus ) {
public void autopilotStatus(AutopilotStatus autopilotStatus) {
}
@Override
public void autopilotArrive( AutopilotWayArrive autopilotWayArrive ) {
public void autopilotArrive(AutopilotWayArrive autopilotWayArrive) {
}
}