diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java index 95d7a876a7..f97d224c6c 100644 --- a/app/src/main/java/com/mogo/launcher/MogoApplication.java +++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java @@ -91,7 +91,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 ); diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java index 3531741702..40ee54edc5 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java @@ -100,6 +100,8 @@ public class V2XMessageEntity implements Serializable { int ALERT_ROAD_LIVE_CAR_WARNING = 1_007; // 道路事件违章停车 int ALERT_ILLEGAL_PARK_WARNING = 1_008; + // 呼叫、请求直播事件 + int ALERT_VOICE_CALL_FOR_LIVECAR_SHOW = 1_009; // 自车求助 int ALERT_CAR_FOR_HELP = 8_000; // obu事件 @@ -117,6 +119,7 @@ public class V2XMessageEntity implements Serializable { V2XTypeEnum.ALERT_ROAD_LIVE_CAR_WARNING, V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING, V2XTypeEnum.ALERT_CAR_FOR_HELP, + V2XTypeEnum.ALERT_VOICE_CALL_FOR_LIVECAR_SHOW, V2XTypeEnum.ALERT_OBU_EVENT, }) @Target({ diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index d1f640ec5a..e4877e12b8 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -8,6 +8,7 @@ import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; @@ -64,8 +65,10 @@ import com.mogo.utils.TipToast; 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; @@ -122,6 +125,11 @@ public class EntranceFragment extends MvpFragment { + 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(); + }); } /** diff --git a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_crash_threshold_set.xml b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_crash_threshold_set.xml new file mode 100644 index 0000000000..1ce622b331 --- /dev/null +++ b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_crash_threshold_set.xml @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +