Browse Source

负压,安卓APP,V1.2

master 安卓V1.2
SHIYUSHENG\10431 2 weeks ago
commit
b47835060c
  1. BIN
      .gradle/8.2/checksums/checksums.lock
  2. BIN
      .gradle/8.2/checksums/sha1-checksums.bin
  3. BIN
      .gradle/8.2/dependencies-accessors/dependencies-accessors.lock
  4. 0
      .gradle/8.2/dependencies-accessors/gc.properties
  5. BIN
      .gradle/8.2/executionHistory/executionHistory.bin
  6. BIN
      .gradle/8.2/executionHistory/executionHistory.lock
  7. BIN
      .gradle/8.2/fileChanges/last-build.bin
  8. BIN
      .gradle/8.2/fileHashes/fileHashes.bin
  9. BIN
      .gradle/8.2/fileHashes/fileHashes.lock
  10. BIN
      .gradle/8.2/fileHashes/resourceHashesCache.bin
  11. 0
      .gradle/8.2/gc.properties
  12. BIN
      .gradle/buildOutputCleanup/buildOutputCleanup.lock
  13. 2
      .gradle/buildOutputCleanup/cache.properties
  14. BIN
      .gradle/buildOutputCleanup/outputFiles.bin
  15. 2
      .gradle/config.properties
  16. BIN
      .gradle/file-system.probe
  17. 0
      .gradle/vcs-1/gc.properties
  18. 3
      .idea/.gitignore
  19. 6
      .idea/AndroidProjectSystem.xml
  20. 9
      .idea/ThicknessApp.iml
  21. 2289
      .idea/caches/deviceStreaming.xml
  22. 6
      .idea/compiler.xml
  23. 10
      .idea/deploymentTargetDropDown.xml
  24. 18
      .idea/deploymentTargetSelector.xml
  25. 13
      .idea/deviceManager.xml
  26. 20
      .idea/gradle.xml
  27. 10
      .idea/migrations.xml
  28. 9
      .idea/misc.xml
  29. 17
      .idea/runConfigurations.xml
  30. 6
      .idea/vcs.xml
  31. 1
      app/.gitignore
  32. 72
      app/build.gradle
  33. 21
      app/proguard-rules.pro
  34. 26
      app/src/androidTest/java/com/bingoorobot/foreignobjectcuttingapp/ExampleInstrumentedTest.java
  35. 47
      app/src/main/AndroidManifest.xml
  36. 464
      app/src/main/java/BspIV.cs
  37. 801
      app/src/main/java/BspPV.cs
  38. 11
      app/src/main/java/D_Cmd.proto
  39. 30
      app/src/main/java/bsp_Error.proto
  40. 19
      app/src/main/java/bsp_IV.proto
  41. 11
      app/src/main/java/bsp_PV.proto
  42. 440
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/MainActivity.java
  43. 874
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspError.java
  44. 1442
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspIV.java
  45. 983
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspPV.java
  46. 837
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/DCmd.java
  47. 44
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/ErrorModel.java
  48. 1726
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/MspMK32.java
  49. 43
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/ScrollBottomScrollView.java
  50. 22
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/CustomProber.java
  51. 95
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/DataExchangeHelper.java
  52. 28
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ErrorDeocdeHelper.java
  53. 99
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/FilpViewHelper.java
  54. 80
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ModbusCRC.java
  55. 70
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/MyDataHelper.java
  56. 206
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/PopupHelper.java
  57. 180
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ReceiivedDataHandler.java
  58. 97
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/UDPHelper.java
  59. 59
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/VideoPlayerHelper.java
  60. 25
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/WebViewHelper.java
  61. 112
      app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ttySerialPortHelper.java
  62. 1
      app/src/main/java/generate_Csharp.bat
  63. 1
      app/src/main/java/generate_java.bat
  64. 25
      app/src/main/java/msp_MK32.proto
  65. BIN
      app/src/main/java/protoc.exe
  66. 25
      app/src/main/res/drawable/background.xml
  67. BIN
      app/src/main/res/drawable/bgr.png
  68. BIN
      app/src/main/res/drawable/bigackground.png
  69. 25
      app/src/main/res/drawable/blue_rounded_rectangle.xml
  70. 10
      app/src/main/res/drawable/border.xml
  71. 24
      app/src/main/res/drawable/borderblue.xml
  72. 24
      app/src/main/res/drawable/borderbluegreen.xml
  73. 24
      app/src/main/res/drawable/bordergreen.xml
  74. 31
      app/src/main/res/drawable/borderlog.xml
  75. 24
      app/src/main/res/drawable/borderorange.xml
  76. 24
      app/src/main/res/drawable/borderwhite.xml
  77. 24
      app/src/main/res/drawable/buttonborderwhite.xml
  78. 14
      app/src/main/res/drawable/dash_line.xml
  79. 13
      app/src/main/res/drawable/divider.xml
  80. 170
      app/src/main/res/drawable/ic_launcher_background.xml
  81. 30
      app/src/main/res/drawable/ic_launcher_foreground.xml
  82. 25
      app/src/main/res/drawable/orange_rounded_rectangle.xml
  83. 15
      app/src/main/res/drawable/radio_button_selected.xml
  84. 8
      app/src/main/res/drawable/radio_button_textcolor.xml
  85. 8
      app/src/main/res/drawable/radio_button_unselected.xml
  86. 5
      app/src/main/res/drawable/radiobutton_background.xml
  87. 28
      app/src/main/res/drawable/rounded_edittext.xml
  88. BIN
      app/src/main/res/drawable/smallbackground.png
  89. BIN
      app/src/main/res/drawable/squrelogo.png
  90. 24
      app/src/main/res/drawable/submenu.xml
  91. BIN
      app/src/main/res/font/font_you_yuan.ttf
  92. 714
      app/src/main/res/layout/activity_main.xml
  93. 214
      app/src/main/res/layout/automodepopup.xml
  94. 26
      app/src/main/res/layout/log_item.xml
  95. 143
      app/src/main/res/layout/manualmodepopup.xml
  96. 6
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  97. 6
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  98. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher.webp
  99. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
  100. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher.webp

BIN
.gradle/8.2/checksums/checksums.lock

Binary file not shown.

BIN
.gradle/8.2/checksums/sha1-checksums.bin

Binary file not shown.

BIN
.gradle/8.2/dependencies-accessors/dependencies-accessors.lock

Binary file not shown.

0
.gradle/8.2/dependencies-accessors/gc.properties

BIN
.gradle/8.2/executionHistory/executionHistory.bin

Binary file not shown.

BIN
.gradle/8.2/executionHistory/executionHistory.lock

Binary file not shown.

BIN
.gradle/8.2/fileChanges/last-build.bin

Binary file not shown.

BIN
.gradle/8.2/fileHashes/fileHashes.bin

Binary file not shown.

BIN
.gradle/8.2/fileHashes/fileHashes.lock

Binary file not shown.

BIN
.gradle/8.2/fileHashes/resourceHashesCache.bin

Binary file not shown.

0
.gradle/8.2/gc.properties

BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock

Binary file not shown.

2
.gradle/buildOutputCleanup/cache.properties

@ -0,0 +1,2 @@
#Wed May 27 16:58:48 CST 2026
gradle.version=8.2

BIN
.gradle/buildOutputCleanup/outputFiles.bin

Binary file not shown.

2
.gradle/config.properties

@ -0,0 +1,2 @@
#Wed May 27 16:58:07 CST 2026
java.home=D\:\\Program Files\\Android\\Android Studio\\jbr

BIN
.gradle/file-system.probe

Binary file not shown.

0
.gradle/vcs-1/gc.properties

3
.idea/.gitignore

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

6
.idea/AndroidProjectSystem.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
</component>
</project>

9
.idea/ThicknessApp.iml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://E:/BingooWorkingSpace/AndroidProjects/ThicknessApp" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

2289
.idea/caches/deviceStreaming.xml

File diff suppressed because it is too large

6
.idea/compiler.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
</component>
</project>

10
.idea/deploymentTargetDropDown.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>

18
.idea/deploymentTargetSelector.xml

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2026-06-03T05:38:33.012085100Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=eea3c443" />
</handle>
</Target>
</DropdownSelection>
<DialogSelection />
</SelectionState>
</selectionStates>
</component>
</project>

13
.idea/deviceManager.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DeviceTable">
<option name="columnSorters">
<list>
<ColumnSorterState>
<option name="column" value="Name" />
<option name="order" value="ASCENDING" />
</ColumnSorterState>
</list>
</option>
</component>
</project>

20
.idea/gradle.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

10
.idea/migrations.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

9
.idea/misc.xml

@ -0,0 +1,9 @@
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

17
.idea/runConfigurations.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
</set>
</option>
</component>
</project>

6
.idea/vcs.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

1
app/.gitignore

@ -0,0 +1 @@
/build

72
app/build.gradle

@ -0,0 +1,72 @@
plugins {
id 'com.android.application'
}
android {
namespace 'com.bingoorobot.foreignobjectcuttingapp'
compileSdk 34
viewBinding
{
enabled true
}
// //add this feature
dataBinding
{
enabled true
}
defaultConfig {
applicationId "com.bingoorobot.foreignobjectcuttingapp"
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
buildConfig true
}
}
dependencies {
implementation 'com.github.nodemedia:nodemediaclient-android:2.9.20'
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'
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20")
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation 'com.google.protobuf:protobuf-java:4.27.2'
implementation 'com.github.nodemedia:nodemediaclient-android:2.9.20'
implementation 'com.github.mik3y:usb-serial-for-android:3.7.0'
implementation 'io.github.xmaihh:serialport:2.1.1'
implementation "com.github.anastr:speedviewlib:1.6.1"
implementation 'com.android.support:recyclerview-v7:25.3.1'
// implementation 'io.github.scwang90:refresh-layout-kernel:2.1.0' //核心模块
// implementation 'io.github.scwang90:refresh-header-classics:2.1.0' //经典刷新头
// implementation 'io.github.scwang90:refresh-footer-classics:2.1.0' //经典加载尾
implementation 'io.github.scwang90:refresh-layout-kernel:2.0.6' //核心必须依赖
implementation 'io.github.scwang90:refresh-header-classics:2.0.6' //经典刷新头
implementation 'io.github.scwang90:refresh-header-radar:2.0.6' //雷达刷新头
implementation 'io.github.scwang90:refresh-header-falsify:2.0.6' //虚拟刷新头
implementation 'io.github.scwang90:refresh-header-material:2.0.6' //谷歌刷新头
implementation 'io.github.scwang90:refresh-header-two-level:2.0.6' //二级刷新头
implementation 'io.github.scwang90:refresh-footer-ball:2.0.6' //球脉冲加载
implementation 'io.github.scwang90:refresh-footer-classics:2.0.6' //经典加载
}

21
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

26
app/src/androidTest/java/com/bingoorobot/foreignobjectcuttingapp/ExampleInstrumentedTest.java

@ -0,0 +1,26 @@
package com.bingoorobot.foreignobjectcuttingapp;
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 <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.bingoorobot.foreignobjectcuttingapp", appContext.getPackageName());
}
}

47
app/src/main/AndroidManifest.xml

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.USB_PERMISSION" />
<uses-feature
android:name="android.hardware.usb.accessory"
android:required="false" />
<uses-feature android:name="android.hardware.usb.host" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:usesCleartextTraffic="true"
android:icon="@drawable/squrelogo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ForeignObjectCuttingApp"
tools:targetApi="31" >
<activity
android:name=".MainActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/device_filter" />
</activity>
</application>
</manifest>

464
app/src/main/java/BspIV.cs

@ -0,0 +1,464 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: bsp_IV.proto
// </auto-generated>
#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;
/// <summary>Holder for reflection information generated from bsp_IV.proto</summary>
public static partial class BspIVReflection {
#region Descriptor
/// <summary>File descriptor for bsp_IV.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static BspIVReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cgxic3BfSVYucHJvdG8irgEKEElWX3N0cnVjdF9kZWZpbmUSEQoJVGVtcGF0",
"dXJlGAEgASgFEg8KB1J1bk1vZGUYAiABKAUSGAoQTGVmdENvbXBlbnNhdGlv",
"bhgDIAEoBRIZChFSaWdodENvbXBlbnNhdGlvbhgEIAEoBRIUCgxDdXJyZW50",
"QW5nbGUYBSABKAUSFgoOUm9ib3RNb3ZlU3BlZWQYBiABKAUSEwoLRW5kUHJl",
"c3N1cmUYByABKAVCJAogY29tLmJpbmdvb3JvYm90LndhdGVyd2FsbC5tb2Rl",
"bHNQAGIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::IV_struct_define), global::IV_struct_define.Parser, new[]{ "Tempature", "RunMode", "LeftCompensation", "RightCompensation", "CurrentAngle", "RobotMoveSpeed", "EndPressure" }, null, null, null, null)
}));
}
#endregion
}
#region Messages
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class IV_struct_define : pb::IMessage<IV_struct_define>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<IV_struct_define> _parser = new pb::MessageParser<IV_struct_define>(() => new IV_struct_define());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<IV_struct_define> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::BspIVReflection.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 IV_struct_define() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public IV_struct_define(IV_struct_define other) : this() {
tempature_ = other.tempature_;
runMode_ = other.runMode_;
leftCompensation_ = other.leftCompensation_;
rightCompensation_ = other.rightCompensation_;
currentAngle_ = other.currentAngle_;
robotMoveSpeed_ = other.robotMoveSpeed_;
endPressure_ = other.endPressure_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public IV_struct_define Clone() {
return new IV_struct_define(this);
}
/// <summary>Field number for the "Tempature" field.</summary>
public const int TempatureFieldNumber = 1;
private int tempature_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int Tempature {
get { return tempature_; }
set {
tempature_ = value;
}
}
/// <summary>Field number for the "RunMode" field.</summary>
public const int RunModeFieldNumber = 2;
private int runMode_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int RunMode {
get { return runMode_; }
set {
runMode_ = value;
}
}
/// <summary>Field number for the "LeftCompensation" field.</summary>
public const int LeftCompensationFieldNumber = 3;
private int leftCompensation_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int LeftCompensation {
get { return leftCompensation_; }
set {
leftCompensation_ = value;
}
}
/// <summary>Field number for the "RightCompensation" field.</summary>
public const int RightCompensationFieldNumber = 4;
private int rightCompensation_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int RightCompensation {
get { return rightCompensation_; }
set {
rightCompensation_ = value;
}
}
/// <summary>Field number for the "CurrentAngle" field.</summary>
public const int CurrentAngleFieldNumber = 5;
private int currentAngle_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CurrentAngle {
get { return currentAngle_; }
set {
currentAngle_ = value;
}
}
/// <summary>Field number for the "RobotMoveSpeed" field.</summary>
public const int RobotMoveSpeedFieldNumber = 6;
private int robotMoveSpeed_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int RobotMoveSpeed {
get { return robotMoveSpeed_; }
set {
robotMoveSpeed_ = value;
}
}
/// <summary>Field number for the "EndPressure" field.</summary>
public const int EndPressureFieldNumber = 7;
private int endPressure_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int EndPressure {
get { return endPressure_; }
set {
endPressure_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as IV_struct_define);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(IV_struct_define other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Tempature != other.Tempature) return false;
if (RunMode != other.RunMode) return false;
if (LeftCompensation != other.LeftCompensation) return false;
if (RightCompensation != other.RightCompensation) return false;
if (CurrentAngle != other.CurrentAngle) return false;
if (RobotMoveSpeed != other.RobotMoveSpeed) return false;
if (EndPressure != other.EndPressure) 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 (Tempature != 0) hash ^= Tempature.GetHashCode();
if (RunMode != 0) hash ^= RunMode.GetHashCode();
if (LeftCompensation != 0) hash ^= LeftCompensation.GetHashCode();
if (RightCompensation != 0) hash ^= RightCompensation.GetHashCode();
if (CurrentAngle != 0) hash ^= CurrentAngle.GetHashCode();
if (RobotMoveSpeed != 0) hash ^= RobotMoveSpeed.GetHashCode();
if (EndPressure != 0) hash ^= EndPressure.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 (Tempature != 0) {
output.WriteRawTag(8);
output.WriteInt32(Tempature);
}
if (RunMode != 0) {
output.WriteRawTag(16);
output.WriteInt32(RunMode);
}
if (LeftCompensation != 0) {
output.WriteRawTag(24);
output.WriteInt32(LeftCompensation);
}
if (RightCompensation != 0) {
output.WriteRawTag(32);
output.WriteInt32(RightCompensation);
}
if (CurrentAngle != 0) {
output.WriteRawTag(40);
output.WriteInt32(CurrentAngle);
}
if (RobotMoveSpeed != 0) {
output.WriteRawTag(48);
output.WriteInt32(RobotMoveSpeed);
}
if (EndPressure != 0) {
output.WriteRawTag(56);
output.WriteInt32(EndPressure);
}
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 (Tempature != 0) {
output.WriteRawTag(8);
output.WriteInt32(Tempature);
}
if (RunMode != 0) {
output.WriteRawTag(16);
output.WriteInt32(RunMode);
}
if (LeftCompensation != 0) {
output.WriteRawTag(24);
output.WriteInt32(LeftCompensation);
}
if (RightCompensation != 0) {
output.WriteRawTag(32);
output.WriteInt32(RightCompensation);
}
if (CurrentAngle != 0) {
output.WriteRawTag(40);
output.WriteInt32(CurrentAngle);
}
if (RobotMoveSpeed != 0) {
output.WriteRawTag(48);
output.WriteInt32(RobotMoveSpeed);
}
if (EndPressure != 0) {
output.WriteRawTag(56);
output.WriteInt32(EndPressure);
}
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 (Tempature != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Tempature);
}
if (RunMode != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(RunMode);
}
if (LeftCompensation != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(LeftCompensation);
}
if (RightCompensation != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(RightCompensation);
}
if (CurrentAngle != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CurrentAngle);
}
if (RobotMoveSpeed != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(RobotMoveSpeed);
}
if (EndPressure != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(EndPressure);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(IV_struct_define other) {
if (other == null) {
return;
}
if (other.Tempature != 0) {
Tempature = other.Tempature;
}
if (other.RunMode != 0) {
RunMode = other.RunMode;
}
if (other.LeftCompensation != 0) {
LeftCompensation = other.LeftCompensation;
}
if (other.RightCompensation != 0) {
RightCompensation = other.RightCompensation;
}
if (other.CurrentAngle != 0) {
CurrentAngle = other.CurrentAngle;
}
if (other.RobotMoveSpeed != 0) {
RobotMoveSpeed = other.RobotMoveSpeed;
}
if (other.EndPressure != 0) {
EndPressure = other.EndPressure;
}
_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: {
Tempature = input.ReadInt32();
break;
}
case 16: {
RunMode = input.ReadInt32();
break;
}
case 24: {
LeftCompensation = input.ReadInt32();
break;
}
case 32: {
RightCompensation = input.ReadInt32();
break;
}
case 40: {
CurrentAngle = input.ReadInt32();
break;
}
case 48: {
RobotMoveSpeed = input.ReadInt32();
break;
}
case 56: {
EndPressure = 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: {
Tempature = input.ReadInt32();
break;
}
case 16: {
RunMode = input.ReadInt32();
break;
}
case 24: {
LeftCompensation = input.ReadInt32();
break;
}
case 32: {
RightCompensation = input.ReadInt32();
break;
}
case 40: {
CurrentAngle = input.ReadInt32();
break;
}
case 48: {
RobotMoveSpeed = input.ReadInt32();
break;
}
case 56: {
EndPressure = input.ReadInt32();
break;
}
}
}
}
#endif
}
#endregion
#endregion Designer generated code

801
app/src/main/java/BspPV.cs

@ -0,0 +1,801 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: bsp_PV.proto
// </auto-generated>
#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;
/// <summary>Holder for reflection information generated from bsp_PV.proto</summary>
public static partial class BspPVReflection {
#region Descriptor
/// <summary>File descriptor for bsp_PV.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static BspPVReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cgxic3BfUFYucHJvdG8i6AEKEFBWX3N0cnVjdF9kZWZpbmUSCwoDQ0gwGAEg",
"ASgFEgsKA0NIMRgCIAEoBRILCgNDSDIYAyABKAUSCwoDQ0gzGAQgASgFEgsK",
"A0NINBgFIAEoBRILCgNDSDUYBiABKAUSCwoDQ0g2GAcgASgFEgsKA0NINxgI",
"IAEoBRILCgNDSDgYCSABKAUSCwoDQ0g5GAogASgFEgwKBENIMTAYCyABKAUS",
"DAoEQ0gxMRgMIAEoBRIMCgRDSDEyGA0gASgFEgwKBENIMTMYDiABKAUSDAoE",
"Q0gxNBgPIAEoBRIMCgRDSDE1GBAgASgFQiQKIGNvbS5iaW5nb29yb2JvdC53",
"YXRlcndhbGwubW9kZWxzUABiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::PV_struct_define), global::PV_struct_define.Parser, new[]{ "CH0", "CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8", "CH9", "CH10", "CH11", "CH12", "CH13", "CH14", "CH15" }, null, null, null, null)
}));
}
#endregion
}
#region Messages
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class PV_struct_define : pb::IMessage<PV_struct_define>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<PV_struct_define> _parser = new pb::MessageParser<PV_struct_define>(() => new PV_struct_define());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<PV_struct_define> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::BspPVReflection.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 PV_struct_define() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public PV_struct_define(PV_struct_define other) : this() {
cH0_ = other.cH0_;
cH1_ = other.cH1_;
cH2_ = other.cH2_;
cH3_ = other.cH3_;
cH4_ = other.cH4_;
cH5_ = other.cH5_;
cH6_ = other.cH6_;
cH7_ = other.cH7_;
cH8_ = other.cH8_;
cH9_ = other.cH9_;
cH10_ = other.cH10_;
cH11_ = other.cH11_;
cH12_ = other.cH12_;
cH13_ = other.cH13_;
cH14_ = other.cH14_;
cH15_ = other.cH15_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public PV_struct_define Clone() {
return new PV_struct_define(this);
}
/// <summary>Field number for the "CH0" field.</summary>
public const int CH0FieldNumber = 1;
private int cH0_;
/// <summary>
///水冷壁
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH0 {
get { return cH0_; }
set {
cH0_ = value;
}
}
/// <summary>Field number for the "CH1" field.</summary>
public const int CH1FieldNumber = 2;
private int cH1_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH1 {
get { return cH1_; }
set {
cH1_ = value;
}
}
/// <summary>Field number for the "CH2" field.</summary>
public const int CH2FieldNumber = 3;
private int cH2_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH2 {
get { return cH2_; }
set {
cH2_ = value;
}
}
/// <summary>Field number for the "CH3" field.</summary>
public const int CH3FieldNumber = 4;
private int cH3_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH3 {
get { return cH3_; }
set {
cH3_ = value;
}
}
/// <summary>Field number for the "CH4" field.</summary>
public const int CH4FieldNumber = 5;
private int cH4_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH4 {
get { return cH4_; }
set {
cH4_ = value;
}
}
/// <summary>Field number for the "CH5" field.</summary>
public const int CH5FieldNumber = 6;
private int cH5_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH5 {
get { return cH5_; }
set {
cH5_ = value;
}
}
/// <summary>Field number for the "CH6" field.</summary>
public const int CH6FieldNumber = 7;
private int cH6_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH6 {
get { return cH6_; }
set {
cH6_ = value;
}
}
/// <summary>Field number for the "CH7" field.</summary>
public const int CH7FieldNumber = 8;
private int cH7_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH7 {
get { return cH7_; }
set {
cH7_ = value;
}
}
/// <summary>Field number for the "CH8" field.</summary>
public const int CH8FieldNumber = 9;
private int cH8_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH8 {
get { return cH8_; }
set {
cH8_ = value;
}
}
/// <summary>Field number for the "CH9" field.</summary>
public const int CH9FieldNumber = 10;
private int cH9_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH9 {
get { return cH9_; }
set {
cH9_ = value;
}
}
/// <summary>Field number for the "CH10" field.</summary>
public const int CH10FieldNumber = 11;
private int cH10_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH10 {
get { return cH10_; }
set {
cH10_ = value;
}
}
/// <summary>Field number for the "CH11" field.</summary>
public const int CH11FieldNumber = 12;
private int cH11_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH11 {
get { return cH11_; }
set {
cH11_ = value;
}
}
/// <summary>Field number for the "CH12" field.</summary>
public const int CH12FieldNumber = 13;
private int cH12_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH12 {
get { return cH12_; }
set {
cH12_ = value;
}
}
/// <summary>Field number for the "CH13" field.</summary>
public const int CH13FieldNumber = 14;
private int cH13_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH13 {
get { return cH13_; }
set {
cH13_ = value;
}
}
/// <summary>Field number for the "CH14" field.</summary>
public const int CH14FieldNumber = 15;
private int cH14_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH14 {
get { return cH14_; }
set {
cH14_ = value;
}
}
/// <summary>Field number for the "CH15" field.</summary>
public const int CH15FieldNumber = 16;
private int cH15_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CH15 {
get { return cH15_; }
set {
cH15_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as PV_struct_define);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(PV_struct_define other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (CH0 != other.CH0) return false;
if (CH1 != other.CH1) return false;
if (CH2 != other.CH2) return false;
if (CH3 != other.CH3) return false;
if (CH4 != other.CH4) return false;
if (CH5 != other.CH5) return false;
if (CH6 != other.CH6) return false;
if (CH7 != other.CH7) return false;
if (CH8 != other.CH8) return false;
if (CH9 != other.CH9) return false;
if (CH10 != other.CH10) return false;
if (CH11 != other.CH11) return false;
if (CH12 != other.CH12) return false;
if (CH13 != other.CH13) return false;
if (CH14 != other.CH14) return false;
if (CH15 != other.CH15) 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 (CH0 != 0) hash ^= CH0.GetHashCode();
if (CH1 != 0) hash ^= CH1.GetHashCode();
if (CH2 != 0) hash ^= CH2.GetHashCode();
if (CH3 != 0) hash ^= CH3.GetHashCode();
if (CH4 != 0) hash ^= CH4.GetHashCode();
if (CH5 != 0) hash ^= CH5.GetHashCode();
if (CH6 != 0) hash ^= CH6.GetHashCode();
if (CH7 != 0) hash ^= CH7.GetHashCode();
if (CH8 != 0) hash ^= CH8.GetHashCode();
if (CH9 != 0) hash ^= CH9.GetHashCode();
if (CH10 != 0) hash ^= CH10.GetHashCode();
if (CH11 != 0) hash ^= CH11.GetHashCode();
if (CH12 != 0) hash ^= CH12.GetHashCode();
if (CH13 != 0) hash ^= CH13.GetHashCode();
if (CH14 != 0) hash ^= CH14.GetHashCode();
if (CH15 != 0) hash ^= CH15.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 (CH0 != 0) {
output.WriteRawTag(8);
output.WriteInt32(CH0);
}
if (CH1 != 0) {
output.WriteRawTag(16);
output.WriteInt32(CH1);
}
if (CH2 != 0) {
output.WriteRawTag(24);
output.WriteInt32(CH2);
}
if (CH3 != 0) {
output.WriteRawTag(32);
output.WriteInt32(CH3);
}
if (CH4 != 0) {
output.WriteRawTag(40);
output.WriteInt32(CH4);
}
if (CH5 != 0) {
output.WriteRawTag(48);
output.WriteInt32(CH5);
}
if (CH6 != 0) {
output.WriteRawTag(56);
output.WriteInt32(CH6);
}
if (CH7 != 0) {
output.WriteRawTag(64);
output.WriteInt32(CH7);
}
if (CH8 != 0) {
output.WriteRawTag(72);
output.WriteInt32(CH8);
}
if (CH9 != 0) {
output.WriteRawTag(80);
output.WriteInt32(CH9);
}
if (CH10 != 0) {
output.WriteRawTag(88);
output.WriteInt32(CH10);
}
if (CH11 != 0) {
output.WriteRawTag(96);
output.WriteInt32(CH11);
}
if (CH12 != 0) {
output.WriteRawTag(104);
output.WriteInt32(CH12);
}
if (CH13 != 0) {
output.WriteRawTag(112);
output.WriteInt32(CH13);
}
if (CH14 != 0) {
output.WriteRawTag(120);
output.WriteInt32(CH14);
}
if (CH15 != 0) {
output.WriteRawTag(128, 1);
output.WriteInt32(CH15);
}
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 (CH0 != 0) {
output.WriteRawTag(8);
output.WriteInt32(CH0);
}
if (CH1 != 0) {
output.WriteRawTag(16);
output.WriteInt32(CH1);
}
if (CH2 != 0) {
output.WriteRawTag(24);
output.WriteInt32(CH2);
}
if (CH3 != 0) {
output.WriteRawTag(32);
output.WriteInt32(CH3);
}
if (CH4 != 0) {
output.WriteRawTag(40);
output.WriteInt32(CH4);
}
if (CH5 != 0) {
output.WriteRawTag(48);
output.WriteInt32(CH5);
}
if (CH6 != 0) {
output.WriteRawTag(56);
output.WriteInt32(CH6);
}
if (CH7 != 0) {
output.WriteRawTag(64);
output.WriteInt32(CH7);
}
if (CH8 != 0) {
output.WriteRawTag(72);
output.WriteInt32(CH8);
}
if (CH9 != 0) {
output.WriteRawTag(80);
output.WriteInt32(CH9);
}
if (CH10 != 0) {
output.WriteRawTag(88);
output.WriteInt32(CH10);
}
if (CH11 != 0) {
output.WriteRawTag(96);
output.WriteInt32(CH11);
}
if (CH12 != 0) {
output.WriteRawTag(104);
output.WriteInt32(CH12);
}
if (CH13 != 0) {
output.WriteRawTag(112);
output.WriteInt32(CH13);
}
if (CH14 != 0) {
output.WriteRawTag(120);
output.WriteInt32(CH14);
}
if (CH15 != 0) {
output.WriteRawTag(128, 1);
output.WriteInt32(CH15);
}
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 (CH0 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH0);
}
if (CH1 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH1);
}
if (CH2 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH2);
}
if (CH3 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH3);
}
if (CH4 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH4);
}
if (CH5 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH5);
}
if (CH6 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH6);
}
if (CH7 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH7);
}
if (CH8 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH8);
}
if (CH9 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH9);
}
if (CH10 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH10);
}
if (CH11 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH11);
}
if (CH12 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH12);
}
if (CH13 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH13);
}
if (CH14 != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(CH14);
}
if (CH15 != 0) {
size += 2 + pb::CodedOutputStream.ComputeInt32Size(CH15);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(PV_struct_define other) {
if (other == null) {
return;
}
if (other.CH0 != 0) {
CH0 = other.CH0;
}
if (other.CH1 != 0) {
CH1 = other.CH1;
}
if (other.CH2 != 0) {
CH2 = other.CH2;
}
if (other.CH3 != 0) {
CH3 = other.CH3;
}
if (other.CH4 != 0) {
CH4 = other.CH4;
}
if (other.CH5 != 0) {
CH5 = other.CH5;
}
if (other.CH6 != 0) {
CH6 = other.CH6;
}
if (other.CH7 != 0) {
CH7 = other.CH7;
}
if (other.CH8 != 0) {
CH8 = other.CH8;
}
if (other.CH9 != 0) {
CH9 = other.CH9;
}
if (other.CH10 != 0) {
CH10 = other.CH10;
}
if (other.CH11 != 0) {
CH11 = other.CH11;
}
if (other.CH12 != 0) {
CH12 = other.CH12;
}
if (other.CH13 != 0) {
CH13 = other.CH13;
}
if (other.CH14 != 0) {
CH14 = other.CH14;
}
if (other.CH15 != 0) {
CH15 = other.CH15;
}
_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: {
CH0 = input.ReadInt32();
break;
}
case 16: {
CH1 = input.ReadInt32();
break;
}
case 24: {
CH2 = input.ReadInt32();
break;
}
case 32: {
CH3 = input.ReadInt32();
break;
}
case 40: {
CH4 = input.ReadInt32();
break;
}
case 48: {
CH5 = input.ReadInt32();
break;
}
case 56: {
CH6 = input.ReadInt32();
break;
}
case 64: {
CH7 = input.ReadInt32();
break;
}
case 72: {
CH8 = input.ReadInt32();
break;
}
case 80: {
CH9 = input.ReadInt32();
break;
}
case 88: {
CH10 = input.ReadInt32();
break;
}
case 96: {
CH11 = input.ReadInt32();
break;
}
case 104: {
CH12 = input.ReadInt32();
break;
}
case 112: {
CH13 = input.ReadInt32();
break;
}
case 120: {
CH14 = input.ReadInt32();
break;
}
case 128: {
CH15 = 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: {
CH0 = input.ReadInt32();
break;
}
case 16: {
CH1 = input.ReadInt32();
break;
}
case 24: {
CH2 = input.ReadInt32();
break;
}
case 32: {
CH3 = input.ReadInt32();
break;
}
case 40: {
CH4 = input.ReadInt32();
break;
}
case 48: {
CH5 = input.ReadInt32();
break;
}
case 56: {
CH6 = input.ReadInt32();
break;
}
case 64: {
CH7 = input.ReadInt32();
break;
}
case 72: {
CH8 = input.ReadInt32();
break;
}
case 80: {
CH9 = input.ReadInt32();
break;
}
case 88: {
CH10 = input.ReadInt32();
break;
}
case 96: {
CH11 = input.ReadInt32();
break;
}
case 104: {
CH12 = input.ReadInt32();
break;
}
case 112: {
CH13 = input.ReadInt32();
break;
}
case 120: {
CH14 = input.ReadInt32();
break;
}
case 128: {
CH15 = input.ReadInt32();
break;
}
}
}
}
#endif
}
#endregion
#endregion Designer generated code

11
app/src/main/java/D_Cmd.proto

@ -0,0 +1,11 @@
syntax = "proto3";
option java_multiple_files = false;
option java_package = "com.bingoorobot.foreignobjectcuttingapp.models";
import "msp_MK32.proto";
import "bsp_PV.proto";
message D_Cmd_struct_define {
SP_MSP_MK32_Button Mk32CMD= 1;
PV_struct_define _toSendPV= 2;
}

30
app/src/main/java/bsp_Error.proto

@ -0,0 +1,30 @@
syntax = "proto3";
option java_multiple_files = false;
option java_package = "com.bingoorobot.foreignobjectcuttingapp.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;
LS_LeftMotor = 2;
LS_RightMotor = 3;
Remote_Button_Reset_State = 4;
upper_Computer = 5; //Ubuntu slam
DDM360B = 6; //电子罗盘
K1061DC = 7; //压强传感器
wire_sensor = 8; //拉线传感器
wire_motor = 9; //卷线电机
}
//protoc --nanopb_out=. *.proto

19
app/src/main/java/bsp_IV.proto

@ -0,0 +1,19 @@
syntax = "proto3";
option java_multiple_files = false;
option java_package = "com.bingoorobot.foreignobjectcuttingapp.models";
message IV_struct_define
{
int32 CurrentAngle= 1; //单位0.01°
int32 RobotMoveSpeed= 2; //单位m/min
int32 SBUS_State=3; //0断开 1连接
int32 SystemError=4; //硬件通讯错误及按键未初始化错误
int32 Left_Motor_Err=5;//左轮电机报警
int32 Right_Motor_Err=6;//右轮电机报警
int32 IsWorking=7;//机器人正在执行运动指令
int32 blowers_pwm=8;//风机PWM调速,0-100
float ForceValue=9;//压强传感器-100~100Kpa
int32 CurrentDirection=10; //电子罗盘,单位0.01°
int32 CurrentHeight=11; //拉线传感器,cm
};

11
app/src/main/java/bsp_PV.proto

@ -0,0 +1,11 @@
syntax = "proto3";
option java_multiple_files = false;
option java_package = "com.bingoorobot.foreignobjectcuttingapp.models";
message PV_struct_define{
int32 RunMode = 1; //1 手动无校准作业 2 手动竖直向左作业 3 手动竖直向右作业
int32 RobotSpeed=2;//0-30m/min
int32 LaneChangeDistance= 3;//1-100cm
double Vertical_Calibration=4;// 1°
double Height_Storage=5;//罐高度m
double Radius_Storage=6;//罐半径m
};

440
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/MainActivity.java

@ -0,0 +1,440 @@
package com.bingoorobot.foreignobjectcuttingapp;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Handler;
import android.text.InputFilter;
import android.view.View;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.view.menu.MenuPopupHelper;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bingoorobot.foreignobjectcuttingapp.databinding.ActivityMainBinding;
import com.bingoorobot.foreignobjectcuttingapp.models.BspPV;
import com.bingoorobot.foreignobjectcuttingapp.services.DataExchangeHelper;
import com.bingoorobot.foreignobjectcuttingapp.services.ModbusCRC;
import com.bingoorobot.foreignobjectcuttingapp.services.MyDataHelper;
import com.bingoorobot.foreignobjectcuttingapp.services.PopupHelper;
import com.bingoorobot.foreignobjectcuttingapp.services.ReceiivedDataHandler;
import com.bingoorobot.foreignobjectcuttingapp.services.UDPHelper;
import com.bingoorobot.foreignobjectcuttingapp.services.VideoPlayerHelper;
import com.bingoorobot.foreignobjectcuttingapp.services.ttySerialPortHelper;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import cn.nodemedia.NodePlayer;
import android.graphics.Color;
public class MainActivity extends AppCompatActivity {
public ActivityMainBinding mainBinding;//通过Binding可以获取界面数据
public static BspPV.PV_struct_define _toSendPV = BspPV.PV_struct_define.newBuilder().build();
Timer timer = new Timer();
public MyDataHelper myDataHelper = new MyDataHelper(this);//数据库类
private boolean mHasMore = true; // 是否有更多数据
private int mCurrentPage = 1;
private SmartRefreshLayout mRefreshLayout;
private RecyclerView recyclerView;
public PopupHelper popupHelper = new PopupHelper(this);
private int testCount = 0;
int nodePlayerWeight_0 = 1;
int nodePlayerWeight_1 = 1;
public String _Manual_Mode_Call_Value = "手动"; // 默认为手动模式 手动 模式值1-3
public String _Auto_Mode_Call_Value = "未启用"; // 默认为未启用 模式值4 5
public String automodeHeight = "0";
public String automodeRadius = "0";
private static int count = 0;//计数,多少个timer发一次
private static volatile int lastCH = 0;//摇杆状态标志,1=上,2=下,0=无动作
private ExecutorService executor = Executors.newSingleThreadExecutor();//创建一个单线程的线程池,用于控制卷线电机
private NodePlayer nodePlayer0, nodePlayer1;
@SuppressLint("UseCompatLoadingForDrawables")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//设置全屏显示
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
mainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main);
UDPHelper.Intialize(this, "192.168.144.98", 8006, 9006);
ttySerialPortHelper.MainActivity = this;
ttySerialPortHelper.Open();
_toSendPV = BspPV.PV_struct_define.newBuilder()
.setRunMode(1).
build();
/* NodePlayer 播放视频区域*/
// NodePlayer nodePlayer0 = new NodePlayer(this);
nodePlayer0 = new NodePlayer(this);
String address0 = "rtsp://192.168.144.25:554/stream1";
VideoPlayerHelper.startVedio(mainBinding.nodePlayerView0,nodePlayer0,address0);
// NodePlayer nodePlayer1=new NodePlayer(this);
nodePlayer1 = new NodePlayer(this);
String address1 = "rtsp://192.168.144.26:554/stream1";
VideoPlayerHelper.startVedio(mainBinding.nodePlayerView1,nodePlayer1,address1);
//单击放大,再次单击缩小
mainBinding.buttonPlayerView0.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (nodePlayerWeight_1 == 1) {
// 全屏:左边权重1,右边权重0
nodePlayerWeight_0 = 1;
nodePlayerWeight_1 = 0;
} else {
// 平分:两个权重都是1
nodePlayerWeight_0 = 1;
nodePlayerWeight_1 = 1;
}
updateLayoutWeights();
mainBinding.videoPage.requestLayout();
}
});
mainBinding.buttonPlayerView1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (nodePlayerWeight_0 == 1) {
// 全屏:左边权重0,右边权重1
nodePlayerWeight_0 = 0;
nodePlayerWeight_1 = 1;
} else {
// 平分:两个权重都是1
nodePlayerWeight_0 = 1;
nodePlayerWeight_1 = 1;
}
updateLayoutWeights();
mainBinding.videoPage.requestLayout();
}
});
mainBinding.pageSelectGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
RadioButton radioButton = (RadioButton) group.findViewById(checkedId);
String result = radioButton.getText().toString();
NavigationToPage(result);
}
});
mainBinding.pageSelectGroup.check(R.id.rb_control);
mainBinding.setManualModeBtn.setOnClickListener(new View.OnClickListener(){
//模式选择弹窗(1.无,2.竖直向左,3.竖直向右)
public void onClick(View v){
popupHelper.Arm_ManualModePopup(this);
}
});
mainBinding.setAutoWorkModeBtn.setOnClickListener(new View.OnClickListener() {
//自动作业参数弹窗(设置罐直径与罐高度)
@Override
public void onClick(View view) {
popupHelper.AutoModePopup(this);
}
});
mainBinding.mainViewErrMessageBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
popupHelper.RobotErrorListPopUp(this);
}
});
}
// 抽离权重更新逻辑,避免重复代码
private void updateLayoutWeights() {
LinearLayout.LayoutParams layoutParams0 = (LinearLayout.LayoutParams) mainBinding.LinearLayoutPlayerView0.getLayoutParams();
layoutParams0.weight = nodePlayerWeight_0;
layoutParams0.width = 0; // 强制设为0
mainBinding.LinearLayoutPlayerView0.setLayoutParams(layoutParams0);
LinearLayout.LayoutParams layoutParams1 = (LinearLayout.LayoutParams) mainBinding.LinearLayoutPlayerView1.getLayoutParams();
layoutParams1.weight = nodePlayerWeight_1;
layoutParams1.width = 0; // 强制设为0
mainBinding.LinearLayoutPlayerView1.setLayoutParams(layoutParams1);
}
protected void NavigationToPage(String page) {
switch (page) {
case "视频": {
mainBinding.videoPage.setVisibility(VISIBLE);
mainBinding.controlPage.setVisibility(INVISIBLE);
break;
}
case "控制": {
mainBinding.videoPage.setVisibility(INVISIBLE);
mainBinding.controlPage.setVisibility(VISIBLE);
break;
}
}
}
@Override
protected void onStart() {
super.onStart();
timer.schedule(new TimerTask() {
@Override
public void run() {
// 使用 Handler 或 runOnUiThread 更新 UI
runOnUiThread(new Runnable() {
@Override
public void run() {
if (!ttySerialPortHelper.IsAllDataSendBack)
{
ttySerialPortHelper.SendData(ttySerialPortHelper.getAllChData_20Hz);
}
testCount++;
_toSendPV=_toSendPV.toBuilder().setRobotSpeed(testCount).build();
String ChangeLaneDistanceStr = mainBinding.MaintvLaneChangeDistanceTo32.getText().toString();
String VeticalAdjustStr = mainBinding.MaintvVerticalAdjustTo32.getText().toString();
String HeightStorageStr;
String RadiusStorageStr;
//换道距离
if(ChangeLaneDistanceStr.isEmpty()){
_toSendPV = _toSendPV.toBuilder().setLaneChangeDistance(1).build();
}else{
_toSendPV = _toSendPV.toBuilder()
.setLaneChangeDistance(Integer.parseInt(ChangeLaneDistanceStr)).build();
}
//竖直微调--小数 *100
try {
if (VeticalAdjustStr.isEmpty()) {
_toSendPV = _toSendPV.toBuilder().setVerticalCalibration(0).build();
} else {
_toSendPV = _toSendPV.toBuilder()
.setVerticalCalibration(Double.parseDouble(VeticalAdjustStr)* 100).build();
}
} catch (Exception e) {
}
//自动作业高度
if(automodeHeight.isEmpty()){
_toSendPV = _toSendPV.toBuilder().setHeightStorage(0).build();
}else{
_toSendPV = _toSendPV.toBuilder()
.setHeightStorage(Double.parseDouble(String.valueOf(automodeHeight))*1).build();
}
//自动作业直径
if(automodeRadius.isEmpty()){
_toSendPV = _toSendPV.toBuilder().setRadiusStorage(0).build();
}else{
_toSendPV = _toSendPV.toBuilder()
.setRadiusStorage(Double.parseDouble(String.valueOf(automodeRadius))*1).build();
}
if(_Manual_Mode_Call_Value.equals("手动")){
_toSendPV = _toSendPV.toBuilder().setRunMode(1).build();
}else if(_Manual_Mode_Call_Value.equals("竖直")){
_toSendPV = _toSendPV.toBuilder().setRunMode(2).build();
}else if(_Manual_Mode_Call_Value.equals("水平")){
_toSendPV = _toSendPV.toBuilder().setRunMode(3).build();
}
else{
_toSendPV = _toSendPV.toBuilder().setRunMode(1).build();
}
// if(_Auto_Mode_Call_Value.equals("竖直向左")){
// _toSendPV = _toSendPV.toBuilder().setRunMode(2).build();
// }else if(_Auto_Mode_Call_Value.equals("竖直向右"))
// {
// _toSendPV = _toSendPV.toBuilder().setRunMode(3).build();
// }
// 只有网线通讯,getSBUSState不可用,改为时间判断
long now = System.currentTimeMillis();
long lastTime = ReceiivedDataHandler.lastReceiveTime;
// 获取左侧显示半框的布局
LinearLayout leftPanel = mainBinding.controlPage.findViewById(R.id.statePanel);
// 如果超过X秒没收到数据,显示断开
if (lastTime != 0 && now - lastTime > 3000) {
mainBinding.tvSignal.setText("断开");
// 左侧显示半框背景变红
if (leftPanel != null) {
leftPanel.setBackgroundColor(Color.RED);}
}
else {
// 左侧显示半框背景恢复
if (leftPanel != null) {
mainBinding.tvSignal.setText("已连接");
leftPanel.setBackgroundResource(R.drawable.orange_rounded_rectangle);
}
}
//卷线电机控制
if(true)//_Manual_Mode_Call_Value.equals("卷线\n控制")
{
count++;
if(count >= 6)//0.6s
{
count = 0;
int speed = 8;//单位:转/分钟
controlMotorByChannel1(speed);// 天空端串口发送报文控制卷线电机
// byte[] speed0Cmd = new byte[] {0x01, 0x06, 0x20, 0x01, 0x00, 0x00, (byte)0xD3, (byte)0xCA}; // 速度 0
// ttySerialPortHelper.SendData(speed0Cmd);
}
}
else {
}
}
});
}
}, 0, 100); // 延迟 0 毫秒,每隔 200 毫秒执行一次
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (nodePlayer0 != null) {
nodePlayer0.stop();
nodePlayer0.start();
}
if (nodePlayer1 != null) {
nodePlayer1.stop();
nodePlayer1.start();
}
}
}, 2000); // 2秒后重启视频流,丢弃陈旧数据
}
// 天空端串口发送报文控制卷线电机
private void controlMotorByChannel1( int Speed) {
executor.submit(() -> {
int speed = Speed * 180;
// 限制速度范围 0-3000
if (speed < 0) speed = 0;
if (speed > 3000) speed = 3000;
// 1. 构建 Modbus 命令(不含 CRC)
byte[] Cmd = new byte[6];
Cmd[0] = 0x01; // 设备地址
Cmd[1] = 0x06; // 功能码(写单个寄存器)
Cmd[2] = 0x20; // 寄存器地址高字节
Cmd[3] = 0x01; // 寄存器地址低字节
Cmd[4] = (byte) ((speed >> 8) & 0xFF); // 速度值高字节
Cmd[5] = (byte) (speed & 0xFF); // 速度值低字节
// 2. 计算 CRC(计算前6个字节)
byte[] crc = ModbusCRC.calculateCRC(Cmd);
// 3. 组装完整命令(6字节数据 + 2字节CRC)
byte[] speedCmd = new byte[8];
System.arraycopy(Cmd, 0, speedCmd, 0, 6);
speedCmd[6] = crc[0]; // CRC 低位
speedCmd[7] = crc[1]; // CRC 高位
//01 06 20 01 05 DC D1 03;设置速度05 DC=1500,约8.3r/min, 减速比180,
//01 06 20 00 00 01 43 CA;正转运行
//01 06 20 00 00 02 03 CB;反转运行
//01 06 20 00 00 09 42 0C;刹车停机(实测刹不住)
// byte[] speedCmd = new byte[] {0x01, 0x06, 0x20, 0x01, (byte)0x05, (byte)0xDC, (byte)0xD1, (byte)0x03};
byte[] runForward = new byte[] {0x01, 0x06, 0x20, 0x00, 0x00, 0x01, (byte)0x43, (byte)0xCA}; // 正转
byte[] runReverse = new byte[] {0x01, 0x06, 0x20, 0x00, 0x00, 0x02, (byte)0x03, (byte)0xCB}; // 反转
byte[] StopCmd = new byte[] {0x01, 0x06, 0x20, 0x01, 0x00, 0x00, (byte)0xD3, (byte)0xCA}; // 速度 0
try
{
if (ttySerialPortHelper.CH1RYV < -500) {
lastCH = 1;
// 正转:速度 + 正转命令
for (int i = 0; i < 2; i++) {
ttySerialPortHelper.SendData(runForward);
Thread.sleep(50);
ttySerialPortHelper.SendData(speedCmd);
Thread.sleep(50);
}
} else if(ttySerialPortHelper.CH1RYV > 500){
lastCH = 2;
// 反转:速度 + 反转命令
for (int i = 0; i < 2; i++) {
ttySerialPortHelper.SendData(runReverse);
Thread.sleep(50);
ttySerialPortHelper.SendData(speedCmd);
Thread.sleep(50);
}
}
else {
if(lastCH == 0){
return;//摇杆不动,不发
}
// 0速度 + 正转命令
for (int i = 0; i < 3; i++) {
ttySerialPortHelper.SendData(StopCmd);
Thread.sleep(50); // 延时30ms
ttySerialPortHelper.SendData(runForward);
Thread.sleep(50); // 延时30ms
}
lastCH = 0;
}
} catch (InterruptedException e) {
e.printStackTrace();
}
});
}
private void showToast(String message)
{
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
}
@Override
public void onStop() {
super.onStop();
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onPause() {
super.onPause();
}
@Override
protected void onDestroy() {
executor.shutdown();// 关闭线程
super.onDestroy();
UDPHelper.Destroy();
if (timer != null) {
timer.cancel();
}
//设置模式为0
_toSendPV = _toSendPV.toBuilder()
.setRunMode(1)
.build();
}
}

874
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspError.java

@ -0,0 +1,874 @@
// 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.bingoorobot.foreignobjectcuttingapp.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 {
/**
* <code>MK32_SBus = 0;</code>
*/
MK32_SBus(0),
/**
* <code>TL720D = 1;</code>
*/
TL720D(1),
/**
* <code>LS_LeftMotor = 2;</code>
*/
LS_LeftMotor(2),
/**
* <code>LS_RightMotor = 3;</code>
*/
LS_RightMotor(3),
/**
* <code>Remote_Button_Reset_State = 4;</code>
*/
Remote_Button_Reset_State(4),
/**
* <pre>
* Ubuntu slam
* </pre>
*
* <code>upper_Computer = 5;</code>
*/
upper_Computer(5),
/**
* <pre>
* 电子罗盘
* </pre>
*
* <code>DDM360B = 6;</code>
*/
DDM360B(6),
/**
* <pre>
* 压强传感器
* </pre>
*
* <code>K1061DC = 7;</code>
*/
K1061DC(7),
/**
* <pre>
* 拉线传感器
* </pre>
*
* <code>wire_sensor = 8;</code>
*/
wire_sensor(8),
/**
* <pre>
* 卷线电机
* </pre>
*
* <code>wire_motor = 9;</code>
*/
wire_motor(9),
UNRECOGNIZED(-1),
;
static {
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
/* major= */ 4,
/* minor= */ 27,
/* patch= */ 2,
/* suffix= */ "",
ComError.class.getName());
}
/**
* <code>MK32_SBus = 0;</code>
*/
public static final int MK32_SBus_VALUE = 0;
/**
* <code>TL720D = 1;</code>
*/
public static final int TL720D_VALUE = 1;
/**
* <code>LS_LeftMotor = 2;</code>
*/
public static final int LS_LeftMotor_VALUE = 2;
/**
* <code>LS_RightMotor = 3;</code>
*/
public static final int LS_RightMotor_VALUE = 3;
/**
* <code>Remote_Button_Reset_State = 4;</code>
*/
public static final int Remote_Button_Reset_State_VALUE = 4;
/**
* <pre>
* Ubuntu slam
* </pre>
*
* <code>upper_Computer = 5;</code>
*/
public static final int upper_Computer_VALUE = 5;
/**
* <pre>
* 电子罗盘
* </pre>
*
* <code>DDM360B = 6;</code>
*/
public static final int DDM360B_VALUE = 6;
/**
* <pre>
* 压强传感器
* </pre>
*
* <code>K1061DC = 7;</code>
*/
public static final int K1061DC_VALUE = 7;
/**
* <pre>
* 拉线传感器
* </pre>
*
* <code>wire_sensor = 8;</code>
*/
public static final int wire_sensor_VALUE = 8;
/**
* <pre>
* 卷线电机
* </pre>
*
* <code>wire_motor = 9;</code>
*/
public static final int wire_motor_VALUE = 9;
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 LS_LeftMotor;
case 3: return LS_RightMotor;
case 4: return Remote_Button_Reset_State;
case 5: return upper_Computer;
case 6: return DDM360B;
case 7: return K1061DC;
case 8: return wire_sensor;
case 9: return wire_motor;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<ComError>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
ComError> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<ComError>() {
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.bingoorobot.foreignobjectcuttingapp.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 {
/**
* <code>int32 Com_Error_Code = 1;</code>
* @return The comErrorCode.
*/
int getComErrorCode();
/**
* <code>int32 Left_Motor_Error_Code = 2;</code>
* @return The leftMotorErrorCode.
*/
int getLeftMotorErrorCode();
/**
* <code>int32 Right_Motor_Error_Code = 3;</code>
* @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.bingoorobot.foreignobjectcuttingapp.models.BspError.internal_static_ErrorData_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.bingoorobot.foreignobjectcuttingapp.models.BspError.internal_static_ErrorData_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData.class, com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData.Builder.class);
}
public static final int COM_ERROR_CODE_FIELD_NUMBER = 1;
private int comErrorCode_ = 0;
/**
* <code>int32 Com_Error_Code = 1;</code>
* @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;
/**
* <code>int32 Left_Motor_Error_Code = 2;</code>
* @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;
/**
* <code>int32 Right_Motor_Error_Code = 3;</code>
* @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.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData)) {
return super.equals(obj);
}
com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData other = (com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.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<Builder> implements
// @@protoc_insertion_point(builder_implements:ErrorData)
com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorDataOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.bingoorobot.foreignobjectcuttingapp.models.BspError.internal_static_ErrorData_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.bingoorobot.foreignobjectcuttingapp.models.BspError.internal_static_ErrorData_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData.class, com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData.Builder.class);
}
// Construct using com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.models.BspError.internal_static_ErrorData_descriptor;
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData getDefaultInstanceForType() {
return com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData.getDefaultInstance();
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData build() {
com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData buildPartial() {
com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData result = new com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData) {
return mergeFrom((com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData other) {
if (other == com.bingoorobot.foreignobjectcuttingapp.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_ ;
/**
* <code>int32 Com_Error_Code = 1;</code>
* @return The comErrorCode.
*/
@java.lang.Override
public int getComErrorCode() {
return comErrorCode_;
}
/**
* <code>int32 Com_Error_Code = 1;</code>
* @param value The comErrorCode to set.
* @return This builder for chaining.
*/
public Builder setComErrorCode(int value) {
comErrorCode_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>int32 Com_Error_Code = 1;</code>
* @return This builder for chaining.
*/
public Builder clearComErrorCode() {
bitField0_ = (bitField0_ & ~0x00000001);
comErrorCode_ = 0;
onChanged();
return this;
}
private int leftMotorErrorCode_ ;
/**
* <code>int32 Left_Motor_Error_Code = 2;</code>
* @return The leftMotorErrorCode.
*/
@java.lang.Override
public int getLeftMotorErrorCode() {
return leftMotorErrorCode_;
}
/**
* <code>int32 Left_Motor_Error_Code = 2;</code>
* @param value The leftMotorErrorCode to set.
* @return This builder for chaining.
*/
public Builder setLeftMotorErrorCode(int value) {
leftMotorErrorCode_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>int32 Left_Motor_Error_Code = 2;</code>
* @return This builder for chaining.
*/
public Builder clearLeftMotorErrorCode() {
bitField0_ = (bitField0_ & ~0x00000002);
leftMotorErrorCode_ = 0;
onChanged();
return this;
}
private int rightMotorErrorCode_ ;
/**
* <code>int32 Right_Motor_Error_Code = 3;</code>
* @return The rightMotorErrorCode.
*/
@java.lang.Override
public int getRightMotorErrorCode() {
return rightMotorErrorCode_;
}
/**
* <code>int32 Right_Motor_Error_Code = 3;</code>
* @param value The rightMotorErrorCode to set.
* @return This builder for chaining.
*/
public Builder setRightMotorErrorCode(int value) {
rightMotorErrorCode_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
* <code>int32 Right_Motor_Error_Code = 3;</code>
* @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.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData();
}
public static com.bingoorobot.foreignobjectcuttingapp.models.BspError.ErrorData getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<ErrorData>
PARSER = new com.google.protobuf.AbstractParser<ErrorData>() {
@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<ErrorData> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<ErrorData> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.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*\270\001" +
"\n\010ComError\022\r\n\tMK32_SBus\020\000\022\n\n\006TL720D\020\001\022\020\n" +
"\014LS_LeftMotor\020\002\022\021\n\rLS_RightMotor\020\003\022\035\n\031Re" +
"mote_Button_Reset_State\020\004\022\022\n\016upper_Compu" +
"ter\020\005\022\013\n\007DDM360B\020\006\022\013\n\007K1061DC\020\007\022\017\n\013wire_" +
"sensor\020\010\022\016\n\nwire_motor\020\tB2\n.com.bingooro" +
"bot.foreignobjectcuttingapp.modelsP\000b\006pr" +
"oto3"
};
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)
}

1442
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspIV.java

File diff suppressed because it is too large

983
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspPV.java

@ -0,0 +1,983 @@
// 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.bingoorobot.foreignobjectcuttingapp.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 {
/**
* <pre>
* 1 手动无校准作业 2 手动竖直向左作业 3 手动竖直向右作业
* </pre>
*
* <code>int32 RunMode = 1;</code>
* @return The runMode.
*/
int getRunMode();
/**
* <pre>
* 0-30m/min
* </pre>
*
* <code>int32 RobotSpeed = 2;</code>
* @return The robotSpeed.
*/
int getRobotSpeed();
/**
* <pre>
* 1-100cm
* </pre>
*
* <code>int32 LaneChangeDistance = 3;</code>
* @return The laneChangeDistance.
*/
int getLaneChangeDistance();
/**
* <pre>
* 1°
* </pre>
*
* <code>double Vertical_Calibration = 4;</code>
* @return The verticalCalibration.
*/
double getVerticalCalibration();
/**
* <pre>
* 罐高度m
* </pre>
*
* <code>double Height_Storage = 5;</code>
* @return The heightStorage.
*/
double getHeightStorage();
/**
* <pre>
* 罐半径m
* </pre>
*
* <code>double Radius_Storage = 6;</code>
* @return The radiusStorage.
*/
double getRadiusStorage();
}
/**
* 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.bingoorobot.foreignobjectcuttingapp.models.BspPV.internal_static_PV_struct_define_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.bingoorobot.foreignobjectcuttingapp.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.class, com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.Builder.class);
}
public static final int RUNMODE_FIELD_NUMBER = 1;
private int runMode_ = 0;
/**
* <pre>
* 1 手动无校准作业 2 手动竖直向左作业 3 手动竖直向右作业
* </pre>
*
* <code>int32 RunMode = 1;</code>
* @return The runMode.
*/
@java.lang.Override
public int getRunMode() {
return runMode_;
}
public static final int ROBOTSPEED_FIELD_NUMBER = 2;
private int robotSpeed_ = 0;
/**
* <pre>
* 0-30m/min
* </pre>
*
* <code>int32 RobotSpeed = 2;</code>
* @return The robotSpeed.
*/
@java.lang.Override
public int getRobotSpeed() {
return robotSpeed_;
}
public static final int LANECHANGEDISTANCE_FIELD_NUMBER = 3;
private int laneChangeDistance_ = 0;
/**
* <pre>
* 1-100cm
* </pre>
*
* <code>int32 LaneChangeDistance = 3;</code>
* @return The laneChangeDistance.
*/
@java.lang.Override
public int getLaneChangeDistance() {
return laneChangeDistance_;
}
public static final int VERTICAL_CALIBRATION_FIELD_NUMBER = 4;
private double verticalCalibration_ = 0D;
/**
* <pre>
* 1°
* </pre>
*
* <code>double Vertical_Calibration = 4;</code>
* @return The verticalCalibration.
*/
@java.lang.Override
public double getVerticalCalibration() {
return verticalCalibration_;
}
public static final int HEIGHT_STORAGE_FIELD_NUMBER = 5;
private double heightStorage_ = 0D;
/**
* <pre>
* 罐高度m
* </pre>
*
* <code>double Height_Storage = 5;</code>
* @return The heightStorage.
*/
@java.lang.Override
public double getHeightStorage() {
return heightStorage_;
}
public static final int RADIUS_STORAGE_FIELD_NUMBER = 6;
private double radiusStorage_ = 0D;
/**
* <pre>
* 罐半径m
* </pre>
*
* <code>double Radius_Storage = 6;</code>
* @return The radiusStorage.
*/
@java.lang.Override
public double getRadiusStorage() {
return radiusStorage_;
}
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 (runMode_ != 0) {
output.writeInt32(1, runMode_);
}
if (robotSpeed_ != 0) {
output.writeInt32(2, robotSpeed_);
}
if (laneChangeDistance_ != 0) {
output.writeInt32(3, laneChangeDistance_);
}
if (java.lang.Double.doubleToRawLongBits(verticalCalibration_) != 0) {
output.writeDouble(4, verticalCalibration_);
}
if (java.lang.Double.doubleToRawLongBits(heightStorage_) != 0) {
output.writeDouble(5, heightStorage_);
}
if (java.lang.Double.doubleToRawLongBits(radiusStorage_) != 0) {
output.writeDouble(6, radiusStorage_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (runMode_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, runMode_);
}
if (robotSpeed_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, robotSpeed_);
}
if (laneChangeDistance_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, laneChangeDistance_);
}
if (java.lang.Double.doubleToRawLongBits(verticalCalibration_) != 0) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(4, verticalCalibration_);
}
if (java.lang.Double.doubleToRawLongBits(heightStorage_) != 0) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(5, heightStorage_);
}
if (java.lang.Double.doubleToRawLongBits(radiusStorage_) != 0) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(6, radiusStorage_);
}
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.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define)) {
return super.equals(obj);
}
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define other = (com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define) obj;
if (getRunMode()
!= other.getRunMode()) return false;
if (getRobotSpeed()
!= other.getRobotSpeed()) return false;
if (getLaneChangeDistance()
!= other.getLaneChangeDistance()) return false;
if (java.lang.Double.doubleToLongBits(getVerticalCalibration())
!= java.lang.Double.doubleToLongBits(
other.getVerticalCalibration())) return false;
if (java.lang.Double.doubleToLongBits(getHeightStorage())
!= java.lang.Double.doubleToLongBits(
other.getHeightStorage())) return false;
if (java.lang.Double.doubleToLongBits(getRadiusStorage())
!= java.lang.Double.doubleToLongBits(
other.getRadiusStorage())) 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) + RUNMODE_FIELD_NUMBER;
hash = (53 * hash) + getRunMode();
hash = (37 * hash) + ROBOTSPEED_FIELD_NUMBER;
hash = (53 * hash) + getRobotSpeed();
hash = (37 * hash) + LANECHANGEDISTANCE_FIELD_NUMBER;
hash = (53 * hash) + getLaneChangeDistance();
hash = (37 * hash) + VERTICAL_CALIBRATION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getVerticalCalibration()));
hash = (37 * hash) + HEIGHT_STORAGE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getHeightStorage()));
hash = (37 * hash) + RADIUS_STORAGE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getRadiusStorage()));
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.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.bingoorobot.foreignobjectcuttingapp.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<Builder> implements
// @@protoc_insertion_point(builder_implements:PV_struct_define)
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_defineOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.bingoorobot.foreignobjectcuttingapp.models.BspPV.internal_static_PV_struct_define_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.bingoorobot.foreignobjectcuttingapp.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.class, com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.Builder.class);
}
// Construct using com.bingoorobot.foreignobjectcuttingapp.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;
runMode_ = 0;
robotSpeed_ = 0;
laneChangeDistance_ = 0;
verticalCalibration_ = 0D;
heightStorage_ = 0D;
radiusStorage_ = 0D;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.bingoorobot.foreignobjectcuttingapp.models.BspPV.internal_static_PV_struct_define_descriptor;
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define getDefaultInstanceForType() {
return com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.getDefaultInstance();
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define build() {
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define buildPartial() {
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define result = new com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.runMode_ = runMode_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.robotSpeed_ = robotSpeed_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.laneChangeDistance_ = laneChangeDistance_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.verticalCalibration_ = verticalCalibration_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.heightStorage_ = heightStorage_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.radiusStorage_ = radiusStorage_;
}
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define) {
return mergeFrom((com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define other) {
if (other == com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.getDefaultInstance()) return this;
if (other.getRunMode() != 0) {
setRunMode(other.getRunMode());
}
if (other.getRobotSpeed() != 0) {
setRobotSpeed(other.getRobotSpeed());
}
if (other.getLaneChangeDistance() != 0) {
setLaneChangeDistance(other.getLaneChangeDistance());
}
if (other.getVerticalCalibration() != 0D) {
setVerticalCalibration(other.getVerticalCalibration());
}
if (other.getHeightStorage() != 0D) {
setHeightStorage(other.getHeightStorage());
}
if (other.getRadiusStorage() != 0D) {
setRadiusStorage(other.getRadiusStorage());
}
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: {
runMode_ = input.readInt32();
bitField0_ |= 0x00000001;
break;
} // case 8
case 16: {
robotSpeed_ = input.readInt32();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24: {
laneChangeDistance_ = input.readInt32();
bitField0_ |= 0x00000004;
break;
} // case 24
case 33: {
verticalCalibration_ = input.readDouble();
bitField0_ |= 0x00000008;
break;
} // case 33
case 41: {
heightStorage_ = input.readDouble();
bitField0_ |= 0x00000010;
break;
} // case 41
case 49: {
radiusStorage_ = input.readDouble();
bitField0_ |= 0x00000020;
break;
} // case 49
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 runMode_ ;
/**
* <pre>
* 1 手动无校准作业 2 手动竖直向左作业 3 手动竖直向右作业
* </pre>
*
* <code>int32 RunMode = 1;</code>
* @return The runMode.
*/
@java.lang.Override
public int getRunMode() {
return runMode_;
}
/**
* <pre>
* 1 手动无校准作业 2 手动竖直向左作业 3 手动竖直向右作业
* </pre>
*
* <code>int32 RunMode = 1;</code>
* @param value The runMode to set.
* @return This builder for chaining.
*/
public Builder setRunMode(int value) {
runMode_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <pre>
* 1 手动无校准作业 2 手动竖直向左作业 3 手动竖直向右作业
* </pre>
*
* <code>int32 RunMode = 1;</code>
* @return This builder for chaining.
*/
public Builder clearRunMode() {
bitField0_ = (bitField0_ & ~0x00000001);
runMode_ = 0;
onChanged();
return this;
}
private int robotSpeed_ ;
/**
* <pre>
* 0-30m/min
* </pre>
*
* <code>int32 RobotSpeed = 2;</code>
* @return The robotSpeed.
*/
@java.lang.Override
public int getRobotSpeed() {
return robotSpeed_;
}
/**
* <pre>
* 0-30m/min
* </pre>
*
* <code>int32 RobotSpeed = 2;</code>
* @param value The robotSpeed to set.
* @return This builder for chaining.
*/
public Builder setRobotSpeed(int value) {
robotSpeed_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <pre>
* 0-30m/min
* </pre>
*
* <code>int32 RobotSpeed = 2;</code>
* @return This builder for chaining.
*/
public Builder clearRobotSpeed() {
bitField0_ = (bitField0_ & ~0x00000002);
robotSpeed_ = 0;
onChanged();
return this;
}
private int laneChangeDistance_ ;
/**
* <pre>
* 1-100cm
* </pre>
*
* <code>int32 LaneChangeDistance = 3;</code>
* @return The laneChangeDistance.
*/
@java.lang.Override
public int getLaneChangeDistance() {
return laneChangeDistance_;
}
/**
* <pre>
* 1-100cm
* </pre>
*
* <code>int32 LaneChangeDistance = 3;</code>
* @param value The laneChangeDistance to set.
* @return This builder for chaining.
*/
public Builder setLaneChangeDistance(int value) {
laneChangeDistance_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
* <pre>
* 1-100cm
* </pre>
*
* <code>int32 LaneChangeDistance = 3;</code>
* @return This builder for chaining.
*/
public Builder clearLaneChangeDistance() {
bitField0_ = (bitField0_ & ~0x00000004);
laneChangeDistance_ = 0;
onChanged();
return this;
}
private double verticalCalibration_ ;
/**
* <pre>
* 1°
* </pre>
*
* <code>double Vertical_Calibration = 4;</code>
* @return The verticalCalibration.
*/
@java.lang.Override
public double getVerticalCalibration() {
return verticalCalibration_;
}
/**
* <pre>
* 1°
* </pre>
*
* <code>double Vertical_Calibration = 4;</code>
* @param value The verticalCalibration to set.
* @return This builder for chaining.
*/
public Builder setVerticalCalibration(double value) {
verticalCalibration_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
* <pre>
* 1°
* </pre>
*
* <code>double Vertical_Calibration = 4;</code>
* @return This builder for chaining.
*/
public Builder clearVerticalCalibration() {
bitField0_ = (bitField0_ & ~0x00000008);
verticalCalibration_ = 0D;
onChanged();
return this;
}
private double heightStorage_ ;
/**
* <pre>
* 罐高度m
* </pre>
*
* <code>double Height_Storage = 5;</code>
* @return The heightStorage.
*/
@java.lang.Override
public double getHeightStorage() {
return heightStorage_;
}
/**
* <pre>
* 罐高度m
* </pre>
*
* <code>double Height_Storage = 5;</code>
* @param value The heightStorage to set.
* @return This builder for chaining.
*/
public Builder setHeightStorage(double value) {
heightStorage_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
* <pre>
* 罐高度m
* </pre>
*
* <code>double Height_Storage = 5;</code>
* @return This builder for chaining.
*/
public Builder clearHeightStorage() {
bitField0_ = (bitField0_ & ~0x00000010);
heightStorage_ = 0D;
onChanged();
return this;
}
private double radiusStorage_ ;
/**
* <pre>
* 罐半径m
* </pre>
*
* <code>double Radius_Storage = 6;</code>
* @return The radiusStorage.
*/
@java.lang.Override
public double getRadiusStorage() {
return radiusStorage_;
}
/**
* <pre>
* 罐半径m
* </pre>
*
* <code>double Radius_Storage = 6;</code>
* @param value The radiusStorage to set.
* @return This builder for chaining.
*/
public Builder setRadiusStorage(double value) {
radiusStorage_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
* <pre>
* 罐半径m
* </pre>
*
* <code>double Radius_Storage = 6;</code>
* @return This builder for chaining.
*/
public Builder clearRadiusStorage() {
bitField0_ = (bitField0_ & ~0x00000020);
radiusStorage_ = 0D;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:PV_struct_define)
}
// @@protoc_insertion_point(class_scope:PV_struct_define)
private static final com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define();
}
public static com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<PV_struct_define>
PARSER = new com.google.protobuf.AbstractParser<PV_struct_define>() {
@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<PV_struct_define> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<PV_struct_define> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.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\"\241\001\n\020PV_struct_define\022\017\n\007R" +
"unMode\030\001 \001(\005\022\022\n\nRobotSpeed\030\002 \001(\005\022\032\n\022Lane" +
"ChangeDistance\030\003 \001(\005\022\034\n\024Vertical_Calibra" +
"tion\030\004 \001(\001\022\026\n\016Height_Storage\030\005 \001(\001\022\026\n\016Ra" +
"dius_Storage\030\006 \001(\001B2\n.com.bingoorobot.fo" +
"reignobjectcuttingapp.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[] { "RunMode", "RobotSpeed", "LaneChangeDistance", "VerticalCalibration", "HeightStorage", "RadiusStorage", });
descriptor.resolveAllFeaturesImmutable();
}
// @@protoc_insertion_point(outer_class_scope)
}

837
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/DCmd.java

@ -0,0 +1,837 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: D_Cmd.proto
// Protobuf Java Version: 4.27.2
package com.bingoorobot.foreignobjectcuttingapp.models;
public final class DCmd {
private DCmd() {}
static {
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
/* major= */ 4,
/* minor= */ 27,
/* patch= */ 2,
/* suffix= */ "",
DCmd.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 D_Cmd_struct_defineOrBuilder extends
// @@protoc_insertion_point(interface_extends:D_Cmd_struct_define)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
* @return Whether the mk32CMD field is set.
*/
boolean hasMk32CMD();
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
* @return The mk32CMD.
*/
com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button getMk32CMD();
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
*/
com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_ButtonOrBuilder getMk32CMDOrBuilder();
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
* @return Whether the toSendPV field is set.
*/
boolean hasToSendPV();
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
* @return The toSendPV.
*/
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define getToSendPV();
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
*/
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_defineOrBuilder getToSendPVOrBuilder();
}
/**
* Protobuf type {@code D_Cmd_struct_define}
*/
public static final class D_Cmd_struct_define extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:D_Cmd_struct_define)
D_Cmd_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= */ "",
D_Cmd_struct_define.class.getName());
}
// Use D_Cmd_struct_define.newBuilder() to construct.
private D_Cmd_struct_define(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
}
private D_Cmd_struct_define() {
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.bingoorobot.foreignobjectcuttingapp.models.DCmd.internal_static_D_Cmd_struct_define_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.bingoorobot.foreignobjectcuttingapp.models.DCmd.internal_static_D_Cmd_struct_define_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define.class, com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define.Builder.class);
}
private int bitField0_;
public static final int MK32CMD_FIELD_NUMBER = 1;
private com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button mk32CMD_;
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
* @return Whether the mk32CMD field is set.
*/
@java.lang.Override
public boolean hasMk32CMD() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
* @return The mk32CMD.
*/
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button getMk32CMD() {
return mk32CMD_ == null ? com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.getDefaultInstance() : mk32CMD_;
}
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
*/
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_ButtonOrBuilder getMk32CMDOrBuilder() {
return mk32CMD_ == null ? com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.getDefaultInstance() : mk32CMD_;
}
public static final int _TOSENDPV_FIELD_NUMBER = 2;
private com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define ToSendPV_;
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
* @return Whether the toSendPV field is set.
*/
@java.lang.Override
public boolean hasToSendPV() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
* @return The toSendPV.
*/
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define getToSendPV() {
return ToSendPV_ == null ? com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.getDefaultInstance() : ToSendPV_;
}
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
*/
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_defineOrBuilder getToSendPVOrBuilder() {
return ToSendPV_ == null ? com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.getDefaultInstance() : ToSendPV_;
}
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 (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getMk32CMD());
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(2, getToSendPV());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getMk32CMD());
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getToSendPV());
}
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.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define)) {
return super.equals(obj);
}
com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define other = (com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define) obj;
if (hasMk32CMD() != other.hasMk32CMD()) return false;
if (hasMk32CMD()) {
if (!getMk32CMD()
.equals(other.getMk32CMD())) return false;
}
if (hasToSendPV() != other.hasToSendPV()) return false;
if (hasToSendPV()) {
if (!getToSendPV()
.equals(other.getToSendPV())) 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();
if (hasMk32CMD()) {
hash = (37 * hash) + MK32CMD_FIELD_NUMBER;
hash = (53 * hash) + getMk32CMD().hashCode();
}
if (hasToSendPV()) {
hash = (37 * hash) + _TOSENDPV_FIELD_NUMBER;
hash = (53 * hash) + getToSendPV().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_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.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_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.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_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.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_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.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_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.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_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 D_Cmd_struct_define}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:D_Cmd_struct_define)
com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_defineOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.bingoorobot.foreignobjectcuttingapp.models.DCmd.internal_static_D_Cmd_struct_define_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.bingoorobot.foreignobjectcuttingapp.models.DCmd.internal_static_D_Cmd_struct_define_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define.class, com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define.Builder.class);
}
// Construct using com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage
.alwaysUseFieldBuilders) {
getMk32CMDFieldBuilder();
getToSendPVFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
mk32CMD_ = null;
if (mk32CMDBuilder_ != null) {
mk32CMDBuilder_.dispose();
mk32CMDBuilder_ = null;
}
ToSendPV_ = null;
if (ToSendPVBuilder_ != null) {
ToSendPVBuilder_.dispose();
ToSendPVBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.bingoorobot.foreignobjectcuttingapp.models.DCmd.internal_static_D_Cmd_struct_define_descriptor;
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define getDefaultInstanceForType() {
return com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define.getDefaultInstance();
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define build() {
com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define buildPartial() {
com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define result = new com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.mk32CMD_ = mk32CMDBuilder_ == null
? mk32CMD_
: mk32CMDBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.ToSendPV_ = ToSendPVBuilder_ == null
? ToSendPV_
: ToSendPVBuilder_.build();
to_bitField0_ |= 0x00000002;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define) {
return mergeFrom((com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define other) {
if (other == com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define.getDefaultInstance()) return this;
if (other.hasMk32CMD()) {
mergeMk32CMD(other.getMk32CMD());
}
if (other.hasToSendPV()) {
mergeToSendPV(other.getToSendPV());
}
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 10: {
input.readMessage(
getMk32CMDFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
input.readMessage(
getToSendPVFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
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 com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button mk32CMD_;
private com.google.protobuf.SingleFieldBuilder<
com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button, com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.Builder, com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_ButtonOrBuilder> mk32CMDBuilder_;
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
* @return Whether the mk32CMD field is set.
*/
public boolean hasMk32CMD() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
* @return The mk32CMD.
*/
public com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button getMk32CMD() {
if (mk32CMDBuilder_ == null) {
return mk32CMD_ == null ? com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.getDefaultInstance() : mk32CMD_;
} else {
return mk32CMDBuilder_.getMessage();
}
}
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
*/
public Builder setMk32CMD(com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button value) {
if (mk32CMDBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
mk32CMD_ = value;
} else {
mk32CMDBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
*/
public Builder setMk32CMD(
com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.Builder builderForValue) {
if (mk32CMDBuilder_ == null) {
mk32CMD_ = builderForValue.build();
} else {
mk32CMDBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
*/
public Builder mergeMk32CMD(com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button value) {
if (mk32CMDBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0) &&
mk32CMD_ != null &&
mk32CMD_ != com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.getDefaultInstance()) {
getMk32CMDBuilder().mergeFrom(value);
} else {
mk32CMD_ = value;
}
} else {
mk32CMDBuilder_.mergeFrom(value);
}
if (mk32CMD_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
*/
public Builder clearMk32CMD() {
bitField0_ = (bitField0_ & ~0x00000001);
mk32CMD_ = null;
if (mk32CMDBuilder_ != null) {
mk32CMDBuilder_.dispose();
mk32CMDBuilder_ = null;
}
onChanged();
return this;
}
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
*/
public com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.Builder getMk32CMDBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getMk32CMDFieldBuilder().getBuilder();
}
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
*/
public com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_ButtonOrBuilder getMk32CMDOrBuilder() {
if (mk32CMDBuilder_ != null) {
return mk32CMDBuilder_.getMessageOrBuilder();
} else {
return mk32CMD_ == null ?
com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.getDefaultInstance() : mk32CMD_;
}
}
/**
* <code>.SP_MSP_MK32_Button Mk32CMD = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button, com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.Builder, com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_ButtonOrBuilder>
getMk32CMDFieldBuilder() {
if (mk32CMDBuilder_ == null) {
mk32CMDBuilder_ = new com.google.protobuf.SingleFieldBuilder<
com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button, com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.Builder, com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_ButtonOrBuilder>(
getMk32CMD(),
getParentForChildren(),
isClean());
mk32CMD_ = null;
}
return mk32CMDBuilder_;
}
private com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define ToSendPV_;
private com.google.protobuf.SingleFieldBuilder<
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define, com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.Builder, com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_defineOrBuilder> ToSendPVBuilder_;
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
* @return Whether the toSendPV field is set.
*/
public boolean hasToSendPV() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
* @return The toSendPV.
*/
public com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define getToSendPV() {
if (ToSendPVBuilder_ == null) {
return ToSendPV_ == null ? com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.getDefaultInstance() : ToSendPV_;
} else {
return ToSendPVBuilder_.getMessage();
}
}
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
*/
public Builder setToSendPV(com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define value) {
if (ToSendPVBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ToSendPV_ = value;
} else {
ToSendPVBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
*/
public Builder setToSendPV(
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.Builder builderForValue) {
if (ToSendPVBuilder_ == null) {
ToSendPV_ = builderForValue.build();
} else {
ToSendPVBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
*/
public Builder mergeToSendPV(com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define value) {
if (ToSendPVBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0) &&
ToSendPV_ != null &&
ToSendPV_ != com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.getDefaultInstance()) {
getToSendPVBuilder().mergeFrom(value);
} else {
ToSendPV_ = value;
}
} else {
ToSendPVBuilder_.mergeFrom(value);
}
if (ToSendPV_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
*/
public Builder clearToSendPV() {
bitField0_ = (bitField0_ & ~0x00000002);
ToSendPV_ = null;
if (ToSendPVBuilder_ != null) {
ToSendPVBuilder_.dispose();
ToSendPVBuilder_ = null;
}
onChanged();
return this;
}
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
*/
public com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.Builder getToSendPVBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getToSendPVFieldBuilder().getBuilder();
}
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
*/
public com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_defineOrBuilder getToSendPVOrBuilder() {
if (ToSendPVBuilder_ != null) {
return ToSendPVBuilder_.getMessageOrBuilder();
} else {
return ToSendPV_ == null ?
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.getDefaultInstance() : ToSendPV_;
}
}
/**
* <code>.PV_struct_define _toSendPV = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define, com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.Builder, com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_defineOrBuilder>
getToSendPVFieldBuilder() {
if (ToSendPVBuilder_ == null) {
ToSendPVBuilder_ = new com.google.protobuf.SingleFieldBuilder<
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define, com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.Builder, com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_defineOrBuilder>(
getToSendPV(),
getParentForChildren(),
isClean());
ToSendPV_ = null;
}
return ToSendPVBuilder_;
}
// @@protoc_insertion_point(builder_scope:D_Cmd_struct_define)
}
// @@protoc_insertion_point(class_scope:D_Cmd_struct_define)
private static final com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define();
}
public static com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<D_Cmd_struct_define>
PARSER = new com.google.protobuf.AbstractParser<D_Cmd_struct_define>() {
@java.lang.Override
public D_Cmd_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<D_Cmd_struct_define> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<D_Cmd_struct_define> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.bingoorobot.foreignobjectcuttingapp.models.DCmd.D_Cmd_struct_define getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_D_Cmd_struct_define_descriptor;
private static final
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_D_Cmd_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\013D_Cmd.proto\032\016msp_MK32.proto\032\014bsp_PV.pr" +
"oto\"a\n\023D_Cmd_struct_define\022$\n\007Mk32CMD\030\001 " +
"\001(\0132\023.SP_MSP_MK32_Button\022$\n\t_toSendPV\030\002 " +
"\001(\0132\021.PV_struct_defineB2\n.com.bingoorobo" +
"t.foreignobjectcuttingapp.modelsP\000b\006prot" +
"o3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.getDescriptor(),
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.getDescriptor(),
});
internal_static_D_Cmd_struct_define_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_D_Cmd_struct_define_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_D_Cmd_struct_define_descriptor,
new java.lang.String[] { "Mk32CMD", "ToSendPV", });
descriptor.resolveAllFeaturesImmutable();
com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.getDescriptor();
com.bingoorobot.foreignobjectcuttingapp.models.BspPV.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}

44
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/ErrorModel.java

@ -0,0 +1,44 @@
package com.bingoorobot.foreignobjectcuttingapp.models;
public class ErrorModel {
public ErrorModel(long timeID, String errorInfo) {
this.timeID = timeID;
this.errorInfo = errorInfo;
}
private long timeID;
public void setDateTimeBJ(String dateTimeUTC) {
this.dateTimeBJ = dateTimeUTC;
}
private String errorInfo;
public String getDateTimeBJ() {
return dateTimeBJ;
}
private String dateTimeBJ;
@Override
public String toString() {
return String.valueOf(dateTimeBJ + errorInfo);
}
public void setTimeID(long timeID) {
this.timeID = timeID;
}
public void setErrorInfo(String errorInfo) {
this.errorInfo = errorInfo;
}
public long getTimeID() {
return timeID;
}
public String getErrorInfo() {
return errorInfo;
}
}

1726
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/MspMK32.java

File diff suppressed because it is too large

43
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/ScrollBottomScrollView.java

@ -0,0 +1,43 @@
package com.bingoorobot.foreignobjectcuttingapp.models;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
public class ScrollBottomScrollView extends ScrollView {
private OnScrollBottomListener listener;
private int calCount;
public interface OnScrollBottomListener {
void scrollToBottom();
}
public void onScrollViewScrollToBottom(OnScrollBottomListener l) {
listener = l;
}
public void unRegisterOnScrollViewScrollToBottom() {
listener = null;
}
public ScrollBottomScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
View view = this.getChildAt(0);
if (this.getHeight() + this.getScrollY() == view.getHeight()) {
calCount++;
if (calCount == 1) {
if (listener != null) {
listener.scrollToBottom();
}
}
} else {
calCount = 0;
}
}
}

22
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/CustomProber.java

@ -0,0 +1,22 @@
package com.bingoorobot.foreignobjectcuttingapp.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);
}
}

95
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/DataExchangeHelper.java

@ -0,0 +1,95 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
import com.bingoorobot.foreignobjectcuttingapp.models.BspIV;
import com.bingoorobot.foreignobjectcuttingapp.models.BspPV;
import com.bingoorobot.foreignobjectcuttingapp.models.DCmd;
import com.google.protobuf.InvalidProtocolBufferException;
public class DataExchangeHelper {
public static int[] decodedCH=new int[17];
static double slope = 1000.0 / (1950 - 1500);
public static int[] getdecodedCH(byte[] receivedData)
{
for (int i=0; i<16; i++)
{
decodedCH[i]= ((receivedData[8+i*2] & 0xFF)|(receivedData[9+i*2] & 0xFF) << 8) ;
}
for (int i = 0; i < 16; i++)
{
decodedCH[i]= (int) Math.round(slope * (decodedCH[i] - 1500));
}
return decodedCH;
}
public static byte[] getSendPVBytes(BspPV.PV_struct_define _toSendPV) {
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);
return sendbyteArray3;
}
public static byte[] getSendD_CMDBytes(DCmd.D_Cmd_struct_define _d_Cmd ) {
byte[] byteArray = _d_Cmd.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);//SHI 2026.6.2,负压吸附项目,UDP发送;
return sendbyteArray3;
}
public static BspIV.IV_struct_define getIVByBytes(byte[] data)
{
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);
try
{
BspIV.IV_struct_define _toReceiveIV = BspIV.IV_struct_define.parseFrom(bytes);
return _toReceiveIV;
} catch (InvalidProtocolBufferException ex)
{
return null;
}
}
return null;
}
return null;
}
}

28
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ErrorDeocdeHelper.java

@ -0,0 +1,28 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
import com.bingoorobot.foreignobjectcuttingapp.models.BspError;
public class ErrorDeocdeHelper {
private static String ErrorResult;
private static String addErrorResult;
public static String ErrorDeocde(int data)
{
ErrorResult="";
for (BspError.ComError err : BspError.ComError.values()) {
int bitPosiiton = err.ordinal();
// 使用左移操作生成要检查的标志位
int bitToCheck = 1 << bitPosiiton;
// 判断该位置是否有对应的标志位
if ((data & bitToCheck) != 0)
{
ErrorResult += err.toString()+addErrorResult +"\t";
} else
{
}
}
return ErrorResult;
}
}

99
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/FilpViewHelper.java

@ -0,0 +1,99 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
import android.graphics.Matrix;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.Surface;
import android.view.TextureView;
import android.view.View;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import java.io.IOException;
public class FilpViewHelper extends AppCompatActivity implements TextureView.SurfaceTextureListener {
private TextureView mVideoTextureView;
private MediaPlayer mMediaPlayer;
private String Address;
private boolean isVerticalFlipped = false;
public void startVedio(TextureView VideoTextureView, String address ){
// 初始化 TextureView 并设置监听器
mVideoTextureView =VideoTextureView;
mVideoTextureView.setSurfaceTextureListener(this);
Address = address;
}
/**
* TextureView 表面就绪时初始化 MediaPlayer
*/
@Override
public void onSurfaceTextureAvailable(android.graphics.SurfaceTexture surface, int width, int height) {
// 1. 创建 MediaPlayer 实例
mMediaPlayer = new MediaPlayer();
try {
// 2. 设置视频流数据源(仅支持 HTTP/RTSP 等基础协议)
mMediaPlayer.setDataSource(Address);
// 3. 绑定 Surface(将 TextureView 作为渲染载体)
mMediaPlayer.setSurface(new Surface(surface));
// 4. 准备播放(异步准备,避免阻塞主线程)
mMediaPlayer.prepareAsync();
mMediaPlayer.setOnPreparedListener(mp -> {
// 准备完成后开始播放
mp.start();
// 调整视频显示比例(可选)
});
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(this, "播放失败:" + e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
/**
* 切换垂直翻转
*/
public void toggleVerticalFlip() {
if (mVideoTextureView == null || mVideoTextureView.getWidth() == 0) {
return;
}
Matrix matrix = new Matrix();
float centerX = mVideoTextureView.getWidth() / 2f;
float centerY = mVideoTextureView.getHeight() / 2f;
if (!isVerticalFlipped) {
matrix.setScale(1, -1, centerX, centerY);
isVerticalFlipped = true;
} else {
matrix.setScale(1, 1, centerX, centerY);
isVerticalFlipped = false;
}
mVideoTextureView.setTransform(matrix);
mVideoTextureView.invalidate();
}
/**
* 生命周期管理(必须实现,避免资源泄漏)
*/
@Override
protected void onDestroy() {
super.onDestroy();
if (mMediaPlayer != null) {
mMediaPlayer.stop();
mMediaPlayer.release();
mMediaPlayer = null;
}
}
// TextureView.SurfaceTextureListener 其他空实现(必须重写)
@Override
public void onSurfaceTextureSizeChanged(android.graphics.SurfaceTexture surface, int width, int height) {}
@Override
public boolean onSurfaceTextureDestroyed(android.graphics.SurfaceTexture surface) { return false; }
@Override
public void onSurfaceTextureUpdated(android.graphics.SurfaceTexture surface) {}
}

80
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ModbusCRC.java

@ -0,0 +1,80 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
public class ModbusCRC {
/**
* 计算 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;
}
public static byte[] calculateCRC16CCITTFALSE(byte[] data) {
int crc = 0xFFFF; // 初始值
for (byte b : data) {
crc ^= (b & 0xFF) << 8; // 处理当前字节
for (int i = 0; i < 8; i++) {
if ((crc & 0x8000) != 0) {
crc = (crc << 1) ^ 0x1021; // 多项式
} else {
crc <<= 1;
}
crc &= 0xFFFF; // 保持16位
}
}
byte[] crcBytes = new byte[2];
crcBytes[0] = (byte) (crc & 0xFF);
crcBytes[1] = (byte) ((crc >> 8) & 0xFF);
return crcBytes;
}
/**
* CRC-16/XMODEM 算法(常用变体)
* 初始值: 0x0000, 多项式: 0x1021, 输入输出不反转
*
* @param data 输入数据字节数组
* @return CRC16 校验值 (2字节)
*/
public static byte[] calculateCRC16XMODEM(byte[] data) {
int crc = 0x0000; // 初始值
for (byte b : data) {
crc ^= (b & 0xFF) << 8; // 处理当前字节
for (int i = 0; i < 8; i++) {
if ((crc & 0x8000) != 0) {
crc = (crc << 1) ^ 0x1021; // 多项式
} else {
crc <<= 1;
}
crc &= 0xFFFF; // 保持16位
}
}
byte[] crcBytes = new byte[2];
crcBytes[0] = (byte) (crc & 0xFF);
crcBytes[1] = (byte) ((crc >> 8) & 0xFF);
return crcBytes;
}
}

70
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/MyDataHelper.java

@ -0,0 +1,70 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;
import com.bingoorobot.foreignobjectcuttingapp.models.ErrorModel;
import java.util.ArrayList;
import java.util.List;
public class MyDataHelper extends SQLiteOpenHelper {
public static final String COLUMN_ID = "id";
public static final String COLUMN_THICKNESS = "thickness";
public static final String TABLE_NAME = "thickness";
public static final String TCOLUMN_IMESTAMP = "timestamp";
public static final String TCOLUMN_DATE_TIME = "dateTime";
/************************************************************************************************/
public static final String Error_TABLE_NAME = "error";
public static final String Error_COLUMN_TimeStamp = "timeID";
public static final String Error_COLUMN_ERROR_INFO = "errorInfo";
public MyDataHelper(@Nullable Context context) {
super(context, "bingbot.db", null, 6);
}
@Override
public void onCreate(SQLiteDatabase db) {
String sql = "CREATE TABLE " + TABLE_NAME + "(" +
COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
TCOLUMN_IMESTAMP + " INTEGER NOT NULL," +
COLUMN_THICKNESS + " INTEGER," +
TCOLUMN_DATE_TIME + " TEXT" + ")";
db.execSQL(sql);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
onCreate(db);
}
public String AddOrUpdateErrorModel(ErrorModel em)
{
ContentValues cv = new ContentValues();
cv.put(Error_COLUMN_TimeStamp,em.getTimeID());
cv.put(Error_COLUMN_ERROR_INFO,em.getErrorInfo());
SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();
long insert = sqLiteDatabase.insertWithOnConflict(Error_TABLE_NAME,null,cv,SQLiteDatabase.CONFLICT_REPLACE);
sqLiteDatabase.close();
if(-1 == insert) {
return "failed";
}
return "success";
}
//增 删 改 查
public String deleteAllFilmThickness() {
SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();
int delete = sqLiteDatabase.delete(TABLE_NAME, null,
null);
sqLiteDatabase.close();
if (delete == 0) {
return "failed";
}
return "success";
}
}

206
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/PopupHelper.java

@ -0,0 +1,206 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
import android.app.Dialog;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import com.bingoorobot.foreignobjectcuttingapp.MainActivity;
import com.bingoorobot.foreignobjectcuttingapp.R;
import com.bingoorobot.foreignobjectcuttingapp.models.BspPV;
import com.bingoorobot.foreignobjectcuttingapp.models.BspError;
import com.bingoorobot.foreignobjectcuttingapp.models.ScrollBottomScrollView;
import java.util.List;
public class PopupHelper {
private MainActivity mainActivity;
String result = "1";
private String modeStorageTemp = "";
public PopupHelper(MainActivity mainActivity) {
this.mainActivity = mainActivity;
}
//模式选择弹窗
public void Arm_ManualModePopup(View.OnClickListener context) { //模式选择弹窗
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.manualmodepopup); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// 获取布局中的视图
Button cancelButton = dialog.findViewById(R.id.manualModeCancel);
Button confirmButton = dialog.findViewById(R.id.manualModeApply);
//获取按钮组
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.manualModeSelectorGroup);
//4种模式
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
RadioButton radioButton = (RadioButton) group.findViewById(checkedId);
if (radioButton != null) {
modeStorageTemp = radioButton.getText().toString();// 暂存选中的模式文字
}
}
});
//下次进来保证是选中状态或者未选中
String ii = mainActivity.mainBinding.manualModeDisplay.getText().toString();
switch (ii) {
case "手动": {
radioGroup.check(R.id.rb_one);
break;
}
case "竖直": {
radioGroup.check(R.id.rb_two);
break;
}
case "水平": {
radioGroup.check(R.id.rb_three);
break;
}
default:
radioGroup.clearCheck();
break;
}
// 设置确定按钮点击事件
confirmButton.setOnClickListener(v -> { //手动模式弹窗确认
if (radioGroup.getCheckedRadioButtonId() != -1) { //有按钮选中时按确定 更新值
//手动模式显示
mainActivity._Manual_Mode_Call_Value = modeStorageTemp;
mainActivity.mainBinding.manualModeDisplay.setText(mainActivity._Manual_Mode_Call_Value);
//自动模式显示
// mainActivity._Auto_Mode_Call_Value = "未启用";
// mainActivity.mainBinding.autoModeDisplay.setText(mainActivity._Auto_Mode_Call_Value);
if("无".equals(mainActivity._Manual_Mode_Call_Value) || "手动".equals(mainActivity._Manual_Mode_Call_Value))
{
mainActivity._Auto_Mode_Call_Value = "未启用";
}
else if(!"0".equals(mainActivity.automodeHeight) || !"0".equals(mainActivity.automodeRadius))
{
mainActivity._Auto_Mode_Call_Value = "启用";
}
mainActivity.mainBinding.autoModeDisplay.setText(mainActivity._Auto_Mode_Call_Value);
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show();
}
dialog.dismiss(); // 关闭弹窗
});
// 设置取消按钮点击事件
cancelButton.setOnClickListener(v -> {
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 显示弹窗
dialog.show();
}
// //自动模式弹窗
public void AutoModePopup(View.OnClickListener context) {
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.automodepopup); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// 获取布局中的视图
Button cancelButton = dialog.findViewById(R.id.autoModeCancel);
Button confirmButton = dialog.findViewById(R.id.autoModeApply);
EditText workRadius_Edit = dialog.findViewById(R.id.radius_input);
EditText workHeight_Edit = dialog.findViewById(R.id.height_input);
workRadius_Edit.setText(mainActivity.automodeRadius);
workHeight_Edit.setText(mainActivity.automodeHeight);
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.autoModeSelectorGroup);
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
RadioButton radioButton = (RadioButton) group.findViewById(checkedId);
if (radioButton != null) {
modeStorageTemp = radioButton.getText().toString();// 暂存选中的模式文字
}
}
});
String ii = mainActivity.mainBinding.autoModeDisplay.getText().toString();
switch (ii) {
// case "竖直向左": { radioGroup.check(R.id.rb_five);
// break;
// }
// case "竖直向右": { radioGroup.check(R.id.rb_six);
// break;
// }
// default:
// radioGroup.clearCheck();//清除选中
// break;
}
// 设置确定按钮点击事件
confirmButton.setOnClickListener(v -> { //自动模式弹窗确认
if (radioGroup.getCheckedRadioButtonId() != -1) {
// mainActivity._Auto_Mode_Call_Value = modeStorageTemp;
// mainActivity.mainBinding.autoModeDisplay.setText(mainActivity._Auto_Mode_Call_Value);
// mainActivity._Manual_Mode_Call_Value = "无";
// mainActivity.mainBinding.manualModeDisplay.setText(mainActivity._Manual_Mode_Call_Value);
}
double value1 = 0;
double value2 = 0;
try {
value1 = Double.parseDouble(String.valueOf(workHeight_Edit.getText()));
value2 = Double.parseDouble(String.valueOf(workRadius_Edit.getText()));
} catch (Exception e) {
Toast.makeText(mainActivity, "输入不能为空", Toast.LENGTH_SHORT).show();
return;
}
if (value1 >= 0 && value1 <= 50) {
mainActivity.automodeHeight = String.valueOf(value1);
} else {
Toast.makeText(mainActivity, "请输入0-50的数字", Toast.LENGTH_SHORT).show();
workHeight_Edit.setText("0");
return;
}
if (value2 >= 0 && value2 <= 50) {
mainActivity.automodeRadius = String.valueOf(value2);
} else {
Toast.makeText(mainActivity, "请输入0-50的数字", Toast.LENGTH_SHORT).show();
workRadius_Edit.setText("0");
return;
}
// if(!"无".equals(mainActivity._Manual_Mode_Call_Value) && !"手动".equals(mainActivity._Manual_Mode_Call_Value))
// {
// if(value1 >= 0 && value2 >= 0)
// {
// mainActivity.mainBinding.autoModeDisplay.setText("启用");
// } else
// {
// mainActivity.mainBinding.autoModeDisplay.setText("未启用");
// }
// } else
// {
// mainActivity.mainBinding.autoModeDisplay.setText("未启用");
// }
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 设置取消按钮点击事件
cancelButton.setOnClickListener(v -> {
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 显示弹窗
dialog.show();
}
public void RobotErrorListPopUp(View.OnClickListener context)
{
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.log_item); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// TextView LogText = dialog.findViewById(R.id.popUpErrorLogTextView);
// ScrollBottomScrollView LogScrollView = dialog.findViewById(R.id.popUpErrorLogTextView);
dialog.show(); // 显示弹窗
}
}

180
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ReceiivedDataHandler.java

@ -0,0 +1,180 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
import static com.bingoorobot.foreignobjectcuttingapp.services.ErrorDeocdeHelper.ErrorDeocde;
import android.graphics.Color;
import android.view.Gravity;
import android.widget.TextView;
import android.widget.Toast;
import com.bingoorobot.foreignobjectcuttingapp.models.BspIV;
import com.bingoorobot.foreignobjectcuttingapp.models.ErrorModel;
import com.google.protobuf.InvalidProtocolBufferException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Objects;
public class ReceiivedDataHandler {
static String errorLast = "";
private static final int Buttons_Not_Reset = 0;
private static final int Not_Intialized = 1;
private static final int Move_Halt = 2;
private static final int Move_Forward = 3;
private static final int Move_Backward = 4;
private static final int Move_TurnLeft = 5;
private static final int Move_TurnRight = 6;
private static final int Emergency_Stop = 7;
private static final int Upper_Computer_TakenOver = 8;
private static final int Sbus_Not_Online = 9;
private static final int Android_Down = 10;
private static final int Cruise_Ahead = 11;
private static final int Cruise_Back = 12;
public static long lastReceiveTime = System.currentTimeMillis(); // 上一次收到数据的时间
public static void midToast(String str, int showTime, com.bingoorobot.foreignobjectcuttingapp.MainActivity MainActivity) {
Toast toast = Toast.makeText(MainActivity, str, showTime);
toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0); //设置显示位置
TextView v = (TextView) toast.getView().findViewById(android.R.id.message);
v.setTextColor(Color.YELLOW); //设置字体颜色
toast.show();
}
public static int thickness = 0;
public static BspIV.IV_struct_define _toReceiveIV_Temp = BspIV.IV_struct_define.newBuilder().build();
;
public static BspIV.IV_struct_define _toReceiveIV = BspIV.IV_struct_define.newBuilder().build();
;
public static void HandleFilmDepthData(com.bingoorobot.foreignobjectcuttingapp.MainActivity MainActivity, byte[] data) {
try {
byte[] crcbytes = new byte[data.length - 2];
System.arraycopy(data, 0, crcbytes, 0, data.length - 2);
byte[] crc = ModbusCRC.calculateCRC(crcbytes);
if (data[data.length - 2] != (byte) (crc[0] & 0xff)) return;
if (data[data.length - 1] != (byte) (crc[1] & 0xff)) return; //crc校验
if ((data[0] != 0x55) && (data[1] != 0x55)) return;//开头结尾为0x55 表示PV数据
byte[] bytes = new byte[data.length - 4];
System.arraycopy(data, 2, bytes, 0, data.length - 4);
try {
// 1. 包裹字节数组(从 offset 开始,读取 4 字节)
ByteBuffer buffer = ByteBuffer.wrap(bytes, 0, 4);
// 2. 设置字节序(必须与字节数组的实际字节序一致,否则结果错误)
buffer.order(ByteOrder.LITTLE_ENDIAN);
// 3. 读取 int 值
thickness = buffer.getInt();
} catch (Exception ex) {
}
MainActivity.runOnUiThread(() -> {
});
} catch ( Exception e) {
}
}
private static int last_received_file_index = 0;
public static void HandleIVData(com.bingoorobot.foreignobjectcuttingapp.MainActivity MainActivity, byte[] data) {
try {
byte[] crcbytes = new byte[data.length - 2];
System.arraycopy(data, 0, crcbytes, 0, data.length - 2);
byte[] crc = ModbusCRC.calculateCRC(crcbytes);
//这里的校验和C#的校验正好反了
if (data[data.length - 2] != (byte) (crc[1] & 0xff)) return;
if (data[data.length - 1] != (byte) (crc[0] & 0xff)) return; //crc校验
if ((data[0] != 0x55) && (data[1] != 0x55)) return;//开头结尾为0x55 表示PV数据
byte[] bytes = new byte[data.length - 4];
System.arraycopy(data, 2, bytes, 0, data.length - 4);
try {
_toReceiveIV_Temp = BspIV.IV_struct_define.parseFrom(bytes);
} catch (InvalidProtocolBufferException ex) {
return;
}
if (_toReceiveIV_Temp == null) return;
_toReceiveIV = _toReceiveIV_Temp;
lastReceiveTime = System.currentTimeMillis();//收到数据,更新时间
MainActivity.runOnUiThread(() -> {
MainActivity.mainBinding.tvSpeedFrom32.setText(String.valueOf(_toReceiveIV.getRobotMoveSpeed()));
MainActivity.mainBinding.tvWindSpeedFrom32.setText(String.valueOf(_toReceiveIV.getBlowersPwm()));
MainActivity.mainBinding.tvPressureFrom32.setText(String.format("%.1f", _toReceiveIV.getForceValue()));
MainActivity.mainBinding.tvAngleFrom32.setText(String.format("%.1f", _toReceiveIV.getCurrentAngle() / 100.00));
MainActivity.mainBinding.tvOrientationFrom32.setText(String.format("%.1f", _toReceiveIV.getCurrentDirection() / 100.00));
MainActivity.mainBinding.tvAltitudeFrom32.setText(String.valueOf(_toReceiveIV.getCurrentHeight()));
// // 只有网线通讯,此处不可用,改为时间判断
// if(0 == _toReceiveIV.getSBUSState())
// {
// MainActivity.mainBinding.tvSignal.setText("断开");
// }else if(1 ==_toReceiveIV.getSBUSState())
// {
// MainActivity.mainBinding.tvSignal.setText("已连接");
// }
int errorInt = _toReceiveIV.getSystemError();//硬件错误
String errorString2 = ErrorDeocde(errorInt);
String errorString = " # " + unsignedIntToBinaryWithSeparator(errorInt);
errorString += " " + toHex4Digits(_toReceiveIV.getLeftMotorErr());
errorString += " " + toHex4Digits(_toReceiveIV.getRightMotorErr());
if(0 != errorInt || 0 != _toReceiveIV.getLeftMotorErr() || 0 != _toReceiveIV.getRightMotorErr()){
if(!Objects.equals(errorLast,errorString)){
ErrorModel em = new ErrorModel(System.currentTimeMillis(),errorString);
}
}
});
} catch (Exception e) {
}
}
public static void HandleCHData(com.bingoorobot.foreignobjectcuttingapp.MainActivity MainActivity, int[] decodedCH) {
try {
MainActivity.runOnUiThread(() -> {
});
} catch (Exception e) {
}
}
/*
逐位检查并构建二进制字符串
*/
String unsignedIntToBinary(int value) {
StringBuilder sb = new StringBuilder(32);
for (int i = 7; i >= 0; i--) {
sb.append((value & (1 << i)) == 0 ? '0' : '1');
}
return sb.toString();
}
/*
逐位检查并构建二进制字符串 每4位添加一个分隔符
*/
static String unsignedIntToBinaryWithSeparator(int value) {
StringBuilder sb = new StringBuilder(35);
for (int i = 11; i >= 0; i--) {
sb.append((value & (1 << i)) == 0 ? '0' : '1');
if (i % 4 == 0 && i != 0) {
sb.append(' '); // 每4位添加一个分隔符
}
}
return sb.toString();
}
static String toHex4Digits(int value) {
char[] hexChars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
int low16Bits = value & 0xFFFF;
char[] result = new char[4];
result[0] = hexChars[(low16Bits >> 12) & 0xF];
result[1] = hexChars[(low16Bits >> 8) & 0xF];
result[2] = hexChars[(low16Bits >> 4) & 0xF];
result[3] = hexChars[low16Bits & 0xF];
return new String(result);
}
}

97
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/UDPHelper.java

@ -0,0 +1,97 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.util.logging.Handler;
public class UDPHelper {
private static com.bingoorobot.foreignobjectcuttingapp.MainActivity MainActivity;
private static Thread receiveThread;
private static boolean running = false;
private static DatagramSocket sendSocket;
private static DatagramSocket receiveSocket;
private static Handler handler;// = new Handler(Looper.getMainLooper());
private static String target_ip;
private static int target_port;
private static int listening_port;
public static void Intialize(com.bingoorobot.foreignobjectcuttingapp.MainActivity mainActivity, String targetip, int targetPort, int listentingPort) {
try {
MainActivity = mainActivity;
target_ip = targetip;
target_port = targetPort;
listening_port = listentingPort;
sendSocket = new DatagramSocket(10000);
//sendSocket.setBroadcast(true);
running = true;
receiveSocket = new DatagramSocket(listening_port);
receiveSocket.setBroadcast(true);
running = true;
receiveThread = new Thread(() -> {
byte[] buffer = new byte[1024];
DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
while (running) {
try {
receiveSocket.receive(packet);
byte[] receivedArray = new byte[packet.getLength()];
System.arraycopy( packet.getData(), 0, receivedArray, 0, receivedArray.length);
ReceiivedDataHandler.HandleIVData(MainActivity, receivedArray);
} catch (IOException e) {
if (running) {
}
}
}
});
receiveThread.start();
} catch (IOException e) {
// tvOutput.setText("Socket error: " + e.getMessage());
}
}
public static void SendData(byte[] buffer) {
MainActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
new Thread(() ->
{
DatagramSocket socket = null;
try {
InetAddress address = InetAddress.getByName(target_ip);
DatagramPacket packet = new DatagramPacket(buffer, buffer.length, address, target_port);
sendSocket.send(packet);
} catch (Exception e)
{
}
}).start();
}});
}
public static void Destroy() {
running = false;
if (receiveSocket != null && !receiveSocket.isClosed()) {
receiveSocket.close();
}
if (sendSocket != null && !sendSocket.isClosed()) {
sendSocket.close();
}
}
}

59
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/VideoPlayerHelper.java

@ -0,0 +1,59 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
import cn.nodemedia.NodePlayer;
import cn.nodemedia.NodePlayerView;
import android.graphics.Matrix;
import android.os.Build;
import android.view.TextureView;
public class VideoPlayerHelper {
public static void startVedio(NodePlayerView nodePlayerView, NodePlayer nodePlayer,String address ){
nodePlayerView.setRenderType(NodePlayerView.RenderType.SURFACEVIEW);//设置渲染器类型
nodePlayerView.setUIViewContentMode(NodePlayerView.UIViewContentMode.ScaleToFill);//设置视频画面缩放模式
nodePlayer.setPlayerView(nodePlayerView);//设置播放视图
//设置RTSP流使用的传输协议,支持的模式有:
nodePlayer.setRtspTransport(NodePlayer.RTSP_TRANSPORT_TCP);//设置传输
// nodePlayer.setRtspTransport(NodePlayer.RTSP_TRANSPORT_UDP);//设置UDP传输(花屏)
nodePlayer.setInputUrl(address);// 设置视频流地址
nodePlayer.setVideoEnable(true);//设置视频启用
nodePlayer.setHWEnable(true);// 启用硬件加速
// nodePlayer.setBufferTime(100);//设置缓冲时间
// nodePlayer.setMaxBufferTime(200);//设置最大缓冲时间
nodePlayer.setBufferTime(0);//设置缓冲时间
nodePlayer.setMaxBufferTime(20);//设置最大缓冲时间
nodePlayer.start();
}
/**
* 切换垂直翻转状态(翻转/恢复原始画面)
*/
public static void toggleVerticalFlip(NodePlayerView mNodePlayerView) {
// 1. 获取/重置变换矩阵(基于官方 NodePlayerView 的 View 父类方法)
Matrix transformMatrix = new Matrix();
transformMatrix =mNodePlayerView.getMatrix();
//mNodePlayerView.getTransform(transformMatrix);
transformMatrix.reset();
// 2. 获取 NodePlayerView 中心坐标(锚点),避免翻转后画面偏移
float centerX = mNodePlayerView.getWidth() / 2f;
float centerY = mNodePlayerView.getHeight() / 2f;
// 3. 执行垂直翻转:Y轴缩放为-1(上下镜像),以中心为锚点
transformMatrix.setScale(1, -1, centerX, centerY);
// // 4. 恢复原始画面:重置为单位矩阵(无变换)
// transformMatrix.setScale(1, 1, centerX, centerY);
// 5. 应用变换矩阵到官方 NodePlayerView(核心步骤,立即生效)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
mNodePlayerView.setAnimationMatrix(transformMatrix);
}
// 6. 刷新视图,确保变换无延迟
mNodePlayerView.invalidate();
}
}

25
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/WebViewHelper.java

@ -0,0 +1,25 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class WebViewHelper {
public static void IntializeAndLoadUrl(WebView webView, String Url)
{
// 基础设置
WebSettings webSettings = webView.getSettings();
webSettings.setUseWideViewPort(true); // 支持 viewport meta 标签,对缩放很重要:cite[2]:cite[6]
webSettings.setLoadWithOverviewMode(true); // 初始缩放至屏幕宽:cite[8]
webSettings.setSupportZoom(true); // 支持缩放:cite[2]:cite[3]:cite[6]
webSettings.setBuiltInZoomControls(true); // 启用内置缩放控件:cite[2]:cite[3]:cite[6]
webSettings.setDisplayZoomControls(false); // 隐藏默认缩放控件(可选):cite[2]:cite[6]
// 设置初始缩放比例为 25%
webView.setInitialScale(100); // 这将使网页内容初始缩小显示:cite[2]:cite[6]:cite[7]
//处理链接跳转(在 WebView 内打开)
webView.setWebViewClient(new WebViewClient());
// 加载网页
webView.loadUrl(Url);
}
}

112
app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ttySerialPortHelper.java

@ -0,0 +1,112 @@
package com.bingoorobot.foreignobjectcuttingapp.services;
import android.util.Log;
import com.bingoorobot.foreignobjectcuttingapp.MainActivity;
import com.bingoorobot.foreignobjectcuttingapp.models.BspPV;
import com.bingoorobot.foreignobjectcuttingapp.models.DCmd;
import com.bingoorobot.foreignobjectcuttingapp.models.MspMK32;
import android_serialport_api.SerialPortFinder;
import tp.xmaihh.serialport.SerialHelper;
import tp.xmaihh.serialport.bean.ComBean;
public class ttySerialPortHelper {
public static com.bingoorobot.foreignobjectcuttingapp.MainActivity MainActivity;
private static final String TAG = "ttySerialPortHelper";
public static boolean IsAllDataSendBack = false;
public static boolean IsAReadAllData = false;
public static SerialHelper serialHelper;
private static SerialPortFinder serialPortFinder;
public static DCmd.D_Cmd_struct_define _d_Cmd = DCmd.D_Cmd_struct_define.newBuilder().build();
private static MspMK32.SP_MSP_MK32_Button _mk32Button = MspMK32.SP_MSP_MK32_Button.newBuilder().build();
private static int index_counter = 0;
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 volatile int CH1RYV;
public static void Open() {
try {
serialHelper = new SerialHelper("dev/ttyHS0", 115200)//MK32
{
@Override
protected void onDataReceived(ComBean comBean) {
MainActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
IsAllDataSendBack = true;
index_counter++;
// 更新 UI 的代码
byte[] receivedData = comBean.bRec;
//校验???
if (receivedData[0] != 0x55 || receivedData[1] != 0x66 || receivedData.length != 42) {
return;
}
// ReceiivedDataHandler.HandleIVData(MainActivity,receivedData);
int[] decodedCH = DataExchangeHelper.getdecodedCH(receivedData);
_mk32Button= _mk32Button.toBuilder().
setCH0RYH(decodedCH[0]).
setCH1RYV(decodedCH[1]).
setCH2LYV(decodedCH[2]).
setCH3LYH(decodedCH[3]).
setCH4SA(decodedCH[4]).
setCH5SB(decodedCH[5]).
setCH6SC(decodedCH[6]).
setCH7SD(decodedCH[7]).
setCH8SE(decodedCH[8]).
setCH9SF(decodedCH[9]).
setCH10LD1(decodedCH[10]).
setCH11RD1(decodedCH[11]).
setCH12S1(decodedCH[12]).
setCH13S2(decodedCH[13]).
setCH14LT(decodedCH[14]).
setCH15RT(decodedCH[15]).
setIsOnline(1).
setRxIndex(index_counter).build();
_d_Cmd= _d_Cmd.toBuilder().setToSendPV(com.bingoorobot.foreignobjectcuttingapp.MainActivity._toSendPV).
setMk32CMD(_mk32Button).
build();
UDPHelper.SendData(DataExchangeHelper.getSendD_CMDBytes(ttySerialPortHelper._d_Cmd));//直接转发
CH1RYV = decodedCH[1]; // 卷线电机开关通道,
}
});
}
};
serialHelper.open();
} catch (Exception exception) {
Log.d(TAG, "Data Received");
}
}
private static int index = 0;
public static void SendData(byte[] data) {
if (serialHelper != null && serialHelper.isOpen()) { // 先判断串口是否打开
serialHelper.send(data); // 发送byte[]
}
}
//55 66 01 01 00 00 00 42 06 31 80
public static byte[] getAllChData_4Hz = new byte[]{0x55, 0x66, 0x01, 0x01, 0x00, 0x00, 0x00, 0x42, 0x02, (byte) (0xB5 & 0xff), (byte) (0xC0 & 0xff)};
public static byte[] getAllChData_5Hz = new byte[]{0x55, 0x66, 0x01, 0x01, 0x00, 0x00, 0x00, 0x42, 0x03, (byte) (0x94 & 0xff), (byte) (0xD0 & 0xff)};
public static byte[] getAllChData_10Hz = new byte[]{0x55, 0x66, 0x01, 0x01, 0x00, 0x00, 0x00, 0x42, 0x04, (byte) (0x73 & 0xff), (byte) (0xA0 & 0xff)};
public static byte[] getAllChData_20Hz = new byte[]{0x55, 0x66, 0x01, 0x01, 0x00, 0x00, 0x00, 0x42, 0x05, (byte) (0x52 & 0xff), (byte) (0xb0 & 0xff)};
public static byte[] getAllChData_50Hz = new byte[]{0x55, 0x66, 0x01, 0x01, 0x00, 0x00, 0x00, 0x42, 0x06, (byte) (0x31 & 0xff), (byte) (0x80 & 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[]
}
public static void onDestroy() {
serialHelper.close();
}
}

1
app/src/main/java/generate_Csharp.bat

@ -0,0 +1 @@
protoc --csharp_out=. *.proto

1
app/src/main/java/generate_java.bat

@ -0,0 +1 @@
protoc --java_out . *.proto

25
app/src/main/java/msp_MK32.proto

@ -0,0 +1,25 @@
syntax = "proto3";
option java_multiple_files = false;
option java_package = "com.bingoorobot.foreignobjectcuttingapp.models";
message SP_MSP_MK32_Button {
int32 RxIndex= 1;
int32 CH0_RY_H= 2;
int32 CH1_RY_V= 3;
int32 CH2_LY_V= 4;
int32 CH3_LY_H= 5;
int32 CH4_SA= 6;
int32 CH5_SB= 7;
int32 CH6_SC= 8;
int32 CH7_SD= 9;
int32 CH8_SE= 10;
int32 CH9_SF= 11;
int32 CH10_LD1= 12;
int32 CH11_RD1= 13;
int32 CH12_S1= 14;
int32 CH13_S2= 15;
int32 CH14_LT= 16;
int32 CH15_RT= 17;
int32 IsOnline= 18;
}

BIN
app/src/main/java/protoc.exe

Binary file not shown.

25
app/src/main/res/drawable/background.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<!-- <solid android:color="@color/gainsboro" />-->
<solid android:color="#f2f3f4" />
<!-- 设置一个黑色边框 -->
<!-- <stroke-->
<!-- android:width="4px"-->
<!-- android:color="@color/deepskyblue" />-->
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

BIN
app/src/main/res/drawable/bgr.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
app/src/main/res/drawable/bigackground.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

25
app/src/main/res/drawable/blue_rounded_rectangle.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<!-- <solid android:color="@color/white" />-->
<solid android:color="#d6eaf8" />
<!-- 设置一个黑色边框 -->
<!-- <stroke-->
<!-- android:width="4px"-->
<!-- android:color="@color/deepskyblue" />-->
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="12dp"
android:bottomRightRadius="12dp"
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

10
app/src/main/res/drawable/border.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 设置一个黑色边框 -->
<stroke android:width="4px" android:color="#ffffff"/>
<!-- 渐变 -->
<!-- 设置一下边距,让空间大一点 -->
</shape>

24
app/src/main/res/drawable/borderblue.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<!-- <solid android:color="#87CEEB" />-->
<!-- 设置一个黑色边框 -->
<stroke
android:width="4px"
android:color="#000000" />
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="10px"
android:bottomRightRadius="10px"
android:topLeftRadius="10px"
android:topRightRadius="10px" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

24
app/src/main/res/drawable/borderbluegreen.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<solid android:color="#d6eaf8" />
<!-- 设置一个黑色边框 -->
<stroke
android:width="2px"
android:color="@color/blue_green" />
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="10px"
android:bottomRightRadius="10px"
android:topLeftRadius="10px"
android:topRightRadius="10px" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

24
app/src/main/res/drawable/bordergreen.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<!-- <solid android:color="#87CEEB" />-->
<!-- 设置一个黑色边框 -->
<stroke
android:width="4px"
android:color="#6efe00" />
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="10px"
android:bottomRightRadius="10px"
android:topLeftRadius="10px"
android:topRightRadius="10px" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

31
app/src/main/res/drawable/borderlog.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<!-- <solid android:color="##deebf7" />-->
<solid android:color="@color/white" />
<!-- 设置一个黑色边框 -->
<stroke
android:width="4px"
android:color="@color/grey" />
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
<!-- <corners-->
<!-- android:bottomLeftRadius="10px"-->
<!-- android:bottomRightRadius="10px"-->
<!-- android:topLeftRadius="10px"-->
<!-- android:topRightRadius="10px" />-->
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

24
app/src/main/res/drawable/borderorange.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<solid android:color="#f6ddcc" />
<!-- 设置一个黑色边框 -->
<stroke
android:width="2dp"
android:color="#ed7041" />
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="10px"
android:bottomRightRadius="10px"
android:topLeftRadius="10px"
android:topRightRadius="10px" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

24
app/src/main/res/drawable/borderwhite.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<!-- <solid android:color="#87CEEB" />-->
<!-- 设置一个黑色边框 -->
<stroke
android:width="2px"
android:color="#ffffff" />
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="10px"
android:bottomRightRadius="10px"
android:topLeftRadius="10px"
android:topRightRadius="10px" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

24
app/src/main/res/drawable/buttonborderwhite.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<solid android:color="#00ffffff" />
<!-- 设置一个黑色边框 -->
<stroke
android:width="16px"
android:color="#ffffff" />
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="10px"
android:bottomRightRadius="10px"
android:topLeftRadius="10px"
android:topRightRadius="10px" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

14
app/src/main/res/drawable/dash_line.xml

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line">
<stroke
android:color="#ffffff"
android:dashWidth="10dp"
/>
<!--width:线条的高度
color:颜色
android:dashGap="8dp"
dashWidth:破折线的宽度
dashGap:破折线间空隙的宽度
如果这里设置了width,xml中android:layout_height的值必须比它大。不设置就默认为0
-->
</shape>

13
app/src/main/res/drawable/divider.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:centerColor="#ff00ff00"
android:endColor="#ff0000ff"
android:startColor="#ffff0000"
android:type="linear" />
<size android:height="4dp"/>
</shape>

170
app/src/main/res/drawable/ic_launcher_background.xml

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

30
app/src/main/res/drawable/ic_launcher_foreground.xml

@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

25
app/src/main/res/drawable/orange_rounded_rectangle.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<!-- <solid android:color="@color/white" />-->
<solid android:color="#FBD6D6" />
<!-- 设置一个黑色边框 -->
<!-- <stroke-->
<!-- android:width="4px"-->
<!-- android:color="@color/deepskyblue" />-->
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="12dp"
android:bottomRightRadius="12dp"
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

15
app/src/main/res/drawable/radio_button_selected.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<!-- 设置一个黑色边框 -->
<stroke android:width="4px"
android:color="#d6eaf8"/>
<solid android:color="#d6eaf8" />
<corners android:radius="10dp" />
<!-- 渐变 -->
<!-- 设置一下边距,让空间大一点 -->
</shape>

8
app/src/main/res/drawable/radio_button_textcolor.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/grey"
android:state_checked="false" />
<item android:color="@color/blue_green"
android:state_checked="true" />
</selector>

8
app/src/main/res/drawable/radio_button_unselected.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充 -->
<solid android:color="#eaeded" />
<!-- 圆角 -->
<corners android:radius="10dp" />
</shape>

5
app/src/main/res/drawable/radiobutton_background.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:drawable="@drawable/radio_button_selected" />
<item android:state_checked="false" android:drawable="@drawable/radio_button_unselected" />
</selector>

28
app/src/main/res/drawable/rounded_edittext.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置Editext的形状-->
<!-- 设置透明背景色 -->
<!-- <solid android:color="#87CEEB" />-->
<!-- 设置一个自定义颜色边框 -->
<stroke
android:width="1px"
android:color="@color/trasnparent" />
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="10px"
android:bottomRightRadius="10px"
android:topLeftRadius="10px"
android:topRightRadius="10px" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

BIN
app/src/main/res/drawable/smallbackground.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
app/src/main/res/drawable/squrelogo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

24
app/src/main/res/drawable/submenu.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 设置透明背景色 -->
<solid android:color="@color/white" />
<!-- <solid android:color="#d6eaf8" />-->
<!-- 设置一个黑色边框 -->
<stroke
android:width="2px"
android:color="@color/deepskyblue" />
<!-- 设置四个圆角的半径 -->
<corners
android:bottomLeftRadius="2dp"
android:bottomRightRadius="2dp"
android:topLeftRadius="2dp"
android:topRightRadius="2dp" />
<!-- 设置一下边距,让空间大一点 -->
<!-- <padding-->
<!-- android:bottom="5dp"-->
<!-- android:left="5dp"-->
<!-- android:right="5dp"-->
<!-- android:top="5dp" />-->
</shape>

BIN
app/src/main/res/font/font_you_yuan.ttf

Binary file not shown.

714
app/src/main/res/layout/activity_main.xml

@ -0,0 +1,714 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp"
android:background="@drawable/background"
android:orientation="vertical">
<!-- 顶部界面标题-->
<TextView
android:layout_width="match_parent"
android:layout_height="25dp"
android:gravity="center"
android:text="@string/app_name"
android:textSize="15sp"
android:textColor="@color/blue_green"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="2dp">
<!--video0-->
<LinearLayout
android:id="@+id/videoPage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:visibility="invisible">
<LinearLayout
android:id="@+id/LinearLayoutPlayerView0"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<cn.nodemedia.NodePlayerView
android:id="@+id/nodePlayerView0"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:background="@color/trasnparent"
android:id="@+id/buttonPlayerView0"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</cn.nodemedia.NodePlayerView>
</LinearLayout>
<LinearLayout
android:id="@+id/LinearLayoutPlayerView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<cn.nodemedia.NodePlayerView
android:id="@+id/nodePlayerView1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:background="@color/trasnparent"
android:id="@+id/buttonPlayerView1"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</cn.nodemedia.NodePlayerView>
</LinearLayout>
</LinearLayout>
<!--控制界面-->
<LinearLayout
android:id="@+id/controlPage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="2dp"
android:visibility="visible"
android:orientation="horizontal">
<!--左侧显示半框-->
<LinearLayout
android:id="@+id/leftPanel"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="15dp"
android:orientation="vertical"
android:layout_weight="1"
android:background="@drawable/orange_rounded_rectangle"
>
<LinearLayout
android:id="@+id/statePanel"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:layout_weight="1.2"
android:gravity="left|center"
android:text="@string/信号状态"
android:textColor="@color/black"
android:textSize="15sp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan" />
<TextView
android:id="@+id/tv_signal"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="xxx"
android:textColor="@color/navy_blue"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:layout_width="35dp"
android:layout_height="match_parent"
android:gravity="center"
android:text=""
android:textColor="@color/dark_ink_blue"
android:textSize="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1.2"
android:gravity="left|center"
android:text="@string/currentSpeed"
android:layout_marginLeft="8dp"
android:textColor="@color/black"
android:textSize="15sp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan" />
<TextView
android:id="@+id/tvSpeedFrom32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="xxx"
android:textColor="@color/navy_blue"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="35dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="m/min
"
android:textColor="@color/dark_ink_blue"
android:textSize="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1.2"
android:gravity="left|center"
android:text="@string/windSpeed"
android:layout_marginLeft="8dp"
android:textColor="@color/black"
android:textSize="15sp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan" />
<TextView
android:id="@+id/tvWindSpeedFrom32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="xxx"
android:textColor="@color/navy_blue"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="35dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="PWM"
android:textColor="@color/dark_ink_blue"
android:textSize="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1.2"
android:gravity="left|center"
android:text="@string/currentPressure"
android:layout_marginLeft="8dp"
android:textColor="@color/black"
android:textSize="15sp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan" />
<TextView
android:id="@+id/tvPressureFrom32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="xxx"
android:textColor="@color/navy_blue"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="35dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="Kpa"
android:textColor="@color/dark_ink_blue"
android:textSize="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1.2"
android:gravity="left|center"
android:layout_marginLeft="8dp"
android:text="@string/currentAngle"
android:textColor="@color/black"
android:textSize="15sp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan" />
<TextView
android:id="@+id/tvAngleFrom32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="xxx"
android:textColor="@color/navy_blue"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="35dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="°"
android:textColor="@color/dark_ink_blue"
android:textSize="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1.2"
android:gravity="left|center"
android:text="@string/currentOrientation"
android:textColor="@color/black"
android:textSize="15sp"
android:layout_marginLeft="8dp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan" />
<TextView
android:id="@+id/tvOrientationFrom32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="xxx"
android:textColor="@color/navy_blue"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="35dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="°"
android:textColor="@color/dark_ink_blue"
android:textSize="10dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="10dp"
>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1.2"
android:gravity="left|center"
android:text="@string/currentAltitude"
android:textColor="@color/black"
android:textSize="15sp"
android:layout_marginLeft="8dp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan" />
<TextView
android:id="@+id/tvAltitudeFrom32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="xxx"
android:textColor="@color/navy_blue"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="35dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="cm"
android:textColor="@color/dark_ink_blue"
android:textSize="10dp" />
</LinearLayout>
</LinearLayout>
<!--右侧显示半框-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:orientation="vertical"
android:layout_weight="2">
<!-- 第一行,2个帧布局-->
<LinearLayout
android:layout_width="match_parent"
android:layout_marginBottom="7dp"
android:layout_height="0dp"
android:layout_weight="1">
<!-- 第一行,第1个帧布局-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginRight="7dp"
android:layout_weight="1"
android:background="@drawable/blue_rounded_rectangle">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:layout_marginLeft="7dp"
android:gravity="left|center"
android:text="@string/ManualMode"
android:textColor="@color/dark_ink_blue"
android:textSize="15sp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan"/>
<TextView
android:id="@+id/manualModeDisplay"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="手动"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center"
android:text=""
android:textColor="@color/blue_green"
android:textSize="15dp" />
</LinearLayout>
<Button
android:id="@+id/setManualModeBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
<!-- 第一行,第2个帧布局-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginRight="7dp"
android:layout_weight="1"
android:background="@drawable/blue_rounded_rectangle">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="left|center"
android:text="自动\n模式"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/autoModeDisplay"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="未启用"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:gravity="center"
android:text=""
android:textColor="@color/blue_green"
android:textSize="20dp" />
</LinearLayout>
<Button
android:id="@+id/setAutoWorkModeBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
</LinearLayout>
<!-- 第二行,2个帧布局-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="7dp"
android:layout_weight="1">
<!-- 第2行,第1个帧布局-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginRight="7dp"
android:layout_weight="1"
android:background="@drawable/blue_rounded_rectangle">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:layout_marginLeft="7dp"
android:gravity="left|center"
android:text="换道\n距离"
android:textColor="@color/dark_ink_blue"
android:textSize="15sp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan" />
<EditText
android:id="@+id/Maintv_LaneChangeDistanceTo32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:background="@drawable/rounded_edittext"
android:imeOptions="actionDone"
android:hint="请输入1到200之间的数字"
android:inputType="number"
android:gravity="center"
android:text="10"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="cm"
android:textColor="@color/blue_green"
android:textSize="15dp" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
<!-- 第三行,2个帧布局-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="7dp"
android:layout_weight="1">
<!-- 第5行,第1个帧布局-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginRight="7dp"
android:layout_weight="1"
android:background="@drawable/blue_rounded_rectangle">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:layout_marginLeft="7dp"
android:gravity="left|center"
android:text="竖直\n微调"
android:textColor="@color/dark_ink_blue"
android:textSize="15sp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan" />
<!-- android:imeOptions="actionDone" 不会切换下一个文本输入 -->
<EditText
android:id="@+id/Maintv_VerticalAdjustTo32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="4"
android:background="@drawable/rounded_edittext"
android:imeOptions="actionDone"
android:hint="请输入-10到10之间的数字"
android:inputType="numberSigned|numberDecimal"
android:digits="-0123456789."
android:gravity="center"
android:text="0.0"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="°"
android:textColor="@color/blue_green"
android:textSize="15dp" />
</LinearLayout>
</FrameLayout>
<!-- 第一行,第2个帧布局-->
</LinearLayout>
<!-- 第四行,2个帧布局-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@drawable/blue_rounded_rectangle">
>
<LinearLayout
android:id="@+id/errorBackgroundRough"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal"
>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:layout_marginLeft="7dp"
android:gravity="left|center"
android:text="报错\n信息"
android:textColor="@color/black"
android:textSize="15sp"
android:textStyle="bold"
android:fontFamily="@font/font_you_yuan" />
<TextView
android:id="@+id/mainViewErrMessageTxViewRough"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:gravity="center"
android:text="无"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text=" "
android:textColor="@color/blue_green"
android:textSize="15dp" />
</LinearLayout>
<Button
android:id="@+id/mainViewErrMessageBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="0dp"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<!--底层进行页面切换-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_margin="0dp"
android:alpha="1"
android:background="@drawable/background"
android:gravity="bottom"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|bottom"
android:layout_marginTop="0dp"
android:gravity="center"
android:orientation="horizontal">
<RadioGroup
android:id="@+id/page_select_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<RadioButton
android:visibility="visible"
android:id="@+id/rb_video"
style="@style/CustomRadioButtonStyle"
android:checked="true"
android:text="视频"/>
<RadioButton
android:id="@+id/rb_control"
style="@style/CustomRadioButtonStyle"
android:text="控制" />
</RadioGroup>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</layout>

214
app/src/main/res/layout/automodepopup.xml

@ -0,0 +1,214 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="500dp"
android:layout_height="360dp"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:letterSpacing="0.5"
android:text="自动模式"
android:textColor="@color/dark_ink_blue"
android:textSize="30sp"
android:textStyle="bold">
</TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:gravity="center"
android:layout_margin="20dp"
android:orientation="horizontal">
<RadioGroup
android:id="@+id/autoModeSelectorGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<!-- <RadioButton-->
<!-- android:id="@+id/rb_five"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_marginRight="20dp"-->
<!-- android:layout_weight="1"-->
<!-- android:background="@drawable/radiobutton_background"-->
<!-- android:button="@null"-->
<!-- android:gravity="center"-->
<!-- android:padding="10dp"-->
<!-- android:text="竖直向左"-->
<!-- android:textColor="@drawable/radio_button_textcolor"-->
<!-- android:textSize="40sp"-->
<!-- android:textStyle="bold" />-->
<!-- <RadioButton-->
<!-- android:id="@+id/rb_six"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_weight="1"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@drawable/radiobutton_background"-->
<!-- android:button="@null"-->
<!-- android:textColor="@drawable/radio_button_textcolor"-->
<!-- android:gravity="center"-->
<!-- android:textStyle="bold"-->
<!-- android:padding="10dp"-->
<!-- android:textSize="40sp"-->
<!-- android:text="竖直向右" />-->
</RadioGroup>
</LinearLayout>
<!--长度宽度-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="horizontal"
android:layout_gravity="center"
android:gravity="center"
android:layout_margin="20dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/borderblue"
android:layout_marginRight="20dp"
>
<TextView
android:layout_width="80dp"
android:layout_height="match_parent"
android:text="储罐\n高度"
android:gravity="left|center"
android:layout_gravity="center"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="@color/black"
android:paddingLeft="20dp"
/>
<EditText
android:id="@+id/height_input"
android:inputType="numberDecimal"
android:background="@null"
android:layout_width="100dp"
android:textColor="@color/blue_green"
android:gravity="right|center"
android:layout_height="match_parent"
android:text="50"
android:textSize="40sp">
</EditText>
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="m"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/borderblue"
>
<TextView
android:layout_width="80dp"
android:layout_height="match_parent"
android:text="储罐\n半径"
android:gravity="left|center"
android:layout_gravity="center"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="@color/black"
android:paddingLeft="20dp"
/>
<EditText
android:id="@+id/radius_input"
android:inputType="numberDecimal"
android:background="@null"
android:layout_width="100dp"
android:textColor="@color/blue_green"
android:gravity="right|center"
android:layout_height="match_parent"
android:text="50"
android:textSize="40sp">
</EditText>
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="m"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<!--第三行 确定取消-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="20dp"
android:gravity="center"
android:background="@drawable/borderbluegreen">
<Button
android:id="@+id/autoModeApply"
android:layout_width="200dp"
android:layout_height="match_parent"
android:gravity="center"
android:background="@color/trasnparent"
android:text="确定"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:background="@drawable/borderorange">
<Button
android:id="@+id/autoModeCancel"
android:layout_width="200dp"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:text="取消"
android:textColor="#ed7041"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>

26
app/src/main/res/layout/log_item.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="450dp"
android:layout_height="350dp"
android:layout_gravity="center"
android:background="@drawable/submenu"
android:orientation="vertical">
<com.bingoorobot.foreignobjectcuttingapp.models.ScrollBottomScrollView
android:id="@+id/popUpErrorLogScrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:background="@drawable/borderlog">
<TextView
android:id="@+id/popUpErrorLogTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:scrollbars="vertical"
android:scrollbarStyle="insideInset"
android:textSize="12sp"
android:textColor="@color/midnightblue" />
</com.bingoorobot.foreignobjectcuttingapp.models.ScrollBottomScrollView>
</LinearLayout>

143
app/src/main/res/layout/manualmodepopup.xml

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="500dp"
android:layout_height="360dp"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="25dp"
android:letterSpacing="0.5"
android:text="作业模式"
android:textColor="@color/dark_ink_blue"
android:textSize="40sp"
android:textStyle="bold">
</TextView>
<!--第一行 模式选择-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:gravity="center"
android:orientation="horizontal">
<RadioGroup
android:id="@+id/manualModeSelectorGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rb_one"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:gravity="center"
android:button="@null"
android:layout_marginRight="15dp"
android:background="@drawable/radiobutton_background"
android:textColor="@drawable/radio_button_textcolor"
android:textStyle="bold"
android:checked="true"
android:padding="10dp"
android:textSize="40sp"
android:text="手动" />
<RadioButton
android:id="@+id/rb_two"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:button="@null"
android:layout_marginRight="10dp"
android:background="@drawable/radiobutton_background"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:padding="10dp"
android:textSize="40sp"
android:text="竖直" />
<RadioButton
android:id="@+id/rb_three"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:button="@null"
android:layout_marginRight="10dp"
android:background="@drawable/radiobutton_background"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:padding="10dp"
android:textSize="40sp"
android:text="水平" /> <!-- \n向右-->
</RadioGroup>
</LinearLayout>
<!--第二行 确认取消-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="40dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="20dp"
android:gravity="center"
android:background="@drawable/borderbluegreen">
<Button
android:id="@+id/manualModeApply"
android:layout_width="200dp"
android:layout_height="match_parent"
android:gravity="center"
android:background="@color/trasnparent"
android:text="确定"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:background="@drawable/borderorange">
<Button
android:id="@+id/manualModeCancel"
android:layout_width="200dp"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:text="取消"
android:textColor="#ed7041"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>

6
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

6
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save