diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..0c0c338 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..639c779 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b2c751a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/.idea/.gitignore b/app/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/app/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/app/.idea/gradle.xml b/app/.idea/gradle.xml new file mode 100644 index 0000000..89935b5 --- /dev/null +++ b/app/.idea/gradle.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/.idea/migrations.xml b/app/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/app/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/app/.idea/misc.xml b/app/.idea/misc.xml new file mode 100644 index 0000000..3040d03 --- /dev/null +++ b/app/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..bcba049 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,65 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.removemarineanimals' + compileSdk 34 + + defaultConfig { + applicationId "com.example.removemarineanimals" + minSdk 24 + targetSdk 34 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + // ✅ 这里统一配置 binding 功能 + buildFeatures { + viewBinding true + dataBinding true + buildConfig true + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + // AndroidX 基础 + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.9.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + + // 测试 + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + + // 第三方依赖 + implementation 'com.github.mik3y:usb-serial-for-android:3.7.0' + implementation 'com.google.protobuf:protobuf-java:4.27.2' + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20") + implementation 'com.github.nodemedia:nodemediaclient-android:2.9.20' + implementation 'io.github.xmaihh:serialport:2.1.1' + // implementation 'com.arthenica:ffmpeg-kit-full:6.0-2' + + // ✅ Room 数据库 + def room_version = "2.6.1" + implementation "androidx.room:room-runtime:$room_version" + annotationProcessor "androidx.room:room-compiler:$room_version" + // 如果以后用 Kotlin + kapt, 改成 kapt + // kapt "androidx.room:room-compiler:$room_version" + implementation "androidx.room:room-ktx:$room_version" // 可选,支持协程/LiveData +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/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 \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/removemarineanimals/AppDatabase.java b/app/src/androidTest/java/com/example/removemarineanimals/AppDatabase.java new file mode 100644 index 0000000..b6c7326 --- /dev/null +++ b/app/src/androidTest/java/com/example/removemarineanimals/AppDatabase.java @@ -0,0 +1,29 @@ +package com.example.removemarineanimals; + +import android.content.Context; + +import androidx.room.Database; +import androidx.room.Room; +import androidx.room.RoomDatabase; + +@Database(entities = {RobotLog.class}, version = 1) +public abstract class AppDatabase extends RoomDatabase { + + public abstract RobotLogDao robotLogDao(); + + private static volatile AppDatabase INSTANCE; + + public static AppDatabase getInstance(Context context) { + if (INSTANCE == null) { + synchronized (AppDatabase.class) { + if (INSTANCE == null) { + INSTANCE = Room.databaseBuilder(context.getApplicationContext(), + AppDatabase.class, "robot_logs.db") + .fallbackToDestructiveMigration() // 数据库升级时清空数据,可根据需求改 + .build(); + } + } + } + return INSTANCE; + } +} diff --git a/app/src/androidTest/java/com/example/removemarineanimals/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/example/removemarineanimals/ExampleInstrumentedTest.java new file mode 100644 index 0000000..6a26675 --- /dev/null +++ b/app/src/androidTest/java/com/example/removemarineanimals/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.removemarineanimals; + +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.example.removemarineanimals", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/removemarineanimals/RobotLog.java b/app/src/androidTest/java/com/example/removemarineanimals/RobotLog.java new file mode 100644 index 0000000..c0bf6dd --- /dev/null +++ b/app/src/androidTest/java/com/example/removemarineanimals/RobotLog.java @@ -0,0 +1,20 @@ +package com.example.removemarineanimals; + +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +@Entity(tableName = "robot_logs") +public class RobotLog { + @PrimaryKey(autoGenerate = true) + public int id; + + @ColumnInfo(name = "type") // "error" 或 "param_change" + public String type; + + @ColumnInfo(name = "message") // 具体信息:报错内容或修改了哪个参数 + public String message; + + @ColumnInfo(name = "time") // 时间戳 + public long time; +} diff --git a/app/src/androidTest/java/com/example/removemarineanimals/RobotLogDao.java b/app/src/androidTest/java/com/example/removemarineanimals/RobotLogDao.java new file mode 100644 index 0000000..6544647 --- /dev/null +++ b/app/src/androidTest/java/com/example/removemarineanimals/RobotLogDao.java @@ -0,0 +1,17 @@ +package com.example.removemarineanimals; + +import androidx.room.Dao; +import androidx.room.Insert; +import androidx.room.Query; + +import java.util.List; + +@Dao +public interface RobotLogDao { + + @Insert + void insert(RobotLog log); + + @Query("SELECT * FROM robot_logs ORDER BY time DESC") + List getAllLogs(); +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9855f77 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/assets/iconfront/demo.css b/app/src/main/assets/iconfront/demo.css new file mode 100644 index 0000000..a67054a --- /dev/null +++ b/app/src/main/assets/iconfront/demo.css @@ -0,0 +1,539 @@ +/* Logo 字体 */ +@font-face { + font-family: "iconfont logo"; + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); + src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), + url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); +} + +.logo { + font-family: "iconfont logo"; + font-size: 160px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +/* tabs */ +.nav-tabs { + position: relative; +} + +.nav-tabs .nav-more { + position: absolute; + right: 0; + bottom: 0; + height: 42px; + line-height: 42px; + color: #666; +} + +#tabs { + border-bottom: 1px solid #eee; +} + +#tabs li { + cursor: pointer; + width: 100px; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 16px; + border-bottom: 2px solid transparent; + position: relative; + z-index: 1; + margin-bottom: -1px; + color: #666; +} + + +#tabs .active { + border-bottom-color: #f00; + color: #222; +} + +.tab-container .content { + display: none; +} + +/* 页面布局 */ +.main { + padding: 30px 100px; + width: 960px; + margin: 0 auto; +} + +.main .logo { + color: #333; + text-align: left; + margin-bottom: 30px; + line-height: 1; + height: 110px; + margin-top: -50px; + overflow: hidden; + *zoom: 1; +} + +.main .logo a { + font-size: 160px; + color: #333; +} + +.helps { + margin-top: 40px; +} + +.helps pre { + padding: 20px; + margin: 10px 0; + border: solid 1px #e7e1cd; + background-color: #fffdef; + overflow: auto; +} + +.icon_lists { + width: 100% !important; + overflow: hidden; + *zoom: 1; +} + +.icon_lists li { + width: 100px; + margin-bottom: 10px; + margin-right: 20px; + text-align: center; + list-style: none !important; + cursor: default; +} + +.icon_lists li .code-name { + line-height: 1.2; +} + +.icon_lists .icon { + display: block; + height: 100px; + line-height: 100px; + font-size: 42px; + margin: 10px auto; + color: #333; + -webkit-transition: font-size 0.25s linear, width 0.25s linear; + -moz-transition: font-size 0.25s linear, width 0.25s linear; + transition: font-size 0.25s linear, width 0.25s linear; +} + +.icon_lists .icon:hover { + font-size: 100px; +} + +.icon_lists .svg-icon { + /* 通过设置 font-size 来改变图标大小 */ + width: 1em; + /* 图标和文字相邻时,垂直对齐 */ + vertical-align: -0.15em; + /* 通过设置 color 来改变 SVG 的颜色/fill */ + fill: currentColor; + /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 + normalize.css 中也包含这行 */ + overflow: hidden; +} + +.icon_lists li .name, +.icon_lists li .code-name { + color: #666; +} + +/* markdown 样式 */ +.markdown { + color: #666; + font-size: 14px; + line-height: 1.8; +} + +.highlight { + line-height: 1.5; +} + +.markdown img { + vertical-align: middle; + max-width: 100%; +} + +.markdown h1 { + color: #404040; + font-weight: 500; + line-height: 40px; + margin-bottom: 24px; +} + +.markdown h2, +.markdown h3, +.markdown h4, +.markdown h5, +.markdown h6 { + color: #404040; + margin: 1.6em 0 0.6em 0; + font-weight: 500; + clear: both; +} + +.markdown h1 { + font-size: 28px; +} + +.markdown h2 { + font-size: 22px; +} + +.markdown h3 { + font-size: 16px; +} + +.markdown h4 { + font-size: 14px; +} + +.markdown h5 { + font-size: 12px; +} + +.markdown h6 { + font-size: 12px; +} + +.markdown hr { + height: 1px; + border: 0; + background: #e9e9e9; + margin: 16px 0; + clear: both; +} + +.markdown p { + margin: 1em 0; +} + +.markdown>p, +.markdown>blockquote, +.markdown>.highlight, +.markdown>ol, +.markdown>ul { + width: 80%; +} + +.markdown ul>li { + list-style: circle; +} + +.markdown>ul li, +.markdown blockquote ul>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown>ul li p, +.markdown>ol li p { + margin: 0.6em 0; +} + +.markdown ol>li { + list-style: decimal; +} + +.markdown>ol li, +.markdown blockquote ol>li { + margin-left: 20px; + padding-left: 4px; +} + +.markdown code { + margin: 0 3px; + padding: 0 5px; + background: #eee; + border-radius: 3px; +} + +.markdown strong, +.markdown b { + font-weight: 600; +} + +.markdown>table { + border-collapse: collapse; + border-spacing: 0px; + empty-cells: show; + border: 1px solid #e9e9e9; + width: 95%; + margin-bottom: 24px; +} + +.markdown>table th { + white-space: nowrap; + color: #333; + font-weight: 600; +} + +.markdown>table th, +.markdown>table td { + border: 1px solid #e9e9e9; + padding: 8px 16px; + text-align: left; +} + +.markdown>table th { + background: #F7F7F7; +} + +.markdown blockquote { + font-size: 90%; + color: #999; + border-left: 4px solid #e9e9e9; + padding-left: 0.8em; + margin: 1em 0; +} + +.markdown blockquote p { + margin: 0; +} + +.markdown .anchor { + opacity: 0; + transition: opacity 0.3s ease; + margin-left: 8px; +} + +.markdown .waiting { + color: #ccc; +} + +.markdown h1:hover .anchor, +.markdown h2:hover .anchor, +.markdown h3:hover .anchor, +.markdown h4:hover .anchor, +.markdown h5:hover .anchor, +.markdown h6:hover .anchor { + opacity: 1; + display: inline-block; +} + +.markdown>br, +.markdown>p>br { + clear: both; +} + + +.hljs { + display: block; + background: white; + padding: 0.5em; + color: #333333; + overflow-x: auto; +} + +.hljs-comment, +.hljs-meta { + color: #969896; +} + +.hljs-string, +.hljs-variable, +.hljs-template-variable, +.hljs-strong, +.hljs-emphasis, +.hljs-quote { + color: #df5000; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-type { + color: #a71d5d; +} + +.hljs-literal, +.hljs-symbol, +.hljs-bullet, +.hljs-attribute { + color: #0086b3; +} + +.hljs-section, +.hljs-name { + color: #63a35c; +} + +.hljs-tag { + color: #333333; +} + +.hljs-title, +.hljs-attr, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #795da3; +} + +.hljs-addition { + color: #55a532; + background-color: #eaffea; +} + +.hljs-deletion { + color: #bd2c00; + background-color: #ffecec; +} + +.hljs-link { + text-decoration: underline; +} + +/* 代码高亮 */ +/* PrismJS 1.15.0 +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre)>code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre)>code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #9a6e3a; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function, +.token.class-name { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} + +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} diff --git a/app/src/main/assets/iconfront/demo_index.html b/app/src/main/assets/iconfront/demo_index.html new file mode 100644 index 0000000..2347919 --- /dev/null +++ b/app/src/main/assets/iconfront/demo_index.html @@ -0,0 +1,4236 @@ + + + + + iconfont Demo + + + + + + + + + + + + + +
+

+ + +

+ +
+
+
    + +
  • + +
    answer
    +
    
    +
  • + +
  • + +
    app
    +
    
    +
  • + +
  • + +
    browser
    +
    
    +
  • + +
  • + +
    camera
    +
    
    +
  • + +
  • + +
    cart
    +
    
    +
  • + +
  • + +
    check
    +
    
    +
  • + +
  • + +
    code
    +
    
    +
  • + +
  • + +
    computer
    +
    
    +
  • + +
  • + +
    delete
    +
    
    +
  • + +
  • + +
    deliver
    +
    
    +
  • + +
  • + +
    display
    +
    
    +
  • + +
  • + +
    down
    +
    
    +
  • + +
  • + +
    download
    +
    
    +
  • + +
  • + +
    edit
    +
    
    +
  • + +
  • + +
    favor
    +
    
    +
  • + +
  • + +
    file
    +
    
    +
  • + +
  • + +
    fill
    +
    
    +
  • + +
  • + +
    fold
    +
    
    +
  • + +
  • + +
    folder
    +
    
    +
  • + +
  • + +
    hide
    +
    
    +
  • + +
  • + +
    home
    +
    
    +
  • + +
  • + +
    information
    +
    
    +
  • + +
  • + +
    link
    +
    
    +
  • + +
  • + +
    报警
    +
    
    +
  • + +
  • + +
    任务
    +
    
    +
  • + +
  • + +
    用户
    +
    
    +
  • + +
  • + +
    详情
    +
    
    +
  • + +
  • + +
    柱状图
    +
    
    +
  • + +
  • + +
    授信管理
    +
    
    +
  • + +
  • + +
    服务器
    +
    
    +
  • + +
  • + +
    任务
    +
    
    +
  • + +
  • + +
    物品箱
    +
    
    +
  • + +
  • + +
    详情
    +
    
    +
  • + +
  • + +
    折线图
    +
    
    +
  • + +
  • + +
    结构
    +
    
    +
  • + +
  • + +
    工作台
    +
    
    +
  • + +
  • + +
    设置
    +
    
    +
  • + +
  • + +
    产品
    +
    
    +
  • + +
  • + +
    流程
    +
    
    +
  • + +
  • + +
    用户
    +
    
    +
  • + +
  • + +
    借款申请
    +
    
    +
  • + +
  • + +
    最大化
    +
    
    +
  • + +
  • + +
    密码
    +
    
    +
  • + +
  • + +
    密码
    +
    
    +
  • + +
  • + +
    最大化
    +
    
    +
  • + +
  • + +
    密码
    +
    
    +
  • + +
  • + +
    关闭
    +
    
    +
  • + +
  • + +
    密码
    +
    
    +
  • + +
  • + +
    最小化
    +
    
    +
  • + +
  • + +
    304错误、关闭、取消
    +
    
    +
  • + +
  • + +
    关闭
    +
    
    +
  • + +
  • + +
    关闭
    +
    
    +
  • + +
  • + +
    关闭
    +
    
    +
  • + +
  • + +
    密码
    +
    
    +
  • + +
  • + +
    关闭
    +
    
    +
  • + +
  • + +
    关闭
    +
    
    +
  • + +
  • + +
    密码
    +
    
    +
  • + +
  • + +
    最小化
    +
    
    +
  • + +
  • + +
    关闭
    +
    
    +
  • + +
  • + +
    退出
    +
    
    +
  • + +
  • + +
    退出
    +
    
    +
  • + +
  • + +
    退出
    +
    
    +
  • + +
  • + +
    配置管理
    +
    
    +
  • + +
  • + +
    测试,实验
    +
    
    +
  • + +
  • + +
    任务管理
    +
    
    +
  • + +
  • + +
    智能科技-icon-柔性自动化线
    +
    
    +
  • + +
  • + +
    agora_面向用例的解决方案
    +
    
    +
  • + +
  • + +
    配置-运维配置
    +
    
    +
  • + +
  • + +
    任务管理
    +
    
    +
  • + +
  • + +
    编辑
    +
    
    +
  • + +
  • + +
    车型
    +
    
    +
  • + +
  • + +
    任务管理
    +
    
    +
  • + +
  • + +
    产品压力测试
    +
    
    +
  • + +
  • + +
    2-1配置管理
    +
    
    +
  • + +
  • + +
    小胖车查车型
    +
    
    +
  • + +
  • + +
    自动化
    +
    
    +
  • + +
  • + +
    供应商管理
    +
    
    +
  • + +
  • + +
    任务 管理
    +
    
    +
  • + +
  • + +
    供应商管理
    +
    
    +
  • + +
  • + +
    供应商管理
    +
    
    +
  • + +
  • + +
    任务管理
    +
    
    +
  • + +
  • + +
    节点事 件测试
    +
    
    +
  • + +
  • + +
    日志管理
    +
    
    +
  • + +
  • + +
    系统日志
    +
    
    +
  • + +
  • + +
    网络
    +
    
    +
  • + +
  • + +
    网络自动化
    +
    
    +
  • + +
  • + +
    任务管理
    +
    
    +
  • + +
  • + +
    车型-线性3-0
    +
    
    +
  • + +
  • + +
    任务管理
    +
    
    +
  • + +
  • + +
    工业自动化
    +
    
    +
  • + +
  • + +
    iServer数据接入测试
    +
    
    +
  • + +
  • + +
    倾斜入库测试
    +
    
    +
  • + +
  • + +
    任务管理
    +
    
    +
  • + +
  • + +
    供应商管理
    +
    
    +
  • + +
  • + +
    配置管理
    +
    
    +
  • + +
  • + +
    车型管理
    +
    
    +
  • + +
  • + +
    网段
    +
    
    +
  • + +
  • + +
    部门管理
    +
    
    +
  • + +
  • + +
    配置管理
    +
    
    +
  • + +
  • + +
    配置管理
    +
    
    +
  • + +
  • + +
    自动化运维
    +
    
    +
  • + +
  • + +
    文件夹、文件
    +
    
    +
  • + +
  • + +
    文本
    +
    
    +
  • + +
  • + +
    文本编辑_填充
    +
    
    +
  • + +
  • + +
    日志管理
    +
    
    +
  • + +
  • + +
    编辑
    +
    
    +
  • + +
  • + +
    测试辅助
    +
    
    +
  • + +
  • + +
    回归测试
    +
    
    +
  • + +
  • + +
    用户
    +
    
    +
  • + +
  • + +
    测试
    +
    
    +
  • + +
  • + +
    供应商管理
    +
    
    +
  • + +
  • + +
    部门管理
    +
    
    +
  • + +
  • + +
    提交日志
    +
    
    +
  • + +
  • + +
    编辑
    +
    
    +
  • + +
  • + +
    编辑
    +
    
    +
  • + +
  • + +
    网络
    +
    
    +
  • + +
  • + +
    配置
    +
    
    +
  • + +
  • + +
    供应商管理
    +
    
    +
  • + +
  • + +
    文件
    +
    
    +
  • + +
  • + +
    任务管理
    +
    
    +
  • + +
  • + +
    素材
    +
    
    +
  • + +
  • + +
    日志管理
    +
    
    +
  • + +
  • + +
    测试用例集
    +
    
    +
  • + +
  • + +
    测试用例子集
    +
    
    +
  • + +
  • + +
    测试用例库
    +
    
    +
  • + +
  • + +
    文件
    +
    
    +
  • + +
  • + +
    销售自动化
    +
    
    +
  • + +
  • + +
    生产自动化
    +
    
    +
  • + +
  • + +
    部门管理
    +
    
    +
  • + +
  • + +
    文件
    +
    
    +
  • + +
  • + +
    文件
    +
    
    +
  • + +
  • + +
    部门
    +
    
    +
  • + +
  • + +
    文件夹
    +
    
    +
  • + +
  • + +
    自动化运维-1
    +
    
    +
  • + +
  • + +
    自动化运维
    +
    
    +
  • + +
  • + +
    品质检测
    +
    
    +
  • + +
  • + +
    部门
    +
    
    +
  • + +
  • + +
    供应商管理
    +
    
    +
  • + +
  • + +
    编辑
    +
    
    +
  • + +
  • + +
    编辑
    +
    
    +
  • + +
  • + +
    部门管理
    +
    
    +
  • + +
  • + +
    监控,测试
    +
    
    +
  • + +
  • + +
    文件-文件夹
    +
    
    +
  • + +
  • + +
    部门
    +
    
    +
  • + +
  • + +
    日志
    +
    
    +
  • + +
  • + +
    配置
    +
    
    +
  • + +
  • + +
    操作日志
    +
    
    +
  • + +
  • + +
    测试工具
    +
    
    +
  • + +
  • + +
    24gl-portraitMalePlus4
    +
    
    +
  • + +
  • + +
    24gl-portraitMalePlus6
    +
    
    +
  • + +
  • + +
    配置/设置
    +
    
    +
  • + +
  • + +
    配置:设置
    +
    
    +
  • + +
  • + +
    配置
    +
    
    +
  • + +
  • + +
    用户
    +
    
    +
  • + +
  • + +
    财务自动化配置
    +
    
    +
  • + +
  • + +
    HTSCIT_文件
    +
    
    +
  • + +
  • + +
    系统日志
    +
    
    +
  • + +
  • + +
    文件
    +
    
    +
  • + +
  • + +
    用户-角色-用户名-单人_jurassic
    +
    
    +
  • + +
  • + +
    供应商管理_ico@2x
    +
    
    +
  • + +
  • + +
    自动化处理_line
    +
    
    +
  • + +
  • + +
    自动化处理_fill
    +
    
    +
  • + +
  • + +
    配置信息
    +
    
    +
  • + +
  • + +
    27营销自动化
    +
    
    +
  • + +
  • + +
    配置2
    +
    
    +
  • + +
  • + +
    电气自动化
    +
    
    +
  • + +
  • + +
    任务管理
    +
    
    +
  • + +
  • + +
    财务自动化配置
    +
    
    +
  • + +
  • + +
    自动化测试
    +
    
    +
  • + +
  • + +
    测试用例
    +
    
    +
  • + +
  • + +
    测试报告
    +
    
    +
  • + +
  • + +
    测试历史版本
    +
    
    +
  • + +
  • + +
    节点配置
    +
    
    +
  • + +
  • + +
    楼宇自动化
    +
    
    +
  • + +
  • + +
    任务管理
    +
    
    +
  • + +
  • + +
    测试
    +
    
    +
  • + +
+
+

Unicode 引用

+
+ +

Unicode 是字体在网页端最原始的应用方式,特点是:

+
    +
  • 支持按字体的方式去动态调整图标大小,颜色等等。
  • +
  • 默认情况下不支持多色,直接添加多色图标会自动去色。
  • +
+
+

注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)

+
+

Unicode 使用步骤如下:

+

第一步:拷贝项目下面生成的 @font-face

+
@font-face {
+  font-family: 'iconfont';
+  src: url('iconfont.woff2?t=1719904676087') format('woff2'),
+       url('iconfont.woff?t=1719904676087') format('woff'),
+       url('iconfont.ttf?t=1719904676087') format('truetype');
+}
+
+

第二步:定义使用 iconfont 的样式

+
.iconfont {
+  font-family: "iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+

第三步:挑选相应图标并获取字体编码,应用于页面

+
+<span class="iconfont">&#x33;</span>
+
+
+

"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

+
+
+
+
+
    + +
  • + +
    + answer +
    +
    .icon-answer +
    +
  • + +
  • + +
    + app +
    +
    .icon-app +
    +
  • + +
  • + +
    + browser +
    +
    .icon-browser +
    +
  • + +
  • + +
    + camera +
    +
    .icon-camera +
    +
  • + +
  • + +
    + cart +
    +
    .icon-cart +
    +
  • + +
  • + +
    + check +
    +
    .icon-check +
    +
  • + +
  • + +
    + code +
    +
    .icon-code +
    +
  • + +
  • + +
    + computer +
    +
    .icon-computer +
    +
  • + +
  • + +
    + delete +
    +
    .icon-delete +
    +
  • + +
  • + +
    + deliver +
    +
    .icon-deliver +
    +
  • + +
  • + +
    + display +
    +
    .icon-display +
    +
  • + +
  • + +
    + down +
    +
    .icon-down +
    +
  • + +
  • + +
    + download +
    +
    .icon-download +
    +
  • + +
  • + +
    + edit +
    +
    .icon-edit +
    +
  • + +
  • + +
    + favor +
    +
    .icon-favor +
    +
  • + +
  • + +
    + file +
    +
    .icon-file +
    +
  • + +
  • + +
    + fill +
    +
    .icon-fill +
    +
  • + +
  • + +
    + fold +
    +
    .icon-fold +
    +
  • + +
  • + +
    + folder +
    +
    .icon-folder +
    +
  • + +
  • + +
    + hide +
    +
    .icon-hide +
    +
  • + +
  • + +
    + home +
    +
    .icon-home +
    +
  • + +
  • + +
    + information +
    +
    .icon-information +
    +
  • + +
  • + +
    + link +
    +
    .icon-link +
    +
  • + +
  • + +
    + 报警 +
    +
    .icon-baojing +
    +
  • + +
  • + +
    + 任务 +
    +
    .icon-renwu +
    +
  • + +
  • + +
    + 用户 +
    +
    .icon-yonghu2 +
    +
  • + +
  • + +
    + 详情 +
    +
    .icon-xiangqing +
    +
  • + +
  • + +
    + 柱状图 +
    +
    .icon-zhuzhuangtu +
    +
  • + +
  • + +
    + 授信管理 +
    +
    .icon-shouxinguanli +
    +
  • + +
  • + +
    + 服务器 +
    +
    .icon-fuwuqi +
    +
  • + +
  • + +
    + 任务 +
    +
    .icon-renwu1 +
    +
  • + +
  • + +
    + 物品箱 +
    +
    .icon-wupinxiang +
    +
  • + +
  • + +
    + 详情 +
    +
    .icon-xiangqing1 +
    +
  • + +
  • + +
    + 折线图 +
    +
    .icon-zhexiantu +
    +
  • + +
  • + +
    + 结构 +
    +
    .icon-jiegou +
    +
  • + +
  • + +
    + 工作台 +
    +
    .icon-gongzuotai +
    +
  • + +
  • + +
    + 设置 +
    +
    .icon-shezhi1 +
    +
  • + +
  • + +
    + 产品 +
    +
    .icon-chanpin +
    +
  • + +
  • + +
    + 流程 +
    +
    .icon-liucheng +
    +
  • + +
  • + +
    + 用户 +
    +
    .icon-yonghu3 +
    +
  • + +
  • + +
    + 借款申请 +
    +
    .icon-jiekuanshenqing +
    +
  • + +
  • + +
    + 最大化 +
    +
    .icon-zuidahua +
    +
  • + +
  • + +
    + 密码 +
    +
    .icon-mima +
    +
  • + +
  • + +
    + 密码 +
    +
    .icon-mima1 +
    +
  • + +
  • + +
    + 最大化 +
    +
    .icon-zuidahua1 +
    +
  • + +
  • + +
    + 密码 +
    +
    .icon-mima2 +
    +
  • + +
  • + +
    + 关闭 +
    +
    .icon-guanbi +
    +
  • + +
  • + +
    + 密码 +
    +
    .icon-mima3 +
    +
  • + +
  • + +
    + 最小化 +
    +
    .icon-zuixiaohua +
    +
  • + +
  • + +
    + 304错误、关闭、取消 +
    +
    .icon-cuowuguanbiquxiao +
    +
  • + +
  • + +
    + 关闭 +
    +
    .icon-guanbi1 +
    +
  • + +
  • + +
    + 关闭 +
    +
    .icon-guanbi2 +
    +
  • + +
  • + +
    + 关闭 +
    +
    .icon-guanbi3 +
    +
  • + +
  • + +
    + 密码 +
    +
    .icon-mima4 +
    +
  • + +
  • + +
    + 关闭 +
    +
    .icon-guanbi4 +
    +
  • + +
  • + +
    + 关闭 +
    +
    .icon-guanbi5 +
    +
  • + +
  • + +
    + 密码 +
    +
    .icon-mima5 +
    +
  • + +
  • + +
    + 最小化 +
    +
    .icon-zuixiaohua1 +
    +
  • + +
  • + +
    + 关闭 +
    +
    .icon-guanbi6 +
    +
  • + +
  • + +
    + 退出 +
    +
    .icon-tuichu +
    +
  • + +
  • + +
    + 退出 +
    +
    .icon-tuichu1 +
    +
  • + +
  • + +
    + 退出 +
    +
    .icon-tuichu2 +
    +
  • + +
  • + +
    + 配置管理 +
    +
    .icon-configuration-management +
    +
  • + +
  • + +
    + 测试,实验 +
    +
    .icon-ziyuan120 +
    +
  • + +
  • + +
    + 任务管理 +
    +
    .icon-renwuguanli3 +
    +
  • + +
  • + +
    + 智能科技-icon-柔性自动化线 +
    +
    .icon-zhinengkeji-icon-8 +
    +
  • + +
  • + +
    + agora_面向用例的解决方案 +
    +
    .icon-agora_mianxiangyonglidejiejuefangan +
    +
  • + +
  • + +
    + 配置-运维配置 +
    +
    .icon-peizhi-yunweipeizhi +
    +
  • + +
  • + +
    + 任务管理 +
    +
    .icon-renwuguanli4 +
    +
  • + +
  • + +
    + 编辑 +
    +
    .icon-bianji5 +
    +
  • + +
  • + +
    + 车型 +
    +
    .icon-chexing +
    +
  • + +
  • + +
    + 任务管理 +
    +
    .icon-renwuguanli5 +
    +
  • + +
  • + +
    + 产品压力测试 +
    +
    .icon-chanpinyaliceshi +
    +
  • + +
  • + +
    + 2-1配置管理 +
    +
    .icon-2-1peizhiguanli +
    +
  • + +
  • + +
    + 小胖车查车型 +
    +
    .icon-xiaopangchechachexing +
    +
  • + +
  • + +
    + 自动化 +
    +
    .icon-zidonghua +
    +
  • + +
  • + +
    + 供应商管理 +
    +
    .icon-gongyingshangguanli2 +
    +
  • + +
  • + +
    + 任务 管理 +
    +
    .icon-renwuguanli6 +
    +
  • + +
  • + +
    + 供应商管理 +
    +
    .icon-gongyingshangguanli3 +
    +
  • + +
  • + +
    + 供应商管理 +
    +
    .icon-gongyingshangguanli4 +
    +
  • + +
  • + +
    + 任务管理 +
    +
    .icon-renwuguanli7 +
    +
  • + +
  • + +
    + 节点事 件测试 +
    +
    .icon-jiedianshijianceshi +
    +
  • + +
  • + +
    + 日志管理 +
    +
    .icon-rizhiguanli2 +
    +
  • + +
  • + +
    + 系统日志 +
    +
    .icon-xitongrizhi1 +
    +
  • + +
  • + +
    + 网络 +
    +
    .icon-wangluo1 +
    +
  • + +
  • + +
    + 网络自动化 +
    +
    .icon-wangluozidonghuaguanli +
    +
  • + +
  • + +
    + 任务管理 +
    +
    .icon-renwuguanli8 +
    +
  • + +
  • + +
    + 车型-线性3-0 +
    +
    .icon-chexing-xianxing3-0 +
    +
  • + +
  • + +
    + 任务管理 +
    +
    .icon-renwuguanli9 +
    +
  • + +
  • + +
    + 工业自动化 +
    +
    .icon-gongyezidonghua +
    +
  • + +
  • + +
    + iServer数据接入测试 +
    +
    .icon-iServershujujieruceshi +
    +
  • + +
  • + +
    + 倾斜入库测试 +
    +
    .icon-qingxierukuceshi +
    +
  • + +
  • + +
    + 任务管理 +
    +
    .icon-renwuguanli10 +
    +
  • + +
  • + +
    + 供应商管理 +
    +
    .icon-gongyingshangguanli5 +
    +
  • + +
  • + +
    + 配置管理 +
    +
    .icon-peizhiguanli +
    +
  • + +
  • + +
    + 车型管理 +
    +
    .icon-chexingguanli +
    +
  • + +
  • + +
    + 网段 +
    +
    .icon-a-ziyuan114 +
    +
  • + +
  • + +
    + 部门管理 +
    +
    .icon-bumenguanli2 +
    +
  • + +
  • + +
    + 配置管理 +
    +
    .icon-peizhiguanli1 +
    +
  • + +
  • + +
    + 配置管理 +
    +
    .icon-peizhiguanli2 +
    +
  • + +
  • + +
    + 自动化运维 +
    +
    .icon-a-lianhe79 +
    +
  • + +
  • + +
    + 文件夹、文件 +
    +
    .icon-a-wenjianjiawenjian +
    +
  • + +
  • + +
    + 文本 +
    +
    .icon-wenben +
    +
  • + +
  • + +
    + 文本编辑_填充 +
    +
    .icon-wenbenbianjitianchong +
    +
  • + +
  • + +
    + 日志管理 +
    +
    .icon-rizhiguanli +
    +
  • + +
  • + +
    + 编辑 +
    +
    .icon-bianji +
    +
  • + +
  • + +
    + 测试辅助 +
    +
    .icon-ceshifuzhu +
    +
  • + +
  • + +
    + 回归测试 +
    +
    .icon-huiguiceshi +
    +
  • + +
  • + +
    + 用户 +
    +
    .icon-yonghu +
    +
  • + +
  • + +
    + 测试 +
    +
    .icon-ceshi +
    +
  • + +
  • + +
    + 供应商管理 +
    +
    .icon-icon-supplier +
    +
  • + +
  • + +
    + 部门管理 +
    +
    .icon-suyaniconchanpinleibufenzuodaohangbufen87 +
    +
  • + +
  • + +
    + 提交日志 +
    +
    .icon-tijiaorizhi +
    +
  • + +
  • + +
    + 编辑 +
    +
    .icon-bianji1 +
    +
  • + +
  • + +
    + 编辑 +
    +
    .icon-bianji2 +
    +
  • + +
  • + +
    + 网络 +
    +
    .icon-wangluo +
    +
  • + +
  • + +
    + 配置 +
    +
    .icon-peizhi +
    +
  • + +
  • + +
    + 供应商管理 +
    +
    .icon-gongyingshangguanli +
    +
  • + +
  • + +
    + 文件 +
    +
    .icon-wenjian +
    +
  • + +
  • + +
    + 任务管理 +
    +
    .icon-renwuguanli +
    +
  • + +
  • + +
    + 素材 +
    +
    .icon-sucai +
    +
  • + +
  • + +
    + 日志管理 +
    +
    .icon-rizhiguanli1 +
    +
  • + +
  • + +
    + 测试用例集 +
    +
    .icon-test-case-group +
    +
  • + +
  • + +
    + 测试用例子集 +
    +
    .icon-test-case-secondary +
    +
  • + +
  • + +
    + 测试用例库 +
    +
    .icon-test-case-group2 +
    +
  • + +
  • + +
    + 文件 +
    +
    .icon-wenjian1 +
    +
  • + +
  • + +
    + 销售自动化 +
    +
    .icon-xiaoshouzidonghua +
    +
  • + +
  • + +
    + 生产自动化 +
    +
    .icon-kujialeqiyezhan_shengchanzidonghua +
    +
  • + +
  • + +
    + 部门管理 +
    +
    .icon-bumenguanli +
    +
  • + +
  • + +
    + 文件 +
    +
    .icon-noun__cc +
    +
  • + +
  • + +
    + 文件 +
    +
    .icon-wenjian2 +
    +
  • + +
  • + +
    + 部门 +
    +
    .icon-bumen +
    +
  • + +
  • + +
    + 文件夹 +
    +
    .icon-wenjianjia +
    +
  • + +
  • + +
    + 自动化运维-1 +
    +
    .icon-oper-auto-1 +
    +
  • + +
  • + +
    + 自动化运维 +
    +
    .icon-oper-auto +
    +
  • + +
  • + +
    + 品质检测 +
    +
    .icon-pinzhijiance +
    +
  • + +
  • + +
    + 部门 +
    +
    .icon-bumen1 +
    +
  • + +
  • + +
    + 供应商管理 +
    +
    .icon-gongyingshangguanli1 +
    +
  • + +
  • + +
    + 编辑 +
    +
    .icon-bianji3 +
    +
  • + +
  • + +
    + 编辑 +
    +
    .icon-bianji4 +
    +
  • + +
  • + +
    + 部门管理 +
    +
    .icon-bumenguanli1 +
    +
  • + +
  • + +
    + 监控,测试 +
    +
    .icon-icon- +
    +
  • + +
  • + +
    + 文件-文件夹 +
    +
    .icon-wj-wjj +
    +
  • + +
  • + +
    + 部门 +
    +
    .icon-bumen2 +
    +
  • + +
  • + +
    + 日志 +
    +
    .icon-rizhi +
    +
  • + +
  • + +
    + 配置 +
    +
    .icon-peizhi1 +
    +
  • + +
  • + +
    + 操作日志 +
    +
    .icon-caozuorizhi +
    +
  • + +
  • + +
    + 测试工具 +
    +
    .icon-ceshigongju +
    +
  • + +
  • + +
    + 24gl-portraitMalePlus4 +
    +
    .icon-24gl-portraitMalePlus4 +
    +
  • + +
  • + +
    + 24gl-portraitMalePlus6 +
    +
    .icon-24gl-portraitMalePlus6 +
    +
  • + +
  • + +
    + 配置/设置 +
    +
    .icon-shezhi +
    +
  • + +
  • + +
    + 配置:设置 +
    +
    .icon-peizhishezhi +
    +
  • + +
  • + +
    + 配置 +
    +
    .icon-peizhi2 +
    +
  • + +
  • + +
    + 用户 +
    +
    .icon-yonghu1 +
    +
  • + +
  • + +
    + 财务自动化配置 +
    +
    .icon-caiwuzidonghuapeizhi +
    +
  • + +
  • + +
    + HTSCIT_文件 +
    +
    .icon-wenjian3 +
    +
  • + +
  • + +
    + 系统日志 +
    +
    .icon-xitongrizhi +
    +
  • + +
  • + +
    + 文件 +
    +
    .icon-wenjian4 +
    +
  • + +
  • + +
    + 用户-角色-用户名-单人_jurassic +
    +
    .icon-jurassic_user +
    +
  • + +
  • + +
    + 供应商管理_ico@2x +
    +
    .icon-gongyingshangguanli_icox +
    +
  • + +
  • + +
    + 自动化处理_line +
    +
    .icon-automated-processing_line +
    +
  • + +
  • + +
    + 自动化处理_fill +
    +
    .icon-automated-processing_fill +
    +
  • + +
  • + +
    + 配置信息 +
    +
    .icon-peizhixinxi +
    +
  • + +
  • + +
    + 27营销自动化 +
    +
    .icon-yingxiaozidonghua +
    +
  • + +
  • + +
    + 配置2 +
    +
    .icon-peizhi3 +
    +
  • + +
  • + +
    + 电气自动化 +
    +
    .icon-dianqizidonghua +
    +
  • + +
  • + +
    + 任务管理 +
    +
    .icon-renwuguanli1 +
    +
  • + +
  • + +
    + 财务自动化配置 +
    +
    .icon-caiwuzidonghuapeizhi1 +
    +
  • + +
  • + +
    + 自动化测试 +
    +
    .icon-xinicon_huabanfuben +
    +
  • + +
  • + +
    + 测试用例 +
    +
    .icon-xinicon_huabanfuben1 +
    +
  • + +
  • + +
    + 测试报告 +
    +
    .icon-xinicon_huabanfuben2 +
    +
  • + +
  • + +
    + 测试历史版本 +
    +
    .icon-lishibanben +
    +
  • + +
  • + +
    + 节点配置 +
    +
    .icon-jiedianpeizhi +
    +
  • + +
  • + +
    + 楼宇自动化 +
    +
    .icon-louyuzidonghua +
    +
  • + +
  • + +
    + 任务管理 +
    +
    .icon-renwuguanli2 +
    +
  • + +
  • + +
    + 测试 +
    +
    .icon-ceshi1 +
    +
  • + +
+
+

font-class 引用

+
+ +

font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。

+

与 Unicode 使用方式相比,具有如下特点:

+
    +
  • 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
  • +
  • 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。
  • +
+

使用步骤如下:

+

第一步:引入项目下面生成的 fontclass 代码:

+
<link rel="stylesheet" href="./iconfont.css">
+
+

第二步:挑选相应图标并获取类名,应用于页面:

+
<span class="iconfont icon-xxx"></span>
+
+
+

" + iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

+
+
+
+
+
    + +
  • + +
    answer
    +
    #icon-answer
    +
  • + +
  • + +
    app
    +
    #icon-app
    +
  • + +
  • + +
    browser
    +
    #icon-browser
    +
  • + +
  • + +
    camera
    +
    #icon-camera
    +
  • + +
  • + +
    cart
    +
    #icon-cart
    +
  • + +
  • + +
    check
    +
    #icon-check
    +
  • + +
  • + +
    code
    +
    #icon-code
    +
  • + +
  • + +
    computer
    +
    #icon-computer
    +
  • + +
  • + +
    delete
    +
    #icon-delete
    +
  • + +
  • + +
    deliver
    +
    #icon-deliver
    +
  • + +
  • + +
    display
    +
    #icon-display
    +
  • + +
  • + +
    down
    +
    #icon-down
    +
  • + +
  • + +
    download
    +
    #icon-download
    +
  • + +
  • + +
    edit
    +
    #icon-edit
    +
  • + +
  • + +
    favor
    +
    #icon-favor
    +
  • + +
  • + +
    file
    +
    #icon-file
    +
  • + +
  • + +
    fill
    +
    #icon-fill
    +
  • + +
  • + +
    fold
    +
    #icon-fold
    +
  • + +
  • + +
    folder
    +
    #icon-folder
    +
  • + +
  • + +
    hide
    +
    #icon-hide
    +
  • + +
  • + +
    home
    +
    #icon-home
    +
  • + +
  • + +
    information
    +
    #icon-information
    +
  • + +
  • + +
    link
    +
    #icon-link
    +
  • + +
  • + +
    报警
    +
    #icon-baojing
    +
  • + +
  • + +
    任务
    +
    #icon-renwu
    +
  • + +
  • + +
    用户
    +
    #icon-yonghu2
    +
  • + +
  • + +
    详情
    +
    #icon-xiangqing
    +
  • + +
  • + +
    柱状图
    +
    #icon-zhuzhuangtu
    +
  • + +
  • + +
    授信管理
    +
    #icon-shouxinguanli
    +
  • + +
  • + +
    服务器
    +
    #icon-fuwuqi
    +
  • + +
  • + +
    任务
    +
    #icon-renwu1
    +
  • + +
  • + +
    物品箱
    +
    #icon-wupinxiang
    +
  • + +
  • + +
    详情
    +
    #icon-xiangqing1
    +
  • + +
  • + +
    折线图
    +
    #icon-zhexiantu
    +
  • + +
  • + +
    结构
    +
    #icon-jiegou
    +
  • + +
  • + +
    工作台
    +
    #icon-gongzuotai
    +
  • + +
  • + +
    设置
    +
    #icon-shezhi1
    +
  • + +
  • + +
    产品
    +
    #icon-chanpin
    +
  • + +
  • + +
    流程
    +
    #icon-liucheng
    +
  • + +
  • + +
    用户
    +
    #icon-yonghu3
    +
  • + +
  • + +
    借款申请
    +
    #icon-jiekuanshenqing
    +
  • + +
  • + +
    最大化
    +
    #icon-zuidahua
    +
  • + +
  • + +
    密码
    +
    #icon-mima
    +
  • + +
  • + +
    密码
    +
    #icon-mima1
    +
  • + +
  • + +
    最大化
    +
    #icon-zuidahua1
    +
  • + +
  • + +
    密码
    +
    #icon-mima2
    +
  • + +
  • + +
    关闭
    +
    #icon-guanbi
    +
  • + +
  • + +
    密码
    +
    #icon-mima3
    +
  • + +
  • + +
    最小化
    +
    #icon-zuixiaohua
    +
  • + +
  • + +
    304错误、关闭、取消
    +
    #icon-cuowuguanbiquxiao
    +
  • + +
  • + +
    关闭
    +
    #icon-guanbi1
    +
  • + +
  • + +
    关闭
    +
    #icon-guanbi2
    +
  • + +
  • + +
    关闭
    +
    #icon-guanbi3
    +
  • + +
  • + +
    密码
    +
    #icon-mima4
    +
  • + +
  • + +
    关闭
    +
    #icon-guanbi4
    +
  • + +
  • + +
    关闭
    +
    #icon-guanbi5
    +
  • + +
  • + +
    密码
    +
    #icon-mima5
    +
  • + +
  • + +
    最小化
    +
    #icon-zuixiaohua1
    +
  • + +
  • + +
    关闭
    +
    #icon-guanbi6
    +
  • + +
  • + +
    退出
    +
    #icon-tuichu
    +
  • + +
  • + +
    退出
    +
    #icon-tuichu1
    +
  • + +
  • + +
    退出
    +
    #icon-tuichu2
    +
  • + +
  • + +
    配置管理
    +
    #icon-configuration-management
    +
  • + +
  • + +
    测试,实验
    +
    #icon-ziyuan120
    +
  • + +
  • + +
    任务管理
    +
    #icon-renwuguanli3
    +
  • + +
  • + +
    智能科技-icon-柔性自动化线
    +
    #icon-zhinengkeji-icon-8
    +
  • + +
  • + +
    agora_面向用例的解决方案
    +
    #icon-agora_mianxiangyonglidejiejuefangan
    +
  • + +
  • + +
    配置-运维配置
    +
    #icon-peizhi-yunweipeizhi
    +
  • + +
  • + +
    任务管理
    +
    #icon-renwuguanli4
    +
  • + +
  • + +
    编辑
    +
    #icon-bianji5
    +
  • + +
  • + +
    车型
    +
    #icon-chexing
    +
  • + +
  • + +
    任务管理
    +
    #icon-renwuguanli5
    +
  • + +
  • + +
    产品压力测试
    +
    #icon-chanpinyaliceshi
    +
  • + +
  • + +
    2-1配置管理
    +
    #icon-2-1peizhiguanli
    +
  • + +
  • + +
    小胖车查车型
    +
    #icon-xiaopangchechachexing
    +
  • + +
  • + +
    自动化
    +
    #icon-zidonghua
    +
  • + +
  • + +
    供应商管理
    +
    #icon-gongyingshangguanli2
    +
  • + +
  • + +
    任务 管理
    +
    #icon-renwuguanli6
    +
  • + +
  • + +
    供应商管理
    +
    #icon-gongyingshangguanli3
    +
  • + +
  • + +
    供应商管理
    +
    #icon-gongyingshangguanli4
    +
  • + +
  • + +
    任务管理
    +
    #icon-renwuguanli7
    +
  • + +
  • + +
    节点事 件测试
    +
    #icon-jiedianshijianceshi
    +
  • + +
  • + +
    日志管理
    +
    #icon-rizhiguanli2
    +
  • + +
  • + +
    系统日志
    +
    #icon-xitongrizhi1
    +
  • + +
  • + +
    网络
    +
    #icon-wangluo1
    +
  • + +
  • + +
    网络自动化
    +
    #icon-wangluozidonghuaguanli
    +
  • + +
  • + +
    任务管理
    +
    #icon-renwuguanli8
    +
  • + +
  • + +
    车型-线性3-0
    +
    #icon-chexing-xianxing3-0
    +
  • + +
  • + +
    任务管理
    +
    #icon-renwuguanli9
    +
  • + +
  • + +
    工业自动化
    +
    #icon-gongyezidonghua
    +
  • + +
  • + +
    iServer数据接入测试
    +
    #icon-iServershujujieruceshi
    +
  • + +
  • + +
    倾斜入库测试
    +
    #icon-qingxierukuceshi
    +
  • + +
  • + +
    任务管理
    +
    #icon-renwuguanli10
    +
  • + +
  • + +
    供应商管理
    +
    #icon-gongyingshangguanli5
    +
  • + +
  • + +
    配置管理
    +
    #icon-peizhiguanli
    +
  • + +
  • + +
    车型管理
    +
    #icon-chexingguanli
    +
  • + +
  • + +
    网段
    +
    #icon-a-ziyuan114
    +
  • + +
  • + +
    部门管理
    +
    #icon-bumenguanli2
    +
  • + +
  • + +
    配置管理
    +
    #icon-peizhiguanli1
    +
  • + +
  • + +
    配置管理
    +
    #icon-peizhiguanli2
    +
  • + +
  • + +
    自动化运维
    +
    #icon-a-lianhe79
    +
  • + +
  • + +
    文件夹、文件
    +
    #icon-a-wenjianjiawenjian
    +
  • + +
  • + +
    文本
    +
    #icon-wenben
    +
  • + +
  • + +
    文本编辑_填充
    +
    #icon-wenbenbianjitianchong
    +
  • + +
  • + +
    日志管理
    +
    #icon-rizhiguanli
    +
  • + +
  • + +
    编辑
    +
    #icon-bianji
    +
  • + +
  • + +
    测试辅助
    +
    #icon-ceshifuzhu
    +
  • + +
  • + +
    回归测试
    +
    #icon-huiguiceshi
    +
  • + +
  • + +
    用户
    +
    #icon-yonghu
    +
  • + +
  • + +
    测试
    +
    #icon-ceshi
    +
  • + +
  • + +
    供应商管理
    +
    #icon-icon-supplier
    +
  • + +
  • + +
    部门管理
    +
    #icon-suyaniconchanpinleibufenzuodaohangbufen87
    +
  • + +
  • + +
    提交日志
    +
    #icon-tijiaorizhi
    +
  • + +
  • + +
    编辑
    +
    #icon-bianji1
    +
  • + +
  • + +
    编辑
    +
    #icon-bianji2
    +
  • + +
  • + +
    网络
    +
    #icon-wangluo
    +
  • + +
  • + +
    配置
    +
    #icon-peizhi
    +
  • + +
  • + +
    供应商管理
    +
    #icon-gongyingshangguanli
    +
  • + +
  • + +
    文件
    +
    #icon-wenjian
    +
  • + +
  • + +
    任务管理
    +
    #icon-renwuguanli
    +
  • + +
  • + +
    素材
    +
    #icon-sucai
    +
  • + +
  • + +
    日志管理
    +
    #icon-rizhiguanli1
    +
  • + +
  • + +
    测试用例集
    +
    #icon-test-case-group
    +
  • + +
  • + +
    测试用例子集
    +
    #icon-test-case-secondary
    +
  • + +
  • + +
    测试用例库
    +
    #icon-test-case-group2
    +
  • + +
  • + +
    文件
    +
    #icon-wenjian1
    +
  • + +
  • + +
    销售自动化
    +
    #icon-xiaoshouzidonghua
    +
  • + +
  • + +
    生产自动化
    +
    #icon-kujialeqiyezhan_shengchanzidonghua
    +
  • + +
  • + +
    部门管理
    +
    #icon-bumenguanli
    +
  • + +
  • + +
    文件
    +
    #icon-noun__cc
    +
  • + +
  • + +
    文件
    +
    #icon-wenjian2
    +
  • + +
  • + +
    部门
    +
    #icon-bumen
    +
  • + +
  • + +
    文件夹
    +
    #icon-wenjianjia
    +
  • + +
  • + +
    自动化运维-1
    +
    #icon-oper-auto-1
    +
  • + +
  • + +
    自动化运维
    +
    #icon-oper-auto
    +
  • + +
  • + +
    品质检测
    +
    #icon-pinzhijiance
    +
  • + +
  • + +
    部门
    +
    #icon-bumen1
    +
  • + +
  • + +
    供应商管理
    +
    #icon-gongyingshangguanli1
    +
  • + +
  • + +
    编辑
    +
    #icon-bianji3
    +
  • + +
  • + +
    编辑
    +
    #icon-bianji4
    +
  • + +
  • + +
    部门管理
    +
    #icon-bumenguanli1
    +
  • + +
  • + +
    监控,测试
    +
    #icon-icon-
    +
  • + +
  • + +
    文件-文件夹
    +
    #icon-wj-wjj
    +
  • + +
  • + +
    部门
    +
    #icon-bumen2
    +
  • + +
  • + +
    日志
    +
    #icon-rizhi
    +
  • + +
  • + +
    配置
    +
    #icon-peizhi1
    +
  • + +
  • + +
    操作日志
    +
    #icon-caozuorizhi
    +
  • + +
  • + +
    测试工具
    +
    #icon-ceshigongju
    +
  • + +
  • + +
    24gl-portraitMalePlus4
    +
    #icon-24gl-portraitMalePlus4
    +
  • + +
  • + +
    24gl-portraitMalePlus6
    +
    #icon-24gl-portraitMalePlus6
    +
  • + +
  • + +
    配置/设置
    +
    #icon-shezhi
    +
  • + +
  • + +
    配置:设置
    +
    #icon-peizhishezhi
    +
  • + +
  • + +
    配置
    +
    #icon-peizhi2
    +
  • + +
  • + +
    用户
    +
    #icon-yonghu1
    +
  • + +
  • + +
    财务自动化配置
    +
    #icon-caiwuzidonghuapeizhi
    +
  • + +
  • + +
    HTSCIT_文件
    +
    #icon-wenjian3
    +
  • + +
  • + +
    系统日志
    +
    #icon-xitongrizhi
    +
  • + +
  • + +
    文件
    +
    #icon-wenjian4
    +
  • + +
  • + +
    用户-角色-用户名-单人_jurassic
    +
    #icon-jurassic_user
    +
  • + +
  • + +
    供应商管理_ico@2x
    +
    #icon-gongyingshangguanli_icox
    +
  • + +
  • + +
    自动化处理_line
    +
    #icon-automated-processing_line
    +
  • + +
  • + +
    自动化处理_fill
    +
    #icon-automated-processing_fill
    +
  • + +
  • + +
    配置信息
    +
    #icon-peizhixinxi
    +
  • + +
  • + +
    27营销自动化
    +
    #icon-yingxiaozidonghua
    +
  • + +
  • + +
    配置2
    +
    #icon-peizhi3
    +
  • + +
  • + +
    电气自动化
    +
    #icon-dianqizidonghua
    +
  • + +
  • + +
    任务管理
    +
    #icon-renwuguanli1
    +
  • + +
  • + +
    财务自动化配置
    +
    #icon-caiwuzidonghuapeizhi1
    +
  • + +
  • + +
    自动化测试
    +
    #icon-xinicon_huabanfuben
    +
  • + +
  • + +
    测试用例
    +
    #icon-xinicon_huabanfuben1
    +
  • + +
  • + +
    测试报告
    +
    #icon-xinicon_huabanfuben2
    +
  • + +
  • + +
    测试历史版本
    +
    #icon-lishibanben
    +
  • + +
  • + +
    节点配置
    +
    #icon-jiedianpeizhi
    +
  • + +
  • + +
    楼宇自动化
    +
    #icon-louyuzidonghua
    +
  • + +
  • + +
    任务管理
    +
    #icon-renwuguanli2
    +
  • + +
  • + +
    测试
    +
    #icon-ceshi1
    +
  • + +
+
+

Symbol 引用

+
+ +

这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章 + 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:

+
    +
  • 支持多色图标了,不再受单色限制。
  • +
  • 通过一些技巧,支持像字体那样,通过 font-size, color 来调整样式。
  • +
  • 兼容性较差,支持 IE9+,及现代浏览器。
  • +
  • 浏览器渲染 SVG 的性能一般,还不如 png。
  • +
+

使用步骤如下:

+

第一步:引入项目下面生成的 symbol 代码:

+
<script src="./iconfont.js"></script>
+
+

第二步:加入通用 CSS 代码(引入一次就行):

+
<style>
+.icon {
+  width: 1em;
+  height: 1em;
+  vertical-align: -0.15em;
+  fill: currentColor;
+  overflow: hidden;
+}
+</style>
+
+

第三步:挑选相应图标并获取类名,应用于页面:

+
<svg class="icon" aria-hidden="true">
+  <use xlink:href="#icon-xxx"></use>
+</svg>
+
+
+
+ +
+
+ + + diff --git a/app/src/main/assets/iconfront/iconfont.css b/app/src/main/assets/iconfront/iconfont.css new file mode 100644 index 0000000..1a49382 --- /dev/null +++ b/app/src/main/assets/iconfront/iconfont.css @@ -0,0 +1,719 @@ +@font-face { + font-family: "iconfont"; /* Project id 3005536 */ + src: url('iconfont.woff2?t=1719904676087') format('woff2'), + url('iconfont.woff?t=1719904676087') format('woff'), + url('iconfont.ttf?t=1719904676087') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-answer:before { + content: "\e64a"; +} + +.icon-app:before { + content: "\e658"; +} + +.icon-browser:before { + content: "\e659"; +} + +.icon-camera:before { + content: "\e65a"; +} + +.icon-cart:before { + content: "\e65c"; +} + +.icon-check:before { + content: "\e65d"; +} + +.icon-code:before { + content: "\e65e"; +} + +.icon-computer:before { + content: "\e65f"; +} + +.icon-delete:before { + content: "\e661"; +} + +.icon-deliver:before { + content: "\e662"; +} + +.icon-display:before { + content: "\e663"; +} + +.icon-down:before { + content: "\e664"; +} + +.icon-download:before { + content: "\e669"; +} + +.icon-edit:before { + content: "\e66a"; +} + +.icon-favor:before { + content: "\e66b"; +} + +.icon-file:before { + content: "\e66c"; +} + +.icon-fill:before { + content: "\e66e"; +} + +.icon-fold:before { + content: "\e66f"; +} + +.icon-folder:before { + content: "\e670"; +} + +.icon-hide:before { + content: "\e671"; +} + +.icon-home:before { + content: "\e672"; +} + +.icon-information:before { + content: "\e673"; +} + +.icon-link:before { + content: "\e674"; +} + +.icon-baojing:before { + content: "\e675"; +} + +.icon-renwu:before { + content: "\e676"; +} + +.icon-yonghu2:before { + content: "\e678"; +} + +.icon-xiangqing:before { + content: "\e679"; +} + +.icon-zhuzhuangtu:before { + content: "\e67f"; +} + +.icon-shouxinguanli:before { + content: "\e680"; +} + +.icon-fuwuqi:before { + content: "\e681"; +} + +.icon-renwu1:before { + content: "\e682"; +} + +.icon-wupinxiang:before { + content: "\e683"; +} + +.icon-xiangqing1:before { + content: "\e684"; +} + +.icon-zhexiantu:before { + content: "\e685"; +} + +.icon-jiegou:before { + content: "\e686"; +} + +.icon-gongzuotai:before { + content: "\e687"; +} + +.icon-shezhi1:before { + content: "\e688"; +} + +.icon-chanpin:before { + content: "\e689"; +} + +.icon-liucheng:before { + content: "\e68a"; +} + +.icon-yonghu3:before { + content: "\e68b"; +} + +.icon-jiekuanshenqing:before { + content: "\e68c"; +} + +.icon-zuidahua:before { + content: "\e65b"; +} + +.icon-mima:before { + content: "\e634"; +} + +.icon-mima1:before { + content: "\e635"; +} + +.icon-zuidahua1:before { + content: "\e637"; +} + +.icon-mima2:before { + content: "\e665"; +} + +.icon-guanbi:before { + content: "\e63b"; +} + +.icon-mima3:before { + content: "\e660"; +} + +.icon-zuixiaohua:before { + content: "\e67e"; +} + +.icon-cuowuguanbiquxiao:before { + content: "\e8e7"; +} + +.icon-guanbi1:before { + content: "\e63d"; +} + +.icon-guanbi2:before { + content: "\e63f"; +} + +.icon-guanbi3:before { + content: "\eaf2"; +} + +.icon-mima4:before { + content: "\e642"; +} + +.icon-guanbi4:before { + content: "\e645"; +} + +.icon-guanbi5:before { + content: "\e6a5"; +} + +.icon-mima5:before { + content: "\e8b2"; +} + +.icon-zuixiaohua1:before { + content: "\e656"; +} + +.icon-guanbi6:before { + content: "\e646"; +} + +.icon-tuichu:before { + content: "\e655"; +} + +.icon-tuichu1:before { + content: "\e638"; +} + +.icon-tuichu2:before { + content: "\e7c8"; +} + +.icon-configuration-management:before { + content: "\e616"; +} + +.icon-ziyuan120:before { + content: "\e789"; +} + +.icon-renwuguanli3:before { + content: "\e781"; +} + +.icon-zhinengkeji-icon-8:before { + content: "\e617"; +} + +.icon-agora_mianxiangyonglidejiejuefangan:before { + content: "\e67c"; +} + +.icon-peizhi-yunweipeizhi:before { + content: "\e618"; +} + +.icon-renwuguanli4:before { + content: "\ec4c"; +} + +.icon-bianji5:before { + content: "\e816"; +} + +.icon-chexing:before { + content: "\e61b"; +} + +.icon-renwuguanli5:before { + content: "\e6e2"; +} + +.icon-chanpinyaliceshi:before { + content: "\e61f"; +} + +.icon-2-1peizhiguanli:before { + content: "\e632"; +} + +.icon-xiaopangchechachexing:before { + content: "\e621"; +} + +.icon-zidonghua:before { + content: "\e633"; +} + +.icon-gongyingshangguanli2:before { + content: "\e622"; +} + +.icon-renwuguanli6:before { + content: "\e625"; +} + +.icon-gongyingshangguanli3:before { + content: "\e67b"; +} + +.icon-gongyingshangguanli4:before { + content: "\e626"; +} + +.icon-renwuguanli7:before { + content: "\e627"; +} + +.icon-jiedianshijianceshi:before { + content: "\e63a"; +} + +.icon-rizhiguanli2:before { + content: "\e6a7"; +} + +.icon-xitongrizhi1:before { + content: "\e6a9"; +} + +.icon-wangluo1:before { + content: "\e628"; +} + +.icon-wangluozidonghuaguanli:before { + content: "\e6ab"; +} + +.icon-renwuguanli8:before { + content: "\e653"; +} + +.icon-chexing-xianxing3-0:before { + content: "\e694"; +} + +.icon-renwuguanli9:before { + content: "\e64f"; +} + +.icon-gongyezidonghua:before { + content: "\e654"; +} + +.icon-iServershujujieruceshi:before { + content: "\e629"; +} + +.icon-qingxierukuceshi:before { + content: "\e62a"; +} + +.icon-renwuguanli10:before { + content: "\e62b"; +} + +.icon-gongyingshangguanli5:before { + content: "\e62c"; +} + +.icon-peizhiguanli:before { + content: "\e67d"; +} + +.icon-chexingguanli:before { + content: "\e66d"; +} + +.icon-a-ziyuan114:before { + content: "\e62d"; +} + +.icon-bumenguanli2:before { + content: "\e636"; +} + +.icon-peizhiguanli1:before { + content: "\e641"; +} + +.icon-peizhiguanli2:before { + content: "\e643"; +} + +.icon-a-lianhe79:before { + content: "\e677"; +} + +.icon-a-wenjianjiawenjian:before { + content: "\e644"; +} + +.icon-wenben:before { + content: "\e600"; +} + +.icon-wenbenbianjitianchong:before { + content: "\e6d4"; +} + +.icon-rizhiguanli:before { + content: "\e639"; +} + +.icon-bianji:before { + content: "\e612"; +} + +.icon-ceshifuzhu:before { + content: "\e601"; +} + +.icon-huiguiceshi:before { + content: "\e608"; +} + +.icon-yonghu:before { + content: "\e788"; +} + +.icon-ceshi:before { + content: "\e6e1"; +} + +.icon-icon-supplier:before { + content: "\e63c"; +} + +.icon-suyaniconchanpinleibufenzuodaohangbufen87:before { + content: "\e730"; +} + +.icon-tijiaorizhi:before { + content: "\e650"; +} + +.icon-bianji1:before { + content: "\e62e"; +} + +.icon-bianji2:before { + content: "\e619"; +} + +.icon-wangluo:before { + content: "\e609"; +} + +.icon-peizhi:before { + content: "\e667"; +} + +.icon-gongyingshangguanli:before { + content: "\e611"; +} + +.icon-wenjian:before { + content: "\e67a"; +} + +.icon-renwuguanli:before { + content: "\e657"; +} + +.icon-sucai:before { + content: "\e602"; +} + +.icon-rizhiguanli1:before { + content: "\e62f"; +} + +.icon-test-case-group:before { + content: "\e606"; +} + +.icon-test-case-secondary:before { + content: "\e607"; +} + +.icon-test-case-group2:before { + content: "\e60a"; +} + +.icon-wenjian1:before { + content: "\e604"; +} + +.icon-xiaoshouzidonghua:before { + content: "\e6a0"; +} + +.icon-kujialeqiyezhan_shengchanzidonghua:before { + content: "\e64b"; +} + +.icon-bumenguanli:before { + content: "\e624"; +} + +.icon-noun__cc:before { + content: "\e610"; +} + +.icon-wenjian2:before { + content: "\e630"; +} + +.icon-bumen:before { + content: "\e758"; +} + +.icon-wenjianjia:before { + content: "\ec17"; +} + +.icon-oper-auto-1:before { + content: "\e7ca"; +} + +.icon-oper-auto:before { + content: "\e7cb"; +} + +.icon-pinzhijiance:before { + content: "\e620"; +} + +.icon-bumen1:before { + content: "\e64d"; +} + +.icon-gongyingshangguanli1:before { + content: "\e623"; +} + +.icon-bianji3:before { + content: "\e603"; +} + +.icon-bianji4:before { + content: "\e61c"; +} + +.icon-bumenguanli1:before { + content: "\e61d"; +} + +.icon-icon-:before { + content: "\e605"; +} + +.icon-wj-wjj:before { + content: "\e7b8"; +} + +.icon-bumen2:before { + content: "\e631"; +} + +.icon-rizhi:before { + content: "\e614"; +} + +.icon-peizhi1:before { + content: "\e60f"; +} + +.icon-caozuorizhi:before { + content: "\e60b"; +} + +.icon-ceshigongju:before { + content: "\e71a"; +} + +.icon-24gl-portraitMalePlus4:before { + content: "\eb25"; +} + +.icon-24gl-portraitMalePlus6:before { + content: "\eb27"; +} + +.icon-shezhi:before { + content: "\e61a"; +} + +.icon-peizhishezhi:before { + content: "\e64c"; +} + +.icon-peizhi2:before { + content: "\e6db"; +} + +.icon-yonghu1:before { + content: "\e668"; +} + +.icon-caiwuzidonghuapeizhi:before { + content: "\e60c"; +} + +.icon-wenjian3:before { + content: "\e64e"; +} + +.icon-xitongrizhi:before { + content: "\e60d"; +} + +.icon-wenjian4:before { + content: "\e695"; +} + +.icon-jurassic_user:before { + content: "\e6a4"; +} + +.icon-gongyingshangguanli_icox:before { + content: "\e6ce"; +} + +.icon-automated-processing_line:before { + content: "\e72f"; +} + +.icon-automated-processing_fill:before { + content: "\e731"; +} + +.icon-peizhixinxi:before { + content: "\e60e"; +} + +.icon-yingxiaozidonghua:before { + content: "\e666"; +} + +.icon-peizhi3:before { + content: "\e61e"; +} + +.icon-dianqizidonghua:before { + content: "\e613"; +} + +.icon-renwuguanli1:before { + content: "\e6de"; +} + +.icon-caiwuzidonghuapeizhi1:before { + content: "\e651"; +} + +.icon-xinicon_huabanfuben:before { + content: "\e647"; +} + +.icon-xinicon_huabanfuben1:before { + content: "\e648"; +} + +.icon-xinicon_huabanfuben2:before { + content: "\e649"; +} + +.icon-lishibanben:before { + content: "\e652"; +} + +.icon-jiedianpeizhi:before { + content: "\e63e"; +} + +.icon-louyuzidonghua:before { + content: "\e793"; +} + +.icon-renwuguanli2:before { + content: "\e615"; +} + +.icon-ceshi1:before { + content: "\e640"; +} + diff --git a/app/src/main/assets/iconfront/iconfont.js b/app/src/main/assets/iconfront/iconfont.js new file mode 100644 index 0000000..3728303 --- /dev/null +++ b/app/src/main/assets/iconfront/iconfont.js @@ -0,0 +1 @@ +window._iconfont_svg_string_3005536='',function(a){var c=(c=document.getElementsByTagName("script"))[c.length-1],l=c.getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var h,i,t,z,v,o=function(c,l){l.parentNode.insertBefore(c,l)};if(l&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}h=function(){var c,l=document.createElement("div");l.innerHTML=a._iconfont_svg_string_3005536,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(c=document.body).firstChild?o(l,c.firstChild):c.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(t=h,z=a.document,v=!1,m(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,p())})}function p(){v||(v=!0,t())}function m(){try{z.documentElement.doScroll("left")}catch(c){return void setTimeout(m,50)}p()}}(window); \ No newline at end of file diff --git a/app/src/main/assets/iconfront/iconfont.json b/app/src/main/assets/iconfront/iconfont.json new file mode 100644 index 0000000..c4a4218 --- /dev/null +++ b/app/src/main/assets/iconfront/iconfont.json @@ -0,0 +1,1241 @@ +{ + "id": "3005536", + "name": "HandyNet", + "font_family": "iconfont", + "css_prefix_text": "icon-", + "description": "", + "glyphs": [ + { + "icon_id": "109717", + "name": "answer", + "font_class": "answer", + "unicode": "e64a", + "unicode_decimal": 58954 + }, + { + "icon_id": "109718", + "name": "app", + "font_class": "app", + "unicode": "e658", + "unicode_decimal": 58968 + }, + { + "icon_id": "109719", + "name": "browser", + "font_class": "browser", + "unicode": "e659", + "unicode_decimal": 58969 + }, + { + "icon_id": "109721", + "name": "camera", + "font_class": "camera", + "unicode": "e65a", + "unicode_decimal": 58970 + }, + { + "icon_id": "109723", + "name": "cart", + "font_class": "cart", + "unicode": "e65c", + "unicode_decimal": 58972 + }, + { + "icon_id": "109724", + "name": "check", + "font_class": "check", + "unicode": "e65d", + "unicode_decimal": 58973 + }, + { + "icon_id": "109725", + "name": "code", + "font_class": "code", + "unicode": "e65e", + "unicode_decimal": 58974 + }, + { + "icon_id": "109726", + "name": "computer", + "font_class": "computer", + "unicode": "e65f", + "unicode_decimal": 58975 + }, + { + "icon_id": "109728", + "name": "delete", + "font_class": "delete", + "unicode": "e661", + "unicode_decimal": 58977 + }, + { + "icon_id": "109730", + "name": "deliver", + "font_class": "deliver", + "unicode": "e662", + "unicode_decimal": 58978 + }, + { + "icon_id": "109731", + "name": "display", + "font_class": "display", + "unicode": "e663", + "unicode_decimal": 58979 + }, + { + "icon_id": "109732", + "name": "down", + "font_class": "down", + "unicode": "e664", + "unicode_decimal": 58980 + }, + { + "icon_id": "109733", + "name": "download", + "font_class": "download", + "unicode": "e669", + "unicode_decimal": 58985 + }, + { + "icon_id": "109734", + "name": "edit", + "font_class": "edit", + "unicode": "e66a", + "unicode_decimal": 58986 + }, + { + "icon_id": "109738", + "name": "favor", + "font_class": "favor", + "unicode": "e66b", + "unicode_decimal": 58987 + }, + { + "icon_id": "109739", + "name": "file", + "font_class": "file", + "unicode": "e66c", + "unicode_decimal": 58988 + }, + { + "icon_id": "109741", + "name": "fill", + "font_class": "fill", + "unicode": "e66e", + "unicode_decimal": 58990 + }, + { + "icon_id": "109742", + "name": "fold", + "font_class": "fold", + "unicode": "e66f", + "unicode_decimal": 58991 + }, + { + "icon_id": "109744", + "name": "folder", + "font_class": "folder", + "unicode": "e670", + "unicode_decimal": 58992 + }, + { + "icon_id": "109749", + "name": "hide", + "font_class": "hide", + "unicode": "e671", + "unicode_decimal": 58993 + }, + { + "icon_id": "109751", + "name": "home", + "font_class": "home", + "unicode": "e672", + "unicode_decimal": 58994 + }, + { + "icon_id": "109752", + "name": "information", + "font_class": "information", + "unicode": "e673", + "unicode_decimal": 58995 + }, + { + "icon_id": "109755", + "name": "link", + "font_class": "link", + "unicode": "e674", + "unicode_decimal": 58996 + }, + { + "icon_id": "30783497", + "name": "报警", + "font_class": "baojing", + "unicode": "e675", + "unicode_decimal": 58997 + }, + { + "icon_id": "30787105", + "name": "任务", + "font_class": "renwu", + "unicode": "e676", + "unicode_decimal": 58998 + }, + { + "icon_id": "30787107", + "name": "用户", + "font_class": "yonghu2", + "unicode": "e678", + "unicode_decimal": 59000 + }, + { + "icon_id": "30787108", + "name": "详情", + "font_class": "xiangqing", + "unicode": "e679", + "unicode_decimal": 59001 + }, + { + "icon_id": "30787110", + "name": "柱状图", + "font_class": "zhuzhuangtu", + "unicode": "e67f", + "unicode_decimal": 59007 + }, + { + "icon_id": "30787113", + "name": "授信管理", + "font_class": "shouxinguanli", + "unicode": "e680", + "unicode_decimal": 59008 + }, + { + "icon_id": "30787179", + "name": "服务器", + "font_class": "fuwuqi", + "unicode": "e681", + "unicode_decimal": 59009 + }, + { + "icon_id": "30787180", + "name": "任务", + "font_class": "renwu1", + "unicode": "e682", + "unicode_decimal": 59010 + }, + { + "icon_id": "30787181", + "name": "物品箱", + "font_class": "wupinxiang", + "unicode": "e683", + "unicode_decimal": 59011 + }, + { + "icon_id": "30787182", + "name": "详情", + "font_class": "xiangqing1", + "unicode": "e684", + "unicode_decimal": 59012 + }, + { + "icon_id": "30787183", + "name": "折线图", + "font_class": "zhexiantu", + "unicode": "e685", + "unicode_decimal": 59013 + }, + { + "icon_id": "30787184", + "name": "结构", + "font_class": "jiegou", + "unicode": "e686", + "unicode_decimal": 59014 + }, + { + "icon_id": "30787185", + "name": "工作台", + "font_class": "gongzuotai", + "unicode": "e687", + "unicode_decimal": 59015 + }, + { + "icon_id": "30787186", + "name": "设置", + "font_class": "shezhi1", + "unicode": "e688", + "unicode_decimal": 59016 + }, + { + "icon_id": "30787187", + "name": "产品", + "font_class": "chanpin", + "unicode": "e689", + "unicode_decimal": 59017 + }, + { + "icon_id": "30787188", + "name": "流程", + "font_class": "liucheng", + "unicode": "e68a", + "unicode_decimal": 59018 + }, + { + "icon_id": "30787189", + "name": "用户", + "font_class": "yonghu3", + "unicode": "e68b", + "unicode_decimal": 59019 + }, + { + "icon_id": "30787190", + "name": "借款申请", + "font_class": "jiekuanshenqing", + "unicode": "e68c", + "unicode_decimal": 59020 + }, + { + "icon_id": "428403", + "name": "最大化", + "font_class": "zuidahua", + "unicode": "e65b", + "unicode_decimal": 58971 + }, + { + "icon_id": "508253", + "name": "密码", + "font_class": "mima", + "unicode": "e634", + "unicode_decimal": 58932 + }, + { + "icon_id": "677589", + "name": "密码", + "font_class": "mima1", + "unicode": "e635", + "unicode_decimal": 58933 + }, + { + "icon_id": "941658", + "name": "最大化", + "font_class": "zuidahua1", + "unicode": "e637", + "unicode_decimal": 58935 + }, + { + "icon_id": "1183037", + "name": "密码", + "font_class": "mima2", + "unicode": "e665", + "unicode_decimal": 58981 + }, + { + "icon_id": "1200198", + "name": "关闭", + "font_class": "guanbi", + "unicode": "e63b", + "unicode_decimal": 58939 + }, + { + "icon_id": "1279441", + "name": "密码", + "font_class": "mima3", + "unicode": "e660", + "unicode_decimal": 58976 + }, + { + "icon_id": "1649166", + "name": "最小化", + "font_class": "zuixiaohua", + "unicode": "e67e", + "unicode_decimal": 59006 + }, + { + "icon_id": "1727523", + "name": "304错误、关闭、取消", + "font_class": "cuowuguanbiquxiao", + "unicode": "e8e7", + "unicode_decimal": 59623 + }, + { + "icon_id": "4880431", + "name": "关闭", + "font_class": "guanbi1", + "unicode": "e63d", + "unicode_decimal": 58941 + }, + { + "icon_id": "5286697", + "name": "关闭", + "font_class": "guanbi2", + "unicode": "e63f", + "unicode_decimal": 58943 + }, + { + "icon_id": "5387522", + "name": "关闭", + "font_class": "guanbi3", + "unicode": "eaf2", + "unicode_decimal": 60146 + }, + { + "icon_id": "5532892", + "name": "密码", + "font_class": "mima4", + "unicode": "e642", + "unicode_decimal": 58946 + }, + { + "icon_id": "9526788", + "name": "关闭", + "font_class": "guanbi4", + "unicode": "e645", + "unicode_decimal": 58949 + }, + { + "icon_id": "10268991", + "name": "关闭", + "font_class": "guanbi5", + "unicode": "e6a5", + "unicode_decimal": 59045 + }, + { + "icon_id": "11372676", + "name": "密码", + "font_class": "mima5", + "unicode": "e8b2", + "unicode_decimal": 59570 + }, + { + "icon_id": "11490918", + "name": "最小化", + "font_class": "zuixiaohua1", + "unicode": "e656", + "unicode_decimal": 58966 + }, + { + "icon_id": "18336449", + "name": "关闭", + "font_class": "guanbi6", + "unicode": "e646", + "unicode_decimal": 58950 + }, + { + "icon_id": "741952", + "name": "退出", + "font_class": "tuichu", + "unicode": "e655", + "unicode_decimal": 58965 + }, + { + "icon_id": "784287", + "name": "退出", + "font_class": "tuichu1", + "unicode": "e638", + "unicode_decimal": 58936 + }, + { + "icon_id": "2150401", + "name": "退出", + "font_class": "tuichu2", + "unicode": "e7c8", + "unicode_decimal": 59336 + }, + { + "icon_id": "14440232", + "name": "配置管理", + "font_class": "configuration-management", + "unicode": "e616", + "unicode_decimal": 58902 + }, + { + "icon_id": "14488543", + "name": "测试,实验", + "font_class": "ziyuan120", + "unicode": "e789", + "unicode_decimal": 59273 + }, + { + "icon_id": "15562234", + "name": "任务管理", + "font_class": "renwuguanli3", + "unicode": "e781", + "unicode_decimal": 59265 + }, + { + "icon_id": "16560688", + "name": "智能科技-icon-柔性自动化线", + "font_class": "zhinengkeji-icon-8", + "unicode": "e617", + "unicode_decimal": 58903 + }, + { + "icon_id": "16802498", + "name": "agora_面向用例的解决方案", + "font_class": "agora_mianxiangyonglidejiejuefangan", + "unicode": "e67c", + "unicode_decimal": 59004 + }, + { + "icon_id": "17523068", + "name": "配置-运维配置", + "font_class": "peizhi-yunweipeizhi", + "unicode": "e618", + "unicode_decimal": 58904 + }, + { + "icon_id": "17581486", + "name": "任务管理", + "font_class": "renwuguanli4", + "unicode": "ec4c", + "unicode_decimal": 60492 + }, + { + "icon_id": "17605466", + "name": "编辑", + "font_class": "bianji5", + "unicode": "e816", + "unicode_decimal": 59414 + }, + { + "icon_id": "17755679", + "name": "车型", + "font_class": "chexing", + "unicode": "e61b", + "unicode_decimal": 58907 + }, + { + "icon_id": "18532317", + "name": "任务管理", + "font_class": "renwuguanli5", + "unicode": "e6e2", + "unicode_decimal": 59106 + }, + { + "icon_id": "18610226", + "name": "产品压力测试", + "font_class": "chanpinyaliceshi", + "unicode": "e61f", + "unicode_decimal": 58911 + }, + { + "icon_id": "18681358", + "name": "2-1配置管理", + "font_class": "2-1peizhiguanli", + "unicode": "e632", + "unicode_decimal": 58930 + }, + { + "icon_id": "18736890", + "name": "小胖车查车型", + "font_class": "xiaopangchechachexing", + "unicode": "e621", + "unicode_decimal": 58913 + }, + { + "icon_id": "18749030", + "name": "自动化", + "font_class": "zidonghua", + "unicode": "e633", + "unicode_decimal": 58931 + }, + { + "icon_id": "18797439", + "name": "供应商管理", + "font_class": "gongyingshangguanli2", + "unicode": "e622", + "unicode_decimal": 58914 + }, + { + "icon_id": "18799720", + "name": "任务 管理", + "font_class": "renwuguanli6", + "unicode": "e625", + "unicode_decimal": 58917 + }, + { + "icon_id": "18853237", + "name": "供应商管理", + "font_class": "gongyingshangguanli3", + "unicode": "e67b", + "unicode_decimal": 59003 + }, + { + "icon_id": "19542637", + "name": "供应商管理", + "font_class": "gongyingshangguanli4", + "unicode": "e626", + "unicode_decimal": 58918 + }, + { + "icon_id": "19542645", + "name": "任务管理", + "font_class": "renwuguanli7", + "unicode": "e627", + "unicode_decimal": 58919 + }, + { + "icon_id": "20240567", + "name": "节点事 件测试", + "font_class": "jiedianshijianceshi", + "unicode": "e63a", + "unicode_decimal": 58938 + }, + { + "icon_id": "20853344", + "name": "日志管理", + "font_class": "rizhiguanli2", + "unicode": "e6a7", + "unicode_decimal": 59047 + }, + { + "icon_id": "20853357", + "name": "系统日志", + "font_class": "xitongrizhi1", + "unicode": "e6a9", + "unicode_decimal": 59049 + }, + { + "icon_id": "21106041", + "name": "网络", + "font_class": "wangluo1", + "unicode": "e628", + "unicode_decimal": 58920 + }, + { + "icon_id": "21736129", + "name": "网络自动化", + "font_class": "wangluozidonghuaguanli", + "unicode": "e6ab", + "unicode_decimal": 59051 + }, + { + "icon_id": "21905674", + "name": "任务管理", + "font_class": "renwuguanli8", + "unicode": "e653", + "unicode_decimal": 58963 + }, + { + "icon_id": "22412664", + "name": "车型-线性3-0", + "font_class": "chexing-xianxing3-0", + "unicode": "e694", + "unicode_decimal": 59028 + }, + { + "icon_id": "22417274", + "name": "任务管理", + "font_class": "renwuguanli9", + "unicode": "e64f", + "unicode_decimal": 58959 + }, + { + "icon_id": "22773536", + "name": "工业自动化", + "font_class": "gongyezidonghua", + "unicode": "e654", + "unicode_decimal": 58964 + }, + { + "icon_id": "22806233", + "name": "iServer数据接入测试", + "font_class": "iServershujujieruceshi", + "unicode": "e629", + "unicode_decimal": 58921 + }, + { + "icon_id": "22806242", + "name": "倾斜入库测试", + "font_class": "qingxierukuceshi", + "unicode": "e62a", + "unicode_decimal": 58922 + }, + { + "icon_id": "24067295", + "name": "任务管理", + "font_class": "renwuguanli10", + "unicode": "e62b", + "unicode_decimal": 58923 + }, + { + "icon_id": "24068781", + "name": "供应商管理", + "font_class": "gongyingshangguanli5", + "unicode": "e62c", + "unicode_decimal": 58924 + }, + { + "icon_id": "24271986", + "name": "配置管理", + "font_class": "peizhiguanli", + "unicode": "e67d", + "unicode_decimal": 59005 + }, + { + "icon_id": "24433506", + "name": "车型管理", + "font_class": "chexingguanli", + "unicode": "e66d", + "unicode_decimal": 58989 + }, + { + "icon_id": "24818718", + "name": "网段", + "font_class": "a-ziyuan114", + "unicode": "e62d", + "unicode_decimal": 58925 + }, + { + "icon_id": "24848374", + "name": "部门管理", + "font_class": "bumenguanli2", + "unicode": "e636", + "unicode_decimal": 58934 + }, + { + "icon_id": "24849176", + "name": "配置管理", + "font_class": "peizhiguanli1", + "unicode": "e641", + "unicode_decimal": 58945 + }, + { + "icon_id": "24849343", + "name": "配置管理", + "font_class": "peizhiguanli2", + "unicode": "e643", + "unicode_decimal": 58947 + }, + { + "icon_id": "25857085", + "name": "自动化运维", + "font_class": "a-lianhe79", + "unicode": "e677", + "unicode_decimal": 58999 + }, + { + "icon_id": "25876391", + "name": "文件夹、文件", + "font_class": "a-wenjianjiawenjian", + "unicode": "e644", + "unicode_decimal": 58948 + }, + { + "icon_id": "1233", + "name": "文本", + "font_class": "wenben", + "unicode": "e600", + "unicode_decimal": 58880 + }, + { + "icon_id": "297678", + "name": "文本编辑_填充", + "font_class": "wenbenbianjitianchong", + "unicode": "e6d4", + "unicode_decimal": 59092 + }, + { + "icon_id": "410325", + "name": "日志管理", + "font_class": "rizhiguanli", + "unicode": "e639", + "unicode_decimal": 58937 + }, + { + "icon_id": "425606", + "name": "编辑", + "font_class": "bianji", + "unicode": "e612", + "unicode_decimal": 58898 + }, + { + "icon_id": "521014", + "name": "测试辅助", + "font_class": "ceshifuzhu", + "unicode": "e601", + "unicode_decimal": 58881 + }, + { + "icon_id": "521024", + "name": "回归测试", + "font_class": "huiguiceshi", + "unicode": "e608", + "unicode_decimal": 58888 + }, + { + "icon_id": "579741", + "name": "用户", + "font_class": "yonghu", + "unicode": "e788", + "unicode_decimal": 59272 + }, + { + "icon_id": "588685", + "name": "测试", + "font_class": "ceshi", + "unicode": "e6e1", + "unicode_decimal": 59105 + }, + { + "icon_id": "712256", + "name": "供应商管理", + "font_class": "icon-supplier", + "unicode": "e63c", + "unicode_decimal": 58940 + }, + { + "icon_id": "763159", + "name": "部门管理", + "font_class": "suyaniconchanpinleibufenzuodaohangbufen87", + "unicode": "e730", + "unicode_decimal": 59184 + }, + { + "icon_id": "992586", + "name": "提交日志", + "font_class": "tijiaorizhi", + "unicode": "e650", + "unicode_decimal": 58960 + }, + { + "icon_id": "1151051", + "name": "编辑", + "font_class": "bianji1", + "unicode": "e62e", + "unicode_decimal": 58926 + }, + { + "icon_id": "1459142", + "name": "编辑", + "font_class": "bianji2", + "unicode": "e619", + "unicode_decimal": 58905 + }, + { + "icon_id": "1494665", + "name": "网络", + "font_class": "wangluo", + "unicode": "e609", + "unicode_decimal": 58889 + }, + { + "icon_id": "1799696", + "name": "配置", + "font_class": "peizhi", + "unicode": "e667", + "unicode_decimal": 58983 + }, + { + "icon_id": "1963493", + "name": "供应商管理", + "font_class": "gongyingshangguanli", + "unicode": "e611", + "unicode_decimal": 58897 + }, + { + "icon_id": "2542134", + "name": "文件", + "font_class": "wenjian", + "unicode": "e67a", + "unicode_decimal": 59002 + }, + { + "icon_id": "2678627", + "name": "任务管理", + "font_class": "renwuguanli", + "unicode": "e657", + "unicode_decimal": 58967 + }, + { + "icon_id": "2815727", + "name": "素材", + "font_class": "sucai", + "unicode": "e602", + "unicode_decimal": 58882 + }, + { + "icon_id": "2959078", + "name": "日志管理", + "font_class": "rizhiguanli1", + "unicode": "e62f", + "unicode_decimal": 58927 + }, + { + "icon_id": "3108158", + "name": "测试用例集", + "font_class": "test-case-group", + "unicode": "e606", + "unicode_decimal": 58886 + }, + { + "icon_id": "3108159", + "name": "测试用例子集", + "font_class": "test-case-secondary", + "unicode": "e607", + "unicode_decimal": 58887 + }, + { + "icon_id": "3108160", + "name": "测试用例库", + "font_class": "test-case-group2", + "unicode": "e60a", + "unicode_decimal": 58890 + }, + { + "icon_id": "3521808", + "name": "文件", + "font_class": "wenjian1", + "unicode": "e604", + "unicode_decimal": 58884 + }, + { + "icon_id": "3663271", + "name": "销售自动化", + "font_class": "xiaoshouzidonghua", + "unicode": "e6a0", + "unicode_decimal": 59040 + }, + { + "icon_id": "3956119", + "name": "生产自动化", + "font_class": "kujialeqiyezhan_shengchanzidonghua", + "unicode": "e64b", + "unicode_decimal": 58955 + }, + { + "icon_id": "4396316", + "name": "部门管理", + "font_class": "bumenguanli", + "unicode": "e624", + "unicode_decimal": 58916 + }, + { + "icon_id": "4503760", + "name": "文件", + "font_class": "noun__cc", + "unicode": "e610", + "unicode_decimal": 58896 + }, + { + "icon_id": "4742649", + "name": "文件", + "font_class": "wenjian2", + "unicode": "e630", + "unicode_decimal": 58928 + }, + { + "icon_id": "4774868", + "name": "部门", + "font_class": "bumen", + "unicode": "e758", + "unicode_decimal": 59224 + }, + { + "icon_id": "4893191", + "name": "文件夹", + "font_class": "wenjianjia", + "unicode": "ec17", + "unicode_decimal": 60439 + }, + { + "icon_id": "5466489", + "name": "自动化运维-1", + "font_class": "oper-auto-1", + "unicode": "e7ca", + "unicode_decimal": 59338 + }, + { + "icon_id": "5466532", + "name": "自动化运维", + "font_class": "oper-auto", + "unicode": "e7cb", + "unicode_decimal": 59339 + }, + { + "icon_id": "5661138", + "name": "品质检测", + "font_class": "pinzhijiance", + "unicode": "e620", + "unicode_decimal": 58912 + }, + { + "icon_id": "6196914", + "name": "部门", + "font_class": "bumen1", + "unicode": "e64d", + "unicode_decimal": 58957 + }, + { + "icon_id": "6241655", + "name": "供应商管理", + "font_class": "gongyingshangguanli1", + "unicode": "e623", + "unicode_decimal": 58915 + }, + { + "icon_id": "6540381", + "name": "编辑", + "font_class": "bianji3", + "unicode": "e603", + "unicode_decimal": 58883 + }, + { + "icon_id": "6550608", + "name": "编辑", + "font_class": "bianji4", + "unicode": "e61c", + "unicode_decimal": 58908 + }, + { + "icon_id": "6627737", + "name": "部门管理", + "font_class": "bumenguanli1", + "unicode": "e61d", + "unicode_decimal": 58909 + }, + { + "icon_id": "6659705", + "name": "监控,测试", + "font_class": "icon-", + "unicode": "e605", + "unicode_decimal": 58885 + }, + { + "icon_id": "6834996", + "name": "文件-文件夹", + "font_class": "wj-wjj", + "unicode": "e7b8", + "unicode_decimal": 59320 + }, + { + "icon_id": "6978129", + "name": "部门", + "font_class": "bumen2", + "unicode": "e631", + "unicode_decimal": 58929 + }, + { + "icon_id": "7159346", + "name": "日志", + "font_class": "rizhi", + "unicode": "e614", + "unicode_decimal": 58900 + }, + { + "icon_id": "7326003", + "name": "配置", + "font_class": "peizhi1", + "unicode": "e60f", + "unicode_decimal": 58895 + }, + { + "icon_id": "7474663", + "name": "操作日志", + "font_class": "caozuorizhi", + "unicode": "e60b", + "unicode_decimal": 58891 + }, + { + "icon_id": "7571402", + "name": "测试工具", + "font_class": "ceshigongju", + "unicode": "e71a", + "unicode_decimal": 59162 + }, + { + "icon_id": "7596825", + "name": "24gl-portraitMalePlus4", + "font_class": "24gl-portraitMalePlus4", + "unicode": "eb25", + "unicode_decimal": 60197 + }, + { + "icon_id": "7596839", + "name": "24gl-portraitMalePlus6", + "font_class": "24gl-portraitMalePlus6", + "unicode": "eb27", + "unicode_decimal": 60199 + }, + { + "icon_id": "8084582", + "name": "配置/设置", + "font_class": "shezhi", + "unicode": "e61a", + "unicode_decimal": 58906 + }, + { + "icon_id": "8094211", + "name": "配置:设置", + "font_class": "peizhishezhi", + "unicode": "e64c", + "unicode_decimal": 58956 + }, + { + "icon_id": "8329623", + "name": "配置", + "font_class": "peizhi2", + "unicode": "e6db", + "unicode_decimal": 59099 + }, + { + "icon_id": "8605745", + "name": "用户", + "font_class": "yonghu1", + "unicode": "e668", + "unicode_decimal": 58984 + }, + { + "icon_id": "8668813", + "name": "财务自动化配置", + "font_class": "caiwuzidonghuapeizhi", + "unicode": "e60c", + "unicode_decimal": 58892 + }, + { + "icon_id": "9592599", + "name": "HTSCIT_文件", + "font_class": "wenjian3", + "unicode": "e64e", + "unicode_decimal": 58958 + }, + { + "icon_id": "9923110", + "name": "系统日志", + "font_class": "xitongrizhi", + "unicode": "e60d", + "unicode_decimal": 58893 + }, + { + "icon_id": "10268893", + "name": "文件", + "font_class": "wenjian4", + "unicode": "e695", + "unicode_decimal": 59029 + }, + { + "icon_id": "10593835", + "name": "用户-角色-用户名-单人_jurassic", + "font_class": "jurassic_user", + "unicode": "e6a4", + "unicode_decimal": 59044 + }, + { + "icon_id": "11192566", + "name": "供应商管理_ico@2x", + "font_class": "gongyingshangguanli_icox", + "unicode": "e6ce", + "unicode_decimal": 59086 + }, + { + "icon_id": "11762121", + "name": "自动化处理_line", + "font_class": "automated-processing_line", + "unicode": "e72f", + "unicode_decimal": 59183 + }, + { + "icon_id": "11762138", + "name": "自动化处理_fill", + "font_class": "automated-processing_fill", + "unicode": "e731", + "unicode_decimal": 59185 + }, + { + "icon_id": "12291973", + "name": "配置信息", + "font_class": "peizhixinxi", + "unicode": "e60e", + "unicode_decimal": 58894 + }, + { + "icon_id": "12498350", + "name": "27营销自动化", + "font_class": "yingxiaozidonghua", + "unicode": "e666", + "unicode_decimal": 58982 + }, + { + "icon_id": "12694603", + "name": "配置2", + "font_class": "peizhi3", + "unicode": "e61e", + "unicode_decimal": 58910 + }, + { + "icon_id": "13106277", + "name": "电气自动化", + "font_class": "dianqizidonghua", + "unicode": "e613", + "unicode_decimal": 58899 + }, + { + "icon_id": "13584361", + "name": "任务管理", + "font_class": "renwuguanli1", + "unicode": "e6de", + "unicode_decimal": 59102 + }, + { + "icon_id": "13604625", + "name": "财务自动化配置", + "font_class": "caiwuzidonghuapeizhi1", + "unicode": "e651", + "unicode_decimal": 58961 + }, + { + "icon_id": "13866072", + "name": "自动化测试", + "font_class": "xinicon_huabanfuben", + "unicode": "e647", + "unicode_decimal": 58951 + }, + { + "icon_id": "13866074", + "name": "测试用例", + "font_class": "xinicon_huabanfuben1", + "unicode": "e648", + "unicode_decimal": 58952 + }, + { + "icon_id": "13866081", + "name": "测试报告", + "font_class": "xinicon_huabanfuben2", + "unicode": "e649", + "unicode_decimal": 58953 + }, + { + "icon_id": "13867117", + "name": "测试历史版本", + "font_class": "lishibanben", + "unicode": "e652", + "unicode_decimal": 58962 + }, + { + "icon_id": "13872008", + "name": "节点配置", + "font_class": "jiedianpeizhi", + "unicode": "e63e", + "unicode_decimal": 58942 + }, + { + "icon_id": "14095330", + "name": "楼宇自动化", + "font_class": "louyuzidonghua", + "unicode": "e793", + "unicode_decimal": 59283 + }, + { + "icon_id": "14236693", + "name": "任务管理", + "font_class": "renwuguanli2", + "unicode": "e615", + "unicode_decimal": 58901 + }, + { + "icon_id": "14386921", + "name": "测试", + "font_class": "ceshi1", + "unicode": "e640", + "unicode_decimal": 58944 + } + ] +} diff --git a/app/src/main/assets/iconfront/iconfont.ttf b/app/src/main/assets/iconfront/iconfont.ttf new file mode 100644 index 0000000..92f4cbb Binary files /dev/null and b/app/src/main/assets/iconfront/iconfont.ttf differ diff --git a/app/src/main/assets/iconfront/iconfont.woff b/app/src/main/assets/iconfront/iconfont.woff new file mode 100644 index 0000000..52a19e6 Binary files /dev/null and b/app/src/main/assets/iconfront/iconfont.woff differ diff --git a/app/src/main/assets/iconfront/iconfont.woff2 b/app/src/main/assets/iconfront/iconfont.woff2 new file mode 100644 index 0000000..f5112ed Binary files /dev/null and b/app/src/main/assets/iconfront/iconfont.woff2 differ diff --git a/app/src/main/java/bsp_Error.proto b/app/src/main/java/bsp_Error.proto new file mode 100644 index 0000000..9bad973 --- /dev/null +++ b/app/src/main/java/bsp_Error.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +option java_multiple_files = false; +option java_package = "com.example.removemarineanimals.models"; + +message ErrorData +{ + int32 Com_Error_Code=1; + int32 Left_Motor_Error_Code=2; + int32 Right_Motor_Error_Code=3; + +} + +enum ComError //枚举消息类型 Error Bit Define +{ + MK32_SBus = 0; + TL720D = 1; + Force_sensor = 2; + ZQ_LeftMotor = 3; + ZQ_RightMotor = 4; + DMAKE_1 = 5; +// DMAKE_2 = 6; +// DMAKE_3 = 7; + MK32_Serial = 6; +} + +//protoc --nanopb_out=. *.proto + + + diff --git a/app/src/main/java/bsp_IV.proto b/app/src/main/java/bsp_IV.proto new file mode 100644 index 0000000..ccd3f4e --- /dev/null +++ b/app/src/main/java/bsp_IV.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +option java_multiple_files = false; +option java_package = "com.example.removemarineanimals.models"; + +message IV_struct_define{ + + // 五轮项目 + int32 Robot_Move_AutoSpeed= 1; + int32 Robot_Move_ManualSpeed= 2; + int32 Robot_CurrentPosition= 3; + int32 Robot_AngleRoll= 4; + int32 Robot_Error= 5; + int32 Robot_DynamometerValue= 6; + int32 Robot_ForceValue= 7; + int32 Robot_CurrentState= 8; + int32 Robot_Current_Left= 9; + int32 Robot_Current_Right= 10; + int32 Robot_Error_Left = 11; + int32 Robot_Error_Right = 12; + +}; diff --git a/app/src/main/java/bsp_PV.proto b/app/src/main/java/bsp_PV.proto new file mode 100644 index 0000000..6390c0f --- /dev/null +++ b/app/src/main/java/bsp_PV.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +option java_multiple_files = false; +option java_package = "com.example.removemarineanimals.models"; +message PV_struct_define{ + + int32 Robot_ChgLength= 1; + double Robot_LeftCompensation=2; + double Robot_RightCompensation=3; + double Robot_AutoSpeedBase=4; + double Robot_ManualSpeedBase=5; +}; diff --git a/app/src/main/java/com/example/removemarineanimals/MainActivity - 副本.txt b/app/src/main/java/com/example/removemarineanimals/MainActivity - 副本.txt new file mode 100644 index 0000000..1f074e9 --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/MainActivity - 副本.txt @@ -0,0 +1,335 @@ +package com.example.removemarineanimals; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.content.ContextCompat; +import androidx.databinding.DataBindingUtil; +import androidx.lifecycle.ViewModelProvider; + +import android.app.PendingIntent; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.hardware.usb.UsbDevice; +import android.hardware.usb.UsbDeviceConnection; +import android.hardware.usb.UsbManager; +import android.os.Build; +import android.os.Bundle; + +import com.example.removemarineanimals.databinding.ActivityMainBinding; +import com.example.removemarineanimals.services.CustomProber; +//import com.example.removemarineanimals.services.USBSerialPortHelper; +import com.example.removemarineanimals.services.VideoHelper; +import com.example.removemarineanimals.viewmodels.MainViewModel; +import com.hoho.android.usbserial.driver.UsbSerialDriver; +import com.hoho.android.usbserial.driver.UsbSerialPort; +import com.hoho.android.usbserial.driver.UsbSerialProber; +import com.hoho.android.usbserial.util.SerialInputOutputManager; + +import android.os.Bundle; +import android.os.CountDownTimer; +import android.os.Handler; +import android.os.Looper; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import cn.nodemedia.NodePlayer; + + +public class MainActivity extends AppCompatActivity implements SerialInputOutputManager.Listener { + + + private enum UsbPermission {Unknown, Requested, Granted, Denied} + + private static final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB"; + private int deviceId = 60000; + private int deviceId_test = 60000; + private int portNum; + private static final int WRITE_WAIT_MILLIS = 500; + private static final int READ_WAIT_MILLIS = 1000; + private static String PortNameContians = "SILICON";/**/ + private int baudRate = 57600; + private boolean withIoManager = true; + + private BroadcastReceiver broadcastReceiver; + private Handler mainLooper; + + + private SerialInputOutputManager usbIoManager; + private UsbSerialPort usbSerialPort; + private UsbPermission usbPermission = UsbPermission.Unknown; + private boolean connected = false; + + + public void GetControlsReferences() { + broadcastReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (INTENT_ACTION_GRANT_USB.equals(intent.getAction())) { + usbPermission = intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false) + ? UsbPermission.Granted : UsbPermission.Denied; + connect(); + } + + + } + }; + mainLooper = new Handler(Looper.getMainLooper()); + + + _receiveBufferlist = new ArrayList(); + } + + + public static ActivityMainBinding mainBinding;//通过Binding可以获取界面数据 +// public USBSerialPortHelper serialPortHelper; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + // setContentView(R.layout.activity_main); + mainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main); + MainViewModel vm = new ViewModelProvider(this).get(MainViewModel.class); + MainViewModel.mainBinding = mainBinding; + // vm.mainBinding=mainBinding; + mainBinding.setVm(vm); + + + //nodePlayer0 =new NodePlayer(this); + //nodePlayer1 =new NodePlayer(this); + + VideoHelper.nodePlayerView0 = mainBinding.nodePlayerView0; + VideoHelper.nodePlayerView1 = mainBinding.nodePlayerView1; + + VideoHelper.nodePlayer0 = new NodePlayer(this); + VideoHelper.nodePlayer1 = new NodePlayer(this); + + + VideoHelper.StatPlayVideo(); + +// +// serialPortHelper=new USBSerialPortHelper(); +// serialPortHelper.MainActivity=this; +// serialPortHelper.intialize(); + + + GetControlsReferences(); + connect(); + + } + + @Override + protected void onStart() { + super.onStart(); + ContextCompat.registerReceiver(this, broadcastReceiver, new IntentFilter(INTENT_ACTION_GRANT_USB), ContextCompat.RECEIVER_NOT_EXPORTED); + + } + + @Override + public void onStop() { + this.unregisterReceiver(broadcastReceiver); + super.onStop(); + } + + @Override + public void onResume() { + super.onResume(); + if (!connected && (usbPermission == UsbPermission.Unknown || usbPermission == UsbPermission.Granted)) { + //mainLooper.post(this::connect); + + } + + } + + @Override + public void onPause() { + if (connected) { + status("串口断开"); + // _serialPortSwitch.setChecked(false); + disconnect(); + } + super.onPause(); + } + + @Override + public void onNewData(byte[] data) { + mainLooper.post(() -> + { + receive(data); + // receive data + }); + } + + @Override + public void onRunError(Exception e) { + mainLooper.post(() -> + { + status("connection lost: " + e.getMessage()); + disconnect(); + }); + } + + private void connect() { + + UsbDevice device = null; + UsbManager usbManager = (UsbManager) this.getSystemService(Context.USB_SERVICE); + for (UsbDevice v : usbManager.getDeviceList().values()) { + status(v.getManufacturerName().toUpperCase()); + if (v.getManufacturerName().toUpperCase().contains(PortNameContians)) { + device = v; + break; + } + } + + if (device == null) { + // _serialPortSwitch.setChecked(false); + + status("找不到设备"); + return; + } + UsbSerialDriver driver = UsbSerialProber.getDefaultProber().probeDevice(device); + if (driver == null) { + driver = CustomProber.getCustomProber().probeDevice(device); + } + if (driver == null) { + // _serialPortSwitch.setChecked(false); + status("无驱动"); + return; + } + if (driver.getPorts().size() < portNum) //就是0 cp2102 或者同一个驱动,第一个 + { + status("connection failed: not enough ports at device"); + status("找不到设备"); + return; + } + usbSerialPort = driver.getPorts().get(portNum); + + UsbDeviceConnection usbConnection = usbManager.openDevice(driver.getDevice()); + if (usbConnection == null && usbPermission == UsbPermission.Unknown && !usbManager.hasPermission(driver.getDevice())) { + usbPermission = UsbPermission.Requested; + int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_MUTABLE : 0; + Intent intent = new Intent(INTENT_ACTION_GRANT_USB); + intent.setPackage(this.getPackageName()); + PendingIntent usbPermissionIntent = PendingIntent.getBroadcast(this, 0, intent, flags); + usbManager.requestPermission(driver.getDevice(), usbPermissionIntent); + return; + } + if (usbConnection == null) { + if (!usbManager.hasPermission(driver.getDevice())) { + status("connection failed: permission denied"); + } else { + status("connection failed: open failed"); + } + + return; + } + + try { + usbSerialPort.open(usbConnection); + try { + usbSerialPort.setParameters(baudRate, 8, 1, UsbSerialPort.PARITY_NONE); + } catch (UnsupportedOperationException e) { + status("unsupport setparameters"); + } + if (withIoManager) { + usbIoManager = new SerialInputOutputManager(usbSerialPort, this); + usbIoManager.setReadBufferSize(40960); + usbIoManager.setReadTimeout(READ_WAIT_MILLIS); + usbIoManager.start(); + } + //status("connected"); + connected = true; + // _serialPortSwitch.setChecked(true); + //switch set true + + } catch (Exception e) { + status("connection failed: " + e.getMessage()); + disconnect(); + } + } + + private void disconnect() { + connected = false; + + if (usbIoManager != null) { + usbIoManager.setListener(null); + usbIoManager.stop(); + } + usbIoManager = null; + try { + usbSerialPort.close(); + } catch (IOException ignored) + { + + } + usbSerialPort = null; + } + + List _receiveBufferlist; + + private byte[] listTobyte(List list) { + if (list == null || list.size() < 0) + return null; + byte[] bytes = new byte[list.size()]; + int i = 0; + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + bytes[i] = iterator.next(); + i++; + } + return bytes; + } + + public int Counter = 1000; + boolean StartCountDown = false; + + private void receive(byte[] data) { + + for (int i = 0; i < data.length; i++) { + _receiveBufferlist.add(data[i]); + } + + //decodeRceive(data); + if (StartCountDown == false) { + StartCountDown = true; + new CountDownTimer(500, 500) { + public void onTick(long millisUntilFinished) { + // Used for formatting digit to be in 2 digits only + + } + + // When the task is over it will print 00:00:00 there + public void onFinish() { + decodeRceive(listTobyte(_receiveBufferlist)); + _receiveBufferlist.clear(); + StartCountDown = false; + } + }.start(); + } + + + } + + private void decodeRceive(byte[] data) { + try { + + } catch ( + Exception e) { + //spn.append("exception:{e} "); + } + } + void status(String str) + { + mainBinding.message.setText(str); +// SpannableStringBuilder spn = new SpannableStringBuilder(str + '\r' + '\n'); +// +// // spn.append(getTime()); +// +// spn.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.colorAccent)), 0, spn.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); +// receiveText.append(spn); +// scrollView.fullScroll(ScrollView.FOCUS_DOWN); + } +} diff --git a/app/src/main/java/com/example/removemarineanimals/MainActivity.java b/app/src/main/java/com/example/removemarineanimals/MainActivity.java new file mode 100644 index 0000000..80ec2f0 --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/MainActivity.java @@ -0,0 +1,433 @@ +package com.example.removemarineanimals; + +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.text.Editable; +import android.text.TextWatcher; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; +import androidx.databinding.DataBindingUtil; +import androidx.lifecycle.ViewModelProvider; +import androidx.lifecycle.ViewModelStoreOwner; + +import com.example.removemarineanimals.databinding.ActivityMainBinding; +import com.example.removemarineanimals.models.BspPV; +import com.example.removemarineanimals.models.RobotRMACM; +import com.example.removemarineanimals.services.ModbusCRC; +import com.example.removemarineanimals.services.VideoPlayerHelper; +import com.example.removemarineanimals.services.ttySerialPortHelper; +import com.example.removemarineanimals.viewmodels.MainViewModel; + +import java.util.Timer; +import java.util.TimerTask; + +import cn.nodemedia.NodePlayer; + + + +public class MainActivity extends AppCompatActivity { + + public ActivityMainBinding mainBinding;//通过Binding可以获取界面数据 + //USB 串口服务 + //public USBSerialPortHelper serialPortHelper; + private BspPV.PV_struct_define _toSendPV; + + public RobotRMACM.RMACM robotRMACM; + String RobotAutoSpeed; + String RobotManualSpeed; + String RobotChgLength; + private static final String ALLOWED_CHARS = "0123456789.-+"; + /** + * 判断字符串是否是数字 + */ + public static boolean isNumber(String value) { + return isInteger(value) || isDouble(value); + } + /** + * 判断字符串是否是整数 + */ + public static boolean isInteger(String value) { + try { + Integer.parseInt(value); + return true; + } catch (NumberFormatException e) { + return false; + } + } + + /** + * 判断字符串是否是浮点数 + */ + public static boolean isDouble(String value) { + try { + Double.parseDouble(value); + if (value.contains(".")) + return true; + return false; + } catch (NumberFormatException e) { + return false; + } + } + + // 整数输入框 + private void setupIntegerEditText(EditText editText) { + editText.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) {} + @Override + public void afterTextChanged(Editable editable) { + String text = editable.toString(); + // 防止输入小数点 + if (text.contains(".")) { + text = text.replace(".", ""); + editText.setText(text); + editText.setSelection(editText.getText().length()); + } + } + }); + + editText.setOnFocusChangeListener((v, hasFocus) -> { + if (!hasFocus) { + String text = editText.getText().toString().trim(); + if (text.isEmpty()) { + editText.setText("0"); + } + + }else { + // 获得焦点时再显示光标 + editText.setCursorVisible(true); + } + + + }); + // 🔑 新增:编辑完成时自动隐藏光标 + editText.setOnEditorActionListener((v, actionId, event) -> { + editText.setCursorVisible(false); + editText.clearFocus(); + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + if (imm != null) { + imm.hideSoftInputFromWindow(editText.getWindowToken(), 0); + } + return false; + }); + } + + // 小数输入框 + private void setupDecimalEditText(EditText editText) { + editText.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) {} + @Override + public void afterTextChanged(Editable editable) { + String text = editable.toString(); + // 如果只输入了 "." + if (text.equals(".")) { + editText.setText("0."); + editText.setSelection(editText.getText().length()); + } + } + }); + + editText.setOnFocusChangeListener((v, hasFocus) -> { + if (!hasFocus) { + String text = editText.getText().toString().trim(); + if (text.isEmpty()) { + editText.setText("0"); + } + }else { + // 获得焦点时再显示光标 + editText.setCursorVisible(true); + } + }); + // 🔑 新增:编辑完成时自动隐藏光标 + editText.setOnEditorActionListener((v, actionId, event) -> { + editText.setCursorVisible(false); + editText.clearFocus(); + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + if (imm != null) { + imm.hideSoftInputFromWindow(editText.getWindowToken(), 0); + } + return false; + }); + } + + // 安全取值,防止 Timer 崩溃 + private int getSafeInt(@NonNull EditText editText, int defaultValue) { + String text = editText.getText().toString().trim(); + if (text.isEmpty()) return defaultValue; + try { + return Integer.parseInt(text); + } catch (NumberFormatException e) { + return defaultValue; + } + } + + private double getSafeDouble(@NonNull EditText editText, double defaultValue) { + String text = editText.getText().toString().trim(); + if (text.isEmpty()) return defaultValue; + try { + return Double.parseDouble(text); + } catch (NumberFormatException e) { + return defaultValue; + } + } + + + + Timer timer = new Timer(); + + //-- + public MainActivity() { + robotRMACM = RobotRMACM.RMACM.newBuilder().setRobotSpeed(0).setLightBrightness(0).build(); + } + + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + + //MainViewModel binding region + mainBinding= DataBindingUtil.setContentView(this,R.layout.activity_main); + MainViewModel vm=new ViewModelProvider((ViewModelStoreOwner) this).get(MainViewModel.class); + MainViewModel.mainBinding=mainBinding; + + mainBinding.setVm(vm); + + // 整数输入框 + setupIntegerEditText(mainBinding.tvRobotChgLength); + setupIntegerEditText(mainBinding.tvRobotManualSpeed); + setupIntegerEditText(mainBinding.tvRobotAutoSpeed); + + // 小数输入框 + setupDecimalEditText(mainBinding.tvRobotLeftCompensation); + setupDecimalEditText(mainBinding.tvRobotRightCompensation); + + + // 保存数据 + String Str_RobotChgLength = "100"; + String Str_RobotLeftCompensation = "0"; + String Str_RobotRightCompensation = "0"; + String Str_RobotManualSpeed = "8"; + String Str_RobotAutoSpeed = "20"; + +// SharedPreferences sharedPreferences = getSharedPreferences("MyData", Context.MODE_PRIVATE); +// +// Str_RobotChgLength = sharedPreferences.getString("RobotChgLength",""); +// Str_RobotLeftCompensation = sharedPreferences.getString("RobotLeftCompensation",""); +// Str_RobotRightCompensation = sharedPreferences.getString("RobotRightCompensation",""); +// Str_RobotManualSpeed = sharedPreferences.getString("RobotManualSpeed",""); +// Str_RobotAutoSpeed = sharedPreferences.getString("RobotAutoSpeed",""); + + mainBinding.rFAngleRoll.setText(String.valueOf(0)); + mainBinding.tvRobotError.setText(String.valueOf(0)); + mainBinding.tvRobotChgLength.setText(Str_RobotChgLength); + mainBinding.tvRobotLeftCompensation.setText(Str_RobotLeftCompensation); + mainBinding.tvRobotRightCompensation.setText(Str_RobotRightCompensation); + mainBinding.tvForce.setText(String.valueOf(0)); + mainBinding.tvRobotManualSpeed.setText(Str_RobotManualSpeed); + mainBinding.tvRobotAutoSpeed.setText(Str_RobotAutoSpeed); + mainBinding.tvRobotCurrent.setText(String.valueOf(0)); + mainBinding.tvDynamometer.setText(String.valueOf(0)); + + /* USB串口 控制区域*/ + ttySerialPortHelper.MainActivity = this; + ttySerialPortHelper.Open(); + + /* NodePlayer 播放视频区域*/ + NodePlayer nodePlayer0=new NodePlayer(this); + // NodePlayer nodePlayer1=new NodePlayer(this); + + //String address0 = "rtsp://192.168.1.168:8554/0"; + // String address1 = "rtsp://192.168.1.169:8554/0"; + + //String addressTest = "rtsp://rtspstream:yEhp9qzAqveM9kHIE7GcL@zephyr.rtsp.stream/movie"; + String address0 = "rtsp://192.168.144.25:8554/main.264"; + /**/ + VideoPlayerHelper.startVedio(mainBinding.nodePlayerView0,nodePlayer0,address0); + // VideoPlayerHelper.startVedio(mainBinding.nodePlayerView1,nodePlayer1,address1); + //VideoPlayerHelper.startVedio(mainBinding.nodePlayerView1,nodePlayer1,addressTest); + + + + timer.schedule(new TimerTask() { + @Override + public void run() { +// byte[] sendbyteArray=new byte[4]; +// sendbyteArray[0]=(byte) 0xff; +// sendbyteArray[1]=(byte) 0xff; +// sendbyteArray[2]=(byte) robotRMACM.getLightBrightness(); +// sendbyteArray[3]=(byte) robotRMACM.getRobotSpeed(); +// mainBinding.tvRobotSpeed22.getText(); +// +// ttySerialPortHelper.SendData(sendbyteArray); + + + + _toSendPV = BspPV.PV_struct_define.newBuilder() + .setRobotChgLength(getSafeInt(mainBinding.tvRobotChgLength, 0)) + .setRobotLeftCompensation(getSafeDouble(mainBinding.tvRobotLeftCompensation, 0.0)) + .setRobotRightCompensation(getSafeDouble(mainBinding.tvRobotRightCompensation, 0.0)) + .setRobotAutoSpeedBase(getSafeDouble(mainBinding.tvRobotAutoSpeed, 0.0)) + .setRobotManualSpeedBase(getSafeDouble(mainBinding.tvRobotManualSpeed, 0.0)) + .build(); + + + + byte[] byteArray = _toSendPV.toByteArray(); + byte[] sendbyteArray = new byte[byteArray.length + 4]; + byte[] sendbyteArray3 = new byte[byteArray.length + 6]; + if (byteArray.length != 0) { + System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); + } + sendbyteArray[0] = (byte) 0x55; + sendbyteArray[1] = (byte) 0x55; + sendbyteArray[2] = (byte) 0x01; + sendbyteArray[3] = (byte) 0x01; + + byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); + + System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); + + System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); + + ttySerialPortHelper.SendData(sendbyteArray3); + } + }, 0, 1000); // 延迟 0 毫秒,每隔 1000 毫秒执行一次 + + + + } + + + + int testCounter=0; + // Create a Timer instance + + @Override + protected void onStart() { + super.onStart(); + + // serialPortHelper.onStart(); + + } + @Override + public void onStop() + { + // serialPortHelper.onStop(); + //获取SharedPreferences对象 + + SharedPreferences sharedPreferences = getSharedPreferences("MyData", Context.MODE_PRIVATE); + SharedPreferences.Editor editor =sharedPreferences.edit(); + + editor.putString("RobotChgLength", String.valueOf(mainBinding.tvRobotChgLength.getText())); + editor.putString("RobotLeftCompensation", String.valueOf(mainBinding.tvRobotLeftCompensation.getText())); + editor.putString("RobotRightCompensation", String.valueOf(mainBinding.tvRobotRightCompensation.getText())); + editor.putString("RobotManualSpeed", String.valueOf(mainBinding.tvRobotManualSpeed.getText())); + editor.putString("RobotAutoSpeed", String.valueOf(mainBinding.tvRobotAutoSpeed.getText())); + editor.apply(); + // 保存数据 + + super.onStop(); + + } + + @Override + public void onResume() + { + super.onResume(); + // serialPortHelper.onResume(); + startSending(); + } + + @Override + public void onPause() + { + // serialPortHelper.onPause(); + + SharedPreferences sharedPreferences = getSharedPreferences("MyData", Context.MODE_PRIVATE); + SharedPreferences.Editor editor =sharedPreferences.edit(); + + editor.putString("RobotChgLength", String.valueOf(mainBinding.tvRobotChgLength.getText())); + editor.putString("RobotLeftCompensation", String.valueOf(mainBinding.tvRobotLeftCompensation.getText())); + editor.putString("RobotRightCompensation", String.valueOf(mainBinding.tvRobotRightCompensation.getText())); + editor.putString("RobotManualSpeed", String.valueOf(mainBinding.tvRobotManualSpeed.getText())); + editor.putString("RobotAutoSpeed", String.valueOf(mainBinding.tvRobotAutoSpeed.getText())); + editor.apply(); + stopSending(); + super.onPause(); + } + @Override + protected void onDestroy() { + super.onDestroy(); + if (timer != null) { + timer.cancel(); + } + } + private TimerTask sendTask; + private void startSending() { + if (timer == null) { + timer = new Timer(); + sendTask = new TimerTask() { + @Override + public void run() { + _toSendPV = BspPV.PV_struct_define.newBuilder() + .setRobotChgLength(Integer.parseInt(mainBinding.tvRobotChgLength.getText().toString())) + .setRobotLeftCompensation(Double.parseDouble(mainBinding.tvRobotLeftCompensation.getText().toString())) + .setRobotRightCompensation(Double.parseDouble(mainBinding.tvRobotRightCompensation.getText().toString())) + .setRobotAutoSpeedBase(Double.parseDouble(mainBinding.tvRobotAutoSpeed.getText().toString())) + .setRobotManualSpeedBase(Double.parseDouble(mainBinding.tvRobotManualSpeed.getText().toString())) + .build(); + + byte[] byteArray = _toSendPV.toByteArray(); + byte[] sendbyteArray = new byte[byteArray.length + 4]; + byte[] sendbyteArray3 = new byte[byteArray.length + 6]; + + if (byteArray.length != 0) { + System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); + } + sendbyteArray[0] = (byte) 0x55; + sendbyteArray[1] = (byte) 0x55; + sendbyteArray[2] = (byte) 0x01; + sendbyteArray[3] = (byte) 0x01; + + byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); + + System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); + System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); + + ttySerialPortHelper.SendData(sendbyteArray3); + } + }; + timer.schedule(sendTask, 0, 1000); // 1 秒一次 + } + } + private void stopSending() { + if (timer != null) { + timer.cancel(); + timer = null; + } + if (sendTask != null) { + sendTask.cancel(); + sendTask = null; + } + } +/* + private void saveMotorError(String motorSide, String errorMsg) { + new Thread(() -> { + AppDatabase db = AppDatabase.getInstance(this); + RobotLog log = new RobotLog(); + log.type = "error"; + log.message = motorSide + " 电机报错: " + errorMsg; + log.time = System.currentTimeMillis(); + db.robotLogDao().insert(log); + }).start(); + } +*/ + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/removemarineanimals/models/BspError.java b/app/src/main/java/com/example/removemarineanimals/models/BspError.java new file mode 100644 index 0000000..a7010bd --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/models/BspError.java @@ -0,0 +1,815 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: bsp_Error.proto +// Protobuf Java Version: 4.27.2 + +package com.example.removemarineanimals.models; + +public final class BspError { + private BspError() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + BspError.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code ComError} + */ + public enum ComError + implements com.google.protobuf.ProtocolMessageEnum { + /** + * MK32_SBus = 0; + */ + MK32_SBus(0), + /** + * TL720D = 1; + */ + TL720D(1), + /** + * Force_sensor = 2; + */ + Force_sensor(2), + /** + * ZQ_LeftMotor = 3; + */ + ZQ_LeftMotor(3), + /** + * ZQ_RightMotor = 4; + */ + ZQ_RightMotor(4), + /** + * DMAKE_1 = 5; + */ + DMAKE_1(5), + /** + *
+     * DMAKE_2 		=	6;
+     * DMAKE_3 		=	7;
+     * 
+ * + * MK32_Serial = 6; + */ + MK32_Serial(6), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + ComError.class.getName()); + } + /** + * MK32_SBus = 0; + */ + public static final int MK32_SBus_VALUE = 0; + /** + * TL720D = 1; + */ + public static final int TL720D_VALUE = 1; + /** + * Force_sensor = 2; + */ + public static final int Force_sensor_VALUE = 2; + /** + * ZQ_LeftMotor = 3; + */ + public static final int ZQ_LeftMotor_VALUE = 3; + /** + * ZQ_RightMotor = 4; + */ + public static final int ZQ_RightMotor_VALUE = 4; + /** + * DMAKE_1 = 5; + */ + public static final int DMAKE_1_VALUE = 5; + /** + *
+     * DMAKE_2 		=	6;
+     * DMAKE_3 		=	7;
+     * 
+ * + * MK32_Serial = 6; + */ + public static final int MK32_Serial_VALUE = 6; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ComError valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ComError forNumber(int value) { + switch (value) { + case 0: return MK32_SBus; + case 1: return TL720D; + case 2: return Force_sensor; + case 3: return ZQ_LeftMotor; + case 4: return ZQ_RightMotor; + case 5: return DMAKE_1; + case 6: return MK32_Serial; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ComError> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ComError findValueByNumber(int number) { + return ComError.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.example.removemarineanimals.models.BspError.getDescriptor().getEnumTypes().get(0); + } + + private static final ComError[] VALUES = values(); + + public static ComError valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ComError(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:ComError) + } + + public interface ErrorDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:ErrorData) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 Com_Error_Code = 1; + * @return The comErrorCode. + */ + int getComErrorCode(); + + /** + * int32 Left_Motor_Error_Code = 2; + * @return The leftMotorErrorCode. + */ + int getLeftMotorErrorCode(); + + /** + * int32 Right_Motor_Error_Code = 3; + * @return The rightMotorErrorCode. + */ + int getRightMotorErrorCode(); + } + /** + * Protobuf type {@code ErrorData} + */ + public static final class ErrorData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:ErrorData) + ErrorDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + ErrorData.class.getName()); + } + // Use ErrorData.newBuilder() to construct. + private ErrorData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ErrorData() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.removemarineanimals.models.BspError.internal_static_ErrorData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.removemarineanimals.models.BspError.internal_static_ErrorData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.removemarineanimals.models.BspError.ErrorData.class, com.example.removemarineanimals.models.BspError.ErrorData.Builder.class); + } + + public static final int COM_ERROR_CODE_FIELD_NUMBER = 1; + private int comErrorCode_ = 0; + /** + * int32 Com_Error_Code = 1; + * @return The comErrorCode. + */ + @java.lang.Override + public int getComErrorCode() { + return comErrorCode_; + } + + public static final int LEFT_MOTOR_ERROR_CODE_FIELD_NUMBER = 2; + private int leftMotorErrorCode_ = 0; + /** + * int32 Left_Motor_Error_Code = 2; + * @return The leftMotorErrorCode. + */ + @java.lang.Override + public int getLeftMotorErrorCode() { + return leftMotorErrorCode_; + } + + public static final int RIGHT_MOTOR_ERROR_CODE_FIELD_NUMBER = 3; + private int rightMotorErrorCode_ = 0; + /** + * int32 Right_Motor_Error_Code = 3; + * @return The rightMotorErrorCode. + */ + @java.lang.Override + public int getRightMotorErrorCode() { + return rightMotorErrorCode_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (comErrorCode_ != 0) { + output.writeInt32(1, comErrorCode_); + } + if (leftMotorErrorCode_ != 0) { + output.writeInt32(2, leftMotorErrorCode_); + } + if (rightMotorErrorCode_ != 0) { + output.writeInt32(3, rightMotorErrorCode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (comErrorCode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, comErrorCode_); + } + if (leftMotorErrorCode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, leftMotorErrorCode_); + } + if (rightMotorErrorCode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, rightMotorErrorCode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.example.removemarineanimals.models.BspError.ErrorData)) { + return super.equals(obj); + } + com.example.removemarineanimals.models.BspError.ErrorData other = (com.example.removemarineanimals.models.BspError.ErrorData) obj; + + if (getComErrorCode() + != other.getComErrorCode()) return false; + if (getLeftMotorErrorCode() + != other.getLeftMotorErrorCode()) return false; + if (getRightMotorErrorCode() + != other.getRightMotorErrorCode()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + COM_ERROR_CODE_FIELD_NUMBER; + hash = (53 * hash) + getComErrorCode(); + hash = (37 * hash) + LEFT_MOTOR_ERROR_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLeftMotorErrorCode(); + hash = (37 * hash) + RIGHT_MOTOR_ERROR_CODE_FIELD_NUMBER; + hash = (53 * hash) + getRightMotorErrorCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.example.removemarineanimals.models.BspError.ErrorData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.example.removemarineanimals.models.BspError.ErrorData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.removemarineanimals.models.BspError.ErrorData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.example.removemarineanimals.models.BspError.ErrorData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code ErrorData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:ErrorData) + com.example.removemarineanimals.models.BspError.ErrorDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.removemarineanimals.models.BspError.internal_static_ErrorData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.removemarineanimals.models.BspError.internal_static_ErrorData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.removemarineanimals.models.BspError.ErrorData.class, com.example.removemarineanimals.models.BspError.ErrorData.Builder.class); + } + + // Construct using com.example.removemarineanimals.models.BspError.ErrorData.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + comErrorCode_ = 0; + leftMotorErrorCode_ = 0; + rightMotorErrorCode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.removemarineanimals.models.BspError.internal_static_ErrorData_descriptor; + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspError.ErrorData getDefaultInstanceForType() { + return com.example.removemarineanimals.models.BspError.ErrorData.getDefaultInstance(); + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspError.ErrorData build() { + com.example.removemarineanimals.models.BspError.ErrorData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspError.ErrorData buildPartial() { + com.example.removemarineanimals.models.BspError.ErrorData result = new com.example.removemarineanimals.models.BspError.ErrorData(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.example.removemarineanimals.models.BspError.ErrorData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.comErrorCode_ = comErrorCode_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.leftMotorErrorCode_ = leftMotorErrorCode_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.rightMotorErrorCode_ = rightMotorErrorCode_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.removemarineanimals.models.BspError.ErrorData) { + return mergeFrom((com.example.removemarineanimals.models.BspError.ErrorData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.removemarineanimals.models.BspError.ErrorData other) { + if (other == com.example.removemarineanimals.models.BspError.ErrorData.getDefaultInstance()) return this; + if (other.getComErrorCode() != 0) { + setComErrorCode(other.getComErrorCode()); + } + if (other.getLeftMotorErrorCode() != 0) { + setLeftMotorErrorCode(other.getLeftMotorErrorCode()); + } + if (other.getRightMotorErrorCode() != 0) { + setRightMotorErrorCode(other.getRightMotorErrorCode()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + comErrorCode_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + leftMotorErrorCode_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + rightMotorErrorCode_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int comErrorCode_ ; + /** + * int32 Com_Error_Code = 1; + * @return The comErrorCode. + */ + @java.lang.Override + public int getComErrorCode() { + return comErrorCode_; + } + /** + * int32 Com_Error_Code = 1; + * @param value The comErrorCode to set. + * @return This builder for chaining. + */ + public Builder setComErrorCode(int value) { + + comErrorCode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 Com_Error_Code = 1; + * @return This builder for chaining. + */ + public Builder clearComErrorCode() { + bitField0_ = (bitField0_ & ~0x00000001); + comErrorCode_ = 0; + onChanged(); + return this; + } + + private int leftMotorErrorCode_ ; + /** + * int32 Left_Motor_Error_Code = 2; + * @return The leftMotorErrorCode. + */ + @java.lang.Override + public int getLeftMotorErrorCode() { + return leftMotorErrorCode_; + } + /** + * int32 Left_Motor_Error_Code = 2; + * @param value The leftMotorErrorCode to set. + * @return This builder for chaining. + */ + public Builder setLeftMotorErrorCode(int value) { + + leftMotorErrorCode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 Left_Motor_Error_Code = 2; + * @return This builder for chaining. + */ + public Builder clearLeftMotorErrorCode() { + bitField0_ = (bitField0_ & ~0x00000002); + leftMotorErrorCode_ = 0; + onChanged(); + return this; + } + + private int rightMotorErrorCode_ ; + /** + * int32 Right_Motor_Error_Code = 3; + * @return The rightMotorErrorCode. + */ + @java.lang.Override + public int getRightMotorErrorCode() { + return rightMotorErrorCode_; + } + /** + * int32 Right_Motor_Error_Code = 3; + * @param value The rightMotorErrorCode to set. + * @return This builder for chaining. + */ + public Builder setRightMotorErrorCode(int value) { + + rightMotorErrorCode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int32 Right_Motor_Error_Code = 3; + * @return This builder for chaining. + */ + public Builder clearRightMotorErrorCode() { + bitField0_ = (bitField0_ & ~0x00000004); + rightMotorErrorCode_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ErrorData) + } + + // @@protoc_insertion_point(class_scope:ErrorData) + private static final com.example.removemarineanimals.models.BspError.ErrorData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.removemarineanimals.models.BspError.ErrorData(); + } + + public static com.example.removemarineanimals.models.BspError.ErrorData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspError.ErrorData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_ErrorData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_ErrorData_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017bsp_Error.proto\"b\n\tErrorData\022\026\n\016Com_Er" + + "ror_Code\030\001 \001(\005\022\035\n\025Left_Motor_Error_Code\030" + + "\002 \001(\005\022\036\n\026Right_Motor_Error_Code\030\003 \001(\005*z\n" + + "\010ComError\022\r\n\tMK32_SBus\020\000\022\n\n\006TL720D\020\001\022\020\n\014" + + "Force_sensor\020\002\022\020\n\014ZQ_LeftMotor\020\003\022\021\n\rZQ_R" + + "ightMotor\020\004\022\013\n\007DMAKE_1\020\005\022\017\n\013MK32_Serial\020" + + "\006B*\n&com.example.removemarineanimals.mod" + + "elsP\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_ErrorData_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_ErrorData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_ErrorData_descriptor, + new java.lang.String[] { "ComErrorCode", "LeftMotorErrorCode", "RightMotorErrorCode", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/app/src/main/java/com/example/removemarineanimals/models/BspIV.java b/app/src/main/java/com/example/removemarineanimals/models/BspIV.java new file mode 100644 index 0000000..61fc59e --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/models/BspIV.java @@ -0,0 +1,1314 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: bsp_IV.proto +// Protobuf Java Version: 4.27.2 + +package com.example.removemarineanimals.models; + +public final class BspIV { + private BspIV() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + BspIV.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface IV_struct_defineOrBuilder extends + // @@protoc_insertion_point(interface_extends:IV_struct_define) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * 五轮项目
+     * 
+ * + * int32 Robot_Move_AutoSpeed = 1; + * @return The robotMoveAutoSpeed. + */ + int getRobotMoveAutoSpeed(); + + /** + * int32 Robot_Move_ManualSpeed = 2; + * @return The robotMoveManualSpeed. + */ + int getRobotMoveManualSpeed(); + + /** + * int32 Robot_CurrentPosition = 3; + * @return The robotCurrentPosition. + */ + int getRobotCurrentPosition(); + + /** + * int32 Robot_AngleRoll = 4; + * @return The robotAngleRoll. + */ + int getRobotAngleRoll(); + + /** + * int32 Robot_Error = 5; + * @return The robotError. + */ + int getRobotError(); + + /** + * int32 Robot_DynamometerValue = 6; + * @return The robotDynamometerValue. + */ + int getRobotDynamometerValue(); + + /** + * int32 Robot_ForceValue = 7; + * @return The robotForceValue. + */ + int getRobotForceValue(); + + /** + * int32 Robot_CurrentState = 8; + * @return The robotCurrentState. + */ + int getRobotCurrentState(); + + /** + * int32 Robot_Current_Left = 9; + * @return The robotCurrentLeft. + */ + int getRobotCurrentLeft(); + + /** + * int32 Robot_Current_Right = 10; + * @return The robotCurrentRight. + */ + int getRobotCurrentRight(); + + /** + * int32 Robot_Error_Left = 11; + * @return The robotErrorLeft. + */ + int getRobotErrorLeft(); + + /** + * int32 Robot_Error_Right = 12; + * @return The robotErrorRight. + */ + int getRobotErrorRight(); + } + /** + * Protobuf type {@code IV_struct_define} + */ + public static final class IV_struct_define extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:IV_struct_define) + IV_struct_defineOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + IV_struct_define.class.getName()); + } + // Use IV_struct_define.newBuilder() to construct. + private IV_struct_define(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private IV_struct_define() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.removemarineanimals.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.removemarineanimals.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.removemarineanimals.models.BspIV.IV_struct_define.class, com.example.removemarineanimals.models.BspIV.IV_struct_define.Builder.class); + } + + public static final int ROBOT_MOVE_AUTOSPEED_FIELD_NUMBER = 1; + private int robotMoveAutoSpeed_ = 0; + /** + *
+     * 五轮项目
+     * 
+ * + * int32 Robot_Move_AutoSpeed = 1; + * @return The robotMoveAutoSpeed. + */ + @java.lang.Override + public int getRobotMoveAutoSpeed() { + return robotMoveAutoSpeed_; + } + + public static final int ROBOT_MOVE_MANUALSPEED_FIELD_NUMBER = 2; + private int robotMoveManualSpeed_ = 0; + /** + * int32 Robot_Move_ManualSpeed = 2; + * @return The robotMoveManualSpeed. + */ + @java.lang.Override + public int getRobotMoveManualSpeed() { + return robotMoveManualSpeed_; + } + + public static final int ROBOT_CURRENTPOSITION_FIELD_NUMBER = 3; + private int robotCurrentPosition_ = 0; + /** + * int32 Robot_CurrentPosition = 3; + * @return The robotCurrentPosition. + */ + @java.lang.Override + public int getRobotCurrentPosition() { + return robotCurrentPosition_; + } + + public static final int ROBOT_ANGLEROLL_FIELD_NUMBER = 4; + private int robotAngleRoll_ = 0; + /** + * int32 Robot_AngleRoll = 4; + * @return The robotAngleRoll. + */ + @java.lang.Override + public int getRobotAngleRoll() { + return robotAngleRoll_; + } + + public static final int ROBOT_ERROR_FIELD_NUMBER = 5; + private int robotError_ = 0; + /** + * int32 Robot_Error = 5; + * @return The robotError. + */ + @java.lang.Override + public int getRobotError() { + return robotError_; + } + + public static final int ROBOT_DYNAMOMETERVALUE_FIELD_NUMBER = 6; + private int robotDynamometerValue_ = 0; + /** + * int32 Robot_DynamometerValue = 6; + * @return The robotDynamometerValue. + */ + @java.lang.Override + public int getRobotDynamometerValue() { + return robotDynamometerValue_; + } + + public static final int ROBOT_FORCEVALUE_FIELD_NUMBER = 7; + private int robotForceValue_ = 0; + /** + * int32 Robot_ForceValue = 7; + * @return The robotForceValue. + */ + @java.lang.Override + public int getRobotForceValue() { + return robotForceValue_; + } + + public static final int ROBOT_CURRENTSTATE_FIELD_NUMBER = 8; + private int robotCurrentState_ = 0; + /** + * int32 Robot_CurrentState = 8; + * @return The robotCurrentState. + */ + @java.lang.Override + public int getRobotCurrentState() { + return robotCurrentState_; + } + + public static final int ROBOT_CURRENT_LEFT_FIELD_NUMBER = 9; + private int robotCurrentLeft_ = 0; + /** + * int32 Robot_Current_Left = 9; + * @return The robotCurrentLeft. + */ + @java.lang.Override + public int getRobotCurrentLeft() { + return robotCurrentLeft_; + } + + public static final int ROBOT_CURRENT_RIGHT_FIELD_NUMBER = 10; + private int robotCurrentRight_ = 0; + /** + * int32 Robot_Current_Right = 10; + * @return The robotCurrentRight. + */ + @java.lang.Override + public int getRobotCurrentRight() { + return robotCurrentRight_; + } + + public static final int ROBOT_ERROR_LEFT_FIELD_NUMBER = 11; + private int robotErrorLeft_ = 0; + /** + * int32 Robot_Error_Left = 11; + * @return The robotErrorLeft. + */ + @java.lang.Override + public int getRobotErrorLeft() { + return robotErrorLeft_; + } + + public static final int ROBOT_ERROR_RIGHT_FIELD_NUMBER = 12; + private int robotErrorRight_ = 0; + /** + * int32 Robot_Error_Right = 12; + * @return The robotErrorRight. + */ + @java.lang.Override + public int getRobotErrorRight() { + return robotErrorRight_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (robotMoveAutoSpeed_ != 0) { + output.writeInt32(1, robotMoveAutoSpeed_); + } + if (robotMoveManualSpeed_ != 0) { + output.writeInt32(2, robotMoveManualSpeed_); + } + if (robotCurrentPosition_ != 0) { + output.writeInt32(3, robotCurrentPosition_); + } + if (robotAngleRoll_ != 0) { + output.writeInt32(4, robotAngleRoll_); + } + if (robotError_ != 0) { + output.writeInt32(5, robotError_); + } + if (robotDynamometerValue_ != 0) { + output.writeInt32(6, robotDynamometerValue_); + } + if (robotForceValue_ != 0) { + output.writeInt32(7, robotForceValue_); + } + if (robotCurrentState_ != 0) { + output.writeInt32(8, robotCurrentState_); + } + if (robotCurrentLeft_ != 0) { + output.writeInt32(9, robotCurrentLeft_); + } + if (robotCurrentRight_ != 0) { + output.writeInt32(10, robotCurrentRight_); + } + if (robotErrorLeft_ != 0) { + output.writeInt32(11, robotErrorLeft_); + } + if (robotErrorRight_ != 0) { + output.writeInt32(12, robotErrorRight_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (robotMoveAutoSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, robotMoveAutoSpeed_); + } + if (robotMoveManualSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, robotMoveManualSpeed_); + } + if (robotCurrentPosition_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, robotCurrentPosition_); + } + if (robotAngleRoll_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, robotAngleRoll_); + } + if (robotError_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, robotError_); + } + if (robotDynamometerValue_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, robotDynamometerValue_); + } + if (robotForceValue_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, robotForceValue_); + } + if (robotCurrentState_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, robotCurrentState_); + } + if (robotCurrentLeft_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, robotCurrentLeft_); + } + if (robotCurrentRight_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, robotCurrentRight_); + } + if (robotErrorLeft_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, robotErrorLeft_); + } + if (robotErrorRight_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(12, robotErrorRight_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.example.removemarineanimals.models.BspIV.IV_struct_define)) { + return super.equals(obj); + } + com.example.removemarineanimals.models.BspIV.IV_struct_define other = (com.example.removemarineanimals.models.BspIV.IV_struct_define) obj; + + if (getRobotMoveAutoSpeed() + != other.getRobotMoveAutoSpeed()) return false; + if (getRobotMoveManualSpeed() + != other.getRobotMoveManualSpeed()) return false; + if (getRobotCurrentPosition() + != other.getRobotCurrentPosition()) return false; + if (getRobotAngleRoll() + != other.getRobotAngleRoll()) return false; + if (getRobotError() + != other.getRobotError()) return false; + if (getRobotDynamometerValue() + != other.getRobotDynamometerValue()) return false; + if (getRobotForceValue() + != other.getRobotForceValue()) return false; + if (getRobotCurrentState() + != other.getRobotCurrentState()) return false; + if (getRobotCurrentLeft() + != other.getRobotCurrentLeft()) return false; + if (getRobotCurrentRight() + != other.getRobotCurrentRight()) return false; + if (getRobotErrorLeft() + != other.getRobotErrorLeft()) return false; + if (getRobotErrorRight() + != other.getRobotErrorRight()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ROBOT_MOVE_AUTOSPEED_FIELD_NUMBER; + hash = (53 * hash) + getRobotMoveAutoSpeed(); + hash = (37 * hash) + ROBOT_MOVE_MANUALSPEED_FIELD_NUMBER; + hash = (53 * hash) + getRobotMoveManualSpeed(); + hash = (37 * hash) + ROBOT_CURRENTPOSITION_FIELD_NUMBER; + hash = (53 * hash) + getRobotCurrentPosition(); + hash = (37 * hash) + ROBOT_ANGLEROLL_FIELD_NUMBER; + hash = (53 * hash) + getRobotAngleRoll(); + hash = (37 * hash) + ROBOT_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getRobotError(); + hash = (37 * hash) + ROBOT_DYNAMOMETERVALUE_FIELD_NUMBER; + hash = (53 * hash) + getRobotDynamometerValue(); + hash = (37 * hash) + ROBOT_FORCEVALUE_FIELD_NUMBER; + hash = (53 * hash) + getRobotForceValue(); + hash = (37 * hash) + ROBOT_CURRENTSTATE_FIELD_NUMBER; + hash = (53 * hash) + getRobotCurrentState(); + hash = (37 * hash) + ROBOT_CURRENT_LEFT_FIELD_NUMBER; + hash = (53 * hash) + getRobotCurrentLeft(); + hash = (37 * hash) + ROBOT_CURRENT_RIGHT_FIELD_NUMBER; + hash = (53 * hash) + getRobotCurrentRight(); + hash = (37 * hash) + ROBOT_ERROR_LEFT_FIELD_NUMBER; + hash = (53 * hash) + getRobotErrorLeft(); + hash = (37 * hash) + ROBOT_ERROR_RIGHT_FIELD_NUMBER; + hash = (53 * hash) + getRobotErrorRight(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.removemarineanimals.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.example.removemarineanimals.models.BspIV.IV_struct_define prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IV_struct_define} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:IV_struct_define) + com.example.removemarineanimals.models.BspIV.IV_struct_defineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.removemarineanimals.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.removemarineanimals.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.removemarineanimals.models.BspIV.IV_struct_define.class, com.example.removemarineanimals.models.BspIV.IV_struct_define.Builder.class); + } + + // Construct using com.example.removemarineanimals.models.BspIV.IV_struct_define.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + robotMoveAutoSpeed_ = 0; + robotMoveManualSpeed_ = 0; + robotCurrentPosition_ = 0; + robotAngleRoll_ = 0; + robotError_ = 0; + robotDynamometerValue_ = 0; + robotForceValue_ = 0; + robotCurrentState_ = 0; + robotCurrentLeft_ = 0; + robotCurrentRight_ = 0; + robotErrorLeft_ = 0; + robotErrorRight_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.removemarineanimals.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspIV.IV_struct_define getDefaultInstanceForType() { + return com.example.removemarineanimals.models.BspIV.IV_struct_define.getDefaultInstance(); + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspIV.IV_struct_define build() { + com.example.removemarineanimals.models.BspIV.IV_struct_define result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspIV.IV_struct_define buildPartial() { + com.example.removemarineanimals.models.BspIV.IV_struct_define result = new com.example.removemarineanimals.models.BspIV.IV_struct_define(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.example.removemarineanimals.models.BspIV.IV_struct_define result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.robotMoveAutoSpeed_ = robotMoveAutoSpeed_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.robotMoveManualSpeed_ = robotMoveManualSpeed_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.robotCurrentPosition_ = robotCurrentPosition_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.robotAngleRoll_ = robotAngleRoll_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.robotError_ = robotError_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.robotDynamometerValue_ = robotDynamometerValue_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.robotForceValue_ = robotForceValue_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.robotCurrentState_ = robotCurrentState_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.robotCurrentLeft_ = robotCurrentLeft_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.robotCurrentRight_ = robotCurrentRight_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.robotErrorLeft_ = robotErrorLeft_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.robotErrorRight_ = robotErrorRight_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.removemarineanimals.models.BspIV.IV_struct_define) { + return mergeFrom((com.example.removemarineanimals.models.BspIV.IV_struct_define)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.removemarineanimals.models.BspIV.IV_struct_define other) { + if (other == com.example.removemarineanimals.models.BspIV.IV_struct_define.getDefaultInstance()) return this; + if (other.getRobotMoveAutoSpeed() != 0) { + setRobotMoveAutoSpeed(other.getRobotMoveAutoSpeed()); + } + if (other.getRobotMoveManualSpeed() != 0) { + setRobotMoveManualSpeed(other.getRobotMoveManualSpeed()); + } + if (other.getRobotCurrentPosition() != 0) { + setRobotCurrentPosition(other.getRobotCurrentPosition()); + } + if (other.getRobotAngleRoll() != 0) { + setRobotAngleRoll(other.getRobotAngleRoll()); + } + if (other.getRobotError() != 0) { + setRobotError(other.getRobotError()); + } + if (other.getRobotDynamometerValue() != 0) { + setRobotDynamometerValue(other.getRobotDynamometerValue()); + } + if (other.getRobotForceValue() != 0) { + setRobotForceValue(other.getRobotForceValue()); + } + if (other.getRobotCurrentState() != 0) { + setRobotCurrentState(other.getRobotCurrentState()); + } + if (other.getRobotCurrentLeft() != 0) { + setRobotCurrentLeft(other.getRobotCurrentLeft()); + } + if (other.getRobotCurrentRight() != 0) { + setRobotCurrentRight(other.getRobotCurrentRight()); + } + if (other.getRobotErrorLeft() != 0) { + setRobotErrorLeft(other.getRobotErrorLeft()); + } + if (other.getRobotErrorRight() != 0) { + setRobotErrorRight(other.getRobotErrorRight()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + robotMoveAutoSpeed_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + robotMoveManualSpeed_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + robotCurrentPosition_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + robotAngleRoll_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + robotError_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + robotDynamometerValue_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + robotForceValue_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + robotCurrentState_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + robotCurrentLeft_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + robotCurrentRight_ = input.readInt32(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + robotErrorLeft_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + robotErrorRight_ = input.readInt32(); + bitField0_ |= 0x00000800; + break; + } // case 96 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int robotMoveAutoSpeed_ ; + /** + *
+       * 五轮项目
+       * 
+ * + * int32 Robot_Move_AutoSpeed = 1; + * @return The robotMoveAutoSpeed. + */ + @java.lang.Override + public int getRobotMoveAutoSpeed() { + return robotMoveAutoSpeed_; + } + /** + *
+       * 五轮项目
+       * 
+ * + * int32 Robot_Move_AutoSpeed = 1; + * @param value The robotMoveAutoSpeed to set. + * @return This builder for chaining. + */ + public Builder setRobotMoveAutoSpeed(int value) { + + robotMoveAutoSpeed_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * 五轮项目
+       * 
+ * + * int32 Robot_Move_AutoSpeed = 1; + * @return This builder for chaining. + */ + public Builder clearRobotMoveAutoSpeed() { + bitField0_ = (bitField0_ & ~0x00000001); + robotMoveAutoSpeed_ = 0; + onChanged(); + return this; + } + + private int robotMoveManualSpeed_ ; + /** + * int32 Robot_Move_ManualSpeed = 2; + * @return The robotMoveManualSpeed. + */ + @java.lang.Override + public int getRobotMoveManualSpeed() { + return robotMoveManualSpeed_; + } + /** + * int32 Robot_Move_ManualSpeed = 2; + * @param value The robotMoveManualSpeed to set. + * @return This builder for chaining. + */ + public Builder setRobotMoveManualSpeed(int value) { + + robotMoveManualSpeed_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 Robot_Move_ManualSpeed = 2; + * @return This builder for chaining. + */ + public Builder clearRobotMoveManualSpeed() { + bitField0_ = (bitField0_ & ~0x00000002); + robotMoveManualSpeed_ = 0; + onChanged(); + return this; + } + + private int robotCurrentPosition_ ; + /** + * int32 Robot_CurrentPosition = 3; + * @return The robotCurrentPosition. + */ + @java.lang.Override + public int getRobotCurrentPosition() { + return robotCurrentPosition_; + } + /** + * int32 Robot_CurrentPosition = 3; + * @param value The robotCurrentPosition to set. + * @return This builder for chaining. + */ + public Builder setRobotCurrentPosition(int value) { + + robotCurrentPosition_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int32 Robot_CurrentPosition = 3; + * @return This builder for chaining. + */ + public Builder clearRobotCurrentPosition() { + bitField0_ = (bitField0_ & ~0x00000004); + robotCurrentPosition_ = 0; + onChanged(); + return this; + } + + private int robotAngleRoll_ ; + /** + * int32 Robot_AngleRoll = 4; + * @return The robotAngleRoll. + */ + @java.lang.Override + public int getRobotAngleRoll() { + return robotAngleRoll_; + } + /** + * int32 Robot_AngleRoll = 4; + * @param value The robotAngleRoll to set. + * @return This builder for chaining. + */ + public Builder setRobotAngleRoll(int value) { + + robotAngleRoll_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int32 Robot_AngleRoll = 4; + * @return This builder for chaining. + */ + public Builder clearRobotAngleRoll() { + bitField0_ = (bitField0_ & ~0x00000008); + robotAngleRoll_ = 0; + onChanged(); + return this; + } + + private int robotError_ ; + /** + * int32 Robot_Error = 5; + * @return The robotError. + */ + @java.lang.Override + public int getRobotError() { + return robotError_; + } + /** + * int32 Robot_Error = 5; + * @param value The robotError to set. + * @return This builder for chaining. + */ + public Builder setRobotError(int value) { + + robotError_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int32 Robot_Error = 5; + * @return This builder for chaining. + */ + public Builder clearRobotError() { + bitField0_ = (bitField0_ & ~0x00000010); + robotError_ = 0; + onChanged(); + return this; + } + + private int robotDynamometerValue_ ; + /** + * int32 Robot_DynamometerValue = 6; + * @return The robotDynamometerValue. + */ + @java.lang.Override + public int getRobotDynamometerValue() { + return robotDynamometerValue_; + } + /** + * int32 Robot_DynamometerValue = 6; + * @param value The robotDynamometerValue to set. + * @return This builder for chaining. + */ + public Builder setRobotDynamometerValue(int value) { + + robotDynamometerValue_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int32 Robot_DynamometerValue = 6; + * @return This builder for chaining. + */ + public Builder clearRobotDynamometerValue() { + bitField0_ = (bitField0_ & ~0x00000020); + robotDynamometerValue_ = 0; + onChanged(); + return this; + } + + private int robotForceValue_ ; + /** + * int32 Robot_ForceValue = 7; + * @return The robotForceValue. + */ + @java.lang.Override + public int getRobotForceValue() { + return robotForceValue_; + } + /** + * int32 Robot_ForceValue = 7; + * @param value The robotForceValue to set. + * @return This builder for chaining. + */ + public Builder setRobotForceValue(int value) { + + robotForceValue_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * int32 Robot_ForceValue = 7; + * @return This builder for chaining. + */ + public Builder clearRobotForceValue() { + bitField0_ = (bitField0_ & ~0x00000040); + robotForceValue_ = 0; + onChanged(); + return this; + } + + private int robotCurrentState_ ; + /** + * int32 Robot_CurrentState = 8; + * @return The robotCurrentState. + */ + @java.lang.Override + public int getRobotCurrentState() { + return robotCurrentState_; + } + /** + * int32 Robot_CurrentState = 8; + * @param value The robotCurrentState to set. + * @return This builder for chaining. + */ + public Builder setRobotCurrentState(int value) { + + robotCurrentState_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * int32 Robot_CurrentState = 8; + * @return This builder for chaining. + */ + public Builder clearRobotCurrentState() { + bitField0_ = (bitField0_ & ~0x00000080); + robotCurrentState_ = 0; + onChanged(); + return this; + } + + private int robotCurrentLeft_ ; + /** + * int32 Robot_Current_Left = 9; + * @return The robotCurrentLeft. + */ + @java.lang.Override + public int getRobotCurrentLeft() { + return robotCurrentLeft_; + } + /** + * int32 Robot_Current_Left = 9; + * @param value The robotCurrentLeft to set. + * @return This builder for chaining. + */ + public Builder setRobotCurrentLeft(int value) { + + robotCurrentLeft_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * int32 Robot_Current_Left = 9; + * @return This builder for chaining. + */ + public Builder clearRobotCurrentLeft() { + bitField0_ = (bitField0_ & ~0x00000100); + robotCurrentLeft_ = 0; + onChanged(); + return this; + } + + private int robotCurrentRight_ ; + /** + * int32 Robot_Current_Right = 10; + * @return The robotCurrentRight. + */ + @java.lang.Override + public int getRobotCurrentRight() { + return robotCurrentRight_; + } + /** + * int32 Robot_Current_Right = 10; + * @param value The robotCurrentRight to set. + * @return This builder for chaining. + */ + public Builder setRobotCurrentRight(int value) { + + robotCurrentRight_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * int32 Robot_Current_Right = 10; + * @return This builder for chaining. + */ + public Builder clearRobotCurrentRight() { + bitField0_ = (bitField0_ & ~0x00000200); + robotCurrentRight_ = 0; + onChanged(); + return this; + } + + private int robotErrorLeft_ ; + /** + * int32 Robot_Error_Left = 11; + * @return The robotErrorLeft. + */ + @java.lang.Override + public int getRobotErrorLeft() { + return robotErrorLeft_; + } + /** + * int32 Robot_Error_Left = 11; + * @param value The robotErrorLeft to set. + * @return This builder for chaining. + */ + public Builder setRobotErrorLeft(int value) { + + robotErrorLeft_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * int32 Robot_Error_Left = 11; + * @return This builder for chaining. + */ + public Builder clearRobotErrorLeft() { + bitField0_ = (bitField0_ & ~0x00000400); + robotErrorLeft_ = 0; + onChanged(); + return this; + } + + private int robotErrorRight_ ; + /** + * int32 Robot_Error_Right = 12; + * @return The robotErrorRight. + */ + @java.lang.Override + public int getRobotErrorRight() { + return robotErrorRight_; + } + /** + * int32 Robot_Error_Right = 12; + * @param value The robotErrorRight to set. + * @return This builder for chaining. + */ + public Builder setRobotErrorRight(int value) { + + robotErrorRight_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * int32 Robot_Error_Right = 12; + * @return This builder for chaining. + */ + public Builder clearRobotErrorRight() { + bitField0_ = (bitField0_ & ~0x00000800); + robotErrorRight_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:IV_struct_define) + } + + // @@protoc_insertion_point(class_scope:IV_struct_define) + private static final com.example.removemarineanimals.models.BspIV.IV_struct_define DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.removemarineanimals.models.BspIV.IV_struct_define(); + } + + public static com.example.removemarineanimals.models.BspIV.IV_struct_define getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IV_struct_define parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspIV.IV_struct_define getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IV_struct_define_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_IV_struct_define_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014bsp_IV.proto\"\341\002\n\020IV_struct_define\022\034\n\024R" + + "obot_Move_AutoSpeed\030\001 \001(\005\022\036\n\026Robot_Move_" + + "ManualSpeed\030\002 \001(\005\022\035\n\025Robot_CurrentPositi" + + "on\030\003 \001(\005\022\027\n\017Robot_AngleRoll\030\004 \001(\005\022\023\n\013Rob" + + "ot_Error\030\005 \001(\005\022\036\n\026Robot_DynamometerValue" + + "\030\006 \001(\005\022\030\n\020Robot_ForceValue\030\007 \001(\005\022\032\n\022Robo" + + "t_CurrentState\030\010 \001(\005\022\032\n\022Robot_Current_Le" + + "ft\030\t \001(\005\022\033\n\023Robot_Current_Right\030\n \001(\005\022\030\n" + + "\020Robot_Error_Left\030\013 \001(\005\022\031\n\021Robot_Error_R" + + "ight\030\014 \001(\005B*\n&com.example.removemarinean" + + "imals.modelsP\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_IV_struct_define_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_IV_struct_define_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_IV_struct_define_descriptor, + new java.lang.String[] { "RobotMoveAutoSpeed", "RobotMoveManualSpeed", "RobotCurrentPosition", "RobotAngleRoll", "RobotError", "RobotDynamometerValue", "RobotForceValue", "RobotCurrentState", "RobotCurrentLeft", "RobotCurrentRight", "RobotErrorLeft", "RobotErrorRight", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/app/src/main/java/com/example/removemarineanimals/models/BspPV.java b/app/src/main/java/com/example/removemarineanimals/models/BspPV.java new file mode 100644 index 0000000..05a7fa5 --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/models/BspPV.java @@ -0,0 +1,793 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: bsp_PV.proto +// Protobuf Java Version: 4.27.2 + +package com.example.removemarineanimals.models; + +public final class BspPV { + private BspPV() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + BspPV.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface PV_struct_defineOrBuilder extends + // @@protoc_insertion_point(interface_extends:PV_struct_define) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 Robot_ChgLength = 1; + * @return The robotChgLength. + */ + int getRobotChgLength(); + + /** + * double Robot_LeftCompensation = 2; + * @return The robotLeftCompensation. + */ + double getRobotLeftCompensation(); + + /** + * double Robot_RightCompensation = 3; + * @return The robotRightCompensation. + */ + double getRobotRightCompensation(); + + /** + * double Robot_AutoSpeedBase = 4; + * @return The robotAutoSpeedBase. + */ + double getRobotAutoSpeedBase(); + + /** + * double Robot_ManualSpeedBase = 5; + * @return The robotManualSpeedBase. + */ + double getRobotManualSpeedBase(); + } + /** + * Protobuf type {@code PV_struct_define} + */ + public static final class PV_struct_define extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:PV_struct_define) + PV_struct_defineOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + PV_struct_define.class.getName()); + } + // Use PV_struct_define.newBuilder() to construct. + private PV_struct_define(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PV_struct_define() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.removemarineanimals.models.BspPV.internal_static_PV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.removemarineanimals.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.removemarineanimals.models.BspPV.PV_struct_define.class, com.example.removemarineanimals.models.BspPV.PV_struct_define.Builder.class); + } + + public static final int ROBOT_CHGLENGTH_FIELD_NUMBER = 1; + private int robotChgLength_ = 0; + /** + * int32 Robot_ChgLength = 1; + * @return The robotChgLength. + */ + @java.lang.Override + public int getRobotChgLength() { + return robotChgLength_; + } + + public static final int ROBOT_LEFTCOMPENSATION_FIELD_NUMBER = 2; + private double robotLeftCompensation_ = 0D; + /** + * double Robot_LeftCompensation = 2; + * @return The robotLeftCompensation. + */ + @java.lang.Override + public double getRobotLeftCompensation() { + return robotLeftCompensation_; + } + + public static final int ROBOT_RIGHTCOMPENSATION_FIELD_NUMBER = 3; + private double robotRightCompensation_ = 0D; + /** + * double Robot_RightCompensation = 3; + * @return The robotRightCompensation. + */ + @java.lang.Override + public double getRobotRightCompensation() { + return robotRightCompensation_; + } + + public static final int ROBOT_AUTOSPEEDBASE_FIELD_NUMBER = 4; + private double robotAutoSpeedBase_ = 0D; + /** + * double Robot_AutoSpeedBase = 4; + * @return The robotAutoSpeedBase. + */ + @java.lang.Override + public double getRobotAutoSpeedBase() { + return robotAutoSpeedBase_; + } + + public static final int ROBOT_MANUALSPEEDBASE_FIELD_NUMBER = 5; + private double robotManualSpeedBase_ = 0D; + /** + * double Robot_ManualSpeedBase = 5; + * @return The robotManualSpeedBase. + */ + @java.lang.Override + public double getRobotManualSpeedBase() { + return robotManualSpeedBase_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (robotChgLength_ != 0) { + output.writeInt32(1, robotChgLength_); + } + if (java.lang.Double.doubleToRawLongBits(robotLeftCompensation_) != 0) { + output.writeDouble(2, robotLeftCompensation_); + } + if (java.lang.Double.doubleToRawLongBits(robotRightCompensation_) != 0) { + output.writeDouble(3, robotRightCompensation_); + } + if (java.lang.Double.doubleToRawLongBits(robotAutoSpeedBase_) != 0) { + output.writeDouble(4, robotAutoSpeedBase_); + } + if (java.lang.Double.doubleToRawLongBits(robotManualSpeedBase_) != 0) { + output.writeDouble(5, robotManualSpeedBase_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (robotChgLength_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, robotChgLength_); + } + if (java.lang.Double.doubleToRawLongBits(robotLeftCompensation_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(2, robotLeftCompensation_); + } + if (java.lang.Double.doubleToRawLongBits(robotRightCompensation_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, robotRightCompensation_); + } + if (java.lang.Double.doubleToRawLongBits(robotAutoSpeedBase_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(4, robotAutoSpeedBase_); + } + if (java.lang.Double.doubleToRawLongBits(robotManualSpeedBase_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(5, robotManualSpeedBase_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.example.removemarineanimals.models.BspPV.PV_struct_define)) { + return super.equals(obj); + } + com.example.removemarineanimals.models.BspPV.PV_struct_define other = (com.example.removemarineanimals.models.BspPV.PV_struct_define) obj; + + if (getRobotChgLength() + != other.getRobotChgLength()) return false; + if (java.lang.Double.doubleToLongBits(getRobotLeftCompensation()) + != java.lang.Double.doubleToLongBits( + other.getRobotLeftCompensation())) return false; + if (java.lang.Double.doubleToLongBits(getRobotRightCompensation()) + != java.lang.Double.doubleToLongBits( + other.getRobotRightCompensation())) return false; + if (java.lang.Double.doubleToLongBits(getRobotAutoSpeedBase()) + != java.lang.Double.doubleToLongBits( + other.getRobotAutoSpeedBase())) return false; + if (java.lang.Double.doubleToLongBits(getRobotManualSpeedBase()) + != java.lang.Double.doubleToLongBits( + other.getRobotManualSpeedBase())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ROBOT_CHGLENGTH_FIELD_NUMBER; + hash = (53 * hash) + getRobotChgLength(); + hash = (37 * hash) + ROBOT_LEFTCOMPENSATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getRobotLeftCompensation())); + hash = (37 * hash) + ROBOT_RIGHTCOMPENSATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getRobotRightCompensation())); + hash = (37 * hash) + ROBOT_AUTOSPEEDBASE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getRobotAutoSpeedBase())); + hash = (37 * hash) + ROBOT_MANUALSPEEDBASE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getRobotManualSpeedBase())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.removemarineanimals.models.BspPV.PV_struct_define parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.example.removemarineanimals.models.BspPV.PV_struct_define prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code PV_struct_define} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:PV_struct_define) + com.example.removemarineanimals.models.BspPV.PV_struct_defineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.removemarineanimals.models.BspPV.internal_static_PV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.removemarineanimals.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.removemarineanimals.models.BspPV.PV_struct_define.class, com.example.removemarineanimals.models.BspPV.PV_struct_define.Builder.class); + } + + // Construct using com.example.removemarineanimals.models.BspPV.PV_struct_define.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + robotChgLength_ = 0; + robotLeftCompensation_ = 0D; + robotRightCompensation_ = 0D; + robotAutoSpeedBase_ = 0D; + robotManualSpeedBase_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.removemarineanimals.models.BspPV.internal_static_PV_struct_define_descriptor; + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspPV.PV_struct_define getDefaultInstanceForType() { + return com.example.removemarineanimals.models.BspPV.PV_struct_define.getDefaultInstance(); + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspPV.PV_struct_define build() { + com.example.removemarineanimals.models.BspPV.PV_struct_define result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspPV.PV_struct_define buildPartial() { + com.example.removemarineanimals.models.BspPV.PV_struct_define result = new com.example.removemarineanimals.models.BspPV.PV_struct_define(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.example.removemarineanimals.models.BspPV.PV_struct_define result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.robotChgLength_ = robotChgLength_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.robotLeftCompensation_ = robotLeftCompensation_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.robotRightCompensation_ = robotRightCompensation_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.robotAutoSpeedBase_ = robotAutoSpeedBase_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.robotManualSpeedBase_ = robotManualSpeedBase_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.removemarineanimals.models.BspPV.PV_struct_define) { + return mergeFrom((com.example.removemarineanimals.models.BspPV.PV_struct_define)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.removemarineanimals.models.BspPV.PV_struct_define other) { + if (other == com.example.removemarineanimals.models.BspPV.PV_struct_define.getDefaultInstance()) return this; + if (other.getRobotChgLength() != 0) { + setRobotChgLength(other.getRobotChgLength()); + } + if (other.getRobotLeftCompensation() != 0D) { + setRobotLeftCompensation(other.getRobotLeftCompensation()); + } + if (other.getRobotRightCompensation() != 0D) { + setRobotRightCompensation(other.getRobotRightCompensation()); + } + if (other.getRobotAutoSpeedBase() != 0D) { + setRobotAutoSpeedBase(other.getRobotAutoSpeedBase()); + } + if (other.getRobotManualSpeedBase() != 0D) { + setRobotManualSpeedBase(other.getRobotManualSpeedBase()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + robotChgLength_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 17: { + robotLeftCompensation_ = input.readDouble(); + bitField0_ |= 0x00000002; + break; + } // case 17 + case 25: { + robotRightCompensation_ = input.readDouble(); + bitField0_ |= 0x00000004; + break; + } // case 25 + case 33: { + robotAutoSpeedBase_ = input.readDouble(); + bitField0_ |= 0x00000008; + break; + } // case 33 + case 41: { + robotManualSpeedBase_ = input.readDouble(); + bitField0_ |= 0x00000010; + break; + } // case 41 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int robotChgLength_ ; + /** + * int32 Robot_ChgLength = 1; + * @return The robotChgLength. + */ + @java.lang.Override + public int getRobotChgLength() { + return robotChgLength_; + } + /** + * int32 Robot_ChgLength = 1; + * @param value The robotChgLength to set. + * @return This builder for chaining. + */ + public Builder setRobotChgLength(int value) { + + robotChgLength_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 Robot_ChgLength = 1; + * @return This builder for chaining. + */ + public Builder clearRobotChgLength() { + bitField0_ = (bitField0_ & ~0x00000001); + robotChgLength_ = 0; + onChanged(); + return this; + } + + private double robotLeftCompensation_ ; + /** + * double Robot_LeftCompensation = 2; + * @return The robotLeftCompensation. + */ + @java.lang.Override + public double getRobotLeftCompensation() { + return robotLeftCompensation_; + } + /** + * double Robot_LeftCompensation = 2; + * @param value The robotLeftCompensation to set. + * @return This builder for chaining. + */ + public Builder setRobotLeftCompensation(double value) { + + robotLeftCompensation_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * double Robot_LeftCompensation = 2; + * @return This builder for chaining. + */ + public Builder clearRobotLeftCompensation() { + bitField0_ = (bitField0_ & ~0x00000002); + robotLeftCompensation_ = 0D; + onChanged(); + return this; + } + + private double robotRightCompensation_ ; + /** + * double Robot_RightCompensation = 3; + * @return The robotRightCompensation. + */ + @java.lang.Override + public double getRobotRightCompensation() { + return robotRightCompensation_; + } + /** + * double Robot_RightCompensation = 3; + * @param value The robotRightCompensation to set. + * @return This builder for chaining. + */ + public Builder setRobotRightCompensation(double value) { + + robotRightCompensation_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * double Robot_RightCompensation = 3; + * @return This builder for chaining. + */ + public Builder clearRobotRightCompensation() { + bitField0_ = (bitField0_ & ~0x00000004); + robotRightCompensation_ = 0D; + onChanged(); + return this; + } + + private double robotAutoSpeedBase_ ; + /** + * double Robot_AutoSpeedBase = 4; + * @return The robotAutoSpeedBase. + */ + @java.lang.Override + public double getRobotAutoSpeedBase() { + return robotAutoSpeedBase_; + } + /** + * double Robot_AutoSpeedBase = 4; + * @param value The robotAutoSpeedBase to set. + * @return This builder for chaining. + */ + public Builder setRobotAutoSpeedBase(double value) { + + robotAutoSpeedBase_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * double Robot_AutoSpeedBase = 4; + * @return This builder for chaining. + */ + public Builder clearRobotAutoSpeedBase() { + bitField0_ = (bitField0_ & ~0x00000008); + robotAutoSpeedBase_ = 0D; + onChanged(); + return this; + } + + private double robotManualSpeedBase_ ; + /** + * double Robot_ManualSpeedBase = 5; + * @return The robotManualSpeedBase. + */ + @java.lang.Override + public double getRobotManualSpeedBase() { + return robotManualSpeedBase_; + } + /** + * double Robot_ManualSpeedBase = 5; + * @param value The robotManualSpeedBase to set. + * @return This builder for chaining. + */ + public Builder setRobotManualSpeedBase(double value) { + + robotManualSpeedBase_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * double Robot_ManualSpeedBase = 5; + * @return This builder for chaining. + */ + public Builder clearRobotManualSpeedBase() { + bitField0_ = (bitField0_ & ~0x00000010); + robotManualSpeedBase_ = 0D; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:PV_struct_define) + } + + // @@protoc_insertion_point(class_scope:PV_struct_define) + private static final com.example.removemarineanimals.models.BspPV.PV_struct_define DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.removemarineanimals.models.BspPV.PV_struct_define(); + } + + public static com.example.removemarineanimals.models.BspPV.PV_struct_define getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PV_struct_define parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.example.removemarineanimals.models.BspPV.PV_struct_define getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_PV_struct_define_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_PV_struct_define_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014bsp_PV.proto\"\250\001\n\020PV_struct_define\022\027\n\017R" + + "obot_ChgLength\030\001 \001(\005\022\036\n\026Robot_LeftCompen" + + "sation\030\002 \001(\001\022\037\n\027Robot_RightCompensation\030" + + "\003 \001(\001\022\033\n\023Robot_AutoSpeedBase\030\004 \001(\001\022\035\n\025Ro" + + "bot_ManualSpeedBase\030\005 \001(\001B*\n&com.example" + + ".removemarineanimals.modelsP\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_PV_struct_define_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_PV_struct_define_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_PV_struct_define_descriptor, + new java.lang.String[] { "RobotChgLength", "RobotLeftCompensation", "RobotRightCompensation", "RobotAutoSpeedBase", "RobotManualSpeedBase", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/app/src/main/java/com/example/removemarineanimals/models/RobotData.java b/app/src/main/java/com/example/removemarineanimals/models/RobotData.java new file mode 100644 index 0000000..138f780 --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/models/RobotData.java @@ -0,0 +1,792 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: robot_data.proto +// Protobuf Java Version: 4.27.2 + +package com.example.removemarineanimals.models; + +public final class RobotData { + private RobotData() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + RobotData.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface DataTransOrBuilder extends + // @@protoc_insertion_point(interface_extends:DataTrans) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * 横滚角
+     * 
+ * + * int32 RF_Angle_Roll = 1; + * @return The rFAngleRoll. + */ + int getRFAngleRoll(); + + /** + *
+     * 俯仰角
+     * 
+ * + * int32 RF_Angle_Pitch = 2; + * @return The rFAnglePitch. + */ + int getRFAnglePitch(); + + /** + *
+     * 航向角
+     * 
+ * + * int32 RF_Angle_Yaw = 3; + * @return The rFAngleYaw. + */ + int getRFAngleYaw(); + + /** + *
+     * 海洋深度
+     * 
+ * + * int32 RF_Depth = 4; + * @return The rFDepth. + */ + int getRFDepth(); + } + /** + * Protobuf type {@code DataTrans} + */ + public static final class DataTrans extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:DataTrans) + DataTransOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + DataTrans.class.getName()); + } + // Use DataTrans.newBuilder() to construct. + private DataTrans(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DataTrans() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return RobotData.internal_static_DataTrans_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return RobotData.internal_static_DataTrans_fieldAccessorTable + .ensureFieldAccessorsInitialized( + DataTrans.class, Builder.class); + } + + public static final int RF_ANGLE_ROLL_FIELD_NUMBER = 1; + private int rFAngleRoll_ = 0; + /** + *
+     * 横滚角
+     * 
+ * + * int32 RF_Angle_Roll = 1; + * @return The rFAngleRoll. + */ + @Override + public int getRFAngleRoll() { + return rFAngleRoll_; + } + + public static final int RF_ANGLE_PITCH_FIELD_NUMBER = 2; + private int rFAnglePitch_ = 0; + /** + *
+     * 俯仰角
+     * 
+ * + * int32 RF_Angle_Pitch = 2; + * @return The rFAnglePitch. + */ + @Override + public int getRFAnglePitch() { + return rFAnglePitch_; + } + + public static final int RF_ANGLE_YAW_FIELD_NUMBER = 3; + private int rFAngleYaw_ = 0; + /** + *
+     * 航向角
+     * 
+ * + * int32 RF_Angle_Yaw = 3; + * @return The rFAngleYaw. + */ + @Override + public int getRFAngleYaw() { + return rFAngleYaw_; + } + + public static final int RF_DEPTH_FIELD_NUMBER = 4; + private int rFDepth_ = 0; + /** + *
+     * 海洋深度
+     * 
+ * + * int32 RF_Depth = 4; + * @return The rFDepth. + */ + @Override + public int getRFDepth() { + return rFDepth_; + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (rFAngleRoll_ != 0) { + output.writeInt32(1, rFAngleRoll_); + } + if (rFAnglePitch_ != 0) { + output.writeInt32(2, rFAnglePitch_); + } + if (rFAngleYaw_ != 0) { + output.writeInt32(3, rFAngleYaw_); + } + if (rFDepth_ != 0) { + output.writeInt32(4, rFDepth_); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rFAngleRoll_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, rFAngleRoll_); + } + if (rFAnglePitch_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, rFAnglePitch_); + } + if (rFAngleYaw_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, rFAngleYaw_); + } + if (rFDepth_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, rFDepth_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof DataTrans)) { + return super.equals(obj); + } + DataTrans other = (DataTrans) obj; + + if (getRFAngleRoll() + != other.getRFAngleRoll()) return false; + if (getRFAnglePitch() + != other.getRFAnglePitch()) return false; + if (getRFAngleYaw() + != other.getRFAngleYaw()) return false; + if (getRFDepth() + != other.getRFDepth()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RF_ANGLE_ROLL_FIELD_NUMBER; + hash = (53 * hash) + getRFAngleRoll(); + hash = (37 * hash) + RF_ANGLE_PITCH_FIELD_NUMBER; + hash = (53 * hash) + getRFAnglePitch(); + hash = (37 * hash) + RF_ANGLE_YAW_FIELD_NUMBER; + hash = (53 * hash) + getRFAngleYaw(); + hash = (37 * hash) + RF_DEPTH_FIELD_NUMBER; + hash = (53 * hash) + getRFDepth(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static DataTrans parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static DataTrans parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static DataTrans parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static DataTrans parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static DataTrans parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static DataTrans parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static DataTrans parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static DataTrans parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static DataTrans parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static DataTrans parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static DataTrans parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static DataTrans parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(DataTrans prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code DataTrans} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:DataTrans) + DataTransOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return RobotData.internal_static_DataTrans_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return RobotData.internal_static_DataTrans_fieldAccessorTable + .ensureFieldAccessorsInitialized( + DataTrans.class, Builder.class); + } + + // Construct using com.example.removemarineanimals.models.RobotData.DataTrans.newBuilder() + private Builder() { + + } + + private Builder( + BuilderParent parent) { + super(parent); + + } + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rFAngleRoll_ = 0; + rFAnglePitch_ = 0; + rFAngleYaw_ = 0; + rFDepth_ = 0; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return RobotData.internal_static_DataTrans_descriptor; + } + + @Override + public DataTrans getDefaultInstanceForType() { + return DataTrans.getDefaultInstance(); + } + + @Override + public DataTrans build() { + DataTrans result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public DataTrans buildPartial() { + DataTrans result = new DataTrans(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(DataTrans result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rFAngleRoll_ = rFAngleRoll_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rFAnglePitch_ = rFAnglePitch_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.rFAngleYaw_ = rFAngleYaw_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rFDepth_ = rFDepth_; + } + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof DataTrans) { + return mergeFrom((DataTrans)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(DataTrans other) { + if (other == DataTrans.getDefaultInstance()) return this; + if (other.getRFAngleRoll() != 0) { + setRFAngleRoll(other.getRFAngleRoll()); + } + if (other.getRFAnglePitch() != 0) { + setRFAnglePitch(other.getRFAnglePitch()); + } + if (other.getRFAngleYaw() != 0) { + setRFAngleYaw(other.getRFAngleYaw()); + } + if (other.getRFDepth() != 0) { + setRFDepth(other.getRFDepth()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + rFAngleRoll_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + rFAnglePitch_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + rFAngleYaw_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + rFDepth_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int rFAngleRoll_ ; + /** + *
+       * 横滚角
+       * 
+ * + * int32 RF_Angle_Roll = 1; + * @return The rFAngleRoll. + */ + @Override + public int getRFAngleRoll() { + return rFAngleRoll_; + } + /** + *
+       * 横滚角
+       * 
+ * + * int32 RF_Angle_Roll = 1; + * @param value The rFAngleRoll to set. + * @return This builder for chaining. + */ + public Builder setRFAngleRoll(int value) { + + rFAngleRoll_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * 横滚角
+       * 
+ * + * int32 RF_Angle_Roll = 1; + * @return This builder for chaining. + */ + public Builder clearRFAngleRoll() { + bitField0_ = (bitField0_ & ~0x00000001); + rFAngleRoll_ = 0; + onChanged(); + return this; + } + + private int rFAnglePitch_ ; + /** + *
+       * 俯仰角
+       * 
+ * + * int32 RF_Angle_Pitch = 2; + * @return The rFAnglePitch. + */ + @Override + public int getRFAnglePitch() { + return rFAnglePitch_; + } + /** + *
+       * 俯仰角
+       * 
+ * + * int32 RF_Angle_Pitch = 2; + * @param value The rFAnglePitch to set. + * @return This builder for chaining. + */ + public Builder setRFAnglePitch(int value) { + + rFAnglePitch_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * 俯仰角
+       * 
+ * + * int32 RF_Angle_Pitch = 2; + * @return This builder for chaining. + */ + public Builder clearRFAnglePitch() { + bitField0_ = (bitField0_ & ~0x00000002); + rFAnglePitch_ = 0; + onChanged(); + return this; + } + + private int rFAngleYaw_ ; + /** + *
+       * 航向角
+       * 
+ * + * int32 RF_Angle_Yaw = 3; + * @return The rFAngleYaw. + */ + @Override + public int getRFAngleYaw() { + return rFAngleYaw_; + } + /** + *
+       * 航向角
+       * 
+ * + * int32 RF_Angle_Yaw = 3; + * @param value The rFAngleYaw to set. + * @return This builder for chaining. + */ + public Builder setRFAngleYaw(int value) { + + rFAngleYaw_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * 航向角
+       * 
+ * + * int32 RF_Angle_Yaw = 3; + * @return This builder for chaining. + */ + public Builder clearRFAngleYaw() { + bitField0_ = (bitField0_ & ~0x00000004); + rFAngleYaw_ = 0; + onChanged(); + return this; + } + + private int rFDepth_ ; + /** + *
+       * 海洋深度
+       * 
+ * + * int32 RF_Depth = 4; + * @return The rFDepth. + */ + @Override + public int getRFDepth() { + return rFDepth_; + } + /** + *
+       * 海洋深度
+       * 
+ * + * int32 RF_Depth = 4; + * @param value The rFDepth to set. + * @return This builder for chaining. + */ + public Builder setRFDepth(int value) { + + rFDepth_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * 海洋深度
+       * 
+ * + * int32 RF_Depth = 4; + * @return This builder for chaining. + */ + public Builder clearRFDepth() { + bitField0_ = (bitField0_ & ~0x00000008); + rFDepth_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:DataTrans) + } + + // @@protoc_insertion_point(class_scope:DataTrans) + private static final DataTrans DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new DataTrans(); + } + + public static DataTrans getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public DataTrans parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public DataTrans getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_DataTrans_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DataTrans_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\020robot_data.proto\"b\n\tDataTrans\022\025\n\rRF_An" + + "gle_Roll\030\001 \001(\005\022\026\n\016RF_Angle_Pitch\030\002 \001(\005\022\024" + + "\n\014RF_Angle_Yaw\030\003 \001(\005\022\020\n\010RF_Depth\030\004 \001(\005B*" + + "\n&com.example.removemarineanimals.models" + + "P\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_DataTrans_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_DataTrans_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_DataTrans_descriptor, + new String[] { "RFAngleRoll", "RFAnglePitch", "RFAngleYaw", "RFDepth", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/app/src/main/java/com/example/removemarineanimals/models/RobotRMACM.java b/app/src/main/java/com/example/removemarineanimals/models/RobotRMACM.java new file mode 100644 index 0000000..c1badac --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/models/RobotRMACM.java @@ -0,0 +1,615 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: robot_RMACM.proto +// Protobuf Java Version: 4.27.2 + +package com.example.removemarineanimals.models; + +public final class RobotRMACM { + private RobotRMACM() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + RobotRMACM.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface RMACMOrBuilder extends + // @@protoc_insertion_point(interface_extends:RMACM) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * 灯光亮度
+     * 
+ * + * int32 LightBrightness = 1; + * @return The lightBrightness. + */ + int getLightBrightness(); + + /** + *
+     * 机器人速度
+     * 
+ * + * int32 Robot_Speed = 2; + * @return The robotSpeed. + */ + int getRobotSpeed(); + } + /** + *
+   * Remove Marine Animal Command
+   * 
+ * + * Protobuf type {@code RMACM} + */ + public static final class RMACM extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:RMACM) + RMACMOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + RMACM.class.getName()); + } + // Use RMACM.newBuilder() to construct. + private RMACM(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RMACM() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return RobotRMACM.internal_static_RMACM_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return RobotRMACM.internal_static_RMACM_fieldAccessorTable + .ensureFieldAccessorsInitialized( + RMACM.class, Builder.class); + } + + public static final int LIGHTBRIGHTNESS_FIELD_NUMBER = 1; + private int lightBrightness_ = 0; + /** + *
+     * 灯光亮度
+     * 
+ * + * int32 LightBrightness = 1; + * @return The lightBrightness. + */ + @Override + public int getLightBrightness() { + return lightBrightness_; + } + + public static final int ROBOT_SPEED_FIELD_NUMBER = 2; + private int robotSpeed_ = 0; + /** + *
+     * 机器人速度
+     * 
+ * + * int32 Robot_Speed = 2; + * @return The robotSpeed. + */ + @Override + public int getRobotSpeed() { + return robotSpeed_; + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (lightBrightness_ != 0) { + output.writeInt32(1, lightBrightness_); + } + if (robotSpeed_ != 0) { + output.writeInt32(2, robotSpeed_); + } + getUnknownFields().writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (lightBrightness_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, lightBrightness_); + } + if (robotSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, robotSpeed_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof RMACM)) { + return super.equals(obj); + } + RMACM other = (RMACM) obj; + + if (getLightBrightness() + != other.getLightBrightness()) return false; + if (getRobotSpeed() + != other.getRobotSpeed()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LIGHTBRIGHTNESS_FIELD_NUMBER; + hash = (53 * hash) + getLightBrightness(); + hash = (37 * hash) + ROBOT_SPEED_FIELD_NUMBER; + hash = (53 * hash) + getRobotSpeed(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static RMACM parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static RMACM parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static RMACM parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static RMACM parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static RMACM parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static RMACM parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static RMACM parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static RMACM parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static RMACM parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static RMACM parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static RMACM parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static RMACM parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(RMACM prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Remove Marine Animal Command
+     * 
+ * + * Protobuf type {@code RMACM} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:RMACM) + RMACMOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return RobotRMACM.internal_static_RMACM_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return RobotRMACM.internal_static_RMACM_fieldAccessorTable + .ensureFieldAccessorsInitialized( + RMACM.class, Builder.class); + } + + // Construct using com.example.removemarineanimals.models.RobotRMACM.RMACM.newBuilder() + private Builder() { + + } + + private Builder( + BuilderParent parent) { + super(parent); + + } + @Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + lightBrightness_ = 0; + robotSpeed_ = 0; + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return RobotRMACM.internal_static_RMACM_descriptor; + } + + @Override + public RMACM getDefaultInstanceForType() { + return RMACM.getDefaultInstance(); + } + + @Override + public RMACM build() { + RMACM result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public RMACM buildPartial() { + RMACM result = new RMACM(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(RMACM result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.lightBrightness_ = lightBrightness_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.robotSpeed_ = robotSpeed_; + } + } + + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof RMACM) { + return mergeFrom((RMACM)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(RMACM other) { + if (other == RMACM.getDefaultInstance()) return this; + if (other.getLightBrightness() != 0) { + setLightBrightness(other.getLightBrightness()); + } + if (other.getRobotSpeed() != 0) { + setRobotSpeed(other.getRobotSpeed()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + lightBrightness_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + robotSpeed_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int lightBrightness_ ; + /** + *
+       * 灯光亮度
+       * 
+ * + * int32 LightBrightness = 1; + * @return The lightBrightness. + */ + @Override + public int getLightBrightness() { + return lightBrightness_; + } + /** + *
+       * 灯光亮度
+       * 
+ * + * int32 LightBrightness = 1; + * @param value The lightBrightness to set. + * @return This builder for chaining. + */ + public Builder setLightBrightness(int value) { + + lightBrightness_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * 灯光亮度
+       * 
+ * + * int32 LightBrightness = 1; + * @return This builder for chaining. + */ + public Builder clearLightBrightness() { + bitField0_ = (bitField0_ & ~0x00000001); + lightBrightness_ = 0; + onChanged(); + return this; + } + + private int robotSpeed_ ; + /** + *
+       * 机器人速度
+       * 
+ * + * int32 Robot_Speed = 2; + * @return The robotSpeed. + */ + @Override + public int getRobotSpeed() { + return robotSpeed_; + } + /** + *
+       * 机器人速度
+       * 
+ * + * int32 Robot_Speed = 2; + * @param value The robotSpeed to set. + * @return This builder for chaining. + */ + public Builder setRobotSpeed(int value) { + + robotSpeed_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * 机器人速度
+       * 
+ * + * int32 Robot_Speed = 2; + * @return This builder for chaining. + */ + public Builder clearRobotSpeed() { + bitField0_ = (bitField0_ & ~0x00000002); + robotSpeed_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:RMACM) + } + + // @@protoc_insertion_point(class_scope:RMACM) + private static final RMACM DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new RMACM(); + } + + public static RMACM getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public RMACM parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public RMACM getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_RMACM_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_RMACM_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\021robot_RMACM.proto\"5\n\005RMACM\022\027\n\017LightBri" + + "ghtness\030\001 \001(\005\022\023\n\013Robot_Speed\030\002 \001(\005B*\n&co" + + "m.example.removemarineanimals.modelsP\000b\006" + + "proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_RMACM_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_RMACM_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_RMACM_descriptor, + new String[] { "LightBrightness", "RobotSpeed", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/app/src/main/java/com/example/removemarineanimals/services/CustomProber.java b/app/src/main/java/com/example/removemarineanimals/services/CustomProber.java new file mode 100644 index 0000000..c9871c8 --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/services/CustomProber.java @@ -0,0 +1,23 @@ +package com.example.removemarineanimals.services; + + +import com.hoho.android.usbserial.driver.FtdiSerialDriver; +import com.hoho.android.usbserial.driver.ProbeTable; +import com.hoho.android.usbserial.driver.UsbSerialProber; + +/** + * add devices here, that are not known to DefaultProber + * + * if the App should auto start for these devices, also + * add IDs to app/src/main/res/xml/device_filter.xml + */ +public class CustomProber { + + public static UsbSerialProber getCustomProber() { + ProbeTable customTable = new ProbeTable(); + customTable.addProduct(0x1234, 0x0001, FtdiSerialDriver.class); // e.g. device with custom VID+PID + customTable.addProduct(0x1234, 0x0002, FtdiSerialDriver.class); // e.g. device with custom VID+PID + return new UsbSerialProber(customTable); + } + +} diff --git a/app/src/main/java/com/example/removemarineanimals/services/DisplayUtils.java b/app/src/main/java/com/example/removemarineanimals/services/DisplayUtils.java new file mode 100644 index 0000000..a39e782 --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/services/DisplayUtils.java @@ -0,0 +1,17 @@ +package com.example.removemarineanimals.services; + +import android.content.Context; +import android.content.res.Resources; +import android.util.TypedValue; + +public class DisplayUtils { + // 静态方法,无需实例化即可调用 + public static int dpToPx(Context context, int dp) { + Resources r = context.getResources(); + return (int) TypedValue.applyDimension( + TypedValue.COMPLEX_UNIT_DIP, + dp, + r.getDisplayMetrics() + ); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/removemarineanimals/services/ModbusCRC.java b/app/src/main/java/com/example/removemarineanimals/services/ModbusCRC.java new file mode 100644 index 0000000..f8b7316 --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/services/ModbusCRC.java @@ -0,0 +1,72 @@ +package com.example.removemarineanimals.services; + +public class ModbusCRC { + +// /** +// * 一个字节包含位的数量 8 +// */ +// private static final int BITS_OF_BYTE = 8; +// /** +// * 多项式 +// */ +// private static final int POLYNOMIAL = 0xA001; +// /** +// * 初始值 +// */ +// private static final int INITIAL_VALUE = 0xFFFF; +// +// /** +// * CRC16 编码 +// * +// * @param bytes 编码内容 +// * @return 编码结果 +// */ +// public static int crc16(byte[] bytes) { +// int res = INITIAL_VALUE; +// for (int data : bytes) { +// res = res ^ data; +// for (int i = 0; i < BITS_OF_BYTE; i++) { +// res = (res & 0x0001) == 1 ? (res >> 1) ^ POLYNOMIAL : res >> 1; +// } +// } +// return revert(res); +// } +// +// /** +// * 翻转16位的高八位和低八位字节 +// * +// * @param src 翻转数字 +// * @return 翻转结果 +// */ +// private static int revert(int src) { +// int lowByte = (src & 0xFF00) >> 8; +// int highByte = (src & 0x00FF) << 8; +// return lowByte | highByte; +// } + + + /** + * 计算 Modbus CRC 校验值 + * @param data 要计算校验值的字节数组 + * @return CRC 校验值,以 2 字节的数组形式返回 + */ + public static byte[] calculateCRC(byte[] data) { + int crc = 0xFFFF; + for (byte b : data) { + crc ^= (b & 0xFF); + for (int i = 0; i < 8; i++) { + if ((crc & 0x0001) != 0) { + crc >>= 1; + crc ^= 0xA001; + } else { + crc >>= 1; + } + } + } + // 将 CRC 结果拆分为两个字节 + byte[] crcBytes = new byte[2]; + crcBytes[0] = (byte) (crc & 0xFF); + crcBytes[1] = (byte) ((crc >> 8) & 0xFF); + return crcBytes; + } +} diff --git a/app/src/main/java/com/example/removemarineanimals/services/RobotDataHanlder.java b/app/src/main/java/com/example/removemarineanimals/services/RobotDataHanlder.java new file mode 100644 index 0000000..798adde --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/services/RobotDataHanlder.java @@ -0,0 +1,54 @@ +package com.example.removemarineanimals.services; + +import com.example.removemarineanimals.models.RobotData; +import com.google.protobuf.InvalidProtocolBufferException; + +public class RobotDataHanlder { + + + public static void test() + { + //byte[] data=hexToByteArray("080110830118313A04B1CBBACF"); + byte[] data=hexToByteArray("100A180A28013A32B1CBBACF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"); + + } + public static RobotData.DataTrans DeoodeDataFromRobot(byte[] data) + { + + RobotData.DataTrans dtrans3 = null; + try + { + dtrans3 = RobotData.DataTrans.parseFrom(data); + + return dtrans3; + } catch (InvalidProtocolBufferException e) { + return null; + } + + + } + + public static byte[] hexToByteArray(String inHex){ + int hexlen = inHex.length(); + byte[] result; + if (hexlen % 2 == 1){ + //奇数 + hexlen++; + result = new byte[(hexlen/2)]; + inHex="0"+inHex; + }else { + //偶数 + result = new byte[(hexlen/2)]; + } + int j=0; + for (int i = 0; i < hexlen; i+=2){ + result[j]=hexToByte(inHex.substring(i,i+2)); + j++; + } + return result; + } + public static byte hexToByte(String inHex){ + return (byte)Integer.parseInt(inHex,16); + } + +} diff --git a/app/src/main/java/com/example/removemarineanimals/services/RtspRecorder.java b/app/src/main/java/com/example/removemarineanimals/services/RtspRecorder.java new file mode 100644 index 0000000..a3d96fa --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/services/RtspRecorder.java @@ -0,0 +1,140 @@ +//package com.example.removemarineanimals.services; +// +//import android.content.Context; +//import android.graphics.Bitmap; +//import android.graphics.Canvas; +//import android.view.View; +//import android.widget.Toast; +// +//import com.arthenica.ffmpegkit.FFmpegKit; +//import com.arthenica.ffmpegkit.FFmpegSession; +//import com.arthenica.ffmpegkit.ReturnCode; +//import com.example.removemarineanimals.MainActivity; +// +//import java.io.File; +//import java.io.FileOutputStream; +//import java.io.IOException; +//import java.text.SimpleDateFormat; +//import java.util.Date; +// +//public class RtspRecorder { +// // 用于控制录制会话 +// private MainActivity MainActivity; +// private static FFmpegSession recordingSession; +// +// // 开始分段录制 +// public static void startRecording(Context context, String rtspUrl) +// { +// +// String outputPath ="storage/emulated/0/DCIM/" + "/record_%Y-%m-%d_%H-%M-%S.mp4"; +// //String outputPath = context.getExternalFilesDir(null) + "/record_%Y-%m-%d_%H-%M-%S.mp4"; +// String command = String.format( +// "-rtsp_transport tcp -i \"%s\" -c:v copy -f segment -segment_time 30 -reset_timestamps 1 -strftime 1 \"%s\"", +// rtspUrl, outputPath +// ); +// +// recordingSession = FFmpegKit.executeAsync(command, session -> { +// if (ReturnCode.isSuccess(session.getReturnCode())) { +// // 录制正常结束 +// } else { +// // 录制异常终止 +// } +// }); +// } +// +// // 停止录制 +// public static void stopRecording() { +// if (recordingSession != null) { +// FFmpegKit.cancel(recordingSession.getSessionId()); +// recordingSession = null; +// } +// } +// +// // 实时截图(需手动调用) +// public static void takeSnapshot(Context context, String rtspUrl) { +// //String outputPath = context.getExternalFilesDir(null) + "/snapshot_%Y-%m-%d_%H-%M-%S.jpg"; +// +// String outputPath = "storage/emulated/0/DCIM/" + "/snapshot_%Y-%m-%d_%H-%M-%S.jpg"; +// +// String command = String.format( +// "-rtsp_transport tcp -i \"%s\" -frames:v 1 -strftime 1 \"%s\"", +// rtspUrl, outputPath +// ); +// FFmpegSession session2 = FFmpegKit.executeAsync(command,session -> { +// if (ReturnCode.isSuccess(session.getReturnCode())) +// { +// // 截图成功 +// Toast.makeText(context, "截图成功", Toast.LENGTH_SHORT).show(); +// +// } else +// { +// // 截图失败 +// Toast.makeText(context, "截图失败", Toast.LENGTH_SHORT).show(); +// } +// }); +// +//// +//// if (ReturnCode.isSuccess(session.getReturnCode())) { +//// // 截图成功 +//// } else { +//// // 截图失败 +//// } +// +//// recordingSession = FFmpegKit.executeAsync(command, session -> { +//// if (ReturnCode.isSuccess(session.getReturnCode())) +//// { +//// // 截图成功 +//// Toast.makeText(context, "截图成功", Toast.LENGTH_SHORT).show(); +//// +//// } else +//// { +//// // 截图失败 +//// Toast.makeText(context, "截图失败", Toast.LENGTH_SHORT).show(); +//// } +//// }); +// +// +// } +// +// // 方法1:通过DrawingCache(适用于可见的View) +// public static Bitmap captureView(View view) { +// view.setDrawingCacheEnabled(true); +// view.buildDrawingCache(); +// Bitmap bitmap = Bitmap.createBitmap(view.getDrawingCache()); +// view.setDrawingCacheEnabled(false); // 释放缓存 +// return bitmap; +// } +// +// // 方法2:直接绘制到Bitmap(更可靠,适用于未显示的View) +// public static Bitmap captureViewManual(View view) { +// +//// view.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)); +//// view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight()); +//// view.buildDrawingCache(); +//// Bitmap bitmap = view.getDrawingCache(); +// +// +// Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); +// Canvas canvas = new Canvas(bitmap); +// view.draw(canvas); +// return bitmap; +// } +// +// public static void SnapPictureByView (View view) +// { +// // 保存到文件(需权限) +// Date dNow=new Date(); +// SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd hh-mm-ss"); +// String path = "storage/emulated/0/DCIM/" + ft.format(dNow)+ ".png"; +// File file = new File(path); +// try (FileOutputStream out = new FileOutputStream(file)) +// { +// // Bitmap screenshot = captureView(view); +// Bitmap screenshot = captureViewManual(view); +// screenshot.compress(Bitmap.CompressFormat.PNG, 100, out); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// } +// +//} \ No newline at end of file diff --git a/app/src/main/java/com/example/removemarineanimals/services/USBSerialPortHelper.java b/app/src/main/java/com/example/removemarineanimals/services/USBSerialPortHelper.java new file mode 100644 index 0000000..f9f8da2 --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/services/USBSerialPortHelper.java @@ -0,0 +1,352 @@ +package com.example.removemarineanimals.services; + +import android.app.PendingIntent; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.hardware.usb.UsbDevice; +import android.hardware.usb.UsbDeviceConnection; +import android.hardware.usb.UsbManager; +import android.os.Build; +import android.os.CountDownTimer; +import android.os.Handler; +import android.os.Looper; + +import androidx.core.content.ContextCompat; + +import com.example.removemarineanimals.BuildConfig; +import com.example.removemarineanimals.MainActivity; +import com.example.removemarineanimals.models.RobotData; +import com.example.removemarineanimals.viewmodels.MainViewModel; +import com.hoho.android.usbserial.driver.UsbSerialDriver; +import com.hoho.android.usbserial.driver.UsbSerialPort; +import com.hoho.android.usbserial.driver.UsbSerialProber; +import com.hoho.android.usbserial.util.SerialInputOutputManager; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class USBSerialPortHelper implements SerialInputOutputManager.Listener { + + + public MainActivity MainActivity; + //sserial port part start + + private enum UsbPermission {Unknown, Requested, Granted, Denied} + + private final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB"; + + + // + // + // + + + private int deviceId = 60000; + private int deviceId_test = 60000; + private int portNum; + private final int WRITE_WAIT_MILLIS = 500; + private final int READ_WAIT_MILLIS = 100; + private String PortNameContians = "SILICON";/**/ + // private static String PortNameContians="FTD"; + private int baudRate = 57600; + private boolean withIoManager = true; + + private BroadcastReceiver broadcastReceiver; + private Handler mainLooper; + + private SerialInputOutputManager usbIoManager; + private UsbSerialPort usbSerialPort; + private UsbPermission usbPermission = UsbPermission.Unknown; + private boolean connected = false; + + public void intialize() { + + broadcastReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (INTENT_ACTION_GRANT_USB.equals(intent.getAction())) { + usbPermission = intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false) ? UsbPermission.Granted : UsbPermission.Denied; + connect(); + } + } + }; + mainLooper = new Handler(Looper.getMainLooper()); + _receiveBufferlist = new ArrayList(); + } + + /* + * Serial + */ + @Override + public void onNewData(byte[] data) { + status("new data"); + mainLooper.post(() -> { + receive(data); + // receive data + }); + } + + @Override + public void onRunError(Exception e) { + mainLooper.post(() -> { + status("connection lost: " + e.getMessage()); + disconnect(); + }); + } + + /* + * Serial + UI + */ + + public void connect() { + + UsbDevice device = null; + UsbManager usbManager = (UsbManager) MainActivity.getSystemService(Context.USB_SERVICE); + for (UsbDevice v : usbManager.getDeviceList().values()) { + status(v.getManufacturerName().toUpperCase()); + if (v.getManufacturerName().toUpperCase().contains(PortNameContians)) { + device = v; + break; + } + } + + if (device == null) { + // _serialPortSwitch.setChecked(false); + + status("找不到设备"); + return; + } + UsbSerialDriver driver = UsbSerialProber.getDefaultProber().probeDevice(device); + if (driver == null) { + driver = CustomProber.getCustomProber().probeDevice(device); + } + if (driver == null) { + // _serialPortSwitch.setChecked(false); + status("无驱动"); + return; + } + if (driver.getPorts().size() < portNum) //就是0 cp2102 或者同一个驱动,第一个 + { + status("connection failed: not enough ports at device"); + status("找不到设备"); + return; + } + usbSerialPort = driver.getPorts().get(portNum); + + UsbDeviceConnection usbConnection = usbManager.openDevice(driver.getDevice()); + if (usbConnection == null && usbPermission == UsbPermission.Unknown && !usbManager.hasPermission(driver.getDevice())) { + usbPermission = UsbPermission.Requested; + int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_MUTABLE : 0; + Intent intent = new Intent(INTENT_ACTION_GRANT_USB); + intent.setPackage(MainActivity.getPackageName()); + PendingIntent usbPermissionIntent = PendingIntent.getBroadcast(MainActivity, 0, intent, flags); + usbManager.requestPermission(driver.getDevice(), usbPermissionIntent); + return; + } + if (usbConnection == null) { + if (!usbManager.hasPermission(driver.getDevice())) { + status("connection failed: permission denied"); + } else { + status("connection failed: open failed"); + } + + return; + } + + try { + usbSerialPort.open(usbConnection); + try { + usbSerialPort.setParameters(baudRate, 8, 1, UsbSerialPort.PARITY_NONE); + status("connected: "); + + } catch (UnsupportedOperationException e) { + status("unsupport setparameters"); + } + if (withIoManager) { + usbIoManager = new SerialInputOutputManager(usbSerialPort, this); + usbIoManager.setReadBufferSize(40960); + usbIoManager.setReadTimeout(READ_WAIT_MILLIS); + usbIoManager.start(); + } + //status("connected"); + connected = true; + // _serialPortSwitch.setChecked(true); + //switch set true + + } catch (Exception e) { + status("connection failed: " + e.getMessage()); + disconnect(); + } + } + + private void disconnect() { + connected = false; + + if (usbIoManager != null) { + usbIoManager.setListener(null); + usbIoManager.stop(); + } + usbIoManager = null; + try { + usbSerialPort.close(); + } catch (IOException ignored) { + + } + usbSerialPort = null; + } + + List _receiveBufferlist; + + private static byte[] listTobyte(List list) { + if (list == null || list.size() < 0) return null; + byte[] bytes = new byte[list.size()]; + int i = 0; + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + bytes[i] = iterator.next(); + i++; + } + return bytes; + } + + boolean StartCountDown = false; + + // byte _receivedData + private void receive(byte[] data) { + + status("read data"); + for (int i = 0; i < data.length; i++) { + _receiveBufferlist.add(data[i]); + } + + //decodeRceive(data); + if (StartCountDown == false)//从收到第一个数据开始计时 + { + StartCountDown = true; + new CountDownTimer(50, 10) { + public void onTick(long millisUntilFinished) { + + + } + + + public void onFinish() { + + status("read finished"); + try { + + decodeRceive(listTobyte(_receiveBufferlist)); + + } + catch (Exception ignored) + { + status(ignored.getMessage()); + } + _receiveBufferlist.clear(); + StartCountDown = false; + } + }.start(); + } + + + } + + void status(String str) { +// SpannableStringBuilder spn = new SpannableStringBuilder(str+'\r'+'\n'); +// +// // spn.append(getTime()); +// +// spn.setSpan(new ForegroundColorSpan(MainActivity.getResources().getColor(R.color.colorAccent)), 0, spn.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); +// receiveText.append(spn); + // mainBinding.roll.fullScroll(ScrollView.FOCUS_DOWN); + + + // com.example.removemarineanimals.MainActivity.mainBinding.message.setText(str); + } + + private void decodeRceive(byte[] data) { + try { + + + byte[] crcbytes = new byte[data.length - 2]; + System.arraycopy(data, 0, crcbytes, 0, data.length - 2); + byte[] crc=ModbusCRC.calculateCRC(crcbytes); + // status(bytesToHex(data)); + + if(data[data.length-2]==(byte)(crc[1]&0xff) && data[data.length-1]==(byte)(crc[0] & 0xff)) + { + + } + if (data[0] == 0x55 && data[1] == 0x55) { + byte[] bytes = new byte[data.length - 2]; + System.arraycopy(data, 2, bytes, 0, data.length - 2); + RobotData.DataTrans _dataTrans = RobotDataHanlder.DeoodeDataFromRobot(bytes); + //RobotData.DataTrans _dataTrans = RobotDataHanlder.DeoodeDataFromRobot(data); + status("received data"); + if (_dataTrans != null) { + + MainViewModel.mainBinding.rFAngleRoll.setText(String.valueOf(_dataTrans.getRFAngleRoll())); + + } + } + + + } catch (Exception e) { + + } + } + + + public void onStart() { + + ContextCompat.registerReceiver(MainActivity, broadcastReceiver, new IntentFilter(INTENT_ACTION_GRANT_USB), ContextCompat.RECEIVER_NOT_EXPORTED); + status("onStart"); + + } + + public void onStop() { + MainActivity.unregisterReceiver(broadcastReceiver); + status("onStop"); + } + + + public void onResume() { + + if (!connected && (usbPermission == UsbPermission.Unknown || usbPermission == UsbPermission.Granted)) { + mainLooper.post(this::connect); + + } + } + + + public void onPause() { + if (connected) { + status("串口断开"); + // _serialPortSwitch.setChecked(false); + disconnect(); + } + + } + + + public void SendData(byte[] data) { + if (connected) { + try { + usbSerialPort.write(data, WRITE_WAIT_MILLIS); + } catch (IOException e) { + status("Send Failed"); + connected = false; + } + } else { + status("usb serialport disconnected"); + + } + + + } + +} diff --git a/app/src/main/java/com/example/removemarineanimals/services/VideoPlayerHelper.java b/app/src/main/java/com/example/removemarineanimals/services/VideoPlayerHelper.java new file mode 100644 index 0000000..9fb28d7 --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/services/VideoPlayerHelper.java @@ -0,0 +1,27 @@ +package com.example.removemarineanimals.services; + +import cn.nodemedia.NodePlayer; +import cn.nodemedia.NodePlayerView; + +public class VideoPlayerHelper { + + + + public static void startVedio(NodePlayerView nodePlayerView, NodePlayer nodePlayer,String address ){ + + + nodePlayerView.setRenderType(NodePlayerView.RenderType.SURFACEVIEW);//设置渲染器类型 + nodePlayerView.setUIViewContentMode(NodePlayerView.UIViewContentMode.ScaleToFill);//设置视频画面缩放模式 + //nodePlayer=new NodePlayer(this); + nodePlayer.setPlayerView(nodePlayerView);//设置播放视图 + //设置RTSP流使用的传输协议,支持的模式有: + nodePlayer.setRtspTransport(NodePlayer.RTSP_TRANSPORT_TCP);//设置传输 + nodePlayer.setInputUrl(address); + nodePlayer.setVideoEnable(true);//设置视频启用 + nodePlayer.setBufferTime(100);//设置缓冲时间 + nodePlayer.setHWEnable(true); + nodePlayer.setMaxBufferTime(200);//设置最大缓冲时间 + nodePlayer.start(); + } +} + diff --git a/app/src/main/java/com/example/removemarineanimals/services/ttySerialPortHelper.java b/app/src/main/java/com/example/removemarineanimals/services/ttySerialPortHelper.java new file mode 100644 index 0000000..482dd1b --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/services/ttySerialPortHelper.java @@ -0,0 +1,224 @@ +package com.example.removemarineanimals.services; + +import android.util.Log; + +import com.example.removemarineanimals.models.BspIV; + +import android_serialport_api.SerialPortFinder; +import tp.xmaihh.serialport.SerialHelper; +import tp.xmaihh.serialport.bean.ComBean; + +public class ttySerialPortHelper { + public static com.example.removemarineanimals.MainActivity MainActivity; + private static final String TAG = "ttySerialPortHelper"; + private static SerialHelper serialHelper; + private static SerialPortFinder serialPortFinder; + + private static int restoreOriginalError(int errorFlag) { + return Integer.reverseBytes(errorFlag); + } + final String[] ports = serialPortFinder.getAllDevicesPath(); + final String[] botes = new String[]{"0", "50", "75", "110", "134", "150", "200", "300", "600", "1200", "1800", "2400", "4800", "9600", "19200", "38400", "57600", "115200", "230400", "460800", "500000", "576000", "921600", "1000000", "1152000", "1500000", "2000000", "2500000", "3000000", "3500000", "4000000", "CUSTOM"}; + final String[] databits = new String[]{"8", "7", "6", "5"}; + final String[] paritys = new String[]{"NONE", "ODD", "EVEN", "SPACE", "MARK"}; + final String[] stopbits = new String[]{"1", "2"}; + final String[] flowcons = new String[]{"NONE", "RTS/CTS", "XON/XOFF"}; + + public static int[] decodedCH=new int[17]; + + public static void Open() + { + + try { + // serialPortFinder = new SerialPortFinder(); + //serialHelper = new SerialHelper("dev/ttyHS0", 115200)//MK32 + serialHelper = new SerialHelper("/dev/ttyHS3", 115200) //UR7 + { + + @Override + protected void onDataReceived(ComBean comBean) { + + MainActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + // 更新 UI 的代码 + byte[] data=comBean.bRec; + // if (data[0] == 0x55 && data[1] == 0x55) { +// byte[] bytes = new byte[data.length - 2]; +// System.arraycopy(data, 2, bytes, 0, data.length - 2); +// RobotData.DataTrans _dataTrans = RobotDataHanlder.DeoodeDataFromRobot(bytes); +// +// if (_dataTrans != null) { +// MainViewModel.mainBinding.rFAngleDepth.setText(String.valueOf(_dataTrans.getRFDepth())); +// MainViewModel.mainBinding.rFAnglePitch.setText(String.valueOf(_dataTrans.getRFAnglePitch())); +// MainViewModel.mainBinding.rFAngleRoll.setText(String.valueOf(_dataTrans.getRFAngleRoll())); +// MainViewModel.mainBinding.rFAngleYaw.setText(String.valueOf(_dataTrans.getRFAngleYaw())); +// } +// } + + try { + + byte[] crcbytes = new byte[data.length - 2]; + System.arraycopy(data, 0, crcbytes, 0, data.length - 2); + byte[] crc=ModbusCRC.calculateCRC(crcbytes); + // status(bytesToHex(data)); + + if(data[data.length-2]==(byte)(crc[1]&0xff) && data[data.length-1]==(byte)(crc[0] & 0xff)) + { + + if ((data[0] == 0x55) && (data[1] == 0x55) ) + { + + byte[] bytes = new byte[data.length - 4]; + System.arraycopy(data, 2, bytes, 0, data.length - 4); + + BspIV.IV_struct_define _toReceiveIV=BspIV.IV_struct_define.parseFrom(bytes); + + + if (_toReceiveIV!=null) + { + // MainActivity.mainBinding.rxRobotSpeed.setText(String.valueOf(_toReceiveIV.getRobotMoveSpeed())); + + MainActivity.mainBinding.rFAngleRoll.setText(String.valueOf(_toReceiveIV.getRobotAngleRoll()/100.0)); + MainActivity.mainBinding.tvRobotError.setText(String.valueOf(_toReceiveIV.getRobotError())); + MainActivity.mainBinding.tvDynamometer.setText(String.valueOf(_toReceiveIV.getRobotDynamometerValue()/100.0)); + MainActivity.mainBinding.tvForce.setText(String.valueOf(_toReceiveIV.getRobotForceValue())); +// MainActivity.mainBinding.tvRobotAutoSpeed.setText(String.valueOf(_toReceiveIV.getRobotMoveAutoSpeed())); + // MainActivity.mainBinding.tvRobotManualSpeed.setText(String.valueOf(_toReceiveIV.getRobotMoveManualSpeed())); + MainActivity.mainBinding.tvRobotCurrent.setText("L"+String.valueOf(_toReceiveIV.getRobotCurrentLeft()/1000) + + "R"+String.valueOf(_toReceiveIV.getRobotCurrentLeft()/1000)); + + int leftError = _toReceiveIV.getRobotErrorLeft(); + int rightError = _toReceiveIV.getRobotErrorRight(); + + // 还原成原始 MCU 的错误值 + int leftOriginal = restoreOriginalError(leftError); + int rightOriginal = restoreOriginalError(rightError); + + // 左 + if (leftOriginal != 0) { + StringBuilder leftBits = new StringBuilder("错误: "); + for (int i = 0; i < 32; i++) { + if (((leftOriginal >> i) & 1) == 1) { + leftBits.append(32 - i).append(" "); + } + } + + MainActivity.mainBinding.tvLeftError.setText(leftBits.toString().trim()); + } else { + MainActivity.mainBinding.tvLeftError.setText("正常"); + } + + //右 + if (rightOriginal != 0) { + StringBuilder rightBits = new StringBuilder("错误: "); + for (int i = 0; i < 32; i++) { + if (((rightOriginal >> i) & 1) == 1) { + rightBits.append(32 - i).append(" "); + } + } + MainActivity.mainBinding.tvRightError.setText(rightBits.toString().trim()); + } else { + MainActivity.mainBinding.tvRightError.setText("正常"); + } + + if(_toReceiveIV.getRobotError() != 0 && _toReceiveIV.getRobotCurrentState() != 12) + { + + } + else + { + String m = ""; + switch (_toReceiveIV.getRobotCurrentState()) + { + case 0 : + m ="停止"; + break; + case 1 : + m ="前进"; + break; + case 2 : + m ="后退"; + break; + case 3 : + m ="左转"; + break; + case 4 : + m ="右转"; + break; + case 5 : + m ="自动前进"; + break; + case 6 : + m ="自动后退"; + break; + case 7 : + m ="左换道"; + break; + case 8 : + m ="右换道"; + break; + case 9 : + m ="上换道"; + break; + case 10 : + m ="下换道"; + break; + case 11 : + m ="换道完成"; + break; + case 12 : + m ="急停"; + break; + default: + throw new IllegalStateException("Unexpected value: " + _toReceiveIV.getRobotCurrentState()); + } + MainActivity.mainBinding.tvRobotError.setText(m); + } + + + + + } + } + } + + } catch (Exception e) { + + } + + } + }); + } + }; + serialHelper.open(); + } + catch (Exception exception) + { + Log.d(TAG,"Data Received"); + } + + } + private static int index =0; + + + public static void SendData(byte[] data) { + + serialHelper.send( data); // 发送byte[] + } + + public static byte[] getAllChData=new byte[]{0x55, 0x66,0x01,0x01,0x00,0x00,0x00,0x42,0x02,(byte)(0xB5&0xff),(byte)(0xC0&0xff)}; + public static byte[] stopgetAllChData=new byte[]{0x55, 0x66,0x01,0x01,0x00,0x00,0x00,0x42,0x00,(byte)(0xf7&0xff),(byte)(0xe0&0xff)}; + public static void sendTxt(String sTxt) + { + serialHelper.sendTxt( sTxt); // 发送byte[] + } +//serialHelper.send(byte[] bOutArray); // 发送byte[] +//serialHelper.sendHex(String sHex); // 发送Hex +//serialHelper.sendTxt(String sTxt); // 发送ASCII + public static void onDestroy() { + + serialHelper.close(); + } + +} diff --git a/app/src/main/java/com/example/removemarineanimals/viewmodels/MainViewModel.java b/app/src/main/java/com/example/removemarineanimals/viewmodels/MainViewModel.java new file mode 100644 index 0000000..7e2b9ad --- /dev/null +++ b/app/src/main/java/com/example/removemarineanimals/viewmodels/MainViewModel.java @@ -0,0 +1,77 @@ +package com.example.removemarineanimals.viewmodels; + + + +import android.view.View; +import android.widget.SeekBar; + +import androidx.annotation.MainThread; +import androidx.lifecycle.LiveData; +import androidx.lifecycle.MutableLiveData; +import androidx.lifecycle.ViewModel; + +import com.example.removemarineanimals.R; +import com.example.removemarineanimals.databinding.ActivityMainBinding; +//import com.example.removemarineanimals.models.user; +//import com.example.removemarineanimals.services.RobotData; +import com.example.removemarineanimals.services.RobotDataHanlder; +//import com.example.removemarineanimals.services.VideoHelper; + +import java.io.UnsupportedEncodingException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import cn.nodemedia.NodePlayer; + +public class MainViewModel extends ViewModel { + + + // public RobotData.DataTrans _dataTrans=new RobotData.DataTrans(); + public static ActivityMainBinding mainBinding;//通过Binding可以获取界面数据 + // public final MutableLiveData LiveUser; + + public MainViewModel() + { +// LiveUser = new MutableLiveData(); +// +// user u=LiveUser.getValue(); +// if(u==null) +// { +// u=new user(); +// u.setName("dddddd"); +// LiveUser.setValue(u); +// } + + + + } + + + //# region Video操作区域 + int recordVideoState=0; + + public void SnapVideo() + { + + + } + + //#end region Video操作区域 + + void SetPage() + { + + + } + + public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { + + } + + + + + + + +} diff --git a/app/src/main/java/generate_java.bat b/app/src/main/java/generate_java.bat new file mode 100644 index 0000000..cda58d5 --- /dev/null +++ b/app/src/main/java/generate_java.bat @@ -0,0 +1,4 @@ +cd /d D:\Android_studio_workspace\RemoveMarineAnimals\app\src\main\java +protoc --proto_path=. --java_out=. bsp_IV.proto +pause + diff --git a/app/src/main/java/protoc.7z b/app/src/main/java/protoc.7z new file mode 100644 index 0000000..b4ac7a1 Binary files /dev/null and b/app/src/main/java/protoc.7z differ diff --git a/app/src/main/java/protoc.exe b/app/src/main/java/protoc.exe new file mode 100644 index 0000000..f1ffb02 Binary files /dev/null and b/app/src/main/java/protoc.exe differ diff --git a/app/src/main/res/drawable/border.xml b/app/src/main/res/drawable/border.xml new file mode 100644 index 0000000..3d0fd95 --- /dev/null +++ b/app/src/main/res/drawable/border.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/borderblue.xml b/app/src/main/res/drawable/borderblue.xml new file mode 100644 index 0000000..d9db99d --- /dev/null +++ b/app/src/main/res/drawable/borderblue.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/dash_line.xml b/app/src/main/res/drawable/dash_line.xml new file mode 100644 index 0000000..c83a8c5 --- /dev/null +++ b/app/src/main/res/drawable/dash_line.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/squrelogo.png b/app/src/main/res/drawable/squrelogo.png new file mode 100644 index 0000000..f7cafaf Binary files /dev/null and b/app/src/main/res/drawable/squrelogo.png differ diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..da468d1 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,569 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..06d7270 --- /dev/null +++ b/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..ce0cb76 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,151 @@ + + + #FF000000 + #FFFFFFFF + #FFFFFFFF + + #3F51B5 + #303F9F + #FF4081 + + + #fffafa + #fffaf0 + #ffebcd + #f8f8ff + #f5f5f5 + #faebd7 + #ffdead + #808080 + #dcdcdc + #d3d3d3 + #a9a9a9 + #696969 + #708090 + #778899 + #2f4f4f + #c0c0c0 + + #ff0000 + #8b0000 + #dc143c + #8b008b + #ff00ff + #ff6347 + #f08080 + #e9967a + #ffdab9 + #dda0dd + #ffc0cb + #ffb6c1 + #ff1493 + #ff69b4 + #fff0f5 + #cd5c5c + #bc8f8f + #b22222 + #800000 + #f0fff0 + #ff4500 + #ffa500 + #32cd32 + #00ff00 + #ffff00 + #f5deb3 + #f0e68c + #deb887 + #ffe4c4 + #ffffe0 + #b8860b + #ff8c00 + #fafad2 + #fffacd + #fff8dc + #fff5ee + #ffefd5 + #ffe4e1 + #ffe4b5 + #fffff0 + #ffd700 + #daa520 + #ffa07a + #ff7f50 + #f5fffa + #f5f5dc + #f4a460 + #fdf5e6 + #faf0e6 + #fa8072 + #d8bfd8 + #d2b48c + #d2691e + #cd853f + #bdb76b + #eee8aa + #a52a2a + #8b4513 + #a0522d + #808000 + #7fff00 + #adff2f + #008000 + #006400 + #556b2f + #6b8e23 + #7cfc00 + #228b22 + #7fffd4 + #afeeee + #98fb98 + #48d1cc + #66cdaa + #00ffff + #00ff7f + #00fa9a + #00ced1 + #2e8b57 + #90ee90 + #8fbc8f + #40e0d0 + #00ffff + #008b8b + #e0ffff + #008080 + #4b0082 + #0000ff + #00008b + #0000cd + #191970 + #000080 + #4169e1 + #f0ffff + #87ceeb + #00bfff + #87cefa + #20b2aa + #add8e6 + #b0e0e6 + #f0f8ff + #7b68ee + #6a5acd + #483d8b + #3cb371 + #4682b4 + #b0c4de + #6495ed + #1e90ff + #5f9ea0 + #8a2be2 + #800080 + #e6e6fa + #da70d6 + #9370db + #9932cc + #ee82ee + #c71585 + #db7093 + #9400d3 + #ba55d3 + #00000000 + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..7eaccc7 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + 五轮 + + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..b2188ae --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/device_filter.xml b/app/src/main/res/xml/device_filter.xml new file mode 100644 index 0000000..b2a252c --- /dev/null +++ b/app/src/main/res/xml/device_filter.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/test/java/com/example/removemarineanimals/ExampleUnitTest.java b/app/src/test/java/com/example/removemarineanimals/ExampleUnitTest.java new file mode 100644 index 0000000..e4c36cc --- /dev/null +++ b/app/src/test/java/com/example/removemarineanimals/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.removemarineanimals; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..536c1b2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.10.1' apply false + id 'com.android.library' version '8.10.1' apply false +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..976c5f8 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Feb 05 16:51:00 CST 2025 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..4f906e0 --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/proto/RobotData.cs b/proto/RobotData.cs new file mode 100644 index 0000000..6ae6f38 --- /dev/null +++ b/proto/RobotData.cs @@ -0,0 +1,363 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: robot_data.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +/// Holder for reflection information generated from robot_data.proto +public static partial class RobotDataReflection { + + #region Descriptor + /// File descriptor for robot_data.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RobotDataReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChByb2JvdF9kYXRhLnByb3RvImIKCURhdGFUcmFucxIVCg1SRl9BbmdsZV9S", + "b2xsGAEgASgFEhYKDlJGX0FuZ2xlX1BpdGNoGAIgASgFEhQKDFJGX0FuZ2xl", + "X1lhdxgDIAEoBRIQCghSRl9EZXB0aBgEIAEoBUIqCiZjb20uZXhhbXBsZS5y", + "ZW1vdmVtYXJpbmVhbmltYWxzLm1vZGVsc1AAYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::DataTrans), global::DataTrans.Parser, new[]{ "RFAngleRoll", "RFAnglePitch", "RFAngleYaw", "RFDepth" }, null, null, null, null) + })); + } + #endregion + +} +#region Messages +[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] +public sealed partial class DataTrans : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DataTrans()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::RobotDataReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DataTrans() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DataTrans(DataTrans other) : this() { + rFAngleRoll_ = other.rFAngleRoll_; + rFAnglePitch_ = other.rFAnglePitch_; + rFAngleYaw_ = other.rFAngleYaw_; + rFDepth_ = other.rFDepth_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public DataTrans Clone() { + return new DataTrans(this); + } + + /// Field number for the "RF_Angle_Roll" field. + public const int RFAngleRollFieldNumber = 1; + private int rFAngleRoll_; + /// + ///横滚角 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RFAngleRoll { + get { return rFAngleRoll_; } + set { + rFAngleRoll_ = value; + } + } + + /// Field number for the "RF_Angle_Pitch" field. + public const int RFAnglePitchFieldNumber = 2; + private int rFAnglePitch_; + /// + ///俯仰角 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RFAnglePitch { + get { return rFAnglePitch_; } + set { + rFAnglePitch_ = value; + } + } + + /// Field number for the "RF_Angle_Yaw" field. + public const int RFAngleYawFieldNumber = 3; + private int rFAngleYaw_; + /// + ///航向角 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RFAngleYaw { + get { return rFAngleYaw_; } + set { + rFAngleYaw_ = value; + } + } + + /// Field number for the "RF_Depth" field. + public const int RFDepthFieldNumber = 4; + private int rFDepth_; + /// + ///海洋深度 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int RFDepth { + get { return rFDepth_; } + set { + rFDepth_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as DataTrans); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(DataTrans other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (RFAngleRoll != other.RFAngleRoll) return false; + if (RFAnglePitch != other.RFAnglePitch) return false; + if (RFAngleYaw != other.RFAngleYaw) return false; + if (RFDepth != other.RFDepth) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (RFAngleRoll != 0) hash ^= RFAngleRoll.GetHashCode(); + if (RFAnglePitch != 0) hash ^= RFAnglePitch.GetHashCode(); + if (RFAngleYaw != 0) hash ^= RFAngleYaw.GetHashCode(); + if (RFDepth != 0) hash ^= RFDepth.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (RFAngleRoll != 0) { + output.WriteRawTag(8); + output.WriteInt32(RFAngleRoll); + } + if (RFAnglePitch != 0) { + output.WriteRawTag(16); + output.WriteInt32(RFAnglePitch); + } + if (RFAngleYaw != 0) { + output.WriteRawTag(24); + output.WriteInt32(RFAngleYaw); + } + if (RFDepth != 0) { + output.WriteRawTag(32); + output.WriteInt32(RFDepth); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (RFAngleRoll != 0) { + output.WriteRawTag(8); + output.WriteInt32(RFAngleRoll); + } + if (RFAnglePitch != 0) { + output.WriteRawTag(16); + output.WriteInt32(RFAnglePitch); + } + if (RFAngleYaw != 0) { + output.WriteRawTag(24); + output.WriteInt32(RFAngleYaw); + } + if (RFDepth != 0) { + output.WriteRawTag(32); + output.WriteInt32(RFDepth); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (RFAngleRoll != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RFAngleRoll); + } + if (RFAnglePitch != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RFAnglePitch); + } + if (RFAngleYaw != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RFAngleYaw); + } + if (RFDepth != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(RFDepth); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(DataTrans other) { + if (other == null) { + return; + } + if (other.RFAngleRoll != 0) { + RFAngleRoll = other.RFAngleRoll; + } + if (other.RFAnglePitch != 0) { + RFAnglePitch = other.RFAnglePitch; + } + if (other.RFAngleYaw != 0) { + RFAngleYaw = other.RFAngleYaw; + } + if (other.RFDepth != 0) { + RFDepth = other.RFDepth; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + RFAngleRoll = input.ReadInt32(); + break; + } + case 16: { + RFAnglePitch = input.ReadInt32(); + break; + } + case 24: { + RFAngleYaw = input.ReadInt32(); + break; + } + case 32: { + RFDepth = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + RFAngleRoll = input.ReadInt32(); + break; + } + case 16: { + RFAnglePitch = input.ReadInt32(); + break; + } + case 24: { + RFAngleYaw = input.ReadInt32(); + break; + } + case 32: { + RFDepth = input.ReadInt32(); + break; + } + } + } + } + #endif + +} + +#endregion + + +#endregion Designer generated code diff --git a/proto/com/example/removemarineanimals/models/RobotData.java b/proto/com/example/removemarineanimals/models/RobotData.java new file mode 100644 index 0000000..bf2f1ca --- /dev/null +++ b/proto/com/example/removemarineanimals/models/RobotData.java @@ -0,0 +1,792 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: robot_data.proto +// Protobuf Java Version: 4.27.2 + +package com.example.removemarineanimals.models; + +public final class RobotData { + private RobotData() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + RobotData.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface DataTransOrBuilder extends + // @@protoc_insertion_point(interface_extends:DataTrans) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * 横滚角
+     * 
+ * + * int32 RF_Angle_Roll = 1; + * @return The rFAngleRoll. + */ + int getRFAngleRoll(); + + /** + *
+     * 俯仰角
+     * 
+ * + * int32 RF_Angle_Pitch = 2; + * @return The rFAnglePitch. + */ + int getRFAnglePitch(); + + /** + *
+     * 航向角
+     * 
+ * + * int32 RF_Angle_Yaw = 3; + * @return The rFAngleYaw. + */ + int getRFAngleYaw(); + + /** + *
+     * 海洋深度
+     * 
+ * + * int32 RF_Depth = 4; + * @return The rFDepth. + */ + int getRFDepth(); + } + /** + * Protobuf type {@code DataTrans} + */ + public static final class DataTrans extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:DataTrans) + DataTransOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + DataTrans.class.getName()); + } + // Use DataTrans.newBuilder() to construct. + private DataTrans(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DataTrans() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.removemarineanimals.models.RobotData.internal_static_DataTrans_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.removemarineanimals.models.RobotData.internal_static_DataTrans_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.removemarineanimals.models.RobotData.DataTrans.class, com.example.removemarineanimals.models.RobotData.DataTrans.Builder.class); + } + + public static final int RF_ANGLE_ROLL_FIELD_NUMBER = 1; + private int rFAngleRoll_ = 0; + /** + *
+     * 横滚角
+     * 
+ * + * int32 RF_Angle_Roll = 1; + * @return The rFAngleRoll. + */ + @java.lang.Override + public int getRFAngleRoll() { + return rFAngleRoll_; + } + + public static final int RF_ANGLE_PITCH_FIELD_NUMBER = 2; + private int rFAnglePitch_ = 0; + /** + *
+     * 俯仰角
+     * 
+ * + * int32 RF_Angle_Pitch = 2; + * @return The rFAnglePitch. + */ + @java.lang.Override + public int getRFAnglePitch() { + return rFAnglePitch_; + } + + public static final int RF_ANGLE_YAW_FIELD_NUMBER = 3; + private int rFAngleYaw_ = 0; + /** + *
+     * 航向角
+     * 
+ * + * int32 RF_Angle_Yaw = 3; + * @return The rFAngleYaw. + */ + @java.lang.Override + public int getRFAngleYaw() { + return rFAngleYaw_; + } + + public static final int RF_DEPTH_FIELD_NUMBER = 4; + private int rFDepth_ = 0; + /** + *
+     * 海洋深度
+     * 
+ * + * int32 RF_Depth = 4; + * @return The rFDepth. + */ + @java.lang.Override + public int getRFDepth() { + return rFDepth_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (rFAngleRoll_ != 0) { + output.writeInt32(1, rFAngleRoll_); + } + if (rFAnglePitch_ != 0) { + output.writeInt32(2, rFAnglePitch_); + } + if (rFAngleYaw_ != 0) { + output.writeInt32(3, rFAngleYaw_); + } + if (rFDepth_ != 0) { + output.writeInt32(4, rFDepth_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rFAngleRoll_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, rFAngleRoll_); + } + if (rFAnglePitch_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, rFAnglePitch_); + } + if (rFAngleYaw_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, rFAngleYaw_); + } + if (rFDepth_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, rFDepth_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.example.removemarineanimals.models.RobotData.DataTrans)) { + return super.equals(obj); + } + com.example.removemarineanimals.models.RobotData.DataTrans other = (com.example.removemarineanimals.models.RobotData.DataTrans) obj; + + if (getRFAngleRoll() + != other.getRFAngleRoll()) return false; + if (getRFAnglePitch() + != other.getRFAnglePitch()) return false; + if (getRFAngleYaw() + != other.getRFAngleYaw()) return false; + if (getRFDepth() + != other.getRFDepth()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RF_ANGLE_ROLL_FIELD_NUMBER; + hash = (53 * hash) + getRFAngleRoll(); + hash = (37 * hash) + RF_ANGLE_PITCH_FIELD_NUMBER; + hash = (53 * hash) + getRFAnglePitch(); + hash = (37 * hash) + RF_ANGLE_YAW_FIELD_NUMBER; + hash = (53 * hash) + getRFAngleYaw(); + hash = (37 * hash) + RF_DEPTH_FIELD_NUMBER; + hash = (53 * hash) + getRFDepth(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.removemarineanimals.models.RobotData.DataTrans parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.RobotData.DataTrans parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.RobotData.DataTrans parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.RobotData.DataTrans parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.RobotData.DataTrans parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.RobotData.DataTrans parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.RobotData.DataTrans parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.removemarineanimals.models.RobotData.DataTrans parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.example.removemarineanimals.models.RobotData.DataTrans parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.example.removemarineanimals.models.RobotData.DataTrans parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.removemarineanimals.models.RobotData.DataTrans parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.removemarineanimals.models.RobotData.DataTrans parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.example.removemarineanimals.models.RobotData.DataTrans prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code DataTrans} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:DataTrans) + com.example.removemarineanimals.models.RobotData.DataTransOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.removemarineanimals.models.RobotData.internal_static_DataTrans_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.removemarineanimals.models.RobotData.internal_static_DataTrans_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.removemarineanimals.models.RobotData.DataTrans.class, com.example.removemarineanimals.models.RobotData.DataTrans.Builder.class); + } + + // Construct using com.example.removemarineanimals.models.RobotData.DataTrans.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rFAngleRoll_ = 0; + rFAnglePitch_ = 0; + rFAngleYaw_ = 0; + rFDepth_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.removemarineanimals.models.RobotData.internal_static_DataTrans_descriptor; + } + + @java.lang.Override + public com.example.removemarineanimals.models.RobotData.DataTrans getDefaultInstanceForType() { + return com.example.removemarineanimals.models.RobotData.DataTrans.getDefaultInstance(); + } + + @java.lang.Override + public com.example.removemarineanimals.models.RobotData.DataTrans build() { + com.example.removemarineanimals.models.RobotData.DataTrans result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.removemarineanimals.models.RobotData.DataTrans buildPartial() { + com.example.removemarineanimals.models.RobotData.DataTrans result = new com.example.removemarineanimals.models.RobotData.DataTrans(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.example.removemarineanimals.models.RobotData.DataTrans result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rFAngleRoll_ = rFAngleRoll_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rFAnglePitch_ = rFAnglePitch_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.rFAngleYaw_ = rFAngleYaw_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rFDepth_ = rFDepth_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.removemarineanimals.models.RobotData.DataTrans) { + return mergeFrom((com.example.removemarineanimals.models.RobotData.DataTrans)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.removemarineanimals.models.RobotData.DataTrans other) { + if (other == com.example.removemarineanimals.models.RobotData.DataTrans.getDefaultInstance()) return this; + if (other.getRFAngleRoll() != 0) { + setRFAngleRoll(other.getRFAngleRoll()); + } + if (other.getRFAnglePitch() != 0) { + setRFAnglePitch(other.getRFAnglePitch()); + } + if (other.getRFAngleYaw() != 0) { + setRFAngleYaw(other.getRFAngleYaw()); + } + if (other.getRFDepth() != 0) { + setRFDepth(other.getRFDepth()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + rFAngleRoll_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + rFAnglePitch_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + rFAngleYaw_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + rFDepth_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int rFAngleRoll_ ; + /** + *
+       * 横滚角
+       * 
+ * + * int32 RF_Angle_Roll = 1; + * @return The rFAngleRoll. + */ + @java.lang.Override + public int getRFAngleRoll() { + return rFAngleRoll_; + } + /** + *
+       * 横滚角
+       * 
+ * + * int32 RF_Angle_Roll = 1; + * @param value The rFAngleRoll to set. + * @return This builder for chaining. + */ + public Builder setRFAngleRoll(int value) { + + rFAngleRoll_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * 横滚角
+       * 
+ * + * int32 RF_Angle_Roll = 1; + * @return This builder for chaining. + */ + public Builder clearRFAngleRoll() { + bitField0_ = (bitField0_ & ~0x00000001); + rFAngleRoll_ = 0; + onChanged(); + return this; + } + + private int rFAnglePitch_ ; + /** + *
+       * 俯仰角
+       * 
+ * + * int32 RF_Angle_Pitch = 2; + * @return The rFAnglePitch. + */ + @java.lang.Override + public int getRFAnglePitch() { + return rFAnglePitch_; + } + /** + *
+       * 俯仰角
+       * 
+ * + * int32 RF_Angle_Pitch = 2; + * @param value The rFAnglePitch to set. + * @return This builder for chaining. + */ + public Builder setRFAnglePitch(int value) { + + rFAnglePitch_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * 俯仰角
+       * 
+ * + * int32 RF_Angle_Pitch = 2; + * @return This builder for chaining. + */ + public Builder clearRFAnglePitch() { + bitField0_ = (bitField0_ & ~0x00000002); + rFAnglePitch_ = 0; + onChanged(); + return this; + } + + private int rFAngleYaw_ ; + /** + *
+       * 航向角
+       * 
+ * + * int32 RF_Angle_Yaw = 3; + * @return The rFAngleYaw. + */ + @java.lang.Override + public int getRFAngleYaw() { + return rFAngleYaw_; + } + /** + *
+       * 航向角
+       * 
+ * + * int32 RF_Angle_Yaw = 3; + * @param value The rFAngleYaw to set. + * @return This builder for chaining. + */ + public Builder setRFAngleYaw(int value) { + + rFAngleYaw_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * 航向角
+       * 
+ * + * int32 RF_Angle_Yaw = 3; + * @return This builder for chaining. + */ + public Builder clearRFAngleYaw() { + bitField0_ = (bitField0_ & ~0x00000004); + rFAngleYaw_ = 0; + onChanged(); + return this; + } + + private int rFDepth_ ; + /** + *
+       * 海洋深度
+       * 
+ * + * int32 RF_Depth = 4; + * @return The rFDepth. + */ + @java.lang.Override + public int getRFDepth() { + return rFDepth_; + } + /** + *
+       * 海洋深度
+       * 
+ * + * int32 RF_Depth = 4; + * @param value The rFDepth to set. + * @return This builder for chaining. + */ + public Builder setRFDepth(int value) { + + rFDepth_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * 海洋深度
+       * 
+ * + * int32 RF_Depth = 4; + * @return This builder for chaining. + */ + public Builder clearRFDepth() { + bitField0_ = (bitField0_ & ~0x00000008); + rFDepth_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:DataTrans) + } + + // @@protoc_insertion_point(class_scope:DataTrans) + private static final com.example.removemarineanimals.models.RobotData.DataTrans DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.removemarineanimals.models.RobotData.DataTrans(); + } + + public static com.example.removemarineanimals.models.RobotData.DataTrans getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DataTrans parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.example.removemarineanimals.models.RobotData.DataTrans getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_DataTrans_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DataTrans_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\020robot_data.proto\"b\n\tDataTrans\022\025\n\rRF_An" + + "gle_Roll\030\001 \001(\005\022\026\n\016RF_Angle_Pitch\030\002 \001(\005\022\024" + + "\n\014RF_Angle_Yaw\030\003 \001(\005\022\020\n\010RF_Depth\030\004 \001(\005B*" + + "\n&com.example.removemarineanimals.models" + + "P\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_DataTrans_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_DataTrans_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_DataTrans_descriptor, + new java.lang.String[] { "RFAngleRoll", "RFAnglePitch", "RFAngleYaw", "RFDepth", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto/com/example/removemarineanimals/models/RobotRMACM.java b/proto/com/example/removemarineanimals/models/RobotRMACM.java new file mode 100644 index 0000000..747439f --- /dev/null +++ b/proto/com/example/removemarineanimals/models/RobotRMACM.java @@ -0,0 +1,615 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: robot_RMACM.proto +// Protobuf Java Version: 4.27.2 + +package com.example.removemarineanimals.models; + +public final class RobotRMACM { + private RobotRMACM() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + RobotRMACM.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface RMACMOrBuilder extends + // @@protoc_insertion_point(interface_extends:RMACM) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * 灯光亮度
+     * 
+ * + * int32 LightBrightness = 1; + * @return The lightBrightness. + */ + int getLightBrightness(); + + /** + *
+     * 机器人速度
+     * 
+ * + * int32 Robot_Speed = 2; + * @return The robotSpeed. + */ + int getRobotSpeed(); + } + /** + *
+   * Remove Marine Animal Command
+   * 
+ * + * Protobuf type {@code RMACM} + */ + public static final class RMACM extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:RMACM) + RMACMOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + RMACM.class.getName()); + } + // Use RMACM.newBuilder() to construct. + private RMACM(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RMACM() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.removemarineanimals.models.RobotRMACM.internal_static_RMACM_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.removemarineanimals.models.RobotRMACM.internal_static_RMACM_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.removemarineanimals.models.RobotRMACM.RMACM.class, com.example.removemarineanimals.models.RobotRMACM.RMACM.Builder.class); + } + + public static final int LIGHTBRIGHTNESS_FIELD_NUMBER = 1; + private int lightBrightness_ = 0; + /** + *
+     * 灯光亮度
+     * 
+ * + * int32 LightBrightness = 1; + * @return The lightBrightness. + */ + @java.lang.Override + public int getLightBrightness() { + return lightBrightness_; + } + + public static final int ROBOT_SPEED_FIELD_NUMBER = 2; + private int robotSpeed_ = 0; + /** + *
+     * 机器人速度
+     * 
+ * + * int32 Robot_Speed = 2; + * @return The robotSpeed. + */ + @java.lang.Override + public int getRobotSpeed() { + return robotSpeed_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (lightBrightness_ != 0) { + output.writeInt32(1, lightBrightness_); + } + if (robotSpeed_ != 0) { + output.writeInt32(2, robotSpeed_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (lightBrightness_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, lightBrightness_); + } + if (robotSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, robotSpeed_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.example.removemarineanimals.models.RobotRMACM.RMACM)) { + return super.equals(obj); + } + com.example.removemarineanimals.models.RobotRMACM.RMACM other = (com.example.removemarineanimals.models.RobotRMACM.RMACM) obj; + + if (getLightBrightness() + != other.getLightBrightness()) return false; + if (getRobotSpeed() + != other.getRobotSpeed()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LIGHTBRIGHTNESS_FIELD_NUMBER; + hash = (53 * hash) + getLightBrightness(); + hash = (37 * hash) + ROBOT_SPEED_FIELD_NUMBER; + hash = (53 * hash) + getRobotSpeed(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.removemarineanimals.models.RobotRMACM.RMACM parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.example.removemarineanimals.models.RobotRMACM.RMACM prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Remove Marine Animal Command
+     * 
+ * + * Protobuf type {@code RMACM} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:RMACM) + com.example.removemarineanimals.models.RobotRMACM.RMACMOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.removemarineanimals.models.RobotRMACM.internal_static_RMACM_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.removemarineanimals.models.RobotRMACM.internal_static_RMACM_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.removemarineanimals.models.RobotRMACM.RMACM.class, com.example.removemarineanimals.models.RobotRMACM.RMACM.Builder.class); + } + + // Construct using com.example.removemarineanimals.models.RobotRMACM.RMACM.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + lightBrightness_ = 0; + robotSpeed_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.removemarineanimals.models.RobotRMACM.internal_static_RMACM_descriptor; + } + + @java.lang.Override + public com.example.removemarineanimals.models.RobotRMACM.RMACM getDefaultInstanceForType() { + return com.example.removemarineanimals.models.RobotRMACM.RMACM.getDefaultInstance(); + } + + @java.lang.Override + public com.example.removemarineanimals.models.RobotRMACM.RMACM build() { + com.example.removemarineanimals.models.RobotRMACM.RMACM result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.removemarineanimals.models.RobotRMACM.RMACM buildPartial() { + com.example.removemarineanimals.models.RobotRMACM.RMACM result = new com.example.removemarineanimals.models.RobotRMACM.RMACM(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.example.removemarineanimals.models.RobotRMACM.RMACM result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.lightBrightness_ = lightBrightness_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.robotSpeed_ = robotSpeed_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.removemarineanimals.models.RobotRMACM.RMACM) { + return mergeFrom((com.example.removemarineanimals.models.RobotRMACM.RMACM)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.removemarineanimals.models.RobotRMACM.RMACM other) { + if (other == com.example.removemarineanimals.models.RobotRMACM.RMACM.getDefaultInstance()) return this; + if (other.getLightBrightness() != 0) { + setLightBrightness(other.getLightBrightness()); + } + if (other.getRobotSpeed() != 0) { + setRobotSpeed(other.getRobotSpeed()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + lightBrightness_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + robotSpeed_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int lightBrightness_ ; + /** + *
+       * 灯光亮度
+       * 
+ * + * int32 LightBrightness = 1; + * @return The lightBrightness. + */ + @java.lang.Override + public int getLightBrightness() { + return lightBrightness_; + } + /** + *
+       * 灯光亮度
+       * 
+ * + * int32 LightBrightness = 1; + * @param value The lightBrightness to set. + * @return This builder for chaining. + */ + public Builder setLightBrightness(int value) { + + lightBrightness_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * 灯光亮度
+       * 
+ * + * int32 LightBrightness = 1; + * @return This builder for chaining. + */ + public Builder clearLightBrightness() { + bitField0_ = (bitField0_ & ~0x00000001); + lightBrightness_ = 0; + onChanged(); + return this; + } + + private int robotSpeed_ ; + /** + *
+       * 机器人速度
+       * 
+ * + * int32 Robot_Speed = 2; + * @return The robotSpeed. + */ + @java.lang.Override + public int getRobotSpeed() { + return robotSpeed_; + } + /** + *
+       * 机器人速度
+       * 
+ * + * int32 Robot_Speed = 2; + * @param value The robotSpeed to set. + * @return This builder for chaining. + */ + public Builder setRobotSpeed(int value) { + + robotSpeed_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * 机器人速度
+       * 
+ * + * int32 Robot_Speed = 2; + * @return This builder for chaining. + */ + public Builder clearRobotSpeed() { + bitField0_ = (bitField0_ & ~0x00000002); + robotSpeed_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:RMACM) + } + + // @@protoc_insertion_point(class_scope:RMACM) + private static final com.example.removemarineanimals.models.RobotRMACM.RMACM DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.removemarineanimals.models.RobotRMACM.RMACM(); + } + + public static com.example.removemarineanimals.models.RobotRMACM.RMACM getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RMACM parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.example.removemarineanimals.models.RobotRMACM.RMACM getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_RMACM_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_RMACM_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\021robot_RMACM.proto\"5\n\005RMACM\022\027\n\017LightBri" + + "ghtness\030\001 \001(\005\022\023\n\013Robot_Speed\030\002 \001(\005B*\n&co" + + "m.example.removemarineanimals.modelsP\000b\006" + + "proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_RMACM_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_RMACM_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_RMACM_descriptor, + new java.lang.String[] { "LightBrightness", "RobotSpeed", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto/generate_c.bat b/proto/generate_c.bat new file mode 100644 index 0000000..e8888bf --- /dev/null +++ b/proto/generate_c.bat @@ -0,0 +1 @@ +protoc --nanopb_out=. *.proto \ No newline at end of file diff --git a/proto/generate_c.txt b/proto/generate_c.txt new file mode 100644 index 0000000..e8888bf --- /dev/null +++ b/proto/generate_c.txt @@ -0,0 +1 @@ +protoc --nanopb_out=. *.proto \ No newline at end of file diff --git a/proto/generate_java.bat b/proto/generate_java.bat new file mode 100644 index 0000000..59085ae --- /dev/null +++ b/proto/generate_java.bat @@ -0,0 +1 @@ + protoc --java_out . *.proto diff --git a/proto/protoc.exe b/proto/protoc.exe new file mode 100644 index 0000000..f1ffb02 Binary files /dev/null and b/proto/protoc.exe differ diff --git a/proto/robot_RMACM.pb.c b/proto/robot_RMACM.pb.c new file mode 100644 index 0000000..4dbdddc --- /dev/null +++ b/proto/robot_RMACM.pb.c @@ -0,0 +1,12 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.8 */ + +#include "robot_RMACM.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(RMACM, RMACM, AUTO) + + + diff --git a/proto/robot_RMACM.pb.h b/proto/robot_RMACM.pb.h new file mode 100644 index 0000000..386bb24 --- /dev/null +++ b/proto/robot_RMACM.pb.h @@ -0,0 +1,52 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.8 */ + +#ifndef PB_ROBOT_RMACM_PB_H_INCLUDED +#define PB_ROBOT_RMACM_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Struct definitions */ +/* Remove Marine Animal Command */ +typedef struct _RMACM { + int32_t LightBrightness; /* 灯光亮度 */ + int32_t Robot_Speed; /* 机器人速度 */ +} RMACM; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define RMACM_init_default {0, 0} +#define RMACM_init_zero {0, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define RMACM_LightBrightness_tag 1 +#define RMACM_Robot_Speed_tag 2 + +/* Struct field encoding specification for nanopb */ +#define RMACM_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, INT32, LightBrightness, 1) \ +X(a, STATIC, SINGULAR, INT32, Robot_Speed, 2) +#define RMACM_CALLBACK NULL +#define RMACM_DEFAULT NULL + +extern const pb_msgdesc_t RMACM_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define RMACM_fields &RMACM_msg + +/* Maximum encoded size of messages (where known) */ +#define RMACM_size 22 +#define ROBOT_RMACM_PB_H_MAX_SIZE RMACM_size + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/proto/robot_RMACM.proto b/proto/robot_RMACM.proto new file mode 100644 index 0000000..23c1cf9 --- /dev/null +++ b/proto/robot_RMACM.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +option java_multiple_files = false;//set true, and all the messages will be stored in different files, which is not what I want +option java_package = "com.example.removemarineanimals.models"; + +//Remove Marine Animal Command +message RMACM{ + + int32 LightBrightness=1; /*灯光亮度*/ + int32 Robot_Speed=2; /*机器人速度*/ + +}; diff --git a/proto/robot_data.options b/proto/robot_data.options new file mode 100644 index 0000000..9cdc3aa --- /dev/null +++ b/proto/robot_data.options @@ -0,0 +1,2 @@ +# lock.options +DataTrans.Buff_Data max_size:50 fixed_length:true \ No newline at end of file diff --git a/proto/robot_data.pb.c b/proto/robot_data.pb.c new file mode 100644 index 0000000..81fb3f9 --- /dev/null +++ b/proto/robot_data.pb.c @@ -0,0 +1,12 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.8 */ + +#include "robot_data.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(DataTrans, DataTrans, AUTO) + + + diff --git a/proto/robot_data.pb.h b/proto/robot_data.pb.h new file mode 100644 index 0000000..720840f --- /dev/null +++ b/proto/robot_data.pb.h @@ -0,0 +1,57 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.8 */ + +#ifndef PB_ROBOT_DATA_PB_H_INCLUDED +#define PB_ROBOT_DATA_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Struct definitions */ +typedef struct _DataTrans { + int32_t RF_Angle_Roll; /* 横滚角 */ + int32_t RF_Angle_Pitch; /* 俯仰角 */ + int32_t RF_Angle_Yaw; /* 航向角 */ + int32_t RF_Depth; /* 海洋深度 */ +} DataTrans; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define DataTrans_init_default {0, 0, 0, 0} +#define DataTrans_init_zero {0, 0, 0, 0} + +/* Field tags (for use in manual encoding/decoding) */ +#define DataTrans_RF_Angle_Roll_tag 1 +#define DataTrans_RF_Angle_Pitch_tag 2 +#define DataTrans_RF_Angle_Yaw_tag 3 +#define DataTrans_RF_Depth_tag 4 + +/* Struct field encoding specification for nanopb */ +#define DataTrans_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, INT32, RF_Angle_Roll, 1) \ +X(a, STATIC, SINGULAR, INT32, RF_Angle_Pitch, 2) \ +X(a, STATIC, SINGULAR, INT32, RF_Angle_Yaw, 3) \ +X(a, STATIC, SINGULAR, INT32, RF_Depth, 4) +#define DataTrans_CALLBACK NULL +#define DataTrans_DEFAULT NULL + +extern const pb_msgdesc_t DataTrans_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define DataTrans_fields &DataTrans_msg + +/* Maximum encoded size of messages (where known) */ +#define DataTrans_size 44 +#define ROBOT_DATA_PB_H_MAX_SIZE DataTrans_size + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/proto/robot_data.proto b/proto/robot_data.proto new file mode 100644 index 0000000..684e708 --- /dev/null +++ b/proto/robot_data.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +option java_multiple_files = false;//set true, and all the messages will be stored in different files, which is not what I want +option java_package = "com.example.removemarineanimals.models"; + + +message DataTrans{ + + int32 RF_Angle_Roll=1; /*横滚角*/ + int32 RF_Angle_Pitch=2; /*俯仰角*/ + int32 RF_Angle_Yaw=3; /*航向角*/ + int32 RF_Depth=4; /*海洋深度*/ +}; diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..6b2f8b4 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,20 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + + maven { url 'https://jitpack.io' } + + } +} + +rootProject.name = "RemoveMarineAnimals" +include ':app'