From 45ff85d864e31b0e1cbbc05551fe2b2bbd5f573e Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Thu, 10 Mar 2022 13:03:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=A5=E6=8E=A7=E6=9C=BA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_ipc_monitoring/.gitignore | 1 + app_ipc_monitoring/build.gradle | 57 ++ app_ipc_monitoring/proguard-rules.pro | 21 + .../adas/client/ExampleInstrumentedTest.java | 27 + .../src/main/AndroidManifest.xml | 57 ++ .../zhidao/adas/client/base/BaseAdapter.java | 110 +++ .../adas/client/base/BaseViewHolder.java | 27 + .../adas/client/bean/ArrivalNotification.java | 21 + .../adas/client/bean/AutopilotState.java | 22 + .../com/zhidao/adas/client/bean/Base.java | 19 + .../zhidao/adas/client/bean/BasicInfoReq.java | 21 + .../adas/client/bean/CarConfigResp.java | 20 + .../adas/client/bean/GlobalPathResp.java | 22 + .../com/zhidao/adas/client/bean/GnssInfo.java | 21 + .../adas/client/bean/MogoReportMessage.java | 23 + .../zhidao/adas/client/bean/RecordPanel.java | 23 + .../adas/client/bean/TrackedObjects.java | 21 + .../zhidao/adas/client/bean/Trajectory.java | 22 + .../zhidao/adas/client/bean/VehicleState.java | 23 + .../com/zhidao/adas/client/bean/Warn.java | 20 + .../ui/autopilot/AiCloudToStartAutopilot.java | 31 + .../ui/autopilot/AutopilotConfigActivity.java | 305 ++++++ .../adas/client/ui/mian/DataShowAdapter.java | 59 ++ .../adas/client/ui/mian/InfoFragment.java | 261 +++++ .../adas/client/ui/mian/InfoTitleAdapter.java | 65 ++ .../zhidao/adas/client/ui/mian/LogModel.java | 49 + .../adas/client/ui/mian/MainActivity.java | 910 ++++++++++++++++++ .../adas/client/ui/mian/UpgradeFragment.java | 119 +++ .../adas/client/ui/mian/VersionFragment.java | 224 +++++ .../zhidao/adas/client/utils/Constants.java | 44 + .../zhidao/adas/client/utils/FileUtils.java | 39 + .../client/utils/MyLinearLayoutManager.java | 36 + .../adas/client/utils/PreferencesUtils.java | 286 ++++++ .../src/main/res/drawable/border_title.png | Bin 0 -> 6409 bytes .../src/main/res/drawable/btn_bg.xml | 19 + .../src/main/res/drawable/ic_border_green.xml | 9 + .../src/main/res/drawable/ic_border_red.xml | 9 + .../main/res/drawable/ic_border_yellow.xml | 9 + .../src/main/res/drawable/icon.xml | 69 ++ .../src/main/res/drawable/item_bg.xml | 31 + .../src/main/res/drawable/item_text_color.xml | 7 + .../activity_autopilot_cloud_config.xml | 529 ++++++++++ .../src/main/res/layout/activity_guardian.xml | 297 ++++++ .../src/main/res/layout/activity_main.xml | 49 + .../src/main/res/layout/fragment_info.xml | 34 + .../src/main/res/layout/fragment_upgrade.xml | 70 ++ .../src/main/res/layout/fragment_version.xml | 247 +++++ .../src/main/res/layout/include_line.xml | 14 + .../src/main/res/layout/include_line2.xml | 14 + .../src/main/res/layout/item_info.xml | 19 + .../src/main/res/layout/item_log_info.xml | 42 + .../src/main/res/layout/item_main.xml | 200 ++++ .../src/main/res/layout/item_node.xml | 63 ++ .../src/main/res/values/colors.xml | 20 + .../src/main/res/values/strings.xml | 3 + .../src/main/res/values/styles.xml | 20 + .../main/res/xml/network_security_config.xml | 4 + .../zhidao/adas/client/ExampleUnitTest.java | 17 + .../zhidao/support/adas/high/AdasManager.java | 2 +- settings.gradle | 1 + 60 files changed, 4803 insertions(+), 1 deletion(-) create mode 100644 app_ipc_monitoring/.gitignore create mode 100644 app_ipc_monitoring/build.gradle create mode 100644 app_ipc_monitoring/proguard-rules.pro create mode 100644 app_ipc_monitoring/src/androidTest/java/com/zhidao/adas/client/ExampleInstrumentedTest.java create mode 100644 app_ipc_monitoring/src/main/AndroidManifest.xml create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/base/BaseAdapter.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/base/BaseViewHolder.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/ArrivalNotification.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/AutopilotState.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Base.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/BasicInfoReq.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/CarConfigResp.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/GlobalPathResp.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/GnssInfo.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/MogoReportMessage.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/RecordPanel.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/TrackedObjects.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Trajectory.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/VehicleState.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Warn.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/autopilot/AiCloudToStartAutopilot.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/autopilot/AutopilotConfigActivity.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/DataShowAdapter.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/InfoFragment.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/InfoTitleAdapter.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/LogModel.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/MainActivity.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/UpgradeFragment.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/VersionFragment.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/FileUtils.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/MyLinearLayoutManager.java create mode 100644 app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/PreferencesUtils.java create mode 100644 app_ipc_monitoring/src/main/res/drawable/border_title.png create mode 100644 app_ipc_monitoring/src/main/res/drawable/btn_bg.xml create mode 100644 app_ipc_monitoring/src/main/res/drawable/ic_border_green.xml create mode 100644 app_ipc_monitoring/src/main/res/drawable/ic_border_red.xml create mode 100644 app_ipc_monitoring/src/main/res/drawable/ic_border_yellow.xml create mode 100644 app_ipc_monitoring/src/main/res/drawable/icon.xml create mode 100644 app_ipc_monitoring/src/main/res/drawable/item_bg.xml create mode 100644 app_ipc_monitoring/src/main/res/drawable/item_text_color.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/activity_autopilot_cloud_config.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/activity_guardian.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/activity_main.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/fragment_info.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/fragment_upgrade.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/fragment_version.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/include_line.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/include_line2.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/item_info.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/item_log_info.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/item_main.xml create mode 100644 app_ipc_monitoring/src/main/res/layout/item_node.xml create mode 100644 app_ipc_monitoring/src/main/res/values/colors.xml create mode 100644 app_ipc_monitoring/src/main/res/values/strings.xml create mode 100644 app_ipc_monitoring/src/main/res/values/styles.xml create mode 100644 app_ipc_monitoring/src/main/res/xml/network_security_config.xml create mode 100644 app_ipc_monitoring/src/test/java/com/zhidao/adas/client/ExampleUnitTest.java diff --git a/app_ipc_monitoring/.gitignore b/app_ipc_monitoring/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/app_ipc_monitoring/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app_ipc_monitoring/build.gradle b/app_ipc_monitoring/build.gradle new file mode 100644 index 0000000000..3348312578 --- /dev/null +++ b/app_ipc_monitoring/build.gradle @@ -0,0 +1,57 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.2" + defaultConfig { + applicationId "com.zhidao.adas.client" + minSdkVersion 19 + targetSdkVersion 22 + multiDexEnabled true + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + flavorDimensions "multi_device" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + productFlavors { + passenger { + dimension "multi_device" + buildConfigField 'boolean', 'IS_CLIENT', 'true' + } + driver { + dimension "multi_device" + buildConfigField 'boolean', 'IS_CLIENT', 'false' + } + + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.1' + implementation 'androidx.recyclerview:recyclerview:1.2.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + implementation "com.google.code.gson:gson:2.8.9" + implementation project(':libraries:mogo-adas') + implementation project(':core:mogo-core-data') +// implementation project(':core:mogo-core-utils') +// api "com.zhidao.support.adas:high:1.2.1.2_bate21" + implementation 'org.greenrobot:eventbus:3.2.0' + implementation 'com.android.support:multidex:1.0.3' + implementation 'com.mogo.cloud:telematic:1.3.30' +} diff --git a/app_ipc_monitoring/proguard-rules.pro b/app_ipc_monitoring/proguard-rules.pro new file mode 100644 index 0000000000..f1b424510d --- /dev/null +++ b/app_ipc_monitoring/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/app_ipc_monitoring/src/androidTest/java/com/zhidao/adas/client/ExampleInstrumentedTest.java b/app_ipc_monitoring/src/androidTest/java/com/zhidao/adas/client/ExampleInstrumentedTest.java new file mode 100644 index 0000000000..a69d6cb30b --- /dev/null +++ b/app_ipc_monitoring/src/androidTest/java/com/zhidao/adas/client/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package com.zhidao.adas.client; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + + assertEquals("com.zhidao.adas.client", appContext.getPackageName()); + } +} diff --git a/app_ipc_monitoring/src/main/AndroidManifest.xml b/app_ipc_monitoring/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..5da8d114a8 --- /dev/null +++ b/app_ipc_monitoring/src/main/AndroidManifest.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/base/BaseAdapter.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/base/BaseAdapter.java new file mode 100644 index 0000000000..495e2f4d8d --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/base/BaseAdapter.java @@ -0,0 +1,110 @@ +package com.zhidao.adas.client.base; + + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.List; + + +/** + * RecycleView Adapter + * Created by renfeicui on 2018/10/12. + */ +public abstract class BaseAdapter extends RecyclerView.Adapter { + protected String TAG = this.getClass().getSimpleName(); + protected List mDatas; + protected Context mContext; + private OnItemClickListener mItemClick; + + public interface OnItemClickListener { + void onItemClick(int position, D data); + } + + + public BaseAdapter() { + } + + public BaseAdapter(List mDatas) { + this.mDatas = mDatas; + } + + public BaseAdapter(OnItemClickListener listener) { + mItemClick = listener; + } + + public BaseAdapter(List mDatas, OnItemClickListener listener) { + this.mDatas = mDatas; + mItemClick = listener; + } + + public void setData(List mDatas) { + this.mDatas = mDatas; + notifyDataSetChanged(); + } + + public void setOnItemClickListener(OnItemClickListener listener) { + mItemClick = listener; + } + + /*** + * 获取制定 位置的Data + * @param position 下标 + * @return Data + */ + public D getItem(int position) { + return mDatas == null ? null : mDatas.get(position); + } + + @Override + public int getItemCount() { + return mDatas == null ? 0 : mDatas.size(); + } + + @Override + public void onBindViewHolder(@NonNull VH viewHolder, int position) { + D bean = getItem(position); + onBindDataToItem(viewHolder, bean, position); + } + + + @NonNull + @Override + public VH onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType) { + mContext = viewGroup.getContext(); + return getViewHolder(getItemViewResource(viewGroup)); + } + + /*** + * 同onBindViewHolder() + * @param viewHolder viewHolder + * @param data 数据 + * @param position 下标 + */ + protected abstract void onBindDataToItem(VH viewHolder, D data, int position); + + /*** + * 获取Item布局 + * @return id + */ + protected abstract View getItemViewResource(ViewGroup viewGroup); + + /** + * 获取ViewHolder + * + * @param view + * @return + */ + protected abstract VH getViewHolder(View view); + + public void onClick(BaseViewHolder viewHolder) { + if (mItemClick != null) { + mItemClick.onItemClick(viewHolder.getAdapterPosition(), getItem(viewHolder.getAdapterPosition())); + } + } + +} \ No newline at end of file diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/base/BaseViewHolder.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/base/BaseViewHolder.java new file mode 100644 index 0000000000..3c62985326 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/base/BaseViewHolder.java @@ -0,0 +1,27 @@ +package com.zhidao.adas.client.base; + +import android.view.View; + +import androidx.recyclerview.widget.RecyclerView; + + +public abstract class BaseViewHolder extends RecyclerView.ViewHolder { + private T adapter; + public View itemView; + + public BaseViewHolder(View itemView, final T adapter) { + super(itemView); + this.itemView = itemView; + this.adapter = adapter; + itemView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + adapter.onClick(BaseViewHolder.this); + } + }); + + } + + + +} \ No newline at end of file diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/ArrivalNotification.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/ArrivalNotification.java new file mode 100644 index 0000000000..8ed95144d3 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/ArrivalNotification.java @@ -0,0 +1,21 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; + +public class ArrivalNotification extends Base { + public final MessagePad.ArrivalNotification bean; + + public ArrivalNotification(MessagePad.Header header, MessagePad.ArrivalNotification bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "ArrivalNotification{" + super.toString() + + " bean=" + bean + + '}'; + } + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/AutopilotState.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/AutopilotState.java new file mode 100644 index 0000000000..87451ea7d3 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/AutopilotState.java @@ -0,0 +1,22 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; + +public class AutopilotState extends Base { + public final MessagePad.AutopilotState bean; + + public AutopilotState(MessagePad.Header header, MessagePad.AutopilotState bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "AutopilotState{" + super.toString() + + " bean=" + bean + + '}'; + } + + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Base.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Base.java new file mode 100644 index 0000000000..d4a5b70e0d --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Base.java @@ -0,0 +1,19 @@ +package com.zhidao.adas.client.bean; + + +import mogo.telematics.pad.MessagePad; + +public abstract class Base { + public final MessagePad.Header header; + public final int len; + + public Base(int len, MessagePad.Header header) { + this.len = 8 + header.getSerializedSize() + len; + this.header = header; + } + + @Override + public String toString() { + return "{" + len + "}header=" + header; + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/BasicInfoReq.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/BasicInfoReq.java new file mode 100644 index 0000000000..871942aab3 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/BasicInfoReq.java @@ -0,0 +1,21 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; + +public class BasicInfoReq extends Base { + public final MessagePad.BasicInfoReq bean; + + public BasicInfoReq(MessagePad.Header header, MessagePad.BasicInfoReq bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "BasicInfoReq{" + super.toString() + + " bean=" + bean + + '}'; + } + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/CarConfigResp.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/CarConfigResp.java new file mode 100644 index 0000000000..b10d57a275 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/CarConfigResp.java @@ -0,0 +1,20 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; + +public class CarConfigResp extends Base { + public final MessagePad.CarConfigResp bean; + + public CarConfigResp(MessagePad.Header header, MessagePad.CarConfigResp bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "CarConfigResp{" + super.toString() + + " bean=" + bean + + '}'; + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/GlobalPathResp.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/GlobalPathResp.java new file mode 100644 index 0000000000..2ecbf51191 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/GlobalPathResp.java @@ -0,0 +1,22 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; + +public class GlobalPathResp extends Base { + public final MessagePad.GlobalPathResp bean; + + public GlobalPathResp(MessagePad.Header header, MessagePad.GlobalPathResp bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "GlobalPathResp{" + super.toString() + + " bean=" + bean + + '}'; + } + + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/GnssInfo.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/GnssInfo.java new file mode 100644 index 0000000000..4025bf06fd --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/GnssInfo.java @@ -0,0 +1,21 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; + +public class GnssInfo extends Base { + public final MessagePad.GnssInfo bean; + + public GnssInfo(MessagePad.Header header, MessagePad.GnssInfo bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "GnssInfo{" + super.toString() + + " bean=" + bean + + '}'; + } + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/MogoReportMessage.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/MogoReportMessage.java new file mode 100644 index 0000000000..b607d57038 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/MogoReportMessage.java @@ -0,0 +1,23 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; +import mogo_msg.MogoReportMsg; + +public class MogoReportMessage extends Base { + public final MogoReportMsg.MogoReportMessage bean; + + public MogoReportMessage(MessagePad.Header header, MogoReportMsg.MogoReportMessage bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "MogoReportMessage{" + super.toString() + + " bean=" + bean + + '}'; + } + + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/RecordPanel.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/RecordPanel.java new file mode 100644 index 0000000000..f02fc9dcfe --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/RecordPanel.java @@ -0,0 +1,23 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; +import record_cache.RecordPanelOuterClass; + +public class RecordPanel extends Base { + public final RecordPanelOuterClass.RecordPanel bean; + + public RecordPanel(MessagePad.Header header, RecordPanelOuterClass.RecordPanel bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "RecordPanel{" + super.toString() + + " bean=" + bean + + '}'; + } + + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/TrackedObjects.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/TrackedObjects.java new file mode 100644 index 0000000000..b3a498d00b --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/TrackedObjects.java @@ -0,0 +1,21 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; + +public class TrackedObjects extends Base { + private MessagePad.TrackedObjects bean; + + public TrackedObjects(MessagePad.Header header, MessagePad.TrackedObjects bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "TrackedObjects{" + super.toString() + + " bean=" + bean + + '}'; + } + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Trajectory.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Trajectory.java new file mode 100644 index 0000000000..4334a2951e --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Trajectory.java @@ -0,0 +1,22 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; + +public class Trajectory extends Base { + public final MessagePad.Trajectory bean; + + public Trajectory(MessagePad.Header header, MessagePad.Trajectory bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "Trajectory{" + super.toString() + + " bean=" + bean + + '}'; + } + + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/VehicleState.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/VehicleState.java new file mode 100644 index 0000000000..69490fc3d0 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/VehicleState.java @@ -0,0 +1,23 @@ +package com.zhidao.adas.client.bean; + +import chassis.VehicleStateOuterClass; +import mogo.telematics.pad.MessagePad; + +public class VehicleState extends Base { + public final VehicleStateOuterClass.VehicleState bean; + + public VehicleState(MessagePad.Header header, VehicleStateOuterClass.VehicleState bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "VehicleState{" + super.toString() + + " bean=" + bean + + '}'; + } + + +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Warn.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Warn.java new file mode 100644 index 0000000000..9a2e48f5b7 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/bean/Warn.java @@ -0,0 +1,20 @@ +package com.zhidao.adas.client.bean; + +import mogo.telematics.pad.MessagePad; + +public class Warn extends Base { + public final MessagePad.Warn bean; + + public Warn(MessagePad.Header header, MessagePad.Warn bean) { + super(bean.getSerializedSize(), header); + this.bean = bean; + } + + + @Override + public String toString() { + return "Warn{" + super.toString() + + " bean=" + bean + + '}'; + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/autopilot/AiCloudToStartAutopilot.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/autopilot/AiCloudToStartAutopilot.java new file mode 100644 index 0000000000..e9d598dbd7 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/autopilot/AiCloudToStartAutopilot.java @@ -0,0 +1,31 @@ +package com.zhidao.adas.client.ui.autopilot; + +import java.util.List; + +public class AiCloudToStartAutopilot { + + private String action = "aiCloudToStartAutopilot"; + public ResultDTO result; + + public static class ResultDTO { + public EndLatLonDTO endLatLon; + public Integer speedLimit = 20; + public StartLatLonDTO startLatLon; + public List wayLatLons; + + public static class EndLatLonDTO { + public Double lat; + public Double lon; + } + + public static class StartLatLonDTO { + public Double lat; + public Double lon; + } + + public static class WayLatLonsDTO { + public Double lat; + public Double lon; + } + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/autopilot/AutopilotConfigActivity.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/autopilot/AutopilotConfigActivity.java new file mode 100644 index 0000000000..13a302b95c --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/autopilot/AutopilotConfigActivity.java @@ -0,0 +1,305 @@ +package com.zhidao.adas.client.ui.autopilot; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.CompoundButton; +import android.widget.EditText; +import android.widget.Switch; +import android.widget.Toast; + +import androidx.appcompat.app.AppCompatActivity; + +import com.google.gson.Gson; + +import com.google.gson.reflect.TypeToken; +import com.zhidao.support.adas.high.AdasManager; +import com.zhidao.adas.client.R; +import com.zhidao.adas.client.utils.Constants; +import com.zhidao.adas.client.utils.PreferencesUtils; + +import java.util.List; + + +public class AutopilotConfigActivity extends AppCompatActivity { + + public static void launch(Context context) { + Intent intent = new Intent(context,AutopilotConfigActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + } + + private Gson gson = new Gson(); + private EditText start_lon1; + private EditText start_lat1; + private EditText stop_lon1; + private EditText stop_lat1; + private EditText t_lon1; + private EditText t_lat1; + + private EditText start_lon2; + private EditText start_lat2; + private EditText stop_lon2; + private EditText stop_lat2; + private EditText t_lon2; + private EditText t_lat2; + + private EditText start_lon3; + private EditText start_lat3; + private EditText stop_lon3; + private EditText stop_lat3; + private EditText t_lon3; + private EditText t_lat3; + + private EditText start_lon4; + private EditText start_lat4; + private EditText stop_lon4; + private EditText stop_lat4; + private EditText t_lon4; + private EditText t_lat4; + private List list; + + AiCloudToStartAutopilot data1; + AiCloudToStartAutopilot data2; + AiCloudToStartAutopilot data3; + AiCloudToStartAutopilot data4; + private String init_all_path = "[\n" + + " {\n" + + " \"action\": \"aiCloudToStartAutopilot\",\n" + + " \"result\": {\n" + + " \"endLatLon\": {\n" + + " \"lat\": 26.82355278566775,\n" + + " \"lon\": 112.57001723522112\n" + + " },\n" + + " \"speedLimit\": 20,\n" + + " \"startLatLon\": {\n" + + " \"lat\": 26.820319143036112,\n" + + " \"lon\": 112.57770688564666\n" + + " },\n" + + " \"wayLatLons\": [{\n" + + " \"lat\": 40.1984044,\n" + + " \"lon\": 116.7323222\n" + + " }]\n" + + " }\n" + + " },\n" + + " {\n" + + " \"action\": \"aiCloudToStartAutopilot\",\n" + + " \"result\": {\n" + + " \"endLatLon\": {\n" + + " \"lat\": 40.1979005,\n" + + " \"lon\": 116.7261382\n" + + " },\n" + + " \"speedLimit\": 20,\n" + + " \"startLatLon\": {\n" + + " \"lat\": 40.1992337,\n" + + " \"lon\": 116.7386131\n" + + " },\n" + + " \"wayLatLons\": [{\n" + + " \"lat\": 40.1984044,\n" + + " \"lon\": 116.7323222\n" + + " }]\n" + + " }\n" + + " },\n" + + " {\n" + + " \"action\": \"aiCloudToStartAutopilot\",\n" + + " \"result\": {\n" + + " \"endLatLon\": {\n" + + " \"lat\": 40.1979005,\n" + + " \"lon\": 116.7261382\n" + + " },\n" + + " \"speedLimit\": 20,\n" + + " \"startLatLon\": {\n" + + " \"lat\": 40.1992337,\n" + + " \"lon\": 116.7386131\n" + + " },\n" + + " \"wayLatLons\": [{\n" + + " \"lat\": 40.1984044,\n" + + " \"lon\": 116.7323222\n" + + " }]\n" + + " }\n" + + " },\n" + + " {\n" + + " \"action\": \"aiCloudToStartAutopilot\",\n" + + " \"result\": {\n" + + " \"endLatLon\": {\n" + + " \"lat\": 40.1979005,\n" + + " \"lon\": 116.7261382\n" + + " },\n" + + " \"speedLimit\": 20,\n" + + " \"startLatLon\": {\n" + + " \"lat\": 40.1992337,\n" + + " \"lon\": 116.7386131\n" + + " },\n" + + " \"wayLatLons\": [{\n" + + " \"lat\": 40.1984044,\n" + + " \"lon\": 116.7323222\n" + + " }]\n" + + " }\n" + + " }\n" + + "]"; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_autopilot_cloud_config); + start_lon1 = findViewById(R.id.start_lon1); + start_lat1 = findViewById(R.id.start_lat1); + stop_lon1 = findViewById(R.id.stop_lon1); + stop_lat1 = findViewById(R.id.stop_lat1); + t_lon1 = findViewById(R.id.t_lon1); + t_lat1 = findViewById(R.id.t_lat1); + + start_lon2 = findViewById(R.id.start_lon2); + start_lat2 = findViewById(R.id.start_lat2); + stop_lon2 = findViewById(R.id.stop_lon2); + stop_lat2 = findViewById(R.id.stop_lat2); + t_lon2 = findViewById(R.id.t_lon2); + t_lat2 = findViewById(R.id.t_lat2); + + start_lon3 = findViewById(R.id.start_lon3); + start_lat3 = findViewById(R.id.start_lat3); + stop_lon3 = findViewById(R.id.stop_lon3); + stop_lat3 = findViewById(R.id.stop_lat3); + t_lon3 = findViewById(R.id.t_lon3); + t_lat3 = findViewById(R.id.t_lat3); + + start_lon4 = findViewById(R.id.start_lon4); + start_lat4 = findViewById(R.id.start_lat4); + stop_lon4 = findViewById(R.id.stop_lon4); + stop_lat4 = findViewById(R.id.stop_lat4); + t_lon4 = findViewById(R.id.t_lon4); + t_lat4 = findViewById(R.id.t_lat4); + //开始执行 + final Button button = findViewById(R.id.start); + button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + String json = PreferencesUtils.getString(AutopilotConfigActivity.this, Constants.SEL_PATH, null); + if (TextUtils.isEmpty(json)) { + Toast.makeText(AutopilotConfigActivity.this, "请先选择路线", Toast.LENGTH_SHORT).show(); + return; + } + json = json.split("##")[1]; + Log.i("开始执行自动驾驶", json); + AdasManager.getInstance().aiCloudToAdasData(json); + } + }); + findViewById(R.id.save).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + data1.result.startLatLon.lon = Double.parseDouble(start_lon1.getText().toString().trim()); + data1.result.startLatLon.lat = Double.parseDouble(start_lat1.getText().toString().trim()); + data1.result.endLatLon.lon = Double.parseDouble(stop_lon1.getText().toString().trim()); + data1.result.endLatLon.lat = Double.parseDouble(stop_lat1.getText().toString().trim()); + data1.result.wayLatLons.get(0).lon = Double.parseDouble(t_lon1.getText().toString().trim()); + data1.result.wayLatLons.get(0).lat = Double.parseDouble(t_lat1.getText().toString().trim()); + + + data2.result.startLatLon.lon = Double.parseDouble(start_lon2.getText().toString().trim()); + data2.result.startLatLon.lat = Double.parseDouble(start_lat2.getText().toString().trim()); + data2.result.endLatLon.lon = Double.parseDouble(stop_lon2.getText().toString().trim()); + data2.result.endLatLon.lat = Double.parseDouble(stop_lat2.getText().toString().trim()); + data2.result.wayLatLons.get(0).lon = Double.parseDouble(t_lon2.getText().toString().trim()); + data2.result.wayLatLons.get(0).lat = Double.parseDouble(t_lat2.getText().toString().trim()); + + + data3.result.startLatLon.lon = Double.parseDouble(start_lon3.getText().toString().trim()); + data3.result.startLatLon.lat = Double.parseDouble(start_lat3.getText().toString().trim()); + data3.result.endLatLon.lon = Double.parseDouble(stop_lon3.getText().toString().trim()); + data3.result.endLatLon.lat = Double.parseDouble(stop_lat3.getText().toString().trim()); + data3.result.wayLatLons.get(0).lon = Double.parseDouble(t_lon3.getText().toString().trim()); + data3.result.wayLatLons.get(0).lat = Double.parseDouble(t_lat3.getText().toString().trim()); + + + data4.result.startLatLon.lon = Double.parseDouble(start_lon4.getText().toString().trim()); + data4.result.startLatLon.lat = Double.parseDouble(start_lat4.getText().toString().trim()); + data4.result.endLatLon.lon = Double.parseDouble(stop_lon4.getText().toString().trim()); + data4.result.endLatLon.lat = Double.parseDouble(stop_lat4.getText().toString().trim()); + data4.result.wayLatLons.get(0).lon = Double.parseDouble(t_lon4.getText().toString().trim()); + data4.result.wayLatLons.get(0).lat = Double.parseDouble(t_lat4.getText().toString().trim()); + + + PreferencesUtils.putString(AutopilotConfigActivity.this, Constants.ALL_PATH, gson.toJson(list)); + } + }); + View path1 = findViewById(R.id.path1); + View path2 = findViewById(R.id.path2); + View path3 = findViewById(R.id.path3); + View path4 = findViewById(R.id.path4); + path1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Toast.makeText(AutopilotConfigActivity.this, "已设置路线1", Toast.LENGTH_SHORT).show(); + PreferencesUtils.putString(AutopilotConfigActivity.this, Constants.SEL_PATH, "1##" + gson.toJson(list.get(0))); + button.setText("开始执行自动驾驶(路线1)"); + } + }); + path2.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Toast.makeText(AutopilotConfigActivity.this, "已设置路线2", Toast.LENGTH_SHORT).show(); + PreferencesUtils.putString(AutopilotConfigActivity.this, Constants.SEL_PATH, "2##" + gson.toJson(list.get(1))); + button.setText("开始执行自动驾驶(路线2)"); + } + }); + path3.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Toast.makeText(AutopilotConfigActivity.this, "已设置路线3", Toast.LENGTH_SHORT).show(); + PreferencesUtils.putString(AutopilotConfigActivity.this, Constants.SEL_PATH, "3##" + gson.toJson(list.get(2))); + button.setText("开始执行自动驾驶(路线3)"); + } + }); + path4.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Toast.makeText(AutopilotConfigActivity.this, "已设置路线4", Toast.LENGTH_SHORT).show(); + PreferencesUtils.putString(AutopilotConfigActivity.this, Constants.SEL_PATH, "4##" + gson.toJson(list.get(3))); + button.setText("开始执行自动驾驶(路线4)"); + } + }); + + String allPath = PreferencesUtils.getString(AutopilotConfigActivity.this, Constants.ALL_PATH, init_all_path); + list = gson.fromJson(allPath, new TypeToken>() { + }.getType()); + data1 = list.get(0); + data2 = list.get(1); + data3 = list.get(2); + data4 = list.get(3); + start_lon1.setText(String.valueOf(data1.result.startLatLon.lon)); + start_lat1.setText(String.valueOf(data1.result.startLatLon.lat)); + stop_lon1.setText(String.valueOf(data1.result.endLatLon.lon)); + stop_lat1.setText(String.valueOf(data1.result.endLatLon.lat)); + t_lon1.setText(String.valueOf(data1.result.wayLatLons.get(0).lon)); + t_lat1.setText(String.valueOf(data1.result.wayLatLons.get(0).lat)); + + start_lon2.setText(String.valueOf(data2.result.startLatLon.lon)); + start_lat2.setText(String.valueOf(data2.result.startLatLon.lat)); + stop_lon2.setText(String.valueOf(data2.result.endLatLon.lon)); + stop_lat2.setText(String.valueOf(data2.result.endLatLon.lat)); + t_lon2.setText(String.valueOf(data2.result.wayLatLons.get(0).lon)); + t_lat2.setText(String.valueOf(data2.result.wayLatLons.get(0).lat)); + + start_lon3.setText(String.valueOf(data3.result.startLatLon.lon)); + start_lat3.setText(String.valueOf(data3.result.startLatLon.lat)); + stop_lon3.setText(String.valueOf(data3.result.endLatLon.lon)); + stop_lat3.setText(String.valueOf(data3.result.endLatLon.lat)); + t_lon3.setText(String.valueOf(data3.result.wayLatLons.get(0).lon)); + t_lat3.setText(String.valueOf(data3.result.wayLatLons.get(0).lat)); + + start_lon4.setText(String.valueOf(data4.result.startLatLon.lon)); + start_lat4.setText(String.valueOf(data4.result.startLatLon.lat)); + stop_lon4.setText(String.valueOf(data4.result.endLatLon.lon)); + stop_lat4.setText(String.valueOf(data4.result.endLatLon.lat)); + t_lon4.setText(String.valueOf(data4.result.wayLatLons.get(0).lon)); + t_lat4.setText(String.valueOf(data4.result.wayLatLons.get(0).lat)); + + + } + +} \ No newline at end of file diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/DataShowAdapter.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/DataShowAdapter.java new file mode 100644 index 0000000000..e66a4f2166 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/DataShowAdapter.java @@ -0,0 +1,59 @@ +package com.zhidao.adas.client.ui.mian; + +import android.annotation.SuppressLint; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.EditText; +import android.widget.TextView; + +import com.zhidao.adas.client.R; +import com.zhidao.adas.client.base.BaseAdapter; +import com.zhidao.adas.client.base.BaseViewHolder; + + +//log所用 +public class DataShowAdapter extends BaseAdapter { + + + public void refreshView(int position) { + if (position == -1) { + notifyDataSetChanged(); + } else { + notifyItemInserted(position); + } +// notifyDataSetChanged(); +// L.i(TAG, "position=" + position); + } + + @SuppressLint("SetTextI18n") + @Override + protected void onBindDataToItem(ViewHolder viewHolder, LogModel data, int position) { + viewHolder.id.setText("[" + data.data.length() + "]" + (position + 1) + ". "); + viewHolder.editText.setTextColor(viewHolder.editText.getResources().getColor(data.getColor())); + viewHolder.editText.setText(data.data); + } + + @Override + protected View getItemViewResource(ViewGroup viewGroup) { + return LayoutInflater.from(mContext).inflate(R.layout.item_log_info, viewGroup, false); + } + + + @Override + protected ViewHolder getViewHolder(View view) { + return new ViewHolder(view, this); + } + + + class ViewHolder extends BaseViewHolder { + EditText editText; + TextView id; + + public ViewHolder(View itemView, DataShowAdapter adapter) { + super(itemView, adapter); + editText =itemView.findViewById(R.id.log); + id =itemView.findViewById(R.id.id); + } + } +} \ No newline at end of file diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/InfoFragment.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/InfoFragment.java new file mode 100644 index 0000000000..32aebe912e --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/InfoFragment.java @@ -0,0 +1,261 @@ +package com.zhidao.adas.client.ui.mian; + +import android.content.Context; +import android.os.Bundle; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; + +import com.zhidao.adas.client.R; +import com.zhidao.adas.client.bean.ArrivalNotification; +import com.zhidao.adas.client.bean.AutopilotState; +import com.zhidao.adas.client.bean.GlobalPathResp; +import com.zhidao.adas.client.bean.GnssInfo; +import com.zhidao.adas.client.bean.RecordPanel; +import com.zhidao.adas.client.bean.TrackedObjects; +import com.zhidao.adas.client.bean.Trajectory; +import com.zhidao.adas.client.bean.VehicleState; +import com.zhidao.adas.client.bean.Warn; +import com.zhidao.adas.client.utils.MyLinearLayoutManager; +import com.zhidao.support.adas.high.common.CupidLogUtils; +import com.zhidao.support.adas.high.msg.ReportMessage; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author song kenan + * @des + * @date 2021/8/16 + */ +public class InfoFragment extends Fragment { + + private String title; + private List data = new ArrayList<>(); + private DataShowAdapter adapter; + + public InfoFragment() { + } + + public InfoFragment(String title) { + this.title = title; + } + + @Override + public void onAttach(@NonNull Context context) { + super.onAttach(context); + } + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_info, container, false); + initView(view); + return view; + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + EventBus.getDefault().register(this); + } + + private TextView tvTitle; + private RecyclerView rvInfo; + + private void initView(View view) { + tvTitle = view.findViewById(R.id.tv_title); + rvInfo = view.findViewById(R.id.rv_info); + + CupidLogUtils.w("InfoFragment===>" + title); + tvTitle.setText(title); + tvTitle.setGravity(Gravity.CENTER); + //创建默认的线性LayoutManager 横向的GridLayoutManager + MyLinearLayoutManager linearLayoutManager = new MyLinearLayoutManager(this.getContext()); + linearLayoutManager.setStackFromEnd(true);//列表再底部开始展示,反转后由上面开始展示 + linearLayoutManager.setReverseLayout(true);//列表翻转 + rvInfo.setLayoutManager(linearLayoutManager); + //如果可以确定每个item的高度是固定的,设置这个选项可以提高性能 + rvInfo.setHasFixedSize(false); + rvInfo.setNestedScrollingEnabled(false); + adapter = new DataShowAdapter(); + adapter.setData(data); + rvInfo.setAdapter(adapter); + + } + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onWarnEvent(Warn info) { + if (title.equals("预警数据")) { + if (data.size() > 19) { + data.remove(0); + } + data.add(new LogModel(LogModel.ACTION.RECEIVE, info.toString())); + adapter.notifyDataSetChanged(); + } + } + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onRectEvent(TrackedObjects info) { + if (title.equals("感知数据")) { + if (data.size() > 4) { + data.remove(0); + } + data.add(new LogModel(LogModel.ACTION.RECEIVE, info.toString())); + adapter.notifyDataSetChanged(); + } + } + + private void onTurnLightState(int turnLight, boolean brake_light) { + StringBuilder builder = new StringBuilder("底盘数据\t"); + if (turnLight == 0) { + builder.append("左转:关"); + builder.append("右转:关"); + } else if (turnLight == 1) { + builder.append("左转:开"); + builder.append("右转:关"); + } else if (turnLight == 2) { + builder.append("左转:关"); + builder.append("右转:开"); + } + + builder.append(brake_light ? " 刹车:开" : " 刹车:关"); + tvTitle.setText(builder.toString()); + } + + /** + * 解析转向灯 + */ + private int turnLightTimes = 0; + private boolean isOnTurnLight = false; + private int turnLight = 0; + + public int setTurnLightState(int turn_light) { + if (turn_light == 0) { + if (isOnTurnLight) { + if (turnLightTimes >= 10) { + isOnTurnLight = false; + turnLight = 0; + } + turnLightTimes++; + } + } else if (turn_light == 1) { + turnLightTimes = 0; + isOnTurnLight = true; + turnLight = 1; + } else if (turn_light == 2) { + turnLightTimes = 0; + isOnTurnLight = true; + turnLight = 2; + } + return turnLight; + } + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onCarEvent(VehicleState info) { + if (title.equals("底盘数据")) { + if (data.size() > 5) { + data.remove(0); + } + data.add(new LogModel(LogModel.ACTION.RECEIVE, info.toString())); + adapter.notifyDataSetChanged(); + int light = info.bean.getLight().getNumber();//转向灯状态 0是正常 1是左转 2是右转 + onTurnLightState(setTurnLightState(light), info.bean.getBrake_light()); + } + } + + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onAutoEvent(GnssInfo info) { + if (title.equals("GNSS数据")) { + if (data.size() > 9) { + data.remove(0); + } + data.add(new LogModel(LogModel.ACTION.RECEIVE, info.toString())); + adapter.notifyDataSetChanged(); + } + } + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onAutoEvent(AutopilotState info) { + if (title.equals("自动驾驶状态")) { + if (data.size() > 9) { + data.remove(0); + } + data.add(new LogModel(LogModel.ACTION.RECEIVE, info.toString())); + adapter.notifyDataSetChanged(); + } + } + + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onTrajectoryEvent(Trajectory info) { + if (title.equals("局部轨迹")) { + if (data.size() > 9) { + data.remove(0); + } + data.add(new LogModel(LogModel.ACTION.RECEIVE, info.toString())); + adapter.notifyDataSetChanged(); + } + } + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onAutopilotWayArriveEvent(ArrivalNotification info) { + if (title.equals("自动驾驶站点")) { + data.add(new LogModel(LogModel.ACTION.RECEIVE, info.toString())); + adapter.notifyDataSetChanged(); + } + } + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onAutopilotRouteEvent(GlobalPathResp info) { + if (title.equals("自动驾驶路径")) { + data.add(new LogModel(LogModel.ACTION.RECEIVE, info.toString())); + adapter.notifyDataSetChanged(); + } + } + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onAutopilotRecordResultEvent(RecordPanel info) { + if (title.equals("BadCase数据")) { + data.add(new LogModel(LogModel.ACTION.RECEIVE, info.toString())); + adapter.notifyDataSetChanged(); + } + } + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onAutopilotGuardianInfoEvent(ReportMessage info) { + if (title.equals("监控事件报告")) { + data.add(new LogModel(LogModel.ACTION.RECEIVE, info.toString())); + adapter.notifyDataSetChanged(); + } + } + + + @Override + public void onDestroyView() { + super.onDestroyView(); + EventBus.getDefault().unregister(this); + } + + @Override + public void onDestroy() { + super.onDestroy(); + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/InfoTitleAdapter.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/InfoTitleAdapter.java new file mode 100644 index 0000000000..136277a6d6 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/InfoTitleAdapter.java @@ -0,0 +1,65 @@ +package com.zhidao.adas.client.ui.mian; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.zhidao.adas.client.R; +import com.zhidao.adas.client.base.BaseAdapter; +import com.zhidao.adas.client.base.BaseViewHolder; + +import java.util.List; + +/** + * @author song kenan + * @des + * @date 2021/8/13 + */ +public class InfoTitleAdapter extends BaseAdapter { + private int selectedPosition = 0;//当前选中的下标 + private boolean isFragment = false; + + public void setSelectedPosition(int position) { + if (position != selectedPosition) { + notifyItemChanged(position); + notifyItemChanged(selectedPosition); + selectedPosition = position; + } + } + public InfoTitleAdapter(List data, boolean isFragment) { + super(data); + this.isFragment = isFragment; + } + + @Override + protected void onBindDataToItem(ViewHolder viewHolder, String data, int position) { + if (data == null) { + return; + } + if (isFragment){ + viewHolder.itemView.setSelected(selectedPosition == position); + } + viewHolder.title.setText(data); + + } + + @Override + protected View getItemViewResource(ViewGroup viewGroup) { + return LayoutInflater.from(mContext).inflate(R.layout.item_info, viewGroup, false); + } + + @Override + protected ViewHolder getViewHolder(View view) { + return new ViewHolder(view, this); + } + + class ViewHolder extends BaseViewHolder { + TextView title; + + public ViewHolder(View itemView, InfoTitleAdapter adapter) { + super(itemView, adapter); + title = itemView.findViewById(R.id.tv_info_title); + } + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/LogModel.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/LogModel.java new file mode 100644 index 0000000000..9946440067 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/LogModel.java @@ -0,0 +1,49 @@ +package com.zhidao.adas.client.ui.mian; + +import android.graphics.Color; + +import com.zhidao.adas.client.R; + + +//保存的log +public class LogModel { + + public interface ACTION { + String SEND = "发送"; + String RECEIVE = "接收"; + String PARSE = "解析"; + } + + public long id; + public String action;//log标签 + public String data;//log数据 + public String time; + + public LogModel() { + } + + public LogModel(String action, String data) { + this.action = action; + this.data = data; + } + + + public int getColor() { + switch (action) { + case ACTION.SEND: + return R.color.colorAccent; + case ACTION.RECEIVE: + return R.color.colorPrimary; + case ACTION.PARSE: + return Color.parseColor("#228B22"); + default: + return Color.parseColor("#871f78"); + } + + } + + @Override + public String toString() { + return data+""; + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/MainActivity.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/MainActivity.java new file mode 100644 index 0000000000..d510940a12 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/MainActivity.java @@ -0,0 +1,910 @@ +package com.zhidao.adas.client.ui.mian; + +import static com.mogo.telematic.MogoProtocolMsg.NORMAL_DATA; + +import android.content.Context; +import android.content.res.Configuration; +import android.os.Bundle; +import android.text.Editable; +import android.text.TextUtils; +import android.text.TextWatcher; +import android.util.Log; +import android.view.Gravity; +import android.view.View; +import android.view.WindowManager; +import android.widget.CompoundButton; +import android.widget.EditText; +import android.widget.RadioButton; +import android.widget.RadioGroup; +import android.widget.Switch; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.AppCompatButton; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.recyclerview.widget.SimpleItemAnimator; + +import com.google.gson.Gson; +import com.mogo.telematic.MogoProtocolMsg; +import com.mogo.telematic.NSDNettyManager; +import com.mogo.telematic.client.listener.NettyClientListener; +import com.mogo.telematic.client.status.ConnectState; +import com.mogo.telematic.server.netty.NettyServerListener; +import com.zhidao.adas.client.R; +import com.zhidao.adas.client.base.BaseAdapter; +import com.zhidao.adas.client.bean.ArrivalNotification; +import com.zhidao.adas.client.bean.AutopilotState; +import com.zhidao.adas.client.bean.BasicInfoReq; +import com.zhidao.adas.client.bean.CarConfigResp; +import com.zhidao.adas.client.bean.GlobalPathResp; +import com.zhidao.adas.client.bean.GnssInfo; +import com.zhidao.adas.client.bean.MogoReportMessage; +import com.zhidao.adas.client.bean.RecordPanel; +import com.zhidao.adas.client.bean.TrackedObjects; +import com.zhidao.adas.client.bean.Trajectory; +import com.zhidao.adas.client.bean.VehicleState; +import com.zhidao.adas.client.bean.Warn; +import com.zhidao.adas.client.utils.Constants; +import com.zhidao.support.adas.high.AdasManager; +import com.zhidao.support.adas.high.AdasOptions; +import com.zhidao.support.adas.high.OnAdasListener; +import com.zhidao.support.adas.high.OnAdasConnectStatusListener; +import com.zhidao.support.adas.high.OnMultiDeviceListener; + +import com.zhidao.support.adas.high.bean.IPCUpgradeStateInfo; +import com.zhidao.support.adas.high.bean.SSHResult; + +import com.zhidao.support.adas.high.common.CupidLogUtils; +import com.zhidao.support.recorder.RecordDataManager; + +import org.greenrobot.eventbus.EventBus; +import org.json.JSONException; +import org.json.JSONObject; + +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.net.SocketException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Enumeration; +import java.util.List; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.ScheduledExecutorService; + +import chassis.VehicleStateOuterClass; +import io.netty.channel.Channel; +import mogo.telematics.pad.MessagePad; +import mogo_msg.MogoReportMsg; +import record_cache.RecordPanelOuterClass; + +public class MainActivity extends AppCompatActivity implements OnAdasListener, OnAdasConnectStatusListener, BaseAdapter.OnItemClickListener { + private final static String TAG = MainActivity.class.getSimpleName(); + private EditText etIp; + private TextView role; + private TextView tvIp; + private TextView title; + private TextView ipcIp; + private TextView localIp; + private View line; + private RadioGroup connectionType; + private AppCompatButton connect; + private AppCompatButton disconnect; + private RadioButton fixation; + private RadioButton assign; + private Switch switchLog; + private RecyclerView infoBtn; + private RecyclerView infoFragment; + private TextView tvConnectState; + private ScheduledExecutorService mExecutorServiceConfigTimer; + private Gson gson; + + + private final List titleFragmentData = new ArrayList<>(); + private final List titleBtnData = new ArrayList<>(); + + private InfoTitleAdapter btnAdapter; + private InfoTitleAdapter fragmentAdapter; + + private InfoFragment carFragment; + private InfoFragment viewFragment; + private InfoFragment canFragment; + private InfoFragment autoFragment; + private InfoFragment warnFragment; + private InfoFragment trajectoryFragment; + private InfoFragment autopilotWayArriveFragment; + private InfoFragment autopilotRouteFragment; + private UpgradeFragment upgradeFragment; + private InfoFragment badcseFragment; + private InfoFragment reportMessageFragment; + private VersionFragment versionFragment; + private FragmentManager manager; + private FragmentTransaction transaction; + private String ftpTime; + private boolean isPad; + private String recordKey; + private String recordFileName; + private int connectStatus; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + isPad = isPad(this); + if (!isPad) + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + initView(); + firstFragment(); + gson = new Gson(); + initAdas(); + connectStatus = AdasManager.getInstance().getIpcConnectionStatus(); + onUpdateConnectStateView(); + showIPCIP(AdasManager.getInstance().getIpcConnectedIp(), AdasManager.getInstance().getIpcConnectedPort()); + } + + + private void connect(boolean isConnect) { + if (isConnect) { + switch (Constants.getIpcConnectionMode(this)) { + case AdasOptions.IPC_CONNECTION_MODE.FIXATION: + AdasManager.getInstance().getAdasOptions().setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(this)); + break; + case AdasOptions.IPC_CONNECTION_MODE.ASSIGN: + String ip = etIp.getText().toString().trim(); + if (TextUtils.isEmpty(ip)) { + Toast.makeText(this, "请输入指定IP", Toast.LENGTH_SHORT).show(); + return; + } + AdasManager.getInstance().getAdasOptions().setIpcAssignIP(ip); + break; + } + AdasManager.getInstance().getAdasOptions().setIpcConnectionMode(Constants.getIpcConnectionMode(this)); + AdasManager.getInstance().connect(); + } else + AdasManager.getInstance().disconnect(); + } + + + private void initView() { + etIp = findViewById(R.id.et_ip); + role = findViewById(R.id.role); + line = findViewById(R.id.line); + connectionType = findViewById(R.id.connection_type); + tvIp = findViewById(R.id.tv_ip); + connect = findViewById(R.id.connect); + disconnect = findViewById(R.id.disconnect); + fixation = findViewById(R.id.fixation); + assign = findViewById(R.id.assign); + switchLog = findViewById(R.id.switch_log); + title = findViewById(R.id.title); + infoBtn = findViewById(R.id.info_btn); + infoFragment = findViewById(R.id.info_fragment); + tvConnectState = findViewById(R.id.tv_connect_state); + ipcIp = findViewById(R.id.ipc_ip); + localIp = findViewById(R.id.local_ip); + + + role.setText(BuildConfig.IS_CLIENT ? "乘客" : "司机"); + if (BuildConfig.IS_CLIENT) { + line.setVisibility(View.GONE); + connectionType.setVisibility(View.GONE); + etIp.setVisibility(View.GONE); + tvIp.setVisibility(View.GONE); + line.setVisibility(View.GONE); + connect.setVisibility(View.GONE); + disconnect.setVisibility(View.GONE); + } + connect.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + connect(true); + } + }); + disconnect.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + connect(false); + } + }); + initListData(); + initBtnRecyclerView(); + initFragmentRecyclerView(); + switch (Constants.getIpcConnectionMode(this)) { + case 0: + fixation.setChecked(true); + break; + case 1: + assign.setChecked(true); + break; + + } + String ip = Constants.getIPCIp(this); + if (!TextUtils.isEmpty(ip)) + etIp.setText(ip); +// infoTitleList.add("录音测试"); + //初始化fragment + manager = getSupportFragmentManager(); + transaction = manager.beginTransaction(); + + + switchLog.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean b) { + if (b) { + AdasManager.getInstance().setEnableLog(true); + switchLog.setText("日志:开"); + + } else { + AdasManager.getInstance().setEnableLog(false); + switchLog.setText("日志:关"); + } + } + }); + connectionType.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(RadioGroup group, int checkedId) { + int type; + switch (checkedId) { + default: + + case R.id.assign: + type = AdasOptions.IPC_CONNECTION_MODE.ASSIGN; + break; + case R.id.fixation: + type = AdasOptions.IPC_CONNECTION_MODE.FIXATION; + break; + } + Constants.setIpcConnectionMode(MainActivity.this, type); + } + }); + etIp.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + if (TextUtils.isEmpty(s)) { + Constants.delIPCIp(MainActivity.this); + } else { + Constants.setIPCIp(MainActivity.this, s.toString()); + } + + } + + @Override + public void afterTextChanged(Editable s) { + } + }); + showLocalIP(); + title.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + showLocalIP(); + } + }); + } + + private void initListData() { + titleFragmentData.add("GNSS数据"); + titleFragmentData.add("底盘数据"); + titleFragmentData.add("感知数据"); + titleFragmentData.add("自动驾驶状态"); + titleFragmentData.add("预警数据"); + titleFragmentData.add("局部轨迹"); + titleFragmentData.add("自动驾驶站点"); + titleFragmentData.add("自动驾驶路径"); + titleFragmentData.add("IPC升级"); + titleFragmentData.add("BadCase数据"); + titleFragmentData.add("监控事件报告"); + titleFragmentData.add("版本和配置"); + + titleBtnData.add("下发站点1"); + titleBtnData.add("下发站点2"); + titleBtnData.add("自动驾驶路径查询"); + titleBtnData.add("下发SN"); + titleBtnData.add("数据采集5秒"); + titleBtnData.add("数据采集start"); + titleBtnData.add("数据采集end"); + titleBtnData.add("发送信号灯"); + titleBtnData.add("速度设置"); + titleBtnData.add("重启Docker"); + titleBtnData.add("重启IPC"); + titleBtnData.add("关机"); + titleBtnData.add("采集类型"); + titleBtnData.add("打开演示模式"); + titleBtnData.add("关闭演示模式"); + } + + private void initBtnRecyclerView() { + //初始info-recycle + GridLayoutManager nodLinearLayoutManage = new GridLayoutManager(this, 2); + nodLinearLayoutManage.setOrientation(LinearLayoutManager.HORIZONTAL); + infoBtn.setLayoutManager(nodLinearLayoutManage); + //如果可以确定每个item的高度是固定的,设置这个选项可以提高性能 + infoBtn.setHasFixedSize(true); + //解决局部刷新闪屏问题 + SimpleItemAnimator animatorInfo = (SimpleItemAnimator) infoBtn.getItemAnimator(); + if (animatorInfo != null) + animatorInfo.setSupportsChangeAnimations(false); + //创建并设置Adapter + btnAdapter = new InfoTitleAdapter(titleBtnData, false); + infoBtn.setAdapter(btnAdapter); + btnAdapter.setOnItemClickListener(this); + } + + private void initFragmentRecyclerView() { + //创建默认的线性LayoutManager 横向的GridLayoutManager + LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); + linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); + infoFragment.setLayoutManager(linearLayoutManager); + //如果可以确定每个item的高度是固定的,设置这个选项可以提高性能 + infoFragment.setHasFixedSize(true); + //解决局部刷新闪屏问题 + SimpleItemAnimator animator = (SimpleItemAnimator) infoFragment.getItemAnimator(); + if (animator != null) + animator.setSupportsChangeAnimations(false); + //创建并设置Adapter + fragmentAdapter = new InfoTitleAdapter(titleFragmentData, true); + infoFragment.setAdapter(fragmentAdapter); + fragmentAdapter.setOnItemClickListener(new BaseAdapter.OnItemClickListener() { + + @Override + public void onItemClick(int position, String data) { + fragmentAdapter.setSelectedPosition(position); + manager = getSupportFragmentManager(); + transaction = manager.beginTransaction(); + CupidLogUtils.w(TAG, "TitleAdapter===>name:" + data); + switch (data) { + case "GNSS数据": + firstFragment(); + break; + case "底盘数据": + if (canFragment == null) + canFragment = new InfoFragment(data); + if (!viewFragment.isVisible()) { + transaction.replace(R.id.fl_info, canFragment); + transaction.commit(); + } + break; + case "感知数据": + if (viewFragment == null) + viewFragment = new InfoFragment(data); + if (!viewFragment.isVisible()) { + transaction.replace(R.id.fl_info, viewFragment); + transaction.commit(); + } + break; + case "自动驾驶状态": + if (autoFragment == null) + autoFragment = new InfoFragment(data); + if (!autoFragment.isVisible()) { + transaction.replace(R.id.fl_info, autoFragment); + transaction.commit(); + } + break; + case "预警数据": + if (warnFragment == null) + warnFragment = new InfoFragment(data); + if (!warnFragment.isVisible()) { + transaction.replace(R.id.fl_info, warnFragment); + transaction.commit(); + } + break; + case "局部轨迹": + if (trajectoryFragment == null) + trajectoryFragment = new InfoFragment(data); + if (!trajectoryFragment.isVisible()) { + transaction.replace(R.id.fl_info, trajectoryFragment); + transaction.commit(); + } + break; + case "自动驾驶站点": + if (autopilotWayArriveFragment == null) + autopilotWayArriveFragment = new InfoFragment(data); + if (!autopilotWayArriveFragment.isVisible()) { + transaction.replace(R.id.fl_info, autopilotWayArriveFragment); + transaction.commit(); + } + break; + case "自动驾驶路径": + if (autopilotRouteFragment == null) + autopilotRouteFragment = new InfoFragment(data); + if (!autopilotRouteFragment.isVisible()) { + transaction.replace(R.id.fl_info, autopilotRouteFragment); + transaction.commit(); + } + break; + case "IPC升级": + if (upgradeFragment == null) + upgradeFragment = new UpgradeFragment(data); + if (!upgradeFragment.isVisible()) { + transaction.replace(R.id.fl_info, upgradeFragment); + transaction.commit(); + } + break; + case "BadCase数据": + if (badcseFragment == null) + badcseFragment = new InfoFragment(data); + if (!badcseFragment.isVisible()) { + transaction.replace(R.id.fl_info, badcseFragment); + transaction.commit(); + } + break; + case "监控事件报告": + if (reportMessageFragment == null) + reportMessageFragment = new InfoFragment(data); + if (!reportMessageFragment.isVisible()) { + transaction.replace(R.id.fl_info, reportMessageFragment); + transaction.commit(); + } + break; + case "版本和配置": + AdasManager.getInstance().sendCarConfigReq(); + if (versionFragment == null) + versionFragment = new VersionFragment("工控机版本\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t固定IP配置"); + if (!versionFragment.isVisible()) { + transaction.replace(R.id.fl_info, versionFragment); + transaction.commit(); + } + break; + } + } + }); + } + + public void showIPCIP(String ip, int port) { + if (!BuildConfig.IS_CLIENT) { + ipcIp.setVisibility(View.VISIBLE); + if (!TextUtils.isEmpty(ip)) { + ip = "IPC IP:" + ip + ":" + port; + } + ipcIp.setText(ip); + } else { + ipcIp.setVisibility(View.GONE); + } + } + + + private void onUpdateConnectStateView() { + String status; + int color; + switch (connectStatus) { + case com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.CONNECTED: + status = "已连接"; + color = R.color.connect_status_connected; + break; + default: + case com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.DISCONNECTED: + status = "未连接"; + color = R.color.connect_status_disconnected; + break; + case com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.CONNECTING: + status = "连接中"; + color = R.color.connect_status_connecting; + break; + + case com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.SEARCH_ADDRESS: + status = "搜索IP"; + color = R.color.connect_status_search_address; + break; + case com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.NOT_FOUND_ADDRESS: + status = "未找到"; + color = R.color.connect_status_disconnecting; + break; + } + CupidLogUtils.i(TAG, "connectStatus=" + status); + runOnUiThread(new Runnable() { + @Override + public void run() { + tvConnectState.setText(status); + tvConnectState.setTextColor(getResources().getColor(color)); + } + }); + } + + + private void updateText(final TextView tv, final String text) { + runOnUiThread(new Runnable() { + @Override + public void run() { + tv.setText(text); + } + }); + + } + + + @Override + public void onSSHResult(final SSHResult info) { + runOnUiThread(new Runnable() { + @Override + public void run() { + showToastCenter("IPC命令下发结果:" + info.code + " 命令:" + info.cmd + " 信息:" + info.msg); + } + }); + CupidLogUtils.w(TAG, "IPC命令下发结果:" + info.code + " 命令:" + info.cmd + " 信息:" + info.msg); + } + + @Override + public void onTrajectory(MessagePad.Header header, MessagePad.Trajectory trajectory) { + EventBus.getDefault().postSticky(new Trajectory(header, trajectory)); + } + + @Override + public void onTrackedObjects(MessagePad.Header header, MessagePad.TrackedObjects trackedObjects) { + EventBus.getDefault().postSticky(new TrackedObjects(header, trackedObjects)); + } + + @Override + public void onGnssInfo(MessagePad.Header header, MessagePad.GnssInfo gnssInfo) { + EventBus.getDefault().postSticky(new GnssInfo(header, gnssInfo)); + } + + @Override + public void onVehicleState(MessagePad.Header header, VehicleStateOuterClass.VehicleState vehicleState) { + EventBus.getDefault().postSticky(new VehicleState(header, vehicleState)); + } + + @Override + public void onAutopilotState(MessagePad.Header header, MessagePad.AutopilotState autopilotState) { + EventBus.getDefault().postSticky(new AutopilotState(header, autopilotState)); + } + + @Override + public void onReportMessage(MessagePad.Header header, MogoReportMsg.MogoReportMessage mogoReportMessage) { + EventBus.getDefault().postSticky(new MogoReportMessage(header, mogoReportMessage)); + } + + @Override + public void onBasicInfoReq(MessagePad.Header header, MessagePad.BasicInfoReq basicInfoReq) { + EventBus.getDefault().postSticky(new BasicInfoReq(header, basicInfoReq)); + } + + @Override + public void onCarConfigResp(MessagePad.Header header, MessagePad.CarConfigResp carConfigResp) { + EventBus.getDefault().postSticky(new CarConfigResp(header, carConfigResp)); + } + + @Override + public void onRecordResult(MessagePad.Header header, RecordPanelOuterClass.RecordPanel recordPanel) { + EventBus.getDefault().postSticky(new RecordPanel(header, recordPanel)); + } + + @Override + public void onGlobalPathResp(MessagePad.Header header, MessagePad.GlobalPathResp globalPathResp) { + EventBus.getDefault().postSticky(new GlobalPathResp(header, globalPathResp)); + } + + @Override + public void onWarn(MessagePad.Header header, MessagePad.Warn warn) { + EventBus.getDefault().postSticky(new Warn(header, warn)); + } + + @Override + public void onArrivalNotification(MessagePad.Header header, MessagePad.ArrivalNotification arrivalNotification) { + EventBus.getDefault().postSticky(new ArrivalNotification(header, arrivalNotification)); + } + + @Override + public void onUpgradeStateInfo(final IPCUpgradeStateInfo info) { + EventBus.getDefault().postSticky(info); + } + + + private Toast toast; + + public void showToastCenter(String msg) { + if (toast != null) { + toast.cancel(); + toast = null; + } + toast = Toast.makeText(this, "", Toast.LENGTH_SHORT); //如果有居中显示需求 + toast.setGravity(Gravity.CENTER, 0, 0); + toast.setText(msg); + toast.show(); + } + + + private void initAdas() { + CupidLogUtils.e(TAG, "--->初始化"); + AdasOptions options; + if (BuildConfig.IS_CLIENT) { + /*—————————————作为乘客端———————————*/ + options = new AdasOptions.Builder().setClient(true).build(); + NSDNettyManager.getInstance().searchAndConnectServer(this, "1234", new NettyClientListener() { + + + @Override + public void onMessageResponseClient(MogoProtocolMsg msg, String sign) { + Log.d("dddd", "12345678=" + Arrays.toString(msg.getBody())); + AdasManager.getInstance().parseIPCData(msg.getBody()); + } + + @Override + public void onClientStatusConnectChanged(int statusCode, String sign) { + if (statusCode == ConnectState.STATUS_CONNECT_SUCCESS) { + connectStatus = com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.CONNECTED; + } else { + connectStatus = com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.DISCONNECTED; + } + runOnUiThread(new Runnable() { + @Override + public void run() { + ipcIp.setVisibility(View.VISIBLE); + ipcIp.setText("司机IP:" + NSDNettyManager.getInstance().getConnServerIp()); + } + }); + onUpdateConnectStateView(); + } + }); + } else { + /*—————————————作为司机端———————————*/ + int mode = Constants.getIpcConnectionMode(this); + switch (mode) { + default: + case AdasOptions.IPC_CONNECTION_MODE.FIXATION: + options = new AdasOptions.Builder().setClient(false).setIpcFixationIP(AdasManager.getInstance().getIPCFixationIPList(this)).setIpcConnectionMode(mode).build(); + break; + case AdasOptions.IPC_CONNECTION_MODE.ASSIGN: + options = new AdasOptions.Builder().setClient(false).setIpcAssignIP(Constants.getIPCIp(this)).setIpcConnectionMode(mode).build(); + break; + } + + NSDNettyManager.getInstance().startNSDNettyServer(this, new NettyServerListener() { + @Override + public void onMessageResponseServer(Object msg, Channel channel) { + } + + @Override + public void onStartServer() { + + } + + @Override + public void onStopServer() { + + } + + @Override + public void onChannelConnect(Channel channel) { + + } + + @Override + public void onChannelDisConnect(Channel channel) { + + } + }); + + + } + AdasManager.getInstance().create(options, this); + + AdasManager.getInstance().setOnAdasListener(this); +// AdasManager.getInstance().setOnAdasConnectStatusListener(this); + if (BuildConfig.IS_CLIENT) { + /*—————————————作为乘客端———————————*/ + + } else { + /*—————————————作为司機端———————————*/ + AdasManager.getInstance().setOnMultiDeviceListener(new OnMultiDeviceListener() { + @Override + public void onForwardingIPCMessage(byte[] bytes) { + // 发送数据给乘客端 + if (NSDNettyManager.getInstance().isServerStart()) { + NSDNettyManager.getInstance().sendMsgToAllClients(new MogoProtocolMsg(NORMAL_DATA, bytes.length, bytes)); + } else { + Log.d("dddd", "司机端Server未启动!"); + } + + } + }); + + + } + } + + + @Override + protected void onPause() { + super.onPause(); +// AdasManager.getInstance().pause(); + } + + @Override + protected void onResume() { + super.onResume(); +// AdasManager.getInstance().resume(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + AdasManager.getInstance().setOnAdasListener(null); + AdasManager.getInstance().destory(); + if (mExecutorServiceConfigTimer != null) { + mExecutorServiceConfigTimer.shutdownNow(); + } + } + + + @Override + public void onConnectionIPCStatus(int ipcConnectionStatus, String failedMsg) { + connectStatus = ipcConnectionStatus; + onUpdateConnectStateView(); + if (connectStatus == com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.CONNECTED) { + CupidLogUtils.w(TAG, "===>MainActivity onWebSocketConnectSuccess"); + showIPCIP(AdasManager.getInstance().getIpcConnectedIp(), AdasManager.getInstance().getIpcConnectedPort()); + } else if (connectStatus == com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.DISCONNECTED) { + toastMsg("ws连接失败:" + failedMsg); + CupidLogUtils.w(TAG, "===>MainActivity onWebSocketConnectFailed"); + showIPCIP(AdasManager.getInstance().getIpcConnectedIp(), AdasManager.getInstance().getIpcConnectedPort()); + } + } + + + public void toastMsg(final String msg) { + runOnUiThread(new Runnable() { + @Override + public void run() { + Toast.makeText(MainActivity.this, msg, Toast.LENGTH_LONG).show(); + } + }); + } + + private void showLocalIP() { + localIp.setText("本机IP:" + getIpAddressString()); + } + + private String getIpAddressString() { + try { + for (Enumeration enNetI = NetworkInterface + .getNetworkInterfaces(); enNetI.hasMoreElements(); ) { + NetworkInterface netI = enNetI.nextElement(); + for (Enumeration enumIpAddr = netI + .getInetAddresses(); enumIpAddr.hasMoreElements(); ) { + InetAddress inetAddress = enumIpAddr.nextElement(); + if (inetAddress instanceof Inet4Address && !inetAddress.isLoopbackAddress()) { + return inetAddress.getHostAddress(); + } + } + } + } catch (SocketException e) { + e.printStackTrace(); + } + return "127.0.0.1"; + } + + /** + * 判断当前设备是手机还是平板,代码来自 Google I/O App for Android + * + * @param context + * @return 平板返回 True,手机返回 False + */ + public static boolean isPad(Context context) { + return (context.getResources().getConfiguration().screenLayout + & Configuration.SCREENLAYOUT_SIZE_MASK) + >= Configuration.SCREENLAYOUT_SIZE_LARGE; + } + + private void firstFragment() { + if (carFragment == null) + carFragment = new InfoFragment("自车状态"); + if (!carFragment.isVisible()) { + transaction.replace(R.id.fl_info, carFragment); + transaction.commit(); + } + } + + @Override + public void onItemClick(int position, String data) { + CupidLogUtils.w(TAG, "TitleAdapter===>name:" + data); + if (connectStatus == com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS.DISCONNECTED) { + toastMsg("IPC 未连接"); + return; + } + switch (data) { + case "下发站点1": + MessagePad.Location startLocation = MessagePad.Location.newBuilder() + .setLatitude(26.820319143036112) + .setLongitude(112.57770688564666) + .build(); + MessagePad.Location endLocation = MessagePad.Location.newBuilder() + .setLatitude(26.82355278566775) + .setLongitude(112.57001723522112) + .build(); + MessagePad.RouteInfo info = MessagePad.RouteInfo.newBuilder() + .setStartLocation(startLocation) + .setStartName("KXCNMZ") + .setEndLocation(endLocation) + .setEndName("SDYJKXCXMBZ") + .addAllWayPoints(null) + .setSpeedLimit(0.0) + .setVehicleType(9) + .setIsSpeakVoice(true) + .build(); + AdasManager.getInstance().sendAutoPilotModeReq(1, 0, info); + //"{\"action\":\"aiCloudToStartAutopilot\",\"result\":{\"endLatLon\":{\"lat\":26.82355278566775,\"lon\":112.57001723522112},\"endName\":\"SDYJKXCXMBZ\",\"isSpeakVoice\":true,\"speedLimit\":0.0,\"startLatLon\":{\"lat\":26.820319143036112,\"lon\":112.57770688564666},\"startName\":\"KXCNMZ\",\"vehicleType\":9,\"wayLatLons\":null}}" +// " {\"action\":\"aiCloudToStartAutopilot\",\"result\":{\"endLatLon\":{\"lat\":26.819811964643154,\"lon\":112.57732459897345},\"endName\":\"KXCNMDM\",\"isSpeakVoice\":true,\"speedLimit\":0.0,\"startLatLon\":{\"lat\":26.823347858814472,\"lon\":112.56994205894226},\"startName\":\"SDYJKXCXMBDM\",\"vehicleType\":9,\"wayLatLons\":null}}" + break; + case "下发站点2": + MessagePad.Location startLocation2 = MessagePad.Location.newBuilder() + .setLatitude(26.823347858814472) + .setLongitude(112.56994205894226) + .build(); + MessagePad.Location endLocation2 = MessagePad.Location.newBuilder() + .setLatitude(26.819811964643154) + .setLongitude(112.57732459897345) + .build(); + MessagePad.RouteInfo info2 = MessagePad.RouteInfo.newBuilder() + .setStartLocation(startLocation2) + .setStartName("SDYJKXCXMBDM") + .setEndLocation(endLocation2) + .setEndName("KXCNMDM") + .addAllWayPoints(null) + .setSpeedLimit(0.0) + .setVehicleType(9) + .setIsSpeakVoice(true) + .build(); + AdasManager.getInstance().sendAutoPilotModeReq(1, 0, info2); +// "{\"action\":\"aiCloudToStartAutopilot\",\"result\":{\"endLatLon\":{\"lat\":26.82355278566775,\"lon\":112.57001723522112},\"endName\":\"SDYJKXCXMBZ\",\"isSpeakVoice\":true,\"speedLimit\":0.0,\"startLatLon\":{\"lat\":26.820319143036112,\"lon\":112.57770688564666},\"startName\":\"KXCNMZ\",\"vehicleType\":9,\"wayLatLons\":null}}" + //" {\"action\":\"aiCloudToStartAutopilot\",\"result\":{\"endLatLon\":{\"lat\":26.819811964643154,\"lon\":112.57732459897345},\"endName\":\"KXCNMDM\",\"isSpeakVoice\":true,\"speedLimit\":0.0,\"startLatLon\":{\"lat\":26.823347858814472,\"lon\":112.56994205894226},\"startName\":\"SDYJKXCXMBDM\",\"vehicleType\":9,\"wayLatLons\":null}}" + break; + case "自动驾驶路径查询": + AdasManager.getInstance().sendGlobalPathReq(); + break; + case "下发SN": + //发送sn + AdasManager.getInstance().sendBasicInfoResp("X202021111192N41VY", 1); + break; + case "数据采集5秒": + boolean b = AdasManager.getInstance().startRecordPackage(1, 5, 1); + CupidLogUtils.w(TAG, "AutopilotRecord===>send:" + b); + break; + case "数据采集start": + boolean bStart = AdasManager.getInstance().startRecordPackage(1, 1); + CupidLogUtils.w(TAG, "AutopilotRecord===>send:" + bStart); + break; + case "数据采集end": + boolean bEnd = AdasManager.getInstance().stopRecordPackage(1, 1); + CupidLogUtils.w(TAG, "AutopilotRecord===>send:" + bEnd); + break; + case "录音测试": + CupidLogUtils.w(TAG, "录音测试"); + RecordDataManager.getInstance().init(MainActivity.this, "1234567", "", 22, "", ""); + RecordDataManager.getInstance().record(); + break; + case "发送信号灯": + AdasManager.getInstance().sendTrafficLightData(null); + break; + case "速度设置": + AdasManager.getInstance().sendAutopilotSpeedReq(30); + break; + case "重启Docker": + AdasManager.getInstance().rebootAPDocker(); + break; + case "重启IPC": + AdasManager.getInstance().rebootIPC(); + break; + case "关机": + AdasManager.getInstance().shutdownIPC(); + break; + case "采集类型": + AdasManager.getInstance().sendRecordCause(recordKey, recordFileName, "1", "变道有干扰"); + break; + case "打开演示模式": + AdasManager.getInstance().sendDemoModeReq(1); + break; + case "关闭演示模式": + AdasManager.getInstance().sendDemoModeReq(0); + break; + } + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/UpgradeFragment.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/UpgradeFragment.java new file mode 100644 index 0000000000..c3194b65e4 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/UpgradeFragment.java @@ -0,0 +1,119 @@ +package com.zhidao.adas.client.ui.mian; + +import android.content.Context; +import android.graphics.Color; +import android.os.Bundle; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import com.zhidao.adas.client.R; +import com.zhidao.support.adas.high.AdasManager; +import com.zhidao.support.adas.high.bean.IPCUpgradeInfo; +import com.zhidao.support.adas.high.bean.IPCUpgradeStateInfo; +import com.zhidao.support.adas.high.common.CupidLogUtils; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.Random; + +/** + * @des 升级页面 + */ +public class UpgradeFragment extends Fragment { + private final int[] colors = {Color.parseColor("#FA8072"), Color.parseColor("#FF00FF"), Color.parseColor("#228B22"), Color.parseColor("#871f78")}; + private final Random random = new Random(); + + private String title; + + public UpgradeFragment() { + } + + public UpgradeFragment(String title) { + this.title = title; + } + + @Override + public void onAttach(@NonNull Context context) { + super.onAttach(context); + } + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_upgrade, container, false); + initView(view); + return view; + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + EventBus.getDefault().register(this); + } + + private TextView tvTitle; + private TextView text2; + private Button btn1; + private Button btn2; + + private void initView(View view) { + tvTitle = view.findViewById(R.id.tv_title); + text2 = view.findViewById(R.id.text2); + btn1 = view.findViewById(R.id.btn1); + btn2 = view.findViewById(R.id.btn2); + CupidLogUtils.w("InfoFragment===>" + title); + tvTitle.setText(title); + tvTitle.setGravity(Gravity.CENTER); + + btn1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + AdasManager.getInstance().sendBaseInfo(IPCUpgradeInfo.affirm()); + } + }); + + btn2.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + AdasManager.getInstance().sendBaseInfo(IPCUpgradeInfo.cancel()); + } + }); + } + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void onIPCUpgradeStateInfo(IPCUpgradeStateInfo info) { + text2.setTextColor(colors[random.nextInt(4)]); + text2.setText("IPC升级 \nUpgradeStatus:" + IPCUpgradeStateInfo.UpgradeStatus.getStatus(info.getUpgradeStatus()) + + "\nDownloadStatus:" + IPCUpgradeStateInfo.DownloadStatus.getStatus(info.getDownloadStatus()) + + "\nUpgradeMode:" + IPCUpgradeStateInfo.UpgradeMode.getStatus(info.getUpgradeMode()) + + "\nProgress:" + info.getProgress() + + "\nImages:" + info.getImages()); + } + + + @Override + public void onDestroyView() { + super.onDestroyView(); + EventBus.getDefault().unregister(this); + } + + @Override + public void onDestroy() { + super.onDestroy(); + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/VersionFragment.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/VersionFragment.java new file mode 100644 index 0000000000..49a9f8b922 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/mian/VersionFragment.java @@ -0,0 +1,224 @@ +package com.zhidao.adas.client.ui.mian; + +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import com.mogo.eagle.core.utilcode.util.AppUtils; +import com.zhidao.adas.client.BuildConfig; +import com.zhidao.adas.client.R; +import com.zhidao.adas.client.bean.CarConfigResp; +import com.zhidao.support.adas.high.AdasManager; +import com.zhidao.support.adas.high.common.Constants; +import com.zhidao.support.adas.high.common.CupidLogUtils; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.greenrobot.eventbus.ThreadMode; + +import java.util.HashSet; + +/** + * @des 升级页面 + */ +public class VersionFragment extends Fragment { + + + private String title; + + public VersionFragment() { + } + + public VersionFragment(String title) { + this.title = title; + } + + @Override + public void onAttach(@NonNull Context context) { + super.onAttach(context); + } + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Nullable + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_version, container, false); + initView(view); + return view; + } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + EventBus.getDefault().register(this); + showIps(); + } + + + private void showIps() { + HashSet ips = AdasManager.getInstance().getIPCFixationIPList(getActivity()); + if (ips != null && !ips.isEmpty()) { + StringBuilder builder = new StringBuilder(); + int i = 0; + for (String ip : ips) { + i++; + builder.append(ip); + if (i % 2 == 0) { + builder.append("\n"); + } else { + builder.append("\t\t\t\t"); + } + } + ipsView.setText(builder.toString()); + } + + } + + private TextView tvTitle; + private TextView ipcIpView; + private TextView ipcVersionView; + private TextView plate_number_view; + private TextView mac_address_view; + private TextView protocol_version_view; + private TextView app_protocol_version_view; + private TextView speed_limit_view; + private TextView ipcIpHint; + private TextView ipcVersionHint; + private TextView plate_number_hint; + private TextView appVersionView; + private TextView mac_address_hint; + private TextView protocol_version_hint; + private TextView app_protocol_version_hint; + private TextView speed_limit_hint; + private TextView mapVersionView; + private TextView ipsView; + private Button btn1; + private Button btn2; + private EditText ipView; + private View layoutVersion; + + private void initView(View view) { + tvTitle = view.findViewById(R.id.tv_title); + btn1 = view.findViewById(R.id.btn1); + ipView = view.findViewById(R.id.ip); + btn2 = view.findViewById(R.id.btn2); + ipcIpView = view.findViewById(R.id.ipc_ip_view); + ipcVersionView = view.findViewById(R.id.ipc_version_view); + plate_number_view = view.findViewById(R.id.plate_number_view); + mac_address_view = view.findViewById(R.id.mac_address_view); + protocol_version_view = view.findViewById(R.id.protocol_version_view); + app_protocol_version_view = view.findViewById(R.id.app_protocol_version_view); + speed_limit_view = view.findViewById(R.id.speed_limit_view); + + ipcIpHint = view.findViewById(R.id.ipc_ip_hint); + ipcVersionHint = view.findViewById(R.id.ipc_version_hint); + plate_number_hint = view.findViewById(R.id.plate_number_hint); + mac_address_hint = view.findViewById(R.id.mac_address_hint); + protocol_version_hint = view.findViewById(R.id.protocol_version_hint); + app_protocol_version_hint = view.findViewById(R.id.app_protocol_version_hint); + speed_limit_hint = view.findViewById(R.id.speed_limit_hint); + appVersionView = view.findViewById(R.id.app_version_view); + mapVersionView = view.findViewById(R.id.map_version_view); + layoutVersion = view.findViewById(R.id.layout_version); + ipsView = view.findViewById(R.id.ips_view); + + CupidLogUtils.w("InfoFragment===>" + title); + tvTitle.setText(title); + tvTitle.setGravity(Gravity.CENTER); + + btn1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + String ip = ipView.getText().toString().trim(); + if (TextUtils.isEmpty(ip)) { + Toast.makeText(getContext(), "请输入IP", Toast.LENGTH_SHORT).show(); + return; + } + if (AdasManager.getInstance().addIPCFixationIP(getContext(), ip)) { + ipView.setText(""); + showIps(); + } else { + Toast.makeText(getContext(), "IP已存在", Toast.LENGTH_SHORT).show(); + } + } + }); + btn2.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + String ip = ipView.getText().toString().trim(); + if (TextUtils.isEmpty(ip)) { + Toast.makeText(getContext(), "请输入IP", Toast.LENGTH_SHORT).show(); + return; + } + if (AdasManager.getInstance().delIPCFixationIP(getContext(), ip)) { + ipView.setText(""); + showIps(); + } else { + Toast.makeText(getContext(), "IP不存在", Toast.LENGTH_SHORT).show(); + } + } + }); + + } + + + @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) + public void showVersion(CarConfigResp adasConfig) { + layoutVersion.setVisibility(View.VISIBLE); + if (!BuildConfig.IS_CLIENT) { + String ip = AdasManager.getInstance().getIpcConnectedIp(); + if (!TextUtils.isEmpty(ip)) { + if (!ip.contains(":")) { + ip = ip + ":" + Constants.DEFAULT_PORT; + } + } + ipcIpView.setText(ip); + ipcVersionView.setText(adasConfig.bean.getDockVersion()); + plate_number_view.setText(adasConfig.bean.getPlateNumber()); + mac_address_view.setText(adasConfig.bean.getMacAddress()); + speed_limit_view.setText(String.valueOf(adasConfig.bean.getSpeedLimit())); + protocol_version_view.setText(String.valueOf(adasConfig.bean.getProtocolVersion().getNumber())); + app_protocol_version_view.setText(String.valueOf(AdasManager.getInstance().getProtocolVersion())); + } else { + ipcIpView.setVisibility(View.GONE); + ipcVersionView.setVisibility(View.GONE); + ipcIpHint.setVisibility(View.GONE); + ipcVersionHint.setVisibility(View.GONE); + plate_number_hint.setVisibility(View.GONE); + appVersionView.setVisibility(View.GONE); + mac_address_hint.setVisibility(View.GONE); + speed_limit_hint.setVisibility(View.GONE); + protocol_version_hint.setVisibility(View.GONE); + app_protocol_version_hint.setVisibility(View.GONE); + } +// appVersionView.setText(AppUtils.getAppVersionName()); + mapVersionView.setText(AdasManager.getInstance().getAPVersion()); + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + EventBus.getDefault().unregister(this); + } + + @Override + public void onDestroy() { + super.onDestroy(); + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java new file mode 100644 index 0000000000..7764de93a4 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/Constants.java @@ -0,0 +1,44 @@ +package com.zhidao.adas.client.utils; + +import android.content.Context; + +/** + * @author song kenan + * @des + * @date 2021/10/8 + */ +public class Constants { + public static final String ALL_PATH = "all_path";//所有路线 + public static final String SEL_PATH = "sel_path";//选择的路线 + + /***********************是否使用固定IP******************/ + // 0:固定IP 1:指定 2:UDP + private static final String IPC_CONNECTION_MODE = "ipc_connection_mode"; + + public static void setIpcConnectionMode(Context context, int type) { + PreferencesUtils.putInt(context, IPC_CONNECTION_MODE, type); + } + + public static int getIpcConnectionMode(Context context) { + return PreferencesUtils.getInt(context, IPC_CONNECTION_MODE, 0); + } + + public static boolean delIpcConnectionMode(Context context) { + return PreferencesUtils.delete(context, IPC_CONNECTION_MODE); + } + + /***********************保存IP******************/ + private static final String IPC_IP = "ipc_ip"; + + public static void setIPCIp(Context context, String ip) { + PreferencesUtils.putString(context, IPC_IP, ip); + } + + public static String getIPCIp(Context context) { + return PreferencesUtils.getString(context, IPC_IP, null); + } + + public static boolean delIPCIp(Context context) { + return PreferencesUtils.delete(context, IPC_IP); + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/FileUtils.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/FileUtils.java new file mode 100644 index 0000000000..5fbc347909 --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/FileUtils.java @@ -0,0 +1,39 @@ +package com.zhidao.adas.client.utils; + +import android.content.Context; + +import java.io.File; +import java.io.FileWriter; +import java.io.Writer; + +/** + * @author nie yunlong + * @des + * @date 2021/2/5 + */ +class FileUtils { + + /** + * 创建文件 + * + * @param data + * @param name + */ + public static void createFile(Context context, String data, String name) { + try { + File file = new File(context.getExternalFilesDir(null) + "/" + name); + if (!file.exists()) { + file.createNewFile(); + } + Writer out = new FileWriter(file,true); + out.write(data); + out.append("\n"); + out.flush(); + out.close(); + + } catch (Exception e) { + e.printStackTrace(); + } + + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/MyLinearLayoutManager.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/MyLinearLayoutManager.java new file mode 100644 index 0000000000..b4e06c2a6c --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/MyLinearLayoutManager.java @@ -0,0 +1,36 @@ +package com.zhidao.adas.client.utils; + +import android.content.Context; +import android.util.AttributeSet; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +public class MyLinearLayoutManager extends LinearLayoutManager { + public MyLinearLayoutManager(Context context) { + super(context); + } + + public MyLinearLayoutManager(Context context, int orientation, boolean reverseLayout) { + super(context, orientation, reverseLayout); + } + + public MyLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + @Override + public boolean supportsPredictiveItemAnimations() { + return false; + } + + @Override + public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) { + //override this method and implement code as below + try { + super.onLayoutChildren(recycler, state); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/PreferencesUtils.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/PreferencesUtils.java new file mode 100644 index 0000000000..f9a8006feb --- /dev/null +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/utils/PreferencesUtils.java @@ -0,0 +1,286 @@ +package com.zhidao.adas.client.utils; + +import android.content.Context; +import android.content.SharedPreferences; + +public class PreferencesUtils { + + public static String PREFERENCE_NAME = "control"; + + public static boolean hasString(Context context, String key) { + if (context == null) return false; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + return settings.contains(key); + } + + /** + * put string preferences + * + * @param context + * @param key The name of the preference to modify + * @param value The new value for the preference + * @return True if the new values were successfully written to persistent + * storage. + */ + public static boolean putString(Context context, String key, String value) { + + if (context == null) return false; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + SharedPreferences.Editor editor = settings.edit(); + editor.putString(key, value); + return editor.commit(); + } + + /** + * get string preferences + * + * @param context + * @param key The name of the preference to retrieve + * @return The preference value if it exists, or null. Throws + * ClassCastException if there is a preference with this name that + * is not a string + * @see #getString(Context, String, String) + */ + public static String getString(Context context, String key) { + if (context == null) return null; + return getString(context, key, null); + } + + /** + * get string preferences + * + * @param context + * @param key The name of the preference to retrieve + * @param defaultValue Value to return if this preference does not exist + * @return The preference value if it exists, or defValue. Throws + * ClassCastException if there is a preference with this name that + * is not a string + */ + public static String getString(Context context, String key, + String defaultValue) { + + if (context == null) return defaultValue; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + return settings.getString(key, defaultValue); + } + + /** + * put int preferences + * + * @param context + * @param key The name of the preference to modify + * @param value The new value for the preference + * @return True if the new values were successfully written to persistent + * storage. + */ + public static boolean putInt(Context context, String key, int value) { + + if (context == null) return false; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + SharedPreferences.Editor editor = settings.edit(); + editor.putInt(key, value); + return editor.commit(); + } + + /** + * get int preferences + * + * @param context + * @param key The name of the preference to retrieve + * @return The preference value if it exists, or -1. Throws + * ClassCastException if there is a preference with this name that + * is not a int + * @see #getInt(Context, String, int) + */ + public static int getInt(Context context, String key) { + + if (context == null) return -1; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + return getInt(context, key, -1); + } + + /** + * get int preferences + * + * @param context + * @param key The name of the preference to retrieve + * @param defaultValue Value to return if this preference does not exist + * @return The preference value if it exists, or defValue. Throws + * ClassCastException if there is a preference with this name that + * is not a int + */ + public static int getInt(Context context, String key, int defaultValue) { + if (context == null) return defaultValue; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + return settings.getInt(key, defaultValue); + } + + /** + * put long preferences + * + * @param context + * @param key The name of the preference to modify + * @param value The new value for the preference + * @return True if the new values were successfully written to persistent + * storage. + */ + public static boolean putLong(Context context, String key, long value) { + if (context == null) return false; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + SharedPreferences.Editor editor = settings.edit(); + editor.putLong(key, value); + return editor.commit(); + } + + /** + * get long preferences + * + * @param context + * @param key The name of the preference to retrieve + * @return The preference value if it exists, or -1. Throws + * ClassCastException if there is a preference with this name that + * is not a long + * @see #getLong(Context, String, long) + */ + public static long getLong(Context context, String key) { + if (context == null) return -1; + return getLong(context, key, -1); + } + + /** + * get long preferences + * + * @param context + * @param key The name of the preference to retrieve + * @param defaultValue Value to return if this preference does not exist + * @return The preference value if it exists, or defValue. Throws + * ClassCastException if there is a preference with this name that + * is not a long + */ + public static long getLong(Context context, String key, long defaultValue) { + if (context == null) return defaultValue; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + + return settings.getLong(key, defaultValue); + } + + /** + * put float preferences + * + * @param context + * @param key The name of the preference to modify + * @param value The new value for the preference + * @return True if the new values were successfully written to persistent + * storage. + */ + public static boolean putFloat(Context context, String key, float value) { + if (context == null) return false; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + SharedPreferences.Editor editor = settings.edit(); + editor.putFloat(key, value); + return editor.commit(); + } + + /** + * get float preferences + * + * @param context + * @param key The name of the preference to retrieve + * @return The preference value if it exists, or -1. Throws + * ClassCastException if there is a preference with this name that + * is not a float + * @see #getFloat(Context, String, float) + */ + public static float getFloat(Context context, String key) { + if (context == null) return -1; + return getFloat(context, key, -1); + } + + /** + * get float preferences + * + * @param context + * @param key The name of the preference to retrieve + * @param defaultValue Value to return if this preference does not exist + * @return The preference value if it exists, or defValue. Throws + * ClassCastException if there is a preference with this name that + * is not a float + */ + public static float getFloat(Context context, String key, float defaultValue) { + if (context == null) return defaultValue; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + return settings.getFloat(key, defaultValue); + } + + /** + * put boolean preferences + * + * @param context + * @param key The name of the preference to modify + * @param value The new value for the preference + * @return True if the new values were successfully written to persistent + * storage. + */ + public static boolean putBoolean(Context context, String key, boolean value) { + if (context == null) return false; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + SharedPreferences.Editor editor = settings.edit(); + editor.putBoolean(key, value); + return editor.commit(); + } + + /** + * get boolean preferences, default is false + * + * @param context + * @param key The name of the preference to retrieve + * @return The preference value if it exists, or false. Throws + * ClassCastException if there is a preference with this name that + * is not a boolean + * @see #getBoolean(Context, String, boolean) + */ + public static boolean getBoolean(Context context, String key) { + if (context == null) return false; + return getBoolean(context, key, false); + } + + /** + * get boolean preferences + * + * @param context + * @param key The name of the preference to retrieve + * @param defaultValue Value to return if this preference does not exist + * @return The preference value if it exists, or defValue. Throws + * ClassCastException if there is a preference with this name that + * is not a boolean + */ + public static boolean getBoolean(Context context, String key, + boolean defaultValue) { + if (context == null) return defaultValue; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + return settings.getBoolean(key, defaultValue); + } + + + public static boolean delete(Context context, String key) { + if (context == null) return false; + SharedPreferences settings = context.getSharedPreferences( + PREFERENCE_NAME, Context.MODE_PRIVATE); + SharedPreferences.Editor editor = settings.edit(); + editor.remove(key); + return editor.commit(); + } + +} diff --git a/app_ipc_monitoring/src/main/res/drawable/border_title.png b/app_ipc_monitoring/src/main/res/drawable/border_title.png new file mode 100644 index 0000000000000000000000000000000000000000..9bc911f3dc774a1c6d1b15ece84ebe4076bd1d22 GIT binary patch literal 6409 zcmeHMdpy&9`~PkTc`(#QIqVjp6qTEZEIFlv#2vyMBgMkVnN0_i(<*W--PAgeV-Y## zd`eA(Ii#3FvqhL;Jkxz|>-GHe`~CAgultYw+4g$xv+wn}uFv(pKJV*V%;{4m!kf2k z1^__#n5p3z0N{bMKDP*LV!c8VuWw_$fzW4641oN%(o+B+S%1v%h*c1BX2=ou$RnKp z+eoPU9psjqeZ8^01}|Z|wk-2|O&O&RnRynyKH!CVmYk}6$IB&ZU+WnmmzlTc1V2P6 zTx{q`O@nJhDP(9%@TqC+M&bgI%28U-%e=G3Phif0WEG`~)(#5gK7Ey}w@zkcws(9F z9iCvW4%afM+Fj`MNl~+o_S~e{qVnRye%j2sb}?VSv4cDU5I6z@fWW*0(jM4i^e)XV zWcm1>eAIK3Zu?Z&4PziJ<*W_=#`ixKV)ya!;`h~wh|mRF#6Zas>>pbx!ZFfCL*V}a zeN@4wB*;4>577v@=QA%wsUT0gkB#Y_NB%O&dZZH+oSR~9T%s{3#9ZDjfgmu38F;3W z78R5>9yNfp1JW9I(9-|54g!~Kfgp6=(FINUaRjz)$P)tuF!i7l{J#S4@!{R|G`s96 zPDb2Kz}2(BtQ~}lA#@NLeC&WBwr+sl(Ek_M!;h~A2K*yj%Y(i9>Hu+HMKi`?i)T9d zE$$#=;FXJLi|GOGfkEv)y#vk|)2>#JR-wx!Gj@M1aGvKs@0I%3DN5M}epz8&`22~l z9m_Z5)!WL8zeV?%1V9QCgquGOd?Wh4yv4K{(c#fL`U=?evlIj&e!+~B5>PV)P#(5F z{ZUFYYT$WI)bES_1yBLFw$>k<^N8Ky6UJlO&fKB}wvUM)w{#6qf6YI3BX+*cDuUl_ zhEZl*K65~9mRdyZcH-oa>#oz)V#kjsHg-Rb)R^5aUA>+#{B`943F-4e7O(kzp1)pH zc9Bwtdd=^)VxTd;z}zVoJp)Q}20UM{KNLRm(Um$BVNJQ)W!yk|eSaW~vl*d1-@5za zzt2+UzN3R-{dYX*!yRrsrXdo`@AW}xAA#bEfW7JNl7~@Q?a^)795=~`2MimpOh$vW zs@uA_`!+;rZ;t0)io@xY$4)X`0C6NjH#^LYDytwQ|2I`2sV3No&jT+_zO)B2!%$Eq z48_w3CV6L?!X(wetR0zcJ^JR;;$%hk`hyAJ@s;-tj3D>(t2`My>)tnpQs=D;!@$J+ zM|9MB&*jC?$`S{x1;-WMMZrpO#kbAmxe0fwJf?%81kbgj#SrLLhQVJtBzK3oaVTEc?8k zFH8>|)VdS>#z>G|2olN=-K(ls0=t^YZPtW{obPf7Vhzt+jYV6D>s6}W-AmBsZ^QIA zhg>Ea)WcSX`Yu_s&9L%G7n|7JG*|8F*}U64?yxH6MLNM+{z`^*v}UKC*lcq_ax!D- zw>M|YeA|z7i@X6Sg33 z2o2DullyehzGFtw`g|j*0iiGYGu z37|2jUfj}x$*#1I^8EOXJFEv?yHtW}e zONhX&U0fMfpRW)si^Y-HacfaQA0sIGzQhauk_$K1Z36aTdg z8LV;05r+#*D4q{w^A-d~tDJ62%%L3CNX`i{0SUm%Am@fEcBhk%i_PA!NLV|?@yUtG zXBO=L*<>NX0D?ftzbIvnDv#gESzZ0fmncD9neFWp?xpUaF?hJAi?@%8*@4%D4vMFb zGutHAjJJAw)iCpb_Or5XVE?MocS^2pNU-^oR|Nmq{q{)lDvA0XS0?CMrp49M96}3F zB$R97F34ssTU15!;oUqoF2CYMr~Y}Kmg(LR6NxTEjmy+Y*%L>(8(!lhgj><-06*S8 z8-?MySEI9I9w+$F%s8|VP%T6pz+JNLIywGic$#%W-=5-vys%l&;~bj7ef+WF`Z2|5 z6wC8d2Ql`?j(e$^Uy*AXQma%sl_@D(6sl8Ye4U%52^qBy6Q`L0Kx_5ljCRfJZktE; zah=Hv6pBQy9ce8?c{~jlw9=68?7|KR2pqdxos<(Iinbd%mq;itq?^ZzA$m(k)-%2p zy?E7im3t*aQePk#$oad}j8==P=AD>4??_!UM&Cob^AX&qH5-1iwzzVtncTnHdov#n zrApvm&P-${(ftF~$-i-kefm10Ut1C5rZY5(TIm@7i8MB*Ado`8CP+c>aU46R9$ehO zB7R}NV(=>u{_$MEHg1M@hIrjCKL`_+K#;SAp&WHy=mbVfAWGE?Eqm$HzrUAD3ePkG zYzv#){kUb30)rrKn_n|W-1ceXRN!Y&7B~a@h5grKV3P-&+1o^JTejCY0i?xh+VHYf zKy8#@$4Q|7$1P!95VQ7x@##-$X^hSSlp~IiM{_WdU>@l& zDu6W~@h71Ufs=Dgcmb%NLeS5YM`=T-?g7gB>sbl822cv}Hy^O201<%n%S7 zUU4X#3IqFv7t!q_tX21f?=!0$7x-#z#wHuWX_hxVNcX<&+T;glge!0?tFY%GOm7fJ zRGkr4>lTLBU$2Q=5zQ$JRY@mj5$S*8*(wWD`$izi(O5&Ysc8;v=`hFAuGdDSY$<@B zLsbpaQEYsKFu)7j!O?K)4p^FTLE!p{gubl^ktzR;7Q@=SwZgli3!BSfASCrw?N~ye zcZok}Y^NC$wyu*Ms3O0X7oW3_t6RxPC!z_Z6vWc@f4&G|2)|d=+bXtBY$8f>jFLXACF;p*O4N5h6_Ld3?}Ev&UO zQt0(Zq|eiGx>6Rh(j`P6?k+7M$|Etu#G?naUCKI#Iz0i;l6kvCm2nrZ{5-kv?2L|g zBWtG(gZ*5-XQXlizXVQUb#**nQeNiS{E*@A{QO@#qvwuZn}LSrTHFzV*I%MLE=S{r zx{Mm^604mKa1-5Bh+?cV;fg+AypA{=2zscmywWmo1Jl#4lw%vB-5GAMr$U*I-$xOYH!CpS;3YnxqN z%SlYhoZfe=IR$0sykI1_I2Gj9SJ(ri;gGae;uIbZ4FX1%S`MX zA4PuYuja+`3Bc$mYM~8#DD#MvmDeIK02dNR+-R>{*Mwo7EzvZYzu#bI$Ahz2vMXyI zBY_U2gImCx@T0eB{pS)0!Sd-r?Spz&P(wEL)sJJdnoyaE9w}K_P{qi>CF?NWY$eUXpyeQg(wrq4x=nZQ)a@VAACVBGGkreoF4-YSUS@thmX0m5hK8 zMVGSjQQAqghhZf$g)vLh*1J)5kI^*uRoQ{58n&ru=wdu)gaucZ1J?sYRhe+tl{)%c z<`JotP3>==_UVS6cN@AEDHuMs;3xyfyg={&X~=;}v_`iGZwM_z{Q>(=pw$>U5 z3czJv90#U=_ggrN{}9*!ZU0%I^jF|E)v3UcqN#Ovgi>Q-*li!=UFm3G-o9Ib&BTLb zu)`+2MvvGCO>|_o^@FtKPrdCfetw;uXqeg$d;^>CPt_=7 c*lHxz=)$3;H}2uA|2BYQMyCw(4V4a7SpBLDyZ literal 0 HcmV?d00001 diff --git a/app_ipc_monitoring/src/main/res/drawable/btn_bg.xml b/app_ipc_monitoring/src/main/res/drawable/btn_bg.xml new file mode 100644 index 0000000000..ba61bf76b4 --- /dev/null +++ b/app_ipc_monitoring/src/main/res/drawable/btn_bg.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app_ipc_monitoring/src/main/res/drawable/ic_border_green.xml b/app_ipc_monitoring/src/main/res/drawable/ic_border_green.xml new file mode 100644 index 0000000000..9646ed9e7c --- /dev/null +++ b/app_ipc_monitoring/src/main/res/drawable/ic_border_green.xml @@ -0,0 +1,9 @@ + + + diff --git a/app_ipc_monitoring/src/main/res/drawable/ic_border_red.xml b/app_ipc_monitoring/src/main/res/drawable/ic_border_red.xml new file mode 100644 index 0000000000..6733c29059 --- /dev/null +++ b/app_ipc_monitoring/src/main/res/drawable/ic_border_red.xml @@ -0,0 +1,9 @@ + + + diff --git a/app_ipc_monitoring/src/main/res/drawable/ic_border_yellow.xml b/app_ipc_monitoring/src/main/res/drawable/ic_border_yellow.xml new file mode 100644 index 0000000000..d5cc348db9 --- /dev/null +++ b/app_ipc_monitoring/src/main/res/drawable/ic_border_yellow.xml @@ -0,0 +1,9 @@ + + + diff --git a/app_ipc_monitoring/src/main/res/drawable/icon.xml b/app_ipc_monitoring/src/main/res/drawable/icon.xml new file mode 100644 index 0000000000..0e2c205a40 --- /dev/null +++ b/app_ipc_monitoring/src/main/res/drawable/icon.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_ipc_monitoring/src/main/res/drawable/item_bg.xml b/app_ipc_monitoring/src/main/res/drawable/item_bg.xml new file mode 100644 index 0000000000..3476874a12 --- /dev/null +++ b/app_ipc_monitoring/src/main/res/drawable/item_bg.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app_ipc_monitoring/src/main/res/drawable/item_text_color.xml b/app_ipc_monitoring/src/main/res/drawable/item_text_color.xml new file mode 100644 index 0000000000..4b611429b1 --- /dev/null +++ b/app_ipc_monitoring/src/main/res/drawable/item_text_color.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/app_ipc_monitoring/src/main/res/layout/activity_autopilot_cloud_config.xml b/app_ipc_monitoring/src/main/res/layout/activity_autopilot_cloud_config.xml new file mode 100644 index 0000000000..131a197495 --- /dev/null +++ b/app_ipc_monitoring/src/main/res/layout/activity_autopilot_cloud_config.xml @@ -0,0 +1,529 @@ + + + + + +