Merge branch 'dev_robotaxi-d-app-module_2120_221017_2.12.0' into 'test_robotaxi-d-app-module_2120_221017_2.12.0.1'

Dev robotaxi d app module 2120 221017 2.12.0

See merge request zhjt/AndroidApp/MoGoEagleEye!319
This commit is contained in:
wangmingjun
2022-10-29 03:43:34 +00:00
49 changed files with 682 additions and 464 deletions

View File

@@ -227,8 +227,8 @@ public class BusPassengerMapDirectionView
if (mAMap != null) {
addRouteColorList();
if (mLinePointsLatLng.size() > 2) {
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "mLinePointsLatLng.size() = " +mLinePointsLatLng.size());
if (mLinePointsLatLng.size() >= 2) {
//设置线段纹理
PolylineOptions polylineOptions = new PolylineOptions();
@@ -303,6 +303,7 @@ public class BusPassengerMapDirectionView
texIndexList.clear();
mCoordinatesLatLng.clear();
mLinePointsLatLng.clear();
CallerLogger.INSTANCE.d(M_BUS_P + TAG, " mCoordinatesLatLng.clear " );
}
public void onCreateView(Bundle savedInstanceState) {

View File

@@ -19,6 +19,7 @@ import com.mogo.eagle.core.data.temp.EventLogout;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.map.MogoMarkerManager;
@@ -107,6 +108,14 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
showAutopilotBiz();
mSwitchLine.setOnClickListener(this);
mLineName.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
showHideTestBar();
return false;
}
});
}
@Subscribe(threadMode = ThreadMode.MAIN)
@@ -421,6 +430,9 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
, endStation.getLon(),R.raw.end_marker);
}
//清除鹰眼右下角小地图轨迹
CallerSmpManager.clearPolyline();
}
/**

View File

@@ -18,7 +18,6 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import com.amap.api.navi.model.NaviLatLng;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
import com.mogo.eagle.core.function.call.map.CallerSmpManager;
@@ -50,7 +49,7 @@ import java.util.List;
* @since 2021/1/18
* 正在进行中订单
*/
public class CommonBeingServerdOrdersFragment extends BaseTaxiUIFragment
public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
implements View.OnClickListener, ICommonNaviChangedCallback {
public static final String TAG = "OCHTaxiBeingServerd";
@@ -98,12 +97,12 @@ public class CommonBeingServerdOrdersFragment extends BaseTaxiUIFragment
private volatile int saveOrderState = -1;
public static CommonBeingServerdOrdersFragment newInstance(Activity activity, TaxiFragment taxiFragment) {
public static TaxiBeingServerdOrdersFragment newInstance(Activity activity, TaxiFragment taxiFragment) {
mActivity = activity;
mTaxiFragment = taxiFragment;
Bundle args = new Bundle();
CommonBeingServerdOrdersFragment fragment = new CommonBeingServerdOrdersFragment();
TaxiBeingServerdOrdersFragment fragment = new TaxiBeingServerdOrdersFragment();
fragment.setArguments(args);
return fragment;
}

View File

@@ -51,7 +51,7 @@ public class TaxiServerOrdersFragment extends BaseTaxiUIFragment {
private ViewPager mTaxiOrderPager;
private String[] mTabTitles = {"进行中","待服务"};
private List<Fragment> fragments = new ArrayList<>();
private CommonBeingServerdOrdersFragment beingServerdOrdersFragment = null;
private TaxiBeingServerdOrdersFragment beingServerdOrdersFragment = null;
private TaxiReserveOrdersFragment reserveOrdersFragment = null;
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@@ -82,7 +82,7 @@ public class TaxiServerOrdersFragment extends BaseTaxiUIFragment {
if (0 == i){
mTaxiOrderTab.addTab(tab,true);
changeTabLayoutTabUI(tab,true);
beingServerdOrdersFragment = CommonBeingServerdOrdersFragment.newInstance(getActivity(),(TaxiFragment) getParentFragment());
beingServerdOrdersFragment = TaxiBeingServerdOrdersFragment.newInstance(getActivity(),(TaxiFragment) getParentFragment());
fragments.add(beingServerdOrdersFragment);
}else if (1 == i){
mTaxiOrderTab.addTab(tab);

View File

@@ -24,7 +24,7 @@ if (!isAndroidTestBuild()) {
if (!isAndroidTestBuild()) {
apply plugin: 'chain.log.hook'
hooklog{
hooklog {
enableTraceToServer false
enableLoggerToLocal true
}
@@ -36,15 +36,6 @@ if (!isAndroidTestBuild()) {
apply plugin: 'apm-plugin'
}
if (!isAndroidTestBuild()) {
apply plugin: 'bytex.threadOpt'
thread_opt {
enable !isReleaseBuild
enableInDebug !isReleaseBuild
logLevel "DEBUG"
}
}
if (!isAndroidTestBuild()) {
apply plugin: 'LancetX'
LancetX {
@@ -273,7 +264,7 @@ dependencies {
} else {
implementation project(':tts:tts-pad')
implementation project(':core:function-impl:mogo-core-function-hmi')
androidTestImplementation project(':core:mogo-core-function-call')
androidTestImplementation project(':core:mogo-core-res')
androidTestImplementation project(':core:function-impl:mogo-core-function-notice')
@@ -290,10 +281,6 @@ dependencies {
androidTestImplementation rootProject.ext.dependencies.androidx_espresso_core
androidTestImplementation rootProject.ext.dependencies.localbroadcastmanager
androidTestImplementation rootProject.ext.dependencies.mogo_v2x
if (isAndroidTestBuild()) {
implementation "com.mogo.thread.opt:lib:${THREAD_OPT_VERSION}"
}
}
if (!isAndroidTestBuild()) {
@@ -366,7 +353,7 @@ def getWorkingBranchHash() {
}
static def getBuildTime() {
def buildTimeFormat = "yyyy-MM-dd HH:mm:ss"
def buildTimeFormat = "yyyy-MM-dd HH:mm:ss"
//设置时间格式
SimpleDateFormat formatter = new SimpleDateFormat(buildTimeFormat, Locale.getDefault())
//获取当前时间

View File

@@ -7,8 +7,6 @@ import androidx.annotation.NonNull;
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.launcher.crash.CrashSystem;
import com.mogo.thread.ext.core.ThreadManager;
import com.mogo.thread.ext.core.config.ThreadConfig;
import java.util.concurrent.ThreadPoolExecutor;
@@ -23,40 +21,40 @@ public class MogoApplication extends MainMoGoApplication {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
ThreadConfig.Builder builder = new ThreadConfig.Builder().listener(new ThreadConfig.TaskExecuteListener() {
@Override
public boolean isEnabled() {
return true; // 如果返回true会有后续的回调如果返回false, 不会有后续的回调
}
@Override
public void onExecutorBefore(@NonNull Runnable runnable, @NonNull ThreadConfig.TaskType type) {
//每个任务执行前回调
// if (type == ThreadConfig.TaskType.HandlerThread) {
// ThreadConfig.Builder builder = new ThreadConfig.Builder().listener(new ThreadConfig.TaskExecuteListener() {
// @Override
// public boolean isEnabled() {
// return true; // 如果返回true会有后续的回调如果返回false, 不会有后续的回调
// }
//
// @Override
// public void onExecutorBefore(@NonNull Runnable runnable, @NonNull ThreadConfig.TaskType type) {
// //每个任务执行前回调
//// if (type == ThreadConfig.TaskType.HandlerThread) {
////
////
//// }
// }
//
// }
}
@Override
public void onExecutorAfter(@NonNull Runnable runnable, @NonNull ThreadConfig.TaskType type) {
//每个任务执行后回调
}
/**
* @param core 线程池的核心数
* @param max 线程池的最大线程数
* @param active 线程池正在活跃的任务数
* @param completed 线程池已完成的任务数
*/
@Override
public void onExecutorStateChanged(@NonNull ThreadPoolExecutor pool, int core, int max, int active, long completed) {
//线程池在执行过程,状态变化回调
//Log.d("POOL", "core:" + core + ";max:" + max + ";active:" + active + ";completed:" + completed);
}
});
builder.loggable(false);
ThreadManager.INSTANCE.init(builder);
// @Override
// public void onExecutorAfter(@NonNull Runnable runnable, @NonNull ThreadConfig.TaskType type) {
// //每个任务执行后回调
// }
//
// /**
// * @param core 线程池的核心数
// * @param max 线程池的最大线程数
// * @param active 线程池正在活跃的任务数
// * @param completed 线程池已完成的任务数
// */
// @Override
// public void onExecutorStateChanged(@NonNull ThreadPoolExecutor pool, int core, int max, int active, long completed) {
// //线程池在执行过程,状态变化回调
// //Log.d("POOL", "core:" + core + ";max:" + max + ";active:" + active + ";completed:" + completed);
// }
// });
// builder.loggable(false);
// ThreadManager.INSTANCE.init(builder);
}
@Override

View File

@@ -34,7 +34,6 @@ buildscript {
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
classpath "com.mogo.cloud:bizconfig:${BIZCONFIG_VERSION}"
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
classpath "com.mogo.thread.opt:plg:${THREAD_OPT_VERSION}"
classpath 'com.mogo.cloud:systrace:1.0.1'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
classpath 'com.mogo.sticky:service:1.0.8'

View File

@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.appupgrade.network;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BINDING;
import android.content.Context;
import android.util.Log;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.eagle.core.data.bindingcar.UpgradeAppInfo;
@@ -72,13 +71,11 @@ public class UpgradeAppNetWorkManager {
@Override
public void onNext(@NonNull UpgradeAppInfo info) {
if (info != null && info.result != null) {
CallerLogger.INSTANCE.d(M_BINDING + TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode());
Log.d(TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode() + "--versionCode =" + versionCode + "--info.result = " + info.result);
CallerLogger.INSTANCE.d(M_BINDING + TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode() + "--versionCode =" + versionCode + "--info.result = " + info.result);
if (info.result.getVersionCode() > versionCode) {
CallerHmiManager.INSTANCE.showUpgradeDialog(info.result.getAppUrl().substring(info.result.getAppUrl().lastIndexOf("/")+1), info.result.getAppUrl(), info.result.getInstallTitle(), info.result.getInstallContent(), info.result.getInstallType());
}
} else {
Log.e(TAG, "onNext info == null");
CallerLogger.INSTANCE.d(M_BINDING + TAG, "UpgradeAppInfo onNext info == null");
}
}

View File

@@ -35,9 +35,9 @@ class DevaToolsProvider : IDevaToolsProvider {
}
override fun initBiz() {
bizConfigCenter.init(mContext!!)
// FuncConfigImpl.init()
traceManager.init(mContext!!)
bizConfigCenter.init(mContext!!)
FuncConfigImpl.init()
MogoLogCatchManager.init(mContext!!)
}

View File

@@ -107,13 +107,8 @@ internal object BadCaseManager : LifecycleEventObserver {
if(ClickUtils.isFastClick()){
if(NetworkUtils.isConnected()){
if(BadCaseConfig.dockerVersion!=null){
val initiativeBadCaseWindow = InitiativeBadCaseWindow(activity)
initiativeBadCaseWindow.setClickListener(object: InitiativeBadCaseWindow.ClickListener{
override fun closeWindow() {
initiativeBadCaseWindow.hideFloatWindow()
}
})
initiativeBadCaseWindow.showFloatWindow()
val caseListDialog = CaseListDialog(activity)
caseListDialog.show()
}else{
ToastUtils.showShort("工控机连接状态异常")
}

View File

@@ -5,6 +5,7 @@ import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.GridLayoutManager
import com.mogo.eagle.core.data.badcase.RecordTypeEntity
@@ -157,20 +158,7 @@ internal class BadCaseConfigView @JvmOverloads constructor(
val gridLayoutManager = GridLayoutManager(context,2)
rvTemplate.layoutManager = gridLayoutManager
rvTemplate.adapter = recordTemplateAdapter
// val list = ArrayList<TopicEntity>()
// list.add(TopicEntity("/v2n/aicloud/rsm_info",false,false))
// list.add(TopicEntity("/autopilot_info/report_msg_error",false,false))
// list.add(TopicEntity("/v2n/aicloud/rsi_info",false,false))
// list.add(TopicEntity("/record_cache/task",false,true))
// list.add(TopicEntity("/sensor/rainmode",false,true))
// list.add(TopicEntity("/record_cache/master/task",false,true))
// list.add(TopicEntity("/telematics/trip_info_event",false,true))
// list.add(TopicEntity("/telematics/light",false,true))
// list.add(TopicEntity("/guardian/aicloud_state",false,true))
// recordTypesList.add(RecordTypeEntity(1,"红路灯",list))
// recordTemplateAdapter?.setData(recordTypesList)
// recordTemplateAdapter?.notifyDataSetChanged()
rvTemplate.visibility = View.GONE
}
fun setClickListener(clickListener: ClickListener) {
@@ -196,6 +184,7 @@ internal class BadCaseConfigView @JvmOverloads constructor(
}
}
if(recordTypesList.size>1){
rvTemplate.visibility = View.VISIBLE
recordTemplateAdapter?.setData(recordTypesList)
recordTemplateAdapter?.notifyDataSetChanged()
}

View File

@@ -1,33 +1,45 @@
package com.zhjt.mogo_core_function_devatools.badcase.biz;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.data.badcase.RecordCaseEntity;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.zhjt.mogo_core_function_devatools.R;
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.CaseListAdapter;
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig;
import java.util.ArrayList;
import mogo.telematics.pad.MessagePad;
import record_cache.RecordPanelOuterClass;
/**
* @author XuXinChao
* @description BadCase清单选择对话框
* @since: 2022/10/19
*/
public class CaseListDialog extends Dialog {
public class CaseListDialog extends Dialog implements IMoGoAutopilotRecordListener {
private TextView tvCancel;
private RecyclerView rvCaseList;
private CaseListAdapter caseListAdapter;
private static final String TAG = "CaseListDialog";
private ArrayList<RecordCaseEntity> recordTypeEntityArrayList = new ArrayList<>();
private Activity activity;
public CaseListDialog(@NonNull Context context) {
super(context, R.style.bad_case_dialog);
public CaseListDialog(@NonNull Activity activity) {
super(activity, R.style.bad_case_dialog);
this.activity = activity;
}
@Override
@@ -43,21 +55,65 @@ public class CaseListDialog extends Dialog {
tvCancel = findViewById(R.id.tvCancel);
rvCaseList = findViewById(R.id.rvCaseList);
caseListAdapter = new CaseListAdapter();
caseListAdapter.setListener(recordCaseEntity -> {
//录制Bag包弹窗
InitiativeBadCaseWindow initiativeBadCaseWindow = new InitiativeBadCaseWindow(activity);
initiativeBadCaseWindow.setClickListener(initiativeBadCaseWindow::hideFloatWindow);
initiativeBadCaseWindow.showFloatWindow(recordCaseEntity);
});
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(),2);
gridLayoutManager.setOrientation(RecyclerView.VERTICAL);
rvCaseList.setLayoutManager(gridLayoutManager);
rvCaseList.setAdapter(caseListAdapter);
ArrayList<String> list = new ArrayList<>();
list.add("红绿灯检测错误");
list.add("接管默认录制");
list.add("行程冲突");
list.add("自定义A");
caseListAdapter.setData(list);
caseListAdapter.notifyDataSetChanged();
}
private void initEvent() {
tvCancel.setOnClickListener(v -> dismiss());
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
//获取数据采集录制模式配置列表
CallerAutoPilotManager.INSTANCE.getBadCaseConfig(0, 0,new ArrayList<>());
}
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
}
@Override
public void onAutopilotRecordResult(@NonNull RecordPanelOuterClass.RecordPanel recordPanel) {
}
@Override
public void onAutopilotRecordConfig(@NonNull MessagePad.RecordDataConfig config) {
ThreadUtils.runOnUiThread(() -> {
if(config.getRecordTypesCount()>0){
for(int index=0;index<config.getRecordTypesCount();index++){
if(config.getRecordTypes(index).getId() != 99){
ArrayList<String> topicList = new ArrayList<>();
// TODO java.lang.IndexOutOfBoundsException: Index: 38, Size: 38
// for(int position=0;index<config.getRecordTypes(index).getTopicsCount();position++){
// topicList.add(config.getRecordTypes(index).getTopicsList().get(position));
// }
recordTypeEntityArrayList.add(new RecordCaseEntity(
config.getRecordTypes(index).getId(),config.getRecordTypes(index).getDesc(),
topicList));
}
}
}
if(BadCaseConfig.customTopicList.size()>0){
recordTypeEntityArrayList.add(new RecordCaseEntity(0,"自定义A",BadCaseConfig.customTopicList));
}
caseListAdapter.setData(recordTypeEntityArrayList);
caseListAdapter.notifyDataSetChanged();
});
}
}

View File

@@ -25,6 +25,7 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.zhjt.mogo_core_function_devatools.R;
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.TopicListAdapter;
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig;
import java.util.ArrayList;
import java.util.List;
@@ -155,21 +156,23 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
topicListAdapter.notifyDataSetChanged();
}
});
tvSave.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(recordType!=null){
Boolean success=CallerAutoPilotManager.INSTANCE.getBadCaseConfig(2,recordType.getId(),addTopicList);
if(Boolean.TRUE.equals(success)){
ToastUtils.showShort("Topic设置成功");
dismiss();
}else{
ToastUtils.showShort("Topic设置失败");
tvSave.setOnClickListener(v -> {
if(recordType!=null){
Boolean success=CallerAutoPilotManager.INSTANCE.getBadCaseConfig(2,recordType.getId(),addTopicList);
if(Boolean.TRUE.equals(success)){
ToastUtils.showShort("Topic设置成功");
if(recordType.getId() == 0){
//自定义Topic
BadCaseConfig.customTopicList.addAll(addTopicList);
}
addTopicList.clear();
dismiss();
}else{
ToastUtils.showShort("Topic设置失败");
}
}
});
tvCancel.setOnClickListener(v -> {
@@ -183,9 +186,13 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
ThreadUtils.runOnUiThread(() -> {
if(config.getAllTopicsCount()>0){
for(int index=0;index<config.getAllTopicsCount();index++){
allTopicList.add(new TopicEntity(config.getAllTopics(index),false,true));
if(!recordType.getTopicsList().contains(config.getAllTopics(index))){
allTopicList.add(new TopicEntity(config.getAllTopics(index),false,true));
}
}
recordType.getTopicsList().addAll(allTopicList);
topicListAdapter.setData(recordType.getTopicsList());
topicListAdapter.notifyDataSetChanged();
}
});
}

View File

@@ -13,6 +13,7 @@ import android.widget.ImageView
import android.widget.TextView
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.badcase.RecordCaseEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
@@ -137,13 +138,6 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
CallerAutopilotRecordListenerManager.addListener(this.hashCode().toString(),this)
// 添加 ADAS车辆状态&定位 监听
CallerAutopilotCarStatusListenerManager.addListener(this.hashCode().toString(), this)
//开启录包
CallerAutoPilotManager.recordPackage(BadCaseConfig.type,
Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration,
BadCaseConfig.previousDuration
)
viewAudioButton.setOnClickListener {
audioStatus = !audioStatus
setAudio(audioStatus)
@@ -337,7 +331,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
return true
}
fun showFloatWindow() {
fun showFloatWindow(recordCaseEntity: RecordCaseEntity) {
if (mFloatLayout.parent == null) {
val metrics = DisplayMetrics()
// 默认固定位置,靠屏幕右边缘的中间
@@ -345,6 +339,9 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
mWindowParams!!.x = metrics.widthPixels
mWindowParams!!.y = metrics.heightPixels / 2 - getSysBarHeight(mActivity)-350
mWindowManager!!.addView(mFloatLayout, mWindowParams)
//开启录包
CallerAutoPilotManager.recordPackage(recordCaseEntity.caseId,Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration,recordCaseEntity.topicList)
}
}

View File

@@ -5,6 +5,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.badcase.RecordCaseEntity
import com.zhjt.mogo_core_function_devatools.R
/**
@@ -14,12 +15,17 @@ import com.zhjt.mogo_core_function_devatools.R
*/
class CaseListAdapter: RecyclerView.Adapter<CaseListAdapter.CaseListHolder>() {
private var data:List<String>? = null
private var data:List<RecordCaseEntity>? = null
private var caseClickListener: CaseClickListener?=null
fun setData( data: List<String>?){
fun setData( data: List<RecordCaseEntity>?){
this.data = data
}
fun setListener(listener: CaseClickListener){
caseClickListener = listener
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CaseListHolder {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_case_list, parent, false)
@@ -27,10 +33,10 @@ class CaseListAdapter: RecyclerView.Adapter<CaseListAdapter.CaseListHolder>() {
}
override fun onBindViewHolder(holder: CaseListHolder, position: Int) {
data?.let {
holder.caseName.text = it[position]
data?.let {recordCaseEntity->
holder.caseName.text = recordCaseEntity[position].caseName
holder.caseName.setOnClickListener {
caseClickListener?.onClick(recordCaseEntity[position])
}
}
}
@@ -40,4 +46,9 @@ class CaseListAdapter: RecyclerView.Adapter<CaseListAdapter.CaseListHolder>() {
class CaseListHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
var caseName: TextView = itemView.findViewById(R.id.caseName)
}
interface CaseClickListener{
fun onClick(recordCaseEntity: RecordCaseEntity)
}
}

View File

@@ -27,7 +27,10 @@ object BadCaseConfig {
//工控机版本
@JvmField
var dockerVersion:String ?= null
@JvmField
var recordKeyList:ArrayList<Long> = ArrayList()
//自定义Topic清单列表
@JvmField
var customTopicList: ArrayList<String> = ArrayList()
}

View File

@@ -42,6 +42,11 @@ class FuncConfigCenter : IMogoOnMessageListener<FuncConfig>, IMoGoAutopilotCarCo
MogoAiCloudSocketManager.getInstance(AbsMogoApplication.getApp().applicationContext)
.registerOnMessageListener(FUNC_CONFIG_TYPE, this)
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
//未连接到工控,默认配置
val bizJson = SPUtils.getInstance("biz_config")
.getString("config", GsonUtils.toJson(defaultFuncConfig()))
refreshConfig(GsonUtils.fromJson(bizJson, FuncConfig::class.java))
}
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
@@ -49,12 +54,7 @@ class FuncConfigCenter : IMogoOnMessageListener<FuncConfig>, IMoGoAutopilotCarCo
UiThreadHandler.post {
funcConfigNetWorkModel.requestFuncConfig(carConfigResp.macAddress, {
SPUtils.getInstance("biz_config").put("config", GsonUtils.toJson(it))
refreshConfig(it)
}, {
val bizJson = SPUtils.getInstance("biz_config")
.getString("config", GsonUtils.toJson(defaultFuncConfig()))
refreshConfig(GsonUtils.fromJson(bizJson, FuncConfig::class.java))
})
refreshConfig(it) }, {})
}
} else {
ToastUtils.showLong("未获取到域控mac信息")

View File

@@ -15,7 +15,7 @@ object FuncConfigImpl {
fun init() {
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(FOUNDATION,
TAG,
TAG,false,
object : IMoGoDevaToolsFuncConfigListener {
override fun updateBizData(
type: String,

View File

@@ -34,6 +34,7 @@ class FuncConfigNetWorkModel {
if (error == null) {
error = onError
}
//todo test
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["mac"] = DeviceUtils.getMacAddress()
map["channelVersion"] = FuncConfigConst.getChannelCode()

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/caseName"
android:layout_width="430px"
android:layout_width="match_parent"
android:layout_height="116px"
android:textColor="#FFFFFFFF"
android:textSize="43px"
@@ -9,6 +9,10 @@
android:gravity="center"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:clickable="true"
android:focusable="true"
>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/caseName"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="84px"
android:textColor="#FFFFFFFF"
android:textSize="34px"
@@ -10,8 +10,9 @@
android:layout_marginTop="20dp"
android:clickable="true"
android:focusable="true"
android:paddingStart="30dp"
android:paddingEnd="30dp"
android:layout_marginStart="20dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
>
</TextView>

View File

@@ -315,20 +315,11 @@
app:layout_constraintLeft_toLeftOf="@id/tvRecordTemplate"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvRecordTemplate"
app:layout_constraintBottom_toBottomOf="parent"
android:background="@drawable/template_list_bg"
android:layout_marginTop="@dimen/dp_50"
android:paddingBottom="20dp"
/>
<RadioGroup
android:id="@+id/rgRecordConfig"
android:layout_width="0dp"
android:layout_height="match_parent"
app:layout_constraintLeft_toLeftOf="@id/tvRecordTemplate"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvRecordTemplate"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_50"
android:paddingBottom="10dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -84,6 +84,7 @@ import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
import com.mogo.eagle.core.function.hmi.ui.tools.AutoPilotAndCheckView
import com.mogo.eagle.core.function.hmi.ui.tools.MaskView
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -134,6 +135,10 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
private var mSOPSettingViewFloat: WarningFloat.Builder? = null
private var mSOPSettingView: SOPSettingView? = null
//StatusView
private var statusBarViewFloat: WarningFloat.Builder? = null
private var statusBarView: StatusBarView? = null
private var mNoticeFloat: WarningFloat.Builder? = null
// 超视距、路侧、前车直播
@@ -193,13 +198,15 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
override fun initViews() {
toggleStatusBarView()
initViewShowWithConfig()
//设置StatusBar初始状态
if (FunctionBuildConfig.isDemoMode) {
viewStatusBar.updateRightView(true, "demoMode", DemoModeView(requireContext()))
statusBarView?.updateRightView(true, "demoMode", DemoModeView(requireContext()))
} else {
viewStatusBar.updateRightView(false, "demoMode", DemoModeView(requireContext()))
statusBarView?.updateRightView(false, "demoMode", DemoModeView(requireContext()))
}
ivCameraIcon?.setOnClickListener {
@@ -424,11 +431,11 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
override fun setStatusBarDarkOrLight(light: Boolean) {
viewStatusBar.setStatusBarDarkOrLight(light)
statusBarView?.setStatusBarDarkOrLight(light)
}
override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
viewStatusBar.updateRightView(insert, tag, viewGroup)
statusBarView?.updateRightView(insert, tag, viewGroup)
}
/**
@@ -686,7 +693,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
}
override fun toggleSOPView() {
activity?.let{
if(mSOPSettingViewFloat!= null){
@@ -738,6 +744,52 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
}
}
private fun toggleStatusBarView() {
activity?.let{
if(statusBarViewFloat!= null){
WarningFloat.dismiss(statusBarViewFloat!!.config.floatTag, false)
statusBarViewFloat = null
statusBarView = null
}else{
if (statusBarView == null){
statusBarView = StatusBarView(it)
}
val side = TOP
val gravity = Gravity.TOP
statusBarViewFloat = WarningFloat.with(it)
.setTag("statusBarView")
.setLayout(statusBarView!!)
.setSidePattern(side)
.setWindowWidth(ScreenUtils.getScreenWidth())
.setWindowHeight(BarUtils.getStatusBarHeight())
.setGravity(gravity, 0)
.setImmersionStatusBar(true)
.setAnimator(object : DefaultAnimator() {
override fun enterAnim(
view: View,
params: LayoutParams,
windowManager: WindowManager,
sidePattern: SidePattern
): Animator? =
super.enterAnim(view, params, windowManager, sidePattern)
?.apply {
interpolator = LinearInterpolator()
}
override fun exitAnim(
view: View,
params: LayoutParams,
windowManager: WindowManager,
sidePattern: SidePattern
): Animator? =
super.exitAnim(view, params, windowManager, sidePattern)
?.setDuration(200)
})
.show()
}
}
}
/**
* 展示VR下V2X预警
*

View File

@@ -196,9 +196,7 @@ class DebugSettingView @JvmOverloads constructor(
//添加 业务配置监听
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
FuncBizConfig.FOUNDATION,
TAG,
this
FuncBizConfig.FOUNDATION, TAG, true, this
)
if (logInfoView != null) {
@@ -230,7 +228,7 @@ class DebugSettingView @JvmOverloads constructor(
CallerAutopilotVehicleStateListenerManager.removeListener(TAG)
// 移除 业务配置监听
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(this)
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener( FuncBizConfig.FOUNDATION, TAG)
if (logInfoView != null) {
logInfoView!!.onEnterBackground()
@@ -568,6 +566,10 @@ class DebugSettingView @JvmOverloads constructor(
}
}
Log.i(
"1026-emArrow",
"debug setting FunctionBuildConfig.isDemoMode : ${FunctionBuildConfig.isDemoMode}"
)
// 演示模式,上一次勾选的数据
tbIsDemoMode.isChecked = FunctionBuildConfig.isDemoMode
@@ -1855,7 +1857,7 @@ class DebugSettingView @JvmOverloads constructor(
}
}
override fun updateBizData(type: String, state: Boolean, lock: Boolean, data: String?) {
override fun updateBizView(type: String, lock: Boolean) {
when (type) {
BIZ_BEAUTY_MODE -> {
tbIsDemoMode.isClickable = !lock

View File

@@ -28,7 +28,7 @@ class SOPSettingView @JvmOverloads constructor(
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoDevaToolsFuncConfigListener {
companion object{
companion object {
const val TAG = "SOPSettingView"
}
@@ -51,7 +51,7 @@ class SOPSettingView @JvmOverloads constructor(
FunctionBuildConfig.isPNCWarning = isChecked
}
if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
tbMarkingObstacles.visibility = View.GONE
}
@@ -71,9 +71,9 @@ class SOPSettingView @JvmOverloads constructor(
//红绿灯标识
tbTrafficLight.isChecked = HmiBuildConfig.isShowTrafficLightView
tbTrafficLight.setOnCheckedChangeListener { _, isChecked ->
if(!isChecked){
if (!isChecked) {
HmiBuildConfig.isShowTrafficLightView = false
}else{
} else {
HmiBuildConfig.isShowTrafficLightView = true
CallerHmiManager.disableWarningTrafficLight()
}
@@ -82,9 +82,9 @@ class SOPSettingView @JvmOverloads constructor(
//限速标识
tbSpeedLimit.isChecked = HmiBuildConfig.isShowLimitingVelocityView
tbSpeedLimit.setOnCheckedChangeListener { _, isChecked ->
if(isChecked){
if (isChecked) {
HmiBuildConfig.isShowLimitingVelocityView = true
}else{
} else {
HmiBuildConfig.isShowLimitingVelocityView = false
CallerHmiManager.disableLimitingVelocity()
}
@@ -122,13 +122,13 @@ class SOPSettingView @JvmOverloads constructor(
//OBU控制总开关
tbObu.isChecked = CallerOBUManager.isConnected()
tbObu.setOnCheckedChangeListener { _, isChecked ->
if(!isChecked){
if(AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
if (!isChecked) {
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
CallerOBUManager.resetObuIpAddress("192.168.1.199")
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
} else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
CallerOBUManager.resetObuIpAddress("192.168.8.199")
}
}else{
} else {
//断开链接
CallerOBUManager.disConnectObu()
}
@@ -137,31 +137,32 @@ class SOPSettingView @JvmOverloads constructor(
//变道绕障的目标障碍物速度阈值
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
ivSpeedReduce.setOnClickListener {
if(FunctionBuildConfig.detouringSpeed<=3){
if (FunctionBuildConfig.detouringSpeed <= 3) {
ToastUtils.showShort("阈值小可为3 m/s")
}else{
} else {
FunctionBuildConfig.detouringSpeed--
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
}
}
ivSpeedAdd.setOnClickListener {
if(FunctionBuildConfig.detouringSpeed>=7){
if (FunctionBuildConfig.detouringSpeed >= 7) {
ToastUtils.showShort("阈值最大可为7 m/s")
}else{
} else {
FunctionBuildConfig.detouringSpeed++
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
}
}
btnSpeedSet.setOnClickListener {
val isSuccess = CallerAutoPilotManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble())
if(isSuccess == true){
val isSuccess =
CallerAutoPilotManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble())
if (isSuccess == true) {
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置成功")
}else{
} else {
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置失败")
}
}
if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
tvSpeedThresholdTitle.visibility = View.GONE
ivSpeedReduce.visibility = View.GONE
tvSpeed.visibility = View.GONE
@@ -175,19 +176,17 @@ class SOPSettingView @JvmOverloads constructor(
super.onAttachedToWindow()
//添加 业务配置监听
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
FuncBizConfig.FOUNDATION,
TAG,
this
FuncBizConfig.FOUNDATION, TAG, true, this
)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
// 移除 业务配置监听
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(this)
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener(FuncBizConfig.FOUNDATION, TAG)
}
override fun updateBizData(type: String, state: Boolean, lock: Boolean, data: String?) {
override fun updateBizView(type: String, lock: Boolean) {
when (type) {
FuncBizConfig.BIZ_BEAUTY_MODE -> {
tbDemoMode.isClickable = !lock

View File

@@ -12,10 +12,12 @@ import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.R
import java.lang.ref.WeakReference
class BatteryGroupView : LinearLayout {
class BatteryGroupView : LinearLayout, IMoGoSkinModeChangeListener {
constructor(
context: Context,
@@ -29,6 +31,7 @@ class BatteryGroupView : LinearLayout {
LayoutInflater.from(context).inflate(R.layout.view_battery_group, this, true)
private var batteryView: BatteryView = (view as BatteryGroupView).findViewById(R.id.viewBattery)
private var ivBatteryCharge: ImageView = (view as BatteryGroupView).findViewById(R.id.ivBatteryCharge)
private var mSkinMode = 0
private val batteryStateReceiver: BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
@@ -49,6 +52,9 @@ class BatteryGroupView : LinearLayout {
}
companion object {
const val TAG = "BatteryGroupView"
class BatteryHandler(batteryGroupView: BatteryGroupView) : Handler() {
//虚引用
@@ -69,6 +75,10 @@ class BatteryGroupView : LinearLayout {
it.batteryView.setCharging(isCharging)
if (isCharging) {
it.ivBatteryCharge.visibility = View.VISIBLE
when(it.mSkinMode){
0 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_light)
1 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_dark)
}
} else {
it.ivBatteryCharge.visibility = View.GONE
}
@@ -83,10 +93,17 @@ class BatteryGroupView : LinearLayout {
val intentFilter = IntentFilter()
intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED)
context.registerReceiver(batteryStateReceiver, intentFilter)
// 添加换肤监听
CallerSkinModeListenerManager.addListener(TAG, this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
context.unregisterReceiver(batteryStateReceiver)
CallerSkinModeListenerManager.removeListener(TAG)
}
override fun onSkinModeChange(skinMode: Int) {
mSkinMode = skinMode
}
}

View File

@@ -8,11 +8,17 @@ import android.graphics.Paint
import android.graphics.RectF
import android.util.AttributeSet
import android.view.View
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.R
import kotlin.math.abs
class BatteryView : View {
class BatteryView : View , IMoGoSkinModeChangeListener {
companion object{
const val TAG = "BatteryView"
}
private val radius = context.resources.getDimension(R.dimen.dp_4) // 圆角角度
private val border = context.resources.getDimension(R.dimen.dp_3) // 外边缘宽度
@@ -23,8 +29,8 @@ class BatteryView : View {
private val headHeight = context.resources.getDimension(R.dimen.dp_8) // 电池头高度
private val headRadius = context.resources.getDimension(R.dimen.dp_1) // 电池头圆角角度
private val batteryNumSize = context.resources.getDimension(R.dimen.dp_20) // 电量显示文字大小
private val batteryColor = context.resources.getColor(R.color.color_7FECECEC) // 电量内部颜色
private val powerColor = Color.WHITE
private var batteryColor = context.resources.getColor(R.color.color_27FFFFFF) // 电量内部颜色
private var powerColor = Color.WHITE
//默认满电
private var mPower = 100
@@ -132,4 +138,28 @@ class BatteryView : View {
invalidate()
}
override fun onSkinModeChange(skinMode: Int) {
when (skinMode) {
0 -> {
batteryColor = resources.getColor(R.color.color_27FFFFFF)
powerColor = Color.WHITE
}
1 -> {
batteryColor = resources.getColor(R.color.color_1E111111)
powerColor = resources.getColor(R.color.color_2C2E30)
}
}
invalidate()
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
// 添加换肤监听
CallerSkinModeListenerManager.addListener(TAG, this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerSkinModeListenerManager.removeListener(TAG)
}
}

View File

@@ -25,6 +25,9 @@ class StatusBarView @JvmOverloads constructor(
init {
LayoutInflater.from(context).inflate(R.layout.view_status_bar, this, true)
setOnClickListener {
}
}
private val rightViewList = CopyOnWriteArrayList<String>()

View File

@@ -9,6 +9,8 @@ import android.os.Handler
import android.os.Message
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatImageView
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.R
import java.lang.ref.WeakReference
@@ -17,7 +19,7 @@ class WifiStateView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : AppCompatImageView(context, attrs, defStyleAttr) {
) : AppCompatImageView(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener {
companion object {
const val TAG = "WifiStateView"
@@ -34,15 +36,8 @@ class WifiStateView @JvmOverloads constructor(
override fun handleMessage(msg: Message) {
super.handleMessage(msg)
val wifiStateView = stateViewWeakReference?.get()
wifiStateView?.let {
when (msg.what) {
-1 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_close)
0 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_one)
1 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_two)
2 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_three)
3 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_four)
4 -> wifiStateView.setImageResource(R.drawable.wifi_light_state_five)
}
wifiStateView?.updateView(msg.what) {
wifiStateView.setImageResource(it)
}
}
}
@@ -51,6 +46,12 @@ class WifiStateView @JvmOverloads constructor(
private var wifiManager: WifiManager? = null
private var wifiHandler: WifiHandler? = null
@Volatile
private var mSkinMode: Int = 0
@Volatile
private var level: Int = 0
init {
wifiManager =
context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager?
@@ -62,12 +63,13 @@ class WifiStateView @JvmOverloads constructor(
when (intent.action) {
WifiManager.WIFI_STATE_CHANGED_ACTION, WifiManager.RSSI_CHANGED_ACTION -> {
if (wifiManager!!.wifiState == WifiManager.WIFI_STATE_DISABLED
|| wifiManager!!.wifiState ==WifiManager.WIFI_STATE_DISABLING) {
|| wifiManager!!.wifiState == WifiManager.WIFI_STATE_DISABLING
) {
wifiHandler?.sendEmptyMessage(-1)
return
}
val wifiInfo = wifiManager!!.connectionInfo
val level = WifiManager.calculateSignalLevel(wifiInfo.rssi, 5)
level = WifiManager.calculateSignalLevel(wifiInfo.rssi, 5)
wifiHandler?.sendEmptyMessage(level)
}
}
@@ -82,11 +84,44 @@ class WifiStateView @JvmOverloads constructor(
//Wifi信号强度变化
intentFilter.addAction(WifiManager.RSSI_CHANGED_ACTION)
context.registerReceiver(wifiStateReceiver, intentFilter)
// 添加换肤监听
CallerSkinModeListenerManager.addListener(TAG, this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
wifiHandler?.removeCallbacksAndMessages(null)
context.unregisterReceiver(wifiStateReceiver)
CallerSkinModeListenerManager.removeListener(TAG)
}
override fun onSkinModeChange(skinMode: Int) {
mSkinMode = skinMode
wifiHandler?.sendEmptyMessage(level)
}
fun updateView(wifiState: Int, resId: ((Int) -> Unit)) {
when (mSkinMode) {
0 -> {
when (wifiState) {
-1 -> resId.invoke(R.drawable.wifi_light_state_close)
0 -> resId.invoke(R.drawable.wifi_light_state_one)
1 -> resId.invoke(R.drawable.wifi_light_state_two)
2 -> resId.invoke(R.drawable.wifi_light_state_three)
3 -> resId.invoke(R.drawable.wifi_light_state_four)
4 -> resId.invoke(R.drawable.wifi_light_state_five)
}
}
1 -> {
when (wifiState) {
-1 -> resId.invoke(R.drawable.wifi_light_state_close)
0 -> resId.invoke(R.drawable.wifi_dark_state_one)
1 -> resId.invoke(R.drawable.wifi_dark_state_two)
2 -> resId.invoke(R.drawable.wifi_dark_state_three)
3 -> resId.invoke(R.drawable.wifi_dark_state_four)
4 -> resId.invoke(R.drawable.wifi_dark_state_five)
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -6,14 +6,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
android:id="@+id/viewStatusBar"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_72"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/viewShowDebugView"
android:layout_width="@dimen/dp_400"

View File

@@ -17,6 +17,6 @@
android:layout_height="@dimen/dp_22"
android:layout_marginStart="@dimen/dp_6"
android:scaleType="fitXY"
android:src="@drawable/battery_charge"
android:src="@drawable/battery_charge_light"
android:visibility="gone" />
</LinearLayout>

View File

@@ -1,183 +1,200 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout 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:layout_width="@dimen/dp_800"
android:layout_height="@dimen/dp_1100"
android:background="#FFFFFF">
<!--绕障类功能-->
<ToggleButton
android:id="@+id/tbObstacleAvoidance"
android:background="#FFFFFF"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启绕障类功能"
android:textOn="关闭绕障类功能"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toTopOf="parent"
/>
<!--危险障碍物颜色标记-->
<ToggleButton
android:id="@+id/tbMarkingObstacles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启「危险障碍物颜色标记」"
android:textOn="关闭「危险障碍物颜色标记」"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbObstacleAvoidance"
/>
<!--引导线动态效果-->
<ToggleButton
android:id="@+id/tbRouteDynamicEffect"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启「引导线动态效果」"
android:textOn="关闭「引导线动态效果」"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbMarkingObstacles"
/>
<!--红绿灯标识-->
<ToggleButton
android:id="@+id/tbTrafficLight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="隐藏红绿灯标识"
android:textOn="展示红绿灯标识"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbRouteDynamicEffect"
/>
<!--限速标识-->
<ToggleButton
android:id="@+id/tbSpeedLimit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="展示限速标识"
android:textOn="隐藏限速标识"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbTrafficLight"
/>
android:layout_height="match_parent"
tools:ignore="UselessParent">
<ToggleButton
android:id="@+id/tbDemoMode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启美化模式"
android:textOn="关闭美化模式"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbSpeedLimit"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ToggleButton
android:id="@+id/tbRainMode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启雨天模式"
android:textOn="关闭雨天模式"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbDemoMode"
/>
<!--绕障类功能-->
<ToggleButton
android:id="@+id/tbObstacleAvoidance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启绕障类功能"
android:textOn="关闭绕障类功能"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toTopOf="parent"
/>
<!--危险障碍物颜色标记-->
<ToggleButton
android:id="@+id/tbMarkingObstacles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启「危险障碍物颜色标记」"
android:textOn="关闭「危险障碍物颜色标记」"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbObstacleAvoidance"
/>
<!--引导线动态效果-->
<ToggleButton
android:id="@+id/tbRouteDynamicEffect"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启「引导线动态效果」"
android:textOn="关闭「引导线动态效果」"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbMarkingObstacles"
/>
<!--红绿灯标识-->
<ToggleButton
android:id="@+id/tbTrafficLight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="隐藏红绿灯标识"
android:textOn="展示红绿灯标识"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbRouteDynamicEffect"
/>
<!--限速标识-->
<ToggleButton
android:id="@+id/tbSpeedLimit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="展示限速标识"
android:textOn="隐藏限速标识"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbTrafficLight"
/>
<ToggleButton
android:id="@+id/tbObu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="关闭OBU"
android:textOn="开启OBU"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
/>
<ToggleButton
android:id="@+id/tbDemoMode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启美化模式"
android:textOn="关闭美化模式"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbSpeedLimit"
/>
<TextView
android:id="@+id/tvSpeedThresholdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbObu"
android:text="变道速度阈值:"
android:textSize="18sp"
android:textColor="#1A1A1A"
android:layout_margin="10dp"
/>
<ToggleButton
android:id="@+id/tbRainMode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启雨天模式"
android:textOn="关闭雨天模式"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbDemoMode"
/>
<ImageView
android:id="@+id/ivSpeedReduce"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/tvSpeedThresholdTitle"
app:layout_constraintTop_toTopOf="@id/tvSpeedThresholdTitle"
app:layout_constraintBottom_toBottomOf="@id/tvSpeedThresholdTitle"
android:src="@drawable/icon_reduce"
android:padding="10dp"
/>
<ToggleButton
android:id="@+id/tbObu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="关闭OBU"
android:textOn="开启OBU"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
/>
<TextView
android:id="@+id/tvSpeed"
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
android:textSize="18sp"
android:gravity="center"
android:background="@drawable/debug_setting_edit_bg"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
/>
<TextView
android:id="@+id/tvSpeedThresholdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbObu"
android:text="变道速度阈值:"
android:textSize="18sp"
android:textColor="#1A1A1A"
android:layout_margin="10dp"
/>
<ImageView
android:id="@+id/ivSpeedAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvSpeed"
app:layout_constraintBottom_toBottomOf="@id/tvSpeed"
app:layout_constraintLeft_toRightOf="@id/tvSpeed"
android:src="@drawable/icon_add"
android:padding="10dp"
/>
<ImageView
android:id="@+id/ivSpeedReduce"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/tvSpeedThresholdTitle"
app:layout_constraintTop_toTopOf="@id/tvSpeedThresholdTitle"
app:layout_constraintBottom_toBottomOf="@id/tvSpeedThresholdTitle"
android:src="@drawable/icon_reduce"
android:padding="10dp"
/>
<Button
android:id="@+id/btnSpeedSet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
android:text="设置阈值"
android:layout_marginStart="10dp"
/>
<TextView
android:id="@+id/tvSpeed"
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
android:textSize="18sp"
android:gravity="center"
android:background="@drawable/debug_setting_edit_bg"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#F0F0F0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnSpeedSet"
/>
<ImageView
android:id="@+id/ivSpeedAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tvSpeed"
app:layout_constraintBottom_toBottomOf="@id/tvSpeed"
app:layout_constraintLeft_toRightOf="@id/tvSpeed"
android:src="@drawable/icon_add"
android:padding="10dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/btnSpeedSet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
android:text="设置阈值"
android:layout_marginStart="10dp"
/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#F0F0F0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnSpeedSet"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</LinearLayout>

View File

@@ -20,7 +20,8 @@
<color name="color_FFFFFF">#FFFFFF</color>
<color name="color_2C2E30">#2C2E30</color>
<color name="color_D4D8DC">#D4D8DC</color>
<color name="color_7FECECEC">#7FECECEC</color>
<color name="color_27FFFFFF">#27FFFFFF</color>
<color name="color_1E111111">#1E111111</color>
<color name="background_wtf">#FF999900</color>
<color name="background_error">#FFCC0000</color>

View File

@@ -58,10 +58,14 @@ object AiRoadMarker {
}
private val checkExpiredTask = Runnable {
// val marker = this@AiRoadMarker.marker.get()
// if (marker != null) {
// unMarker(marker)
// }
val poi = this.marker.get()
val car = this.carLocation.get()
if (poi != null && car != null) {
val distance = DrivingDirectionUtils.distance(car.first, car.second, poi.poi_lon, poi.poi_lat) * 10000
if (distance < 500) {
unMarker(poi)
}
}
}
private val onClearAllMarker = object : OnClearAllMarker {
@@ -183,12 +187,6 @@ object AiRoadMarker {
try {
val loc = arrayOf(location.longitude, location.latitude)
carLocation.set(Triple(loc[0], loc[1], location.bearing.toDouble()))
// val marker = marker.get() ?: return
// val isOutOfRange = isOutOfRange(marker.poi_lon, marker.poi_lat, carLocation.get().first, carLocation.get().second, carLocation.get().third)
// if (isOutOfRange) {
// Logger.d(TAG, "--- onLocationChanged: isOutOfRange --- ")
// unMarker(marker)
// }
} catch (t: Throwable) {
Logger.e(TAG, "error: ${t.message}")
}
@@ -326,42 +324,34 @@ object AiRoadMarker {
fun unMarker(marker: Marker) {
Logger.d(TAG, "--- unMarker ---")
markers -= marker
this.marker.set(null)
removeLine()
V2XAiRoadEventMarker.removeMarkers(null)
handler.removeCallbacks(checkExpiredTask)
}
private fun isOutOfRange(markerLon: Double, markerLat: Double, carLon: Double, carLat: Double, carAngle: Double): Boolean {
return !isFrontOfCar(markerLon, markerLat, carLon, carLat, carAngle)
}
private fun isFrontOfCar(markerLon: Double, markerLat: Double, carLon: Double, carLat: Double, carAngle: Double): Boolean {
val degree = DrivingDirectionUtils.getDegreeOfCar2Poi2(carLon, carLat, markerLon, markerLat, carAngle)
return degree < 90
}
fun receive(marker: Marker) {
val cur = this.marker.get()
Logger.d(TAG, "receive --- 1 ---")
if (cur == marker) {
Logger.d(TAG, "receive --- 2 ---")
val poi = this.marker.get()
val car = this.carLocation.get()
if (poi != null && car != null) {
val distance = DrivingDirectionUtils.distance(car.first, car.second, marker.poi_lon, marker.poi_lat) * 10000
Logger.d(TAG, "receive --- 3 ---:car:[${car.first}, ${car.second}] -> poi:[${marker.poi_lon}, ${marker.poi_lat}] --> distance:$distance")
if (distance < 200) {
checkExpired()
} else {
handler.removeCallbacks(checkExpiredTask)
}
val poi = this.marker.get()
val car = this.carLocation.get()
if (poi != null && car != null) {
val distance = DrivingDirectionUtils.distance(car.first, car.second, marker.poi_lon, marker.poi_lat) * 10000
Logger.d(TAG, "receive --- 2 ---:car:[${car.first}, ${car.second}] -> poi:[${marker.poi_lon}, ${marker.poi_lat}] --> distance:$distance")
if (distance < 500) {
checkExpired()
} else {
handler.removeCallbacks(checkExpiredTask)
}
} else {
if (poi != null) {
checkExpired()
}
}
}
private fun checkExpired() {
handler.removeCallbacks(checkExpiredTask)
handler.postDelayed(checkExpiredTask, 60_000)
handler.postDelayed(checkExpiredTask, 10000)
}
data class Marker(

View File

@@ -24,8 +24,9 @@ import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.drawer.V2XWarnDataDrawer;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.module.common.utils.Trigonometric;
import com.mogo.v2x.data.V2XLocation;
import com.mogo.v2x.data.V2XWarningTarget;
import java.util.ArrayList;
import java.util.Arrays;
@@ -39,7 +40,7 @@ import java.util.List;
public class V2XWarningMarker implements IV2XMarker {
private static final String TAG = "V2XWarningMarker";
private static final String WARNING_ARROWS = "WARNING_ARROWS";
private V2XWarningEntity mCloundWarningInfo;
private V2XWarningTarget mCloundWarningInfo;
private boolean isSelfLineClear = true;//绘制线是否已被清除
private final List fillPoints = new ArrayList();//停止线经纬度合集
private boolean isFirstLocation = false;
@@ -60,7 +61,7 @@ public class V2XWarningMarker implements IV2XMarker {
public void drawPOI(Object entity) {
try {
CallerLogger.INSTANCE.d(M_V2X + TAG, "===drawPOI");
mCloundWarningInfo = (V2XWarningEntity) entity;
mCloundWarningInfo = (V2XWarningTarget) entity;
drawLineWithEntity();
} catch (Exception e) {
@@ -109,7 +110,7 @@ public class V2XWarningMarker implements IV2XMarker {
warningLocation);
*/
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo);
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo.getLon(), mCloundWarningInfo.getLat(), mCloundWarningInfo.getType(), mCloundWarningInfo.getCollisionLat(), mCloundWarningInfo.getCollisionLon(), mCloundWarningInfo.getAngle(), mCloundWarningInfo.getShowTime());
//添加停止线marker
//衡阳交付-取消划线需求,只渲染识别物红色模型移动过程
@@ -133,7 +134,7 @@ public class V2XWarningMarker implements IV2XMarker {
CallerLogger.INSTANCE.d(M_V2X + TAG, "数据为空carLocation == null");
}
*/
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo);
V2XWarnDataDrawer.getInstance().renderWarnData(mCloundWarningInfo.getLon(), mCloundWarningInfo.getLat(), mCloundWarningInfo.getType(), mCloundWarningInfo.getCollisionLat(), mCloundWarningInfo.getCollisionLon(), mCloundWarningInfo.getAngle(), mCloundWarningInfo.getShowTime());
}, 0);
@@ -157,7 +158,7 @@ public class V2XWarningMarker implements IV2XMarker {
* startLatLng: 划线起点=停止线上的坐标点
* mogoLatLng: 停止线前方50m坐标点
* */
private void drawRedWarningLineFrontOfStopLine(V2XWarningEntity info, MogoLatLng
private void drawRedWarningLineFrontOfStopLine(V2XWarningTarget info, MogoLatLng
startLatLng, MogoLatLng mogoLatLng) {
if (info != null) {
double angle = Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, mogoLatLng.lon, mogoLatLng.lat);
@@ -166,7 +167,7 @@ public class V2XWarningMarker implements IV2XMarker {
if (stopPolyLineMnager != null) {
IMogoPolyline polyLine = stopPolyLineMnager.getMogoStopPolyline();
MogoLatLng endLatlng = new MogoLatLng(mogoLatLng.lat, mogoLatLng.lon);
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatLng, 25, angle);
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatLng.lon, startLatLng.lat, 25, angle);
if (polyLine != null) {
CallerLogger.INSTANCE.d(M_V2X + TAG, "drawStopLine polyLine != null");
polyLine.setPoints(Arrays.asList(startLatLng, addMiddleLoc, endLatlng));
@@ -178,8 +179,8 @@ public class V2XWarningMarker implements IV2XMarker {
locations.add(addMiddleLoc);
locations.add(endLatlng);
lineInfo.setLocations(locations);
lineInfo.setHeading(info.heading);
CallerLogger.INSTANCE.d(M_V2X + TAG, "drawStopLine width = " + info.getRoadwidth());
lineInfo.setHeading(info.getHeading());
CallerLogger.INSTANCE.d(TAG, "drawStopLine width = " + info.getRoadwidth());
lineInfo.setWidth(info.getRoadwidth() * 14 + 5);
stopPolyLineMnager.drawStopPolyline(BridgeApi.INSTANCE.context(), lineInfo);
}
@@ -231,17 +232,17 @@ public class V2XWarningMarker implements IV2XMarker {
fillPoints.clear();
List stopLines = mCloundWarningInfo.getStopLines();
if (stopLines != null && stopLines.size() > 1) {
MogoLatLng x = mCloundWarningInfo.getStopLines().get(0);
MogoLatLng y = mCloundWarningInfo.getStopLines().get(1);
V2XLocation x = mCloundWarningInfo.getStopLines().get(0);
V2XLocation y = mCloundWarningInfo.getStopLines().get(1);
//两点间的距离
float distance = CoordinateUtils.calculateLineDistance(x.lon, x.lat, y.lon, y.lat);
float distance = CoordinateUtils.calculateLineDistance(x.getLon(), x.getLat(), y.getLon(), y.getLat());
float average = distance / 3;
//两点间的角度
double angle = Trigonometric.getAngle(x.lon, x.lat, y.lon, y.lat);
double angle = Trigonometric.getAngle(x.getLon(), x.getLat(), y.getLon(), y.getLat());
//根据距离和角度获取下个点的经纬度
fillPoints.add(x);
for (int i = 1; i < 3; i++) {
MogoLatLng newLocation = Trigonometric.getNewLocation(x, average * i, angle);
MogoLatLng newLocation = Trigonometric.getNewLocation(x.getLon(), x.getLat(), average * i, angle);
fillPoints.add(newLocation);
}
fillPoints.add(y);
@@ -265,12 +266,12 @@ public class V2XWarningMarker implements IV2XMarker {
marker.removeMarkers(TYPE_MARKER_CLOUD_STOP_LINE_DATA);
}
for (int i = 0; i < fillPoints.size(); i++) {
V2XWarningEntity entity = new V2XWarningEntity();
V2XWarningTarget entity = new V2XWarningTarget();
MogoLatLng latLng = (MogoLatLng) fillPoints.get(i);
entity.setLat(latLng.lat);
entity.setLon(latLng.lon);
entity.heading = mCloundWarningInfo.heading;
V2XWarnDataDrawer.getInstance().renderStopLineData(entity);
entity.setHeading(mCloundWarningInfo.getHeading());
V2XWarnDataDrawer.getInstance().renderStopLineData(entity.getLon(), entity.getLat());
}
}
} catch (Exception e) {
@@ -279,7 +280,7 @@ public class V2XWarningMarker implements IV2XMarker {
}
private MogoLatLng getMogoLat(MogoLatLng latlng) {
MogoLatLng newLocation = Trigonometric.getNewLocation(latlng, mCloundWarningInfo.getStopLineDistance(),
MogoLatLng newLocation = Trigonometric.getNewLocation(latlng.lon, latlng.lat, mCloundWarningInfo.getStopLineDistance(),
mCloundWarningInfo.getAngle());
return newLocation;
}
@@ -293,11 +294,11 @@ public class V2XWarningMarker implements IV2XMarker {
}
MogoLatLng newLocation = new MogoLatLng(0, 0);
if (mCloundWarningInfo != null && mCloundWarningInfo.getStopLines() != null && mCloundWarningInfo.getStopLines().size() > 1) {
MogoLatLng x = mCloundWarningInfo.getStopLines().get(0);
MogoLatLng y = mCloundWarningInfo.getStopLines().get(1);
float distance = CoordinateUtils.calculateLineDistance(x.lon, x.lat, y.lon, y.lat);
double angle = Trigonometric.getAngle(x.lon, x.lat, y.lon, y.lat);
newLocation = Trigonometric.getNewLocation(x, distance * 0.5, angle);
V2XLocation x = mCloundWarningInfo.getStopLines().get(0);
V2XLocation y = mCloundWarningInfo.getStopLines().get(1);
float distance = CoordinateUtils.calculateLineDistance(x.getLon(), x.getLat(), y.getLat(), y.getLat());
double angle = Trigonometric.getAngle(x.getLat(), x.getLat(), y.getLon(), y.getLat());
newLocation = Trigonometric.getNewLocation(x.getLon(), x.getLat(), distance * 0.5, angle);
} else {
CallerLogger.INSTANCE.d(M_V2X + TAG, "停止线返回坐标点数量不正确" + mCloundWarningInfo.getStopLines().size());
}
@@ -335,7 +336,7 @@ public class V2XWarningMarker implements IV2XMarker {
startLatlng = new MogoLatLng(lat, lon);
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
//扩展点为了渐变色添加
addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2,
addMiddleLoc = Trigonometric.getNewLocation(startLatlng.getLon(), startLatlng.getLat(), distance / 2,
Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));
CallerLogger.INSTANCE.d(M_V2X + TAG, "angle==扩展点为了渐变色添加:" +
String.valueOf(Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat)));
@@ -368,7 +369,7 @@ public class V2XWarningMarker implements IV2XMarker {
/**
* 侧方目标物与预碰撞点连线,并且更新数据 TODO 需要实时给行人当前位置
*/
private void drawOtherObjectLine(V2XWarningEntity info) {
private void drawOtherObjectLine(V2XWarningTarget info) {
if (info != null) {
CallerLogger.INSTANCE.d(M_V2X + TAG, "info != null");
IMoGoPersonWarnPolylineManager personWarnPolylineManager = BridgeApi.INSTANCE.v2xPersonWarnPolyline();
@@ -379,7 +380,7 @@ public class V2XWarningMarker implements IV2XMarker {
MogoLatLng startLatlng = new MogoLatLng(info.getLat(), info.getLon());//识别物坐标
MogoLatLng endLatlng = new MogoLatLng(info.getCollisionLat(), info.getCollisionLon());//预碰撞点坐标
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);//识别物到碰撞点之间的距离
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2,
MogoLatLng addMiddleLoc = Trigonometric.getNewLocation(startLatlng.getLon(), startLatlng.getLat(), distance / 2,
Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));//补点
if (polyLine != null) {
CallerLogger.INSTANCE.d(M_V2X + TAG, "目标物与碰撞点连线 != null");
@@ -394,7 +395,7 @@ public class V2XWarningMarker implements IV2XMarker {
locations.add(addMiddleLoc);
locations.add(endLatlng);
lineInfo.setLocations(locations);
lineInfo.setHeading(info.heading);
lineInfo.setHeading(info.getHeading());
lineInfo.setWidth(info.getRoadwidth() * 14 + 5);
personWarnPolylineManager.drawPersonWarnPolyline(BridgeApi.INSTANCE.context(), lineInfo);
CallerLogger.INSTANCE.d(M_V2X + TAG, "目标物与预碰撞点画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
@@ -415,7 +416,7 @@ public class V2XWarningMarker implements IV2XMarker {
int count = (int) (distance / 5);
for (int i = 0; i < count; i++) {
MogoLatLng newLo = Trigonometric.getNewLocation(
startLatLng, 5 * (i + 1), Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat));
startLatLng.getLon(), startLatLng.getLat(), 5 * (i + 1), Trigonometric.getAngle(startLatLng.lon, startLatLng.lat, endLatLng.lon, endLatLng.lat));
V2XWarnDataDrawer.getInstance().drawerArrowsMarkerWithLocation(newLo, WARNING_ARROWS, 10, new Double(rotate).intValue());
CallerLogger.INSTANCE.d(M_V2X + TAG, "小箭头位置" + newLo);
}
@@ -428,7 +429,10 @@ public class V2XWarningMarker implements IV2XMarker {
carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() && isSelfLineClear == false) {
if (mCloundWarningInfo != null) {
mCloundWarningInfo.setCarLocation(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()));
V2XLocation v2XLocation = new V2XLocation();
v2XLocation.setLat(latLng.getLatitude());
v2XLocation.setLon(latLng.getLongitude());
mCloundWarningInfo.setCarLocation(v2XLocation);
}
//衡阳交付-取消划线需求,只渲染识别物红色模型移动过程
//drawSelfCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());

View File

@@ -0,0 +1,3 @@
package com.mogo.eagle.core.data.badcase
data class RecordCaseEntity(var caseId: Int,var caseName: String,var topicList: ArrayList<String>)

View File

@@ -12,5 +12,10 @@ interface IMoGoDevaToolsFuncConfigListener {
* lock : 锁定状态
* data : json
*/
fun updateBizData(type: String, state: Boolean, lock: Boolean, data: String?)
fun updateBizData(type: String, state: Boolean, lock: Boolean, data: String?) {}
/**
* 更新业务锁定状态,仅限View使用
*/
fun updateBizView(type: String,lock: Boolean){}
}

View File

@@ -11,6 +11,7 @@ object CallerDevaToolsFuncConfigListenerManager {
ConcurrentHashMap()
private val cacheMap = mutableMapOf<String, MutableList<SubBiz>>()
private val viewCacheMap = mutableMapOf<String, Boolean>()
/**
* 添加监听
@@ -20,16 +21,18 @@ object CallerDevaToolsFuncConfigListenerManager {
fun registerDevaToolsFuncConfigListener(
@Nullable biz: String,
@Nullable tag: String,
onlyViewRegister:Boolean = false,
@Nullable listener: IMoGoDevaToolsFuncConfigListener
) {
if (M_DEVA_TOOLS_FUNC_CONFIG_LISTENER.containsKey("$biz'_'$tag")) {
return
}
M_DEVA_TOOLS_FUNC_CONFIG_LISTENER["$biz'_'$tag"] = listener
viewCacheMap["$biz'_'$tag"] = onlyViewRegister
cacheMap[biz]?.let {
if (it.size > 0) {
invokeDevaToolsFuncConfigBizUpdate(biz, it)
invokeDevaToolsFuncConfigBizUpdate(biz, it, tag)
}
}
}
@@ -43,6 +46,7 @@ object CallerDevaToolsFuncConfigListenerManager {
return
}
M_DEVA_TOOLS_FUNC_CONFIG_LISTENER.remove("$biz'_'$tag")
viewCacheMap.remove("$biz'_'$tag")
}
/**
@@ -63,15 +67,32 @@ object CallerDevaToolsFuncConfigListenerManager {
/**
* 由订阅方判断Type类型聚合一些
*/
fun invokeDevaToolsFuncConfigBizUpdate(biz: String, list: MutableList<SubBiz>) {
fun invokeDevaToolsFuncConfigBizUpdate(
biz: String,
list: MutableList<SubBiz>,
tag: String = ""
) {
cacheMap[biz] = list
M_DEVA_TOOLS_FUNC_CONFIG_LISTENER.forEach {
val key = it.key
if (key.contains(biz)) {
//全量更新
if (tag.isEmpty()) {
list.forEach { subBiz ->
val listener = it.value
listener.updateBizData(subBiz.type, subBiz.state, subBiz.lock, subBiz.data)
}
return@forEach
}
// 根据biz_tag选择行下发
val key = it.key
if (key.contains("$biz'_'$tag")) {
list.forEach { subBiz ->
val listener = it.value
if(viewCacheMap["$biz'_'$tag"] == true){
listener.updateBizView(subBiz.type,subBiz.lock)
}else{
listener.updateBizData(subBiz.type, subBiz.state, subBiz.lock, subBiz.data)
}
}
}
}
}

View File

@@ -59,8 +59,8 @@ bytex.ASM_API=ASM7
HOOK_LOG_VERSION=1.6.1
SERVICE_CHAIN_VERSION=1.1.0
BIZCONFIG_VERSION=1.2.8
SERVICE_BIZ_VERSION=1.2.1
BIZCONFIG_VERSION=1.3.2
SERVICE_BIZ_VERSION=1.2.4
################ 外部依赖引用 ################
# loglib
LOGLIB_VERSION=1.3.38
@@ -85,7 +85,7 @@ MOGO_LOCATION_VERSION=1.4.3.26
MOGO_TELEMATIC_VERSION=1.4.3.26
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.6.0.10
MAP_SDK_VERSION=2.6.1.1
MAP_SDK_OPERATION_VERSION=1.1.2.4
# websocket
WEBSOCKET_VERSION=1.1.7

View File

@@ -12,7 +12,7 @@ public class CupidLogUtils {
* 默认是打开日志
*/
// private static boolean mIsEnableLog = BuildConfig.DEBUG;
private static boolean mIsEnableLog = true;
private static boolean mIsEnableLog = false;
/**
* @param isEnableLog true开启 false关闭

View File

@@ -15,7 +15,6 @@ import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.V2XWarningEntity;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
@@ -65,21 +64,20 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
/**
* 识别物移动
*
* @param data
*/
public void renderWarnData(V2XWarningEntity data) {
public void renderWarnData(double lon, double lat, int type, double collisionlat, double collisionLon, double angle, long showTime) {
MarkerLocation location = new MarkerLocation();
location.setLat(data.getLat());
location.setLon(data.getLon());
location.setLat(lat);
location.setLon(lon);
location.setAngle(angle);
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setMarkerLocation(location);
markerShowEntity.setMarkerType(TYPE_MARKER_CLOUD_WARN_DATA);
IMogoMarker marker = drawMarker(markerShowEntity, modeResType(data.getType()));
marker.addDynamicAnchorPosition(new MogoLatLng(data.getCollisionLat(), data.getCollisionLon()), (float) data.getHeading(), (long) (data.getShowTime() * 1000));
IMogoMarker marker = drawMarker(markerShowEntity, modeResType(type));
// marker.addDynamicAnchorPosition(new MogoLatLng(collisionlat, collisionLon), (float) heading, showTime * 1000);
UiThreadHandler.postDelayed(() -> {
marker.remove();
}, data.getShowTime() * 1000);
}, showTime * 1000);
}
@@ -103,6 +101,8 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
.data(markerShowEntity)
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon())
.controlAngle(true)
.rotate((float) markerShowEntity.getMarkerLocation().getAngle())
.setGps(true);
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
options.icon3DRes(getModelRes(modeResType)); //TODO
@@ -132,12 +132,11 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
/**
* 绘制停止线 marker
*
* @param data
*/
public void renderStopLineData(V2XWarningEntity data) {
public void renderStopLineData(double lon, double lat) {
MarkerLocation location = new MarkerLocation();
location.setLat(data.getLat());
location.setLon(data.getLon());
location.setLat(lat);
location.setLon(lon);
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setMarkerLocation(location);

View File

@@ -37,10 +37,10 @@ public class Trigonometric {
/**
* 根据角度获取指定距离点的经纬度
*/
public static MogoLatLng getNewLocation(MogoLatLng st, double distance, double angle) {
mRadLo = st.getLon() * Math.PI / 180.;
mRadLa = st.getLat() * Math.PI / 180.;
Ec = radius_s + (radius_b - radius_s) * (90. - st.lat) / 90;
public static MogoLatLng getNewLocation(double lon, double lat, double distance, double angle) {
mRadLo = lon * Math.PI / 180.;
mRadLa = lat * Math.PI / 180.;
Ec = radius_s + (radius_b - radius_s) * (90. - lat) / 90;
Ed = Ec * Math.cos(mRadLa);
double dx = distance * Math.sin(Math.toRadians(angle));