Merge branch 'demo/shunyi_v2v' into demo/shunyi_v2v_merge
# Conflicts: # app/src/main/java/com/mogo/launcher/MogoApplication.java # modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java # modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml # modules/mogo-module-search/build.gradle # services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java # services/mogo-service-api/src/main/java/com/mogo/service/MogoServicePaths.java
This commit is contained in:
15
.idea/codeStyles/Project.xml
generated
15
.idea/codeStyles/Project.xml
generated
@@ -3,18 +3,9 @@
|
||||
<JetCodeStyleSettings>
|
||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||
<value>
|
||||
<package name="java.util" alias="false" withSubpackages="false" />
|
||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
||||
<package name="io.ktor" alias="false" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PACKAGES_IMPORT_LAYOUT">
|
||||
<value>
|
||||
<package name="" alias="false" withSubpackages="true" />
|
||||
<package name="java" alias="false" withSubpackages="true" />
|
||||
<package name="javax" alias="false" withSubpackages="true" />
|
||||
<package name="kotlin" alias="false" withSubpackages="true" />
|
||||
<package name="" alias="true" withSubpackages="true" />
|
||||
<package name="java.util" withSubpackages="false" static="false" />
|
||||
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
|
||||
<package name="io.ktor" withSubpackages="true" static="false" />
|
||||
</value>
|
||||
</option>
|
||||
</JetCodeStyleSettings>
|
||||
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -80,7 +80,9 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_MOGO_MONITOR, "MogoMonitor"));
|
||||
MogoModulePaths.addModule( new MogoModule( V2XConst.PATH_EVENT_PANEL, V2XConst.MODULE_NAME_EVENT_PANEL ) );
|
||||
MogoModulePaths.addModule( new MogoModule( PushUIConstants.PATH, PushUIConstants.NAME ) );
|
||||
|
||||
// 碰撞报警模块
|
||||
MogoModulePaths.addModule(new MogoModule(MogoServicePaths.PATH_CRASH_WARNING,
|
||||
"CrashWarning"));
|
||||
if ( !DebugConfig.isLauncher() ) {
|
||||
PersistentManager.getInstance().initManager( this );
|
||||
Intent intent = new Intent( this, MogoMainService.class );
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
@@ -9,7 +8,7 @@ import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -60,8 +59,10 @@ import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.manager.ts.TsThreshold;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -119,6 +120,11 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
private TextView mMsgCounter;
|
||||
|
||||
private ImageView mUserHeadImg;
|
||||
private View thresholdSetContainer;
|
||||
private EditText topEditC, frontLeftEditC, frontRightEditC, backLeftEditC, backRightEditC,
|
||||
bottomEditC;
|
||||
private EditText topEditS, frontLeftEditS, frontRightEditS, backLeftEditS, backRightEditS,
|
||||
bottomEditS;
|
||||
|
||||
/**
|
||||
* 搜索莫模块
|
||||
@@ -313,6 +319,67 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload, mStatusManager);
|
||||
|
||||
debugTopView();
|
||||
debugCrashWarn();
|
||||
}
|
||||
|
||||
private void debugCrashWarn(){
|
||||
thresholdSetContainer = findViewById(R.id.thresholdSetContainer);
|
||||
topEditC = findViewById(R.id.etTopC);
|
||||
frontLeftEditC = findViewById(R.id.etFrontLeftC);
|
||||
backLeftEditC = findViewById(R.id.etBackLeftC);
|
||||
frontRightEditC = findViewById(R.id.etFrontRightC);
|
||||
backRightEditC = findViewById(R.id.etBackRightC);
|
||||
bottomEditC = findViewById(R.id.etBottomC);
|
||||
|
||||
topEditS = findViewById(R.id.etTopS);
|
||||
frontLeftEditS = findViewById(R.id.etFrontLeftS);
|
||||
backLeftEditS = findViewById(R.id.etBackLeftS);
|
||||
frontRightEditS = findViewById(R.id.etFrontRightS);
|
||||
backRightEditS = findViewById(R.id.etBackRightS);
|
||||
bottomEditS = findViewById(R.id.etBottomS);
|
||||
|
||||
findViewById(R.id.btnClose).setOnClickListener(view -> {
|
||||
thresholdSetContainer.setVisibility(View.GONE);
|
||||
mApis.getAdasControllerApi().showADAS();
|
||||
});
|
||||
mUploadRoadCondition.setOnLongClickListener(v -> {
|
||||
mApis.getAdasControllerApi().closeADAS();
|
||||
thresholdSetContainer.setVisibility(View.VISIBLE);
|
||||
TsThreshold threshold = mApis.getCrashWarnProvider().getCurrentCrashThreshold();
|
||||
topEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC5()));
|
||||
topEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS5()));
|
||||
bottomEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC6()));
|
||||
bottomEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS6()));
|
||||
frontLeftEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC4()));
|
||||
frontLeftEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS4()));
|
||||
backLeftEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC3()));
|
||||
backLeftEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS3()));
|
||||
frontRightEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC1()));
|
||||
frontRightEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS1()));
|
||||
backRightEditC.setText(String.format(Locale.CHINA, "%d", threshold.getC2()));
|
||||
backRightEditS.setText(String.format(Locale.CHINA, "%d", threshold.getS2()));
|
||||
return true;
|
||||
});
|
||||
findViewById(R.id.btnSet).setOnClickListener(view -> {
|
||||
// 设置阈值
|
||||
TsThreshold threshold = new TsThreshold(
|
||||
Integer.parseInt(frontRightEditC.getText().toString()),
|
||||
Integer.parseInt(frontRightEditS.getText().toString()),
|
||||
Integer.parseInt(backRightEditC.getText().toString()),
|
||||
Integer.parseInt(backRightEditS.getText().toString()),
|
||||
Integer.parseInt(backLeftEditC.getText().toString()),
|
||||
Integer.parseInt(backLeftEditS.getText().toString()),
|
||||
Integer.parseInt(frontLeftEditC.getText().toString()),
|
||||
Integer.parseInt(frontLeftEditS.getText().toString()),
|
||||
Integer.parseInt(topEditC.getText().toString()),
|
||||
Integer.parseInt(topEditS.getText().toString()),
|
||||
Integer.parseInt(bottomEditC.getText().toString()),
|
||||
Integer.parseInt(bottomEditS.getText().toString())
|
||||
);
|
||||
mApis.getCrashWarnProvider().setCrashThreshold(threshold);
|
||||
thresholdSetContainer.setVisibility(View.GONE);
|
||||
mApis.getAdasControllerApi().showADAS();
|
||||
});
|
||||
}
|
||||
|
||||
public void showShareDialog() {
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/thresholdSetContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#000"
|
||||
android:padding="30dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="前保险杠设置(5)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etTopC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvTop"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTop" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etTopS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvTop"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTop" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFrontLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="左前门设置(4)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tvFrontRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etTopC" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFrontLeftC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvFrontLeft"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvFrontLeft" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFrontLeftS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvFrontLeft"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvFrontLeft" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvFrontRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:text="右前门设置(1)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tvFrontLeft"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etTopC" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFrontRightC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvFrontRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvFrontRight" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etFrontRightS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvFrontRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvFrontRight" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBackLeft"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="左后门设置(3)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tvBackRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etFrontRightS" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBackLeftC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvBackLeft"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBackLeft" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBackLeftS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvBackLeft"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBackLeft" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBackRight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="右后门设置(2)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tvBackLeft"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etFrontRightS" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBackRightC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvBackRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBackRight" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBackRightS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvBackRight"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBackRight" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="后保险杠设置(6)"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etBackRightS" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBottomC"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="碰撞"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvBottom"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBottom" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBottomS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center"
|
||||
android:hint="剐蹭"
|
||||
android:textColor="#fff"
|
||||
android:textColorHint="#ccc"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvBottom"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvBottom" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnClose"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="关闭"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="设置"
|
||||
android:textColor="#fff"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -217,4 +217,6 @@
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="btnDebugCtrlNaviView,btnDebugCtrlSubView,btnDebugCtrlTopView,btnDebugAddBottomLayerView" />
|
||||
|
||||
<include layout="@layout/module_ext_layout_crash_threshold_set" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -39,7 +39,6 @@ dependencies {
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.rxjava
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
} else {
|
||||
|
||||
@@ -39,22 +39,6 @@ class ObuManager: IMogoObuManager,Handler.Callback {
|
||||
|
||||
private var handler = Handler(Looper.getMainLooper(), this)
|
||||
|
||||
override fun getNaviListener(): IMogoNaviListener? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getLocationListener(): IMogoLocationListener? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getType(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
override fun getMarkerClickListener(): IMogoMarkerClickListener? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
Logger.d(TAG,"init=======")
|
||||
if (DebugConfig.isUseMockObuData()) {
|
||||
@@ -68,34 +52,6 @@ class ObuManager: IMogoObuManager,Handler.Callback {
|
||||
}
|
||||
}
|
||||
|
||||
override fun getMapListener(): IMogoMapListener? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getAppPackage(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
override fun createView(context: Context?): View? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun createFragment(context: Context?, data: Bundle?): Fragment? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getModuleName(): String {
|
||||
return "moduleObu"
|
||||
}
|
||||
|
||||
override fun getAppName(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
override fun getCardLifecycle(): IMogoModuleLifecycle? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun registerObuDataChangedListener(listener: IMogoObuDataChangedListener?) {
|
||||
this.dataChangedListener = listener
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.zhidao.mogo.module.obu.crashwarn
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.service.MogoServicePaths
|
||||
import com.mogo.service.obu.IMogoCrashWarnProvider
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.zhidao.manager.constent.Common
|
||||
import com.zhidao.manager.power.ZDPowerManager
|
||||
import com.zhidao.manager.ts.TsSensorChannel
|
||||
import com.zhidao.manager.ts.TsThreshold
|
||||
|
||||
/**
|
||||
* 碰撞报警provider
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_CRASH_WARNING)
|
||||
class CrashWarningProvider:IMogoCrashWarnProvider {
|
||||
companion object{
|
||||
const val TAG = "CrashWarningProvider"
|
||||
}
|
||||
|
||||
val crashThreshold = TsThreshold(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
|
||||
|
||||
override fun setCrashThreshold(threshold: TsThreshold?) {
|
||||
ZDPowerManager.getInstance().setTsThreshold(threshold)
|
||||
}
|
||||
|
||||
override fun getCurrentCrashThreshold(): TsThreshold = crashThreshold
|
||||
|
||||
override fun init(context: Context) {
|
||||
Logger.d(TAG, "init---->")
|
||||
ZDPowerManager.getInstance().setTsBoxStatusListener(object : ZDPowerManager.TsBoxStatusListener{
|
||||
override fun onBoxSelfCheckChanged(p0: TsSensorChannel?) {
|
||||
}
|
||||
|
||||
override fun onBoxThresholdChanged(threshold: TsThreshold?) {
|
||||
threshold?.let {
|
||||
Logger.d(TAG, "获取到当前阈值: $threshold")
|
||||
crashThreshold.copy(threshold)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTimeChanged(p0: Int, p1: Int, p2: Int, p3: Int, p4: Int, p5: Int) {
|
||||
}
|
||||
|
||||
override fun onVersionChanged(p0: String?) {
|
||||
}
|
||||
|
||||
override fun onBoxSwitchChanged(p0: Int, p1: Int, p2: Int, p3: Int) {
|
||||
}
|
||||
/**
|
||||
* 碰撞报警事件
|
||||
* @param position 碰撞位置 1:右前车门,2:右后车门,3:左后车门,4:左前车门,5:前保险杠,6:后保险杠
|
||||
* @param levelH 高力度级数(1--5)
|
||||
* @param levelL 低力度级数 (1--5)
|
||||
*/
|
||||
override fun onAlarmChanged(position: Int, levelH: Int, levelL: Int) {
|
||||
// 发送广播通知adas
|
||||
Logger.d(TAG, "碰撞事件报警------ position: $position, levelH: $levelH,levelL: $levelL")
|
||||
val intent = Intent("com.mogo.launcher.action.CRASH_WARNING")
|
||||
intent.putExtra("position", position)
|
||||
intent.putExtra("levelH", levelH)
|
||||
intent.putExtra("levelL", levelL)
|
||||
context.sendBroadcast(intent)
|
||||
}
|
||||
|
||||
override fun onSerialNumChanged(p0: String?) {
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
val getThresholdResult = ZDPowerManager.getInstance().tsBoxStatus
|
||||
Logger.d(TAG, "获取当前碰撞阈值: $getThresholdResult")
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
// implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
|
||||
@@ -42,6 +42,7 @@ dependencies {
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
api rootProject.ext.dependencies.fresco
|
||||
api rootProject.ext.dependencies.obusdk
|
||||
api 'com.mogo.module:module-crash-warning:1'
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
} else {
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.mogo.service.module.IMogoSearchManager;
|
||||
import com.mogo.service.module.IMogoSettingManager;
|
||||
import com.mogo.service.monitor.IMogoMonitorProvider;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.service.obu.IMogoCrashWarnProvider;
|
||||
import com.mogo.service.obu.IMogoObuManager;
|
||||
import com.mogo.service.passport.IMogoPassportManager;
|
||||
import com.mogo.service.share.IMogoShareManager;
|
||||
@@ -257,4 +258,10 @@ public interface IMogoServiceApis extends IProvider {
|
||||
* @return
|
||||
*/
|
||||
IMogoMonitorProvider getMogoMonitorApi();
|
||||
|
||||
/**
|
||||
* 获取crashWarnProvider
|
||||
* @return
|
||||
*/
|
||||
IMogoCrashWarnProvider getCrashWarnProvider();
|
||||
}
|
||||
|
||||
@@ -244,4 +244,10 @@ public class MogoServicePaths {
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_STRATEGY_SHARE = "/share/strategy";
|
||||
|
||||
/**
|
||||
* 碰撞报警模块
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_CRASH_WARNING = "/crash/warning";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.mogo.service.obu;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.zhidao.manager.ts.TsThreshold;
|
||||
|
||||
/**
|
||||
* 碰撞报警相关接口
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IMogoCrashWarnProvider extends IProvider {
|
||||
/**
|
||||
* 设置碰撞碰撞报警阈值
|
||||
* @param threshold
|
||||
*/
|
||||
void setCrashThreshold(TsThreshold threshold);
|
||||
|
||||
/**
|
||||
* 获取当前碰撞报警阈值
|
||||
* @return
|
||||
*/
|
||||
TsThreshold getCurrentCrashThreshold();
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.mogo.service.obu;
|
||||
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.zhidao.smartv2x.listener.OnMessageReceiveListener;
|
||||
|
||||
/**
|
||||
* obu事件管理器
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IMogoObuManager extends IMogoModuleProvider, OnMessageReceiveListener{
|
||||
public interface IMogoObuManager extends IProvider, OnMessageReceiveListener{
|
||||
void registerObuDataChangedListener(IMogoObuDataChangedListener listener);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.mogo.service.module.IMogoSearchManager;
|
||||
import com.mogo.service.module.IMogoSettingManager;
|
||||
import com.mogo.service.monitor.IMogoMonitorProvider;
|
||||
import com.mogo.service.network.IMogoNetwork;
|
||||
import com.mogo.service.obu.IMogoCrashWarnProvider;
|
||||
import com.mogo.service.obu.IMogoObuManager;
|
||||
import com.mogo.service.passport.IMogoPassportManager;
|
||||
import com.mogo.service.share.IMogoShareManager;
|
||||
@@ -218,6 +219,11 @@ public class MogoServiceApis implements IMogoServiceApis {
|
||||
return getApiInstance(IMogoMonitorProvider.class,MogoServicePaths.PATH_MOGO_MONITOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoCrashWarnProvider getCrashWarnProvider() {
|
||||
return getApiInstance(IMogoCrashWarnProvider.class, MogoServicePaths.PATH_CRASH_WARNING);
|
||||
}
|
||||
|
||||
private static < T extends IProvider > T getApiInstance(Class< T > clazz, String path ) {
|
||||
T inst = SingletonsHolder.get( clazz );
|
||||
if ( inst == null ) {
|
||||
|
||||
Reference in New Issue
Block a user