commit b47835060ce219d2e2496d580821fceb7603fc90 Author: SHIYUSHENG\10431 <1043108841@qq.com> Date: Thu Sep 17 09:09:12 2026 +0800 负压,安卓APP,V1.2 diff --git a/.gradle/8.2/checksums/checksums.lock b/.gradle/8.2/checksums/checksums.lock new file mode 100644 index 0000000..0c452d3 Binary files /dev/null and b/.gradle/8.2/checksums/checksums.lock differ diff --git a/.gradle/8.2/checksums/sha1-checksums.bin b/.gradle/8.2/checksums/sha1-checksums.bin new file mode 100644 index 0000000..7b9b102 Binary files /dev/null and b/.gradle/8.2/checksums/sha1-checksums.bin differ diff --git a/.gradle/8.2/dependencies-accessors/dependencies-accessors.lock b/.gradle/8.2/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 0000000..5033910 Binary files /dev/null and b/.gradle/8.2/dependencies-accessors/dependencies-accessors.lock differ diff --git a/.gradle/8.2/dependencies-accessors/gc.properties b/.gradle/8.2/dependencies-accessors/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/8.2/executionHistory/executionHistory.bin b/.gradle/8.2/executionHistory/executionHistory.bin new file mode 100644 index 0000000..479491a Binary files /dev/null and b/.gradle/8.2/executionHistory/executionHistory.bin differ diff --git a/.gradle/8.2/executionHistory/executionHistory.lock b/.gradle/8.2/executionHistory/executionHistory.lock new file mode 100644 index 0000000..c975dac Binary files /dev/null and b/.gradle/8.2/executionHistory/executionHistory.lock differ diff --git a/.gradle/8.2/fileChanges/last-build.bin b/.gradle/8.2/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/8.2/fileChanges/last-build.bin differ diff --git a/.gradle/8.2/fileHashes/fileHashes.bin b/.gradle/8.2/fileHashes/fileHashes.bin new file mode 100644 index 0000000..d9325b2 Binary files /dev/null and b/.gradle/8.2/fileHashes/fileHashes.bin differ diff --git a/.gradle/8.2/fileHashes/fileHashes.lock b/.gradle/8.2/fileHashes/fileHashes.lock new file mode 100644 index 0000000..1207ccc Binary files /dev/null and b/.gradle/8.2/fileHashes/fileHashes.lock differ diff --git a/.gradle/8.2/fileHashes/resourceHashesCache.bin b/.gradle/8.2/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..016b576 Binary files /dev/null and b/.gradle/8.2/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/8.2/gc.properties b/.gradle/8.2/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..c0a74c2 Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..9c33458 --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Wed May 27 16:58:48 CST 2026 +gradle.version=8.2 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..1795d0c Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/config.properties b/.gradle/config.properties new file mode 100644 index 0000000..a9f64fd --- /dev/null +++ b/.gradle/config.properties @@ -0,0 +1,2 @@ +#Wed May 27 16:58:07 CST 2026 +java.home=D\:\\Program Files\\Android\\Android Studio\\jbr diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe new file mode 100644 index 0000000..35d928d Binary files /dev/null and b/.gradle/file-system.probe differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/ThicknessApp.iml b/.idea/ThicknessApp.iml new file mode 100644 index 0000000..2454cf4 --- /dev/null +++ b/.idea/ThicknessApp.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml new file mode 100644 index 0000000..4d3d6d9 --- /dev/null +++ b/.idea/caches/deviceStreaming.xml @@ -0,0 +1,2289 @@ + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..0c0c338 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..6643db3 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/deviceManager.xml b/.idea/deviceManager.xml new file mode 100644 index 0000000..91f9558 --- /dev/null +++ b/.idea/deviceManager.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..7b3006b --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b2c751a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..b56737b --- /dev/null +++ b/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' //经典加载 + +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/bingoorobot/foreignobjectcuttingapp/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/bingoorobot/foreignobjectcuttingapp/ExampleInstrumentedTest.java new file mode 100644 index 0000000..87820d7 --- /dev/null +++ b/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 Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.bingoorobot.foreignobjectcuttingapp", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..10d35e4 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/BspIV.cs b/app/src/main/java/BspIV.cs new file mode 100644 index 0000000..0d4170a --- /dev/null +++ b/app/src/main/java/BspIV.cs @@ -0,0 +1,464 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bsp_IV.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +/// Holder for reflection information generated from bsp_IV.proto +public static partial class BspIVReflection { + + #region Descriptor + /// File descriptor for bsp_IV.proto + 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 +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IV_struct_define()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::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); + } + + /// Field number for the "Tempature" field. + 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; + } + } + + /// Field number for the "RunMode" field. + 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; + } + } + + /// Field number for the "LeftCompensation" field. + 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; + } + } + + /// Field number for the "RightCompensation" field. + 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; + } + } + + /// Field number for the "CurrentAngle" field. + 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; + } + } + + /// Field number for the "RobotMoveSpeed" field. + 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; + } + } + + /// Field number for the "EndPressure" field. + 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 diff --git a/app/src/main/java/BspPV.cs b/app/src/main/java/BspPV.cs new file mode 100644 index 0000000..7ea1a4a --- /dev/null +++ b/app/src/main/java/BspPV.cs @@ -0,0 +1,801 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: bsp_PV.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +/// Holder for reflection information generated from bsp_PV.proto +public static partial class BspPVReflection { + + #region Descriptor + /// File descriptor for bsp_PV.proto + 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 +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PV_struct_define()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::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); + } + + /// Field number for the "CH0" field. + public const int CH0FieldNumber = 1; + private int cH0_; + /// + ///水冷壁 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CH0 { + get { return cH0_; } + set { + cH0_ = value; + } + } + + /// Field number for the "CH1" field. + 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; + } + } + + /// Field number for the "CH2" field. + 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; + } + } + + /// Field number for the "CH3" field. + 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; + } + } + + /// Field number for the "CH4" field. + 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; + } + } + + /// Field number for the "CH5" field. + 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; + } + } + + /// Field number for the "CH6" field. + 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; + } + } + + /// Field number for the "CH7" field. + 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; + } + } + + /// Field number for the "CH8" field. + 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; + } + } + + /// Field number for the "CH9" field. + 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; + } + } + + /// Field number for the "CH10" field. + 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; + } + } + + /// Field number for the "CH11" field. + 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; + } + } + + /// Field number for the "CH12" field. + 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; + } + } + + /// Field number for the "CH13" field. + 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; + } + } + + /// Field number for the "CH14" field. + 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; + } + } + + /// Field number for the "CH15" field. + 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 diff --git a/app/src/main/java/D_Cmd.proto b/app/src/main/java/D_Cmd.proto new file mode 100644 index 0000000..a450903 --- /dev/null +++ b/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; + } + diff --git a/app/src/main/java/bsp_Error.proto b/app/src/main/java/bsp_Error.proto new file mode 100644 index 0000000..f643a8c --- /dev/null +++ b/app/src/main/java/bsp_Error.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +option java_multiple_files = false; +option java_package = "com.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 + + + diff --git a/app/src/main/java/bsp_IV.proto b/app/src/main/java/bsp_IV.proto new file mode 100644 index 0000000..a4268a0 --- /dev/null +++ b/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 +}; diff --git a/app/src/main/java/bsp_PV.proto b/app/src/main/java/bsp_PV.proto new file mode 100644 index 0000000..6d8aeb0 --- /dev/null +++ b/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 + }; diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/MainActivity.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/MainActivity.java new file mode 100644 index 0000000..6f708c9 --- /dev/null +++ b/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(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspError.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspError.java new file mode 100644 index 0000000..b89d079 --- /dev/null +++ b/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 { + /** + * MK32_SBus = 0; + */ + MK32_SBus(0), + /** + * TL720D = 1; + */ + TL720D(1), + /** + * LS_LeftMotor = 2; + */ + LS_LeftMotor(2), + /** + * LS_RightMotor = 3; + */ + LS_RightMotor(3), + /** + * Remote_Button_Reset_State = 4; + */ + Remote_Button_Reset_State(4), + /** + *
+     * Ubuntu slam
+     * 
+ * + * upper_Computer = 5; + */ + upper_Computer(5), + /** + *
+     * 电子罗盘
+     * 
+ * + * DDM360B = 6; + */ + DDM360B(6), + /** + *
+     * 压强传感器
+     * 
+ * + * K1061DC = 7; + */ + K1061DC(7), + /** + *
+     * 拉线传感器
+     * 
+ * + * wire_sensor = 8; + */ + wire_sensor(8), + /** + *
+     * 卷线电机
+     * 
+ * + * wire_motor = 9; + */ + 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()); + } + /** + * MK32_SBus = 0; + */ + public static final int MK32_SBus_VALUE = 0; + /** + * TL720D = 1; + */ + public static final int TL720D_VALUE = 1; + /** + * LS_LeftMotor = 2; + */ + public static final int LS_LeftMotor_VALUE = 2; + /** + * LS_RightMotor = 3; + */ + public static final int LS_RightMotor_VALUE = 3; + /** + * Remote_Button_Reset_State = 4; + */ + public static final int Remote_Button_Reset_State_VALUE = 4; + /** + *
+     * Ubuntu slam
+     * 
+ * + * upper_Computer = 5; + */ + public static final int upper_Computer_VALUE = 5; + /** + *
+     * 电子罗盘
+     * 
+ * + * DDM360B = 6; + */ + public static final int DDM360B_VALUE = 6; + /** + *
+     * 压强传感器
+     * 
+ * + * K1061DC = 7; + */ + public static final int K1061DC_VALUE = 7; + /** + *
+     * 拉线传感器
+     * 
+ * + * wire_sensor = 8; + */ + public static final int wire_sensor_VALUE = 8; + /** + *
+     * 卷线电机
+     * 
+ * + * wire_motor = 9; + */ + 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 + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ComError> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ComError findValueByNumber(int number) { + return ComError.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.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 { + + /** + * int32 Com_Error_Code = 1; + * @return The comErrorCode. + */ + int getComErrorCode(); + + /** + * int32 Left_Motor_Error_Code = 2; + * @return The leftMotorErrorCode. + */ + int getLeftMotorErrorCode(); + + /** + * int32 Right_Motor_Error_Code = 3; + * @return The rightMotorErrorCode. + */ + int getRightMotorErrorCode(); + } + /** + * Protobuf type {@code ErrorData} + */ + public static final class ErrorData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:ErrorData) + ErrorDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + ErrorData.class.getName()); + } + // Use ErrorData.newBuilder() to construct. + private ErrorData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private ErrorData() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.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; + /** + * int32 Com_Error_Code = 1; + * @return The comErrorCode. + */ + @java.lang.Override + public int getComErrorCode() { + return comErrorCode_; + } + + public static final int LEFT_MOTOR_ERROR_CODE_FIELD_NUMBER = 2; + private int leftMotorErrorCode_ = 0; + /** + * int32 Left_Motor_Error_Code = 2; + * @return The leftMotorErrorCode. + */ + @java.lang.Override + public int getLeftMotorErrorCode() { + return leftMotorErrorCode_; + } + + public static final int RIGHT_MOTOR_ERROR_CODE_FIELD_NUMBER = 3; + private int rightMotorErrorCode_ = 0; + /** + * int32 Right_Motor_Error_Code = 3; + * @return The rightMotorErrorCode. + */ + @java.lang.Override + public int getRightMotorErrorCode() { + return rightMotorErrorCode_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (comErrorCode_ != 0) { + output.writeInt32(1, comErrorCode_); + } + if (leftMotorErrorCode_ != 0) { + output.writeInt32(2, leftMotorErrorCode_); + } + if (rightMotorErrorCode_ != 0) { + output.writeInt32(3, rightMotorErrorCode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (comErrorCode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, comErrorCode_); + } + if (leftMotorErrorCode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, leftMotorErrorCode_); + } + if (rightMotorErrorCode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, rightMotorErrorCode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.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 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_ ; + /** + * int32 Com_Error_Code = 1; + * @return The comErrorCode. + */ + @java.lang.Override + public int getComErrorCode() { + return comErrorCode_; + } + /** + * int32 Com_Error_Code = 1; + * @param value The comErrorCode to set. + * @return This builder for chaining. + */ + public Builder setComErrorCode(int value) { + + comErrorCode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 Com_Error_Code = 1; + * @return This builder for chaining. + */ + public Builder clearComErrorCode() { + bitField0_ = (bitField0_ & ~0x00000001); + comErrorCode_ = 0; + onChanged(); + return this; + } + + private int leftMotorErrorCode_ ; + /** + * int32 Left_Motor_Error_Code = 2; + * @return The leftMotorErrorCode. + */ + @java.lang.Override + public int getLeftMotorErrorCode() { + return leftMotorErrorCode_; + } + /** + * int32 Left_Motor_Error_Code = 2; + * @param value The leftMotorErrorCode to set. + * @return This builder for chaining. + */ + public Builder setLeftMotorErrorCode(int value) { + + leftMotorErrorCode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 Left_Motor_Error_Code = 2; + * @return This builder for chaining. + */ + public Builder clearLeftMotorErrorCode() { + bitField0_ = (bitField0_ & ~0x00000002); + leftMotorErrorCode_ = 0; + onChanged(); + return this; + } + + private int rightMotorErrorCode_ ; + /** + * int32 Right_Motor_Error_Code = 3; + * @return The rightMotorErrorCode. + */ + @java.lang.Override + public int getRightMotorErrorCode() { + return rightMotorErrorCode_; + } + /** + * int32 Right_Motor_Error_Code = 3; + * @param value The rightMotorErrorCode to set. + * @return This builder for chaining. + */ + public Builder setRightMotorErrorCode(int value) { + + rightMotorErrorCode_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int32 Right_Motor_Error_Code = 3; + * @return This builder for chaining. + */ + public Builder clearRightMotorErrorCode() { + bitField0_ = (bitField0_ & ~0x00000004); + rightMotorErrorCode_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:ErrorData) + } + + // @@protoc_insertion_point(class_scope:ErrorData) + private static final com.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 + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.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) +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspIV.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspIV.java new file mode 100644 index 0000000..3c5544d --- /dev/null +++ b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspIV.java @@ -0,0 +1,1442 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: bsp_IV.proto +// Protobuf Java Version: 4.27.2 + +package com.bingoorobot.foreignobjectcuttingapp.models; + +public final class BspIV { + private BspIV() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + BspIV.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface IV_struct_defineOrBuilder extends + // @@protoc_insertion_point(interface_extends:IV_struct_define) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * 单位0.01°
+     * 
+ * + * int32 CurrentAngle = 1; + * @return The currentAngle. + */ + int getCurrentAngle(); + + /** + *
+     * 单位m/min
+     * 
+ * + * int32 RobotMoveSpeed = 2; + * @return The robotMoveSpeed. + */ + int getRobotMoveSpeed(); + + /** + *
+     * 0断开 1连接
+     * 
+ * + * int32 SBUS_State = 3; + * @return The sBUSState. + */ + int getSBUSState(); + + /** + *
+     * 硬件通讯错误及按键未初始化错误
+     * 
+ * + * int32 SystemError = 4; + * @return The systemError. + */ + int getSystemError(); + + /** + *
+     * 左轮电机报警
+     * 
+ * + * int32 Left_Motor_Err = 5; + * @return The leftMotorErr. + */ + int getLeftMotorErr(); + + /** + *
+     * 右轮电机报警
+     * 
+ * + * int32 Right_Motor_Err = 6; + * @return The rightMotorErr. + */ + int getRightMotorErr(); + + /** + *
+     * 机器人正在执行运动指令
+     * 
+ * + * int32 IsWorking = 7; + * @return The isWorking. + */ + int getIsWorking(); + + /** + *
+     * 风机PWM调速,0-100
+     * 
+ * + * int32 blowers_pwm = 8; + * @return The blowersPwm. + */ + int getBlowersPwm(); + + /** + *
+     * 压强传感器-100~100Kpa
+     * 
+ * + * float ForceValue = 9; + * @return The forceValue. + */ + float getForceValue(); + + /** + *
+     * 电子罗盘,单位0.01°
+     * 
+ * + * int32 CurrentDirection = 10; + * @return The currentDirection. + */ + int getCurrentDirection(); + + /** + *
+     * 拉线传感器,cm
+     * 
+ * + * int32 CurrentHeight = 11; + * @return The currentHeight. + */ + int getCurrentHeight(); + } + /** + * Protobuf type {@code IV_struct_define} + */ + public static final class IV_struct_define extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:IV_struct_define) + IV_struct_defineOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + IV_struct_define.class.getName()); + } + // Use IV_struct_define.newBuilder() to construct. + private IV_struct_define(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private IV_struct_define() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.bingoorobot.foreignobjectcuttingapp.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.bingoorobot.foreignobjectcuttingapp.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define.class, com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define.Builder.class); + } + + public static final int CURRENTANGLE_FIELD_NUMBER = 1; + private int currentAngle_ = 0; + /** + *
+     * 单位0.01°
+     * 
+ * + * int32 CurrentAngle = 1; + * @return The currentAngle. + */ + @java.lang.Override + public int getCurrentAngle() { + return currentAngle_; + } + + public static final int ROBOTMOVESPEED_FIELD_NUMBER = 2; + private int robotMoveSpeed_ = 0; + /** + *
+     * 单位m/min
+     * 
+ * + * int32 RobotMoveSpeed = 2; + * @return The robotMoveSpeed. + */ + @java.lang.Override + public int getRobotMoveSpeed() { + return robotMoveSpeed_; + } + + public static final int SBUS_STATE_FIELD_NUMBER = 3; + private int sBUSState_ = 0; + /** + *
+     * 0断开 1连接
+     * 
+ * + * int32 SBUS_State = 3; + * @return The sBUSState. + */ + @java.lang.Override + public int getSBUSState() { + return sBUSState_; + } + + public static final int SYSTEMERROR_FIELD_NUMBER = 4; + private int systemError_ = 0; + /** + *
+     * 硬件通讯错误及按键未初始化错误
+     * 
+ * + * int32 SystemError = 4; + * @return The systemError. + */ + @java.lang.Override + public int getSystemError() { + return systemError_; + } + + public static final int LEFT_MOTOR_ERR_FIELD_NUMBER = 5; + private int leftMotorErr_ = 0; + /** + *
+     * 左轮电机报警
+     * 
+ * + * int32 Left_Motor_Err = 5; + * @return The leftMotorErr. + */ + @java.lang.Override + public int getLeftMotorErr() { + return leftMotorErr_; + } + + public static final int RIGHT_MOTOR_ERR_FIELD_NUMBER = 6; + private int rightMotorErr_ = 0; + /** + *
+     * 右轮电机报警
+     * 
+ * + * int32 Right_Motor_Err = 6; + * @return The rightMotorErr. + */ + @java.lang.Override + public int getRightMotorErr() { + return rightMotorErr_; + } + + public static final int ISWORKING_FIELD_NUMBER = 7; + private int isWorking_ = 0; + /** + *
+     * 机器人正在执行运动指令
+     * 
+ * + * int32 IsWorking = 7; + * @return The isWorking. + */ + @java.lang.Override + public int getIsWorking() { + return isWorking_; + } + + public static final int BLOWERS_PWM_FIELD_NUMBER = 8; + private int blowersPwm_ = 0; + /** + *
+     * 风机PWM调速,0-100
+     * 
+ * + * int32 blowers_pwm = 8; + * @return The blowersPwm. + */ + @java.lang.Override + public int getBlowersPwm() { + return blowersPwm_; + } + + public static final int FORCEVALUE_FIELD_NUMBER = 9; + private float forceValue_ = 0F; + /** + *
+     * 压强传感器-100~100Kpa
+     * 
+ * + * float ForceValue = 9; + * @return The forceValue. + */ + @java.lang.Override + public float getForceValue() { + return forceValue_; + } + + public static final int CURRENTDIRECTION_FIELD_NUMBER = 10; + private int currentDirection_ = 0; + /** + *
+     * 电子罗盘,单位0.01°
+     * 
+ * + * int32 CurrentDirection = 10; + * @return The currentDirection. + */ + @java.lang.Override + public int getCurrentDirection() { + return currentDirection_; + } + + public static final int CURRENTHEIGHT_FIELD_NUMBER = 11; + private int currentHeight_ = 0; + /** + *
+     * 拉线传感器,cm
+     * 
+ * + * int32 CurrentHeight = 11; + * @return The currentHeight. + */ + @java.lang.Override + public int getCurrentHeight() { + return currentHeight_; + } + + 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 (currentAngle_ != 0) { + output.writeInt32(1, currentAngle_); + } + if (robotMoveSpeed_ != 0) { + output.writeInt32(2, robotMoveSpeed_); + } + if (sBUSState_ != 0) { + output.writeInt32(3, sBUSState_); + } + if (systemError_ != 0) { + output.writeInt32(4, systemError_); + } + if (leftMotorErr_ != 0) { + output.writeInt32(5, leftMotorErr_); + } + if (rightMotorErr_ != 0) { + output.writeInt32(6, rightMotorErr_); + } + if (isWorking_ != 0) { + output.writeInt32(7, isWorking_); + } + if (blowersPwm_ != 0) { + output.writeInt32(8, blowersPwm_); + } + if (java.lang.Float.floatToRawIntBits(forceValue_) != 0) { + output.writeFloat(9, forceValue_); + } + if (currentDirection_ != 0) { + output.writeInt32(10, currentDirection_); + } + if (currentHeight_ != 0) { + output.writeInt32(11, currentHeight_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (currentAngle_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, currentAngle_); + } + if (robotMoveSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, robotMoveSpeed_); + } + if (sBUSState_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, sBUSState_); + } + if (systemError_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, systemError_); + } + if (leftMotorErr_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, leftMotorErr_); + } + if (rightMotorErr_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, rightMotorErr_); + } + if (isWorking_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, isWorking_); + } + if (blowersPwm_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, blowersPwm_); + } + if (java.lang.Float.floatToRawIntBits(forceValue_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(9, forceValue_); + } + if (currentDirection_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, currentDirection_); + } + if (currentHeight_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, currentHeight_); + } + 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.BspIV.IV_struct_define)) { + return super.equals(obj); + } + com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define other = (com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define) obj; + + if (getCurrentAngle() + != other.getCurrentAngle()) return false; + if (getRobotMoveSpeed() + != other.getRobotMoveSpeed()) return false; + if (getSBUSState() + != other.getSBUSState()) return false; + if (getSystemError() + != other.getSystemError()) return false; + if (getLeftMotorErr() + != other.getLeftMotorErr()) return false; + if (getRightMotorErr() + != other.getRightMotorErr()) return false; + if (getIsWorking() + != other.getIsWorking()) return false; + if (getBlowersPwm() + != other.getBlowersPwm()) return false; + if (java.lang.Float.floatToIntBits(getForceValue()) + != java.lang.Float.floatToIntBits( + other.getForceValue())) return false; + if (getCurrentDirection() + != other.getCurrentDirection()) return false; + if (getCurrentHeight() + != other.getCurrentHeight()) 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) + CURRENTANGLE_FIELD_NUMBER; + hash = (53 * hash) + getCurrentAngle(); + hash = (37 * hash) + ROBOTMOVESPEED_FIELD_NUMBER; + hash = (53 * hash) + getRobotMoveSpeed(); + hash = (37 * hash) + SBUS_STATE_FIELD_NUMBER; + hash = (53 * hash) + getSBUSState(); + hash = (37 * hash) + SYSTEMERROR_FIELD_NUMBER; + hash = (53 * hash) + getSystemError(); + hash = (37 * hash) + LEFT_MOTOR_ERR_FIELD_NUMBER; + hash = (53 * hash) + getLeftMotorErr(); + hash = (37 * hash) + RIGHT_MOTOR_ERR_FIELD_NUMBER; + hash = (53 * hash) + getRightMotorErr(); + hash = (37 * hash) + ISWORKING_FIELD_NUMBER; + hash = (53 * hash) + getIsWorking(); + hash = (37 * hash) + BLOWERS_PWM_FIELD_NUMBER; + hash = (53 * hash) + getBlowersPwm(); + hash = (37 * hash) + FORCEVALUE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getForceValue()); + hash = (37 * hash) + CURRENTDIRECTION_FIELD_NUMBER; + hash = (53 * hash) + getCurrentDirection(); + hash = (37 * hash) + CURRENTHEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getCurrentHeight(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IV_struct_define} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:IV_struct_define) + com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_defineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.bingoorobot.foreignobjectcuttingapp.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.bingoorobot.foreignobjectcuttingapp.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define.class, com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define.Builder.class); + } + + // Construct using com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + currentAngle_ = 0; + robotMoveSpeed_ = 0; + sBUSState_ = 0; + systemError_ = 0; + leftMotorErr_ = 0; + rightMotorErr_ = 0; + isWorking_ = 0; + blowersPwm_ = 0; + forceValue_ = 0F; + currentDirection_ = 0; + currentHeight_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.bingoorobot.foreignobjectcuttingapp.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + public com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define getDefaultInstanceForType() { + return com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define.getDefaultInstance(); + } + + @java.lang.Override + public com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define build() { + com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define buildPartial() { + com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define result = new com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.currentAngle_ = currentAngle_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.robotMoveSpeed_ = robotMoveSpeed_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sBUSState_ = sBUSState_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.systemError_ = systemError_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.leftMotorErr_ = leftMotorErr_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.rightMotorErr_ = rightMotorErr_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.isWorking_ = isWorking_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.blowersPwm_ = blowersPwm_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.forceValue_ = forceValue_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.currentDirection_ = currentDirection_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.currentHeight_ = currentHeight_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define) { + return mergeFrom((com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define other) { + if (other == com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define.getDefaultInstance()) return this; + if (other.getCurrentAngle() != 0) { + setCurrentAngle(other.getCurrentAngle()); + } + if (other.getRobotMoveSpeed() != 0) { + setRobotMoveSpeed(other.getRobotMoveSpeed()); + } + if (other.getSBUSState() != 0) { + setSBUSState(other.getSBUSState()); + } + if (other.getSystemError() != 0) { + setSystemError(other.getSystemError()); + } + if (other.getLeftMotorErr() != 0) { + setLeftMotorErr(other.getLeftMotorErr()); + } + if (other.getRightMotorErr() != 0) { + setRightMotorErr(other.getRightMotorErr()); + } + if (other.getIsWorking() != 0) { + setIsWorking(other.getIsWorking()); + } + if (other.getBlowersPwm() != 0) { + setBlowersPwm(other.getBlowersPwm()); + } + if (other.getForceValue() != 0F) { + setForceValue(other.getForceValue()); + } + if (other.getCurrentDirection() != 0) { + setCurrentDirection(other.getCurrentDirection()); + } + if (other.getCurrentHeight() != 0) { + setCurrentHeight(other.getCurrentHeight()); + } + 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: { + currentAngle_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + robotMoveSpeed_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + sBUSState_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + systemError_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + leftMotorErr_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + rightMotorErr_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + isWorking_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + blowersPwm_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 77: { + forceValue_ = input.readFloat(); + bitField0_ |= 0x00000100; + break; + } // case 77 + case 80: { + currentDirection_ = input.readInt32(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + currentHeight_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 88 + 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 currentAngle_ ; + /** + *
+       * 单位0.01°
+       * 
+ * + * int32 CurrentAngle = 1; + * @return The currentAngle. + */ + @java.lang.Override + public int getCurrentAngle() { + return currentAngle_; + } + /** + *
+       * 单位0.01°
+       * 
+ * + * int32 CurrentAngle = 1; + * @param value The currentAngle to set. + * @return This builder for chaining. + */ + public Builder setCurrentAngle(int value) { + + currentAngle_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * 单位0.01°
+       * 
+ * + * int32 CurrentAngle = 1; + * @return This builder for chaining. + */ + public Builder clearCurrentAngle() { + bitField0_ = (bitField0_ & ~0x00000001); + currentAngle_ = 0; + onChanged(); + return this; + } + + private int robotMoveSpeed_ ; + /** + *
+       * 单位m/min
+       * 
+ * + * int32 RobotMoveSpeed = 2; + * @return The robotMoveSpeed. + */ + @java.lang.Override + public int getRobotMoveSpeed() { + return robotMoveSpeed_; + } + /** + *
+       * 单位m/min
+       * 
+ * + * int32 RobotMoveSpeed = 2; + * @param value The robotMoveSpeed to set. + * @return This builder for chaining. + */ + public Builder setRobotMoveSpeed(int value) { + + robotMoveSpeed_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * 单位m/min
+       * 
+ * + * int32 RobotMoveSpeed = 2; + * @return This builder for chaining. + */ + public Builder clearRobotMoveSpeed() { + bitField0_ = (bitField0_ & ~0x00000002); + robotMoveSpeed_ = 0; + onChanged(); + return this; + } + + private int sBUSState_ ; + /** + *
+       * 0断开 1连接
+       * 
+ * + * int32 SBUS_State = 3; + * @return The sBUSState. + */ + @java.lang.Override + public int getSBUSState() { + return sBUSState_; + } + /** + *
+       * 0断开 1连接
+       * 
+ * + * int32 SBUS_State = 3; + * @param value The sBUSState to set. + * @return This builder for chaining. + */ + public Builder setSBUSState(int value) { + + sBUSState_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * 0断开 1连接
+       * 
+ * + * int32 SBUS_State = 3; + * @return This builder for chaining. + */ + public Builder clearSBUSState() { + bitField0_ = (bitField0_ & ~0x00000004); + sBUSState_ = 0; + onChanged(); + return this; + } + + private int systemError_ ; + /** + *
+       * 硬件通讯错误及按键未初始化错误
+       * 
+ * + * int32 SystemError = 4; + * @return The systemError. + */ + @java.lang.Override + public int getSystemError() { + return systemError_; + } + /** + *
+       * 硬件通讯错误及按键未初始化错误
+       * 
+ * + * int32 SystemError = 4; + * @param value The systemError to set. + * @return This builder for chaining. + */ + public Builder setSystemError(int value) { + + systemError_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * 硬件通讯错误及按键未初始化错误
+       * 
+ * + * int32 SystemError = 4; + * @return This builder for chaining. + */ + public Builder clearSystemError() { + bitField0_ = (bitField0_ & ~0x00000008); + systemError_ = 0; + onChanged(); + return this; + } + + private int leftMotorErr_ ; + /** + *
+       * 左轮电机报警
+       * 
+ * + * int32 Left_Motor_Err = 5; + * @return The leftMotorErr. + */ + @java.lang.Override + public int getLeftMotorErr() { + return leftMotorErr_; + } + /** + *
+       * 左轮电机报警
+       * 
+ * + * int32 Left_Motor_Err = 5; + * @param value The leftMotorErr to set. + * @return This builder for chaining. + */ + public Builder setLeftMotorErr(int value) { + + leftMotorErr_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       * 左轮电机报警
+       * 
+ * + * int32 Left_Motor_Err = 5; + * @return This builder for chaining. + */ + public Builder clearLeftMotorErr() { + bitField0_ = (bitField0_ & ~0x00000010); + leftMotorErr_ = 0; + onChanged(); + return this; + } + + private int rightMotorErr_ ; + /** + *
+       * 右轮电机报警
+       * 
+ * + * int32 Right_Motor_Err = 6; + * @return The rightMotorErr. + */ + @java.lang.Override + public int getRightMotorErr() { + return rightMotorErr_; + } + /** + *
+       * 右轮电机报警
+       * 
+ * + * int32 Right_Motor_Err = 6; + * @param value The rightMotorErr to set. + * @return This builder for chaining. + */ + public Builder setRightMotorErr(int value) { + + rightMotorErr_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+       * 右轮电机报警
+       * 
+ * + * int32 Right_Motor_Err = 6; + * @return This builder for chaining. + */ + public Builder clearRightMotorErr() { + bitField0_ = (bitField0_ & ~0x00000020); + rightMotorErr_ = 0; + onChanged(); + return this; + } + + private int isWorking_ ; + /** + *
+       * 机器人正在执行运动指令
+       * 
+ * + * int32 IsWorking = 7; + * @return The isWorking. + */ + @java.lang.Override + public int getIsWorking() { + return isWorking_; + } + /** + *
+       * 机器人正在执行运动指令
+       * 
+ * + * int32 IsWorking = 7; + * @param value The isWorking to set. + * @return This builder for chaining. + */ + public Builder setIsWorking(int value) { + + isWorking_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+       * 机器人正在执行运动指令
+       * 
+ * + * int32 IsWorking = 7; + * @return This builder for chaining. + */ + public Builder clearIsWorking() { + bitField0_ = (bitField0_ & ~0x00000040); + isWorking_ = 0; + onChanged(); + return this; + } + + private int blowersPwm_ ; + /** + *
+       * 风机PWM调速,0-100
+       * 
+ * + * int32 blowers_pwm = 8; + * @return The blowersPwm. + */ + @java.lang.Override + public int getBlowersPwm() { + return blowersPwm_; + } + /** + *
+       * 风机PWM调速,0-100
+       * 
+ * + * int32 blowers_pwm = 8; + * @param value The blowersPwm to set. + * @return This builder for chaining. + */ + public Builder setBlowersPwm(int value) { + + blowersPwm_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+       * 风机PWM调速,0-100
+       * 
+ * + * int32 blowers_pwm = 8; + * @return This builder for chaining. + */ + public Builder clearBlowersPwm() { + bitField0_ = (bitField0_ & ~0x00000080); + blowersPwm_ = 0; + onChanged(); + return this; + } + + private float forceValue_ ; + /** + *
+       * 压强传感器-100~100Kpa
+       * 
+ * + * float ForceValue = 9; + * @return The forceValue. + */ + @java.lang.Override + public float getForceValue() { + return forceValue_; + } + /** + *
+       * 压强传感器-100~100Kpa
+       * 
+ * + * float ForceValue = 9; + * @param value The forceValue to set. + * @return This builder for chaining. + */ + public Builder setForceValue(float value) { + + forceValue_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + *
+       * 压强传感器-100~100Kpa
+       * 
+ * + * float ForceValue = 9; + * @return This builder for chaining. + */ + public Builder clearForceValue() { + bitField0_ = (bitField0_ & ~0x00000100); + forceValue_ = 0F; + onChanged(); + return this; + } + + private int currentDirection_ ; + /** + *
+       * 电子罗盘,单位0.01°
+       * 
+ * + * int32 CurrentDirection = 10; + * @return The currentDirection. + */ + @java.lang.Override + public int getCurrentDirection() { + return currentDirection_; + } + /** + *
+       * 电子罗盘,单位0.01°
+       * 
+ * + * int32 CurrentDirection = 10; + * @param value The currentDirection to set. + * @return This builder for chaining. + */ + public Builder setCurrentDirection(int value) { + + currentDirection_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + *
+       * 电子罗盘,单位0.01°
+       * 
+ * + * int32 CurrentDirection = 10; + * @return This builder for chaining. + */ + public Builder clearCurrentDirection() { + bitField0_ = (bitField0_ & ~0x00000200); + currentDirection_ = 0; + onChanged(); + return this; + } + + private int currentHeight_ ; + /** + *
+       * 拉线传感器,cm
+       * 
+ * + * int32 CurrentHeight = 11; + * @return The currentHeight. + */ + @java.lang.Override + public int getCurrentHeight() { + return currentHeight_; + } + /** + *
+       * 拉线传感器,cm
+       * 
+ * + * int32 CurrentHeight = 11; + * @param value The currentHeight to set. + * @return This builder for chaining. + */ + public Builder setCurrentHeight(int value) { + + currentHeight_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + *
+       * 拉线传感器,cm
+       * 
+ * + * int32 CurrentHeight = 11; + * @return This builder for chaining. + */ + public Builder clearCurrentHeight() { + bitField0_ = (bitField0_ & ~0x00000400); + currentHeight_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:IV_struct_define) + } + + // @@protoc_insertion_point(class_scope:IV_struct_define) + private static final com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define(); + } + + public static com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IV_struct_define parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.bingoorobot.foreignobjectcuttingapp.models.BspIV.IV_struct_define getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_IV_struct_define_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_IV_struct_define_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014bsp_IV.proto\"\207\002\n\020IV_struct_define\022\024\n\014C" + + "urrentAngle\030\001 \001(\005\022\026\n\016RobotMoveSpeed\030\002 \001(" + + "\005\022\022\n\nSBUS_State\030\003 \001(\005\022\023\n\013SystemError\030\004 \001" + + "(\005\022\026\n\016Left_Motor_Err\030\005 \001(\005\022\027\n\017Right_Moto" + + "r_Err\030\006 \001(\005\022\021\n\tIsWorking\030\007 \001(\005\022\023\n\013blower" + + "s_pwm\030\010 \001(\005\022\022\n\nForceValue\030\t \001(\002\022\030\n\020Curre" + + "ntDirection\030\n \001(\005\022\025\n\rCurrentHeight\030\013 \001(\005" + + "B2\n.com.bingoorobot.foreignobjectcutting" + + "app.modelsP\000b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_IV_struct_define_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_IV_struct_define_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_IV_struct_define_descriptor, + new java.lang.String[] { "CurrentAngle", "RobotMoveSpeed", "SBUSState", "SystemError", "LeftMotorErr", "RightMotorErr", "IsWorking", "BlowersPwm", "ForceValue", "CurrentDirection", "CurrentHeight", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspPV.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/BspPV.java new file mode 100644 index 0000000..7385a74 --- /dev/null +++ b/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 { + + /** + *
+     * 1 手动无校准作业 2   手动竖直向左作业 3 手动竖直向右作业
+     * 
+ * + * int32 RunMode = 1; + * @return The runMode. + */ + int getRunMode(); + + /** + *
+     * 0-30m/min
+     * 
+ * + * int32 RobotSpeed = 2; + * @return The robotSpeed. + */ + int getRobotSpeed(); + + /** + *
+     * 1-100cm
+     * 
+ * + * int32 LaneChangeDistance = 3; + * @return The laneChangeDistance. + */ + int getLaneChangeDistance(); + + /** + *
+     * 1°
+     * 
+ * + * double Vertical_Calibration = 4; + * @return The verticalCalibration. + */ + double getVerticalCalibration(); + + /** + *
+     * 罐高度m
+     * 
+ * + * double Height_Storage = 5; + * @return The heightStorage. + */ + double getHeightStorage(); + + /** + *
+     * 罐半径m
+     * 
+ * + * double Radius_Storage = 6; + * @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; + /** + *
+     * 1 手动无校准作业 2   手动竖直向左作业 3 手动竖直向右作业
+     * 
+ * + * int32 RunMode = 1; + * @return The runMode. + */ + @java.lang.Override + public int getRunMode() { + return runMode_; + } + + public static final int ROBOTSPEED_FIELD_NUMBER = 2; + private int robotSpeed_ = 0; + /** + *
+     * 0-30m/min
+     * 
+ * + * int32 RobotSpeed = 2; + * @return The robotSpeed. + */ + @java.lang.Override + public int getRobotSpeed() { + return robotSpeed_; + } + + public static final int LANECHANGEDISTANCE_FIELD_NUMBER = 3; + private int laneChangeDistance_ = 0; + /** + *
+     * 1-100cm
+     * 
+ * + * int32 LaneChangeDistance = 3; + * @return The laneChangeDistance. + */ + @java.lang.Override + public int getLaneChangeDistance() { + return laneChangeDistance_; + } + + public static final int VERTICAL_CALIBRATION_FIELD_NUMBER = 4; + private double verticalCalibration_ = 0D; + /** + *
+     * 1°
+     * 
+ * + * double Vertical_Calibration = 4; + * @return The verticalCalibration. + */ + @java.lang.Override + public double getVerticalCalibration() { + return verticalCalibration_; + } + + public static final int HEIGHT_STORAGE_FIELD_NUMBER = 5; + private double heightStorage_ = 0D; + /** + *
+     * 罐高度m
+     * 
+ * + * double Height_Storage = 5; + * @return The heightStorage. + */ + @java.lang.Override + public double getHeightStorage() { + return heightStorage_; + } + + public static final int RADIUS_STORAGE_FIELD_NUMBER = 6; + private double radiusStorage_ = 0D; + /** + *
+     * 罐半径m
+     * 
+ * + * double Radius_Storage = 6; + * @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 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_ ; + /** + *
+       * 1 手动无校准作业 2   手动竖直向左作业 3 手动竖直向右作业
+       * 
+ * + * int32 RunMode = 1; + * @return The runMode. + */ + @java.lang.Override + public int getRunMode() { + return runMode_; + } + /** + *
+       * 1 手动无校准作业 2   手动竖直向左作业 3 手动竖直向右作业
+       * 
+ * + * int32 RunMode = 1; + * @param value The runMode to set. + * @return This builder for chaining. + */ + public Builder setRunMode(int value) { + + runMode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * 1 手动无校准作业 2   手动竖直向左作业 3 手动竖直向右作业
+       * 
+ * + * int32 RunMode = 1; + * @return This builder for chaining. + */ + public Builder clearRunMode() { + bitField0_ = (bitField0_ & ~0x00000001); + runMode_ = 0; + onChanged(); + return this; + } + + private int robotSpeed_ ; + /** + *
+       * 0-30m/min
+       * 
+ * + * int32 RobotSpeed = 2; + * @return The robotSpeed. + */ + @java.lang.Override + public int getRobotSpeed() { + return robotSpeed_; + } + /** + *
+       * 0-30m/min
+       * 
+ * + * int32 RobotSpeed = 2; + * @param value The robotSpeed to set. + * @return This builder for chaining. + */ + public Builder setRobotSpeed(int value) { + + robotSpeed_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * 0-30m/min
+       * 
+ * + * int32 RobotSpeed = 2; + * @return This builder for chaining. + */ + public Builder clearRobotSpeed() { + bitField0_ = (bitField0_ & ~0x00000002); + robotSpeed_ = 0; + onChanged(); + return this; + } + + private int laneChangeDistance_ ; + /** + *
+       * 1-100cm
+       * 
+ * + * int32 LaneChangeDistance = 3; + * @return The laneChangeDistance. + */ + @java.lang.Override + public int getLaneChangeDistance() { + return laneChangeDistance_; + } + /** + *
+       * 1-100cm
+       * 
+ * + * int32 LaneChangeDistance = 3; + * @param value The laneChangeDistance to set. + * @return This builder for chaining. + */ + public Builder setLaneChangeDistance(int value) { + + laneChangeDistance_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * 1-100cm
+       * 
+ * + * int32 LaneChangeDistance = 3; + * @return This builder for chaining. + */ + public Builder clearLaneChangeDistance() { + bitField0_ = (bitField0_ & ~0x00000004); + laneChangeDistance_ = 0; + onChanged(); + return this; + } + + private double verticalCalibration_ ; + /** + *
+       * 1°
+       * 
+ * + * double Vertical_Calibration = 4; + * @return The verticalCalibration. + */ + @java.lang.Override + public double getVerticalCalibration() { + return verticalCalibration_; + } + /** + *
+       * 1°
+       * 
+ * + * double Vertical_Calibration = 4; + * @param value The verticalCalibration to set. + * @return This builder for chaining. + */ + public Builder setVerticalCalibration(double value) { + + verticalCalibration_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * 1°
+       * 
+ * + * double Vertical_Calibration = 4; + * @return This builder for chaining. + */ + public Builder clearVerticalCalibration() { + bitField0_ = (bitField0_ & ~0x00000008); + verticalCalibration_ = 0D; + onChanged(); + return this; + } + + private double heightStorage_ ; + /** + *
+       * 罐高度m
+       * 
+ * + * double Height_Storage = 5; + * @return The heightStorage. + */ + @java.lang.Override + public double getHeightStorage() { + return heightStorage_; + } + /** + *
+       * 罐高度m
+       * 
+ * + * double Height_Storage = 5; + * @param value The heightStorage to set. + * @return This builder for chaining. + */ + public Builder setHeightStorage(double value) { + + heightStorage_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       * 罐高度m
+       * 
+ * + * double Height_Storage = 5; + * @return This builder for chaining. + */ + public Builder clearHeightStorage() { + bitField0_ = (bitField0_ & ~0x00000010); + heightStorage_ = 0D; + onChanged(); + return this; + } + + private double radiusStorage_ ; + /** + *
+       * 罐半径m
+       * 
+ * + * double Radius_Storage = 6; + * @return The radiusStorage. + */ + @java.lang.Override + public double getRadiusStorage() { + return radiusStorage_; + } + /** + *
+       * 罐半径m
+       * 
+ * + * double Radius_Storage = 6; + * @param value The radiusStorage to set. + * @return This builder for chaining. + */ + public Builder setRadiusStorage(double value) { + + radiusStorage_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+       * 罐半径m
+       * 
+ * + * double Radius_Storage = 6; + * @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 + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PV_struct_define parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.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) +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/DCmd.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/DCmd.java new file mode 100644 index 0000000..f06dd80 --- /dev/null +++ b/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 { + + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + * @return Whether the mk32CMD field is set. + */ + boolean hasMk32CMD(); + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + * @return The mk32CMD. + */ + com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button getMk32CMD(); + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + */ + com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_ButtonOrBuilder getMk32CMDOrBuilder(); + + /** + * .PV_struct_define _toSendPV = 2; + * @return Whether the toSendPV field is set. + */ + boolean hasToSendPV(); + /** + * .PV_struct_define _toSendPV = 2; + * @return The toSendPV. + */ + com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define getToSendPV(); + /** + * .PV_struct_define _toSendPV = 2; + */ + 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_; + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + * @return Whether the mk32CMD field is set. + */ + @java.lang.Override + public boolean hasMk32CMD() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + * @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_; + } + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + */ + @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_; + /** + * .PV_struct_define _toSendPV = 2; + * @return Whether the toSendPV field is set. + */ + @java.lang.Override + public boolean hasToSendPV() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .PV_struct_define _toSendPV = 2; + * @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_; + } + /** + * .PV_struct_define _toSendPV = 2; + */ + @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 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_; + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + * @return Whether the mk32CMD field is set. + */ + public boolean hasMk32CMD() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + * @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(); + } + } + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + */ + 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; + } + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + */ + 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; + } + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + */ + 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; + } + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + */ + public Builder clearMk32CMD() { + bitField0_ = (bitField0_ & ~0x00000001); + mk32CMD_ = null; + if (mk32CMDBuilder_ != null) { + mk32CMDBuilder_.dispose(); + mk32CMDBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + */ + public com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.Builder getMk32CMDBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getMk32CMDFieldBuilder().getBuilder(); + } + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + */ + 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_; + } + } + /** + * .SP_MSP_MK32_Button Mk32CMD = 1; + */ + 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_; + /** + * .PV_struct_define _toSendPV = 2; + * @return Whether the toSendPV field is set. + */ + public boolean hasToSendPV() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * .PV_struct_define _toSendPV = 2; + * @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(); + } + } + /** + * .PV_struct_define _toSendPV = 2; + */ + 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; + } + /** + * .PV_struct_define _toSendPV = 2; + */ + 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; + } + /** + * .PV_struct_define _toSendPV = 2; + */ + 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; + } + /** + * .PV_struct_define _toSendPV = 2; + */ + public Builder clearToSendPV() { + bitField0_ = (bitField0_ & ~0x00000002); + ToSendPV_ = null; + if (ToSendPVBuilder_ != null) { + ToSendPVBuilder_.dispose(); + ToSendPVBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .PV_struct_define _toSendPV = 2; + */ + public com.bingoorobot.foreignobjectcuttingapp.models.BspPV.PV_struct_define.Builder getToSendPVBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getToSendPVFieldBuilder().getBuilder(); + } + /** + * .PV_struct_define _toSendPV = 2; + */ + 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_; + } + } + /** + * .PV_struct_define _toSendPV = 2; + */ + 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 + PARSER = new com.google.protobuf.AbstractParser() { + @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 parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser 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) +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/ErrorModel.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/ErrorModel.java new file mode 100644 index 0000000..574100c --- /dev/null +++ b/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; + } +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/MspMK32.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/MspMK32.java new file mode 100644 index 0000000..91e0a50 --- /dev/null +++ b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/MspMK32.java @@ -0,0 +1,1726 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: msp_MK32.proto +// Protobuf Java Version: 4.27.2 + +package com.bingoorobot.foreignobjectcuttingapp.models; + +public final class MspMK32 { + private MspMK32() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + MspMK32.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 SP_MSP_MK32_ButtonOrBuilder extends + // @@protoc_insertion_point(interface_extends:SP_MSP_MK32_Button) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 RxIndex = 1; + * @return The rxIndex. + */ + int getRxIndex(); + + /** + * int32 CH0_RY_H = 2; + * @return The cH0RYH. + */ + int getCH0RYH(); + + /** + * int32 CH1_RY_V = 3; + * @return The cH1RYV. + */ + int getCH1RYV(); + + /** + * int32 CH2_LY_V = 4; + * @return The cH2LYV. + */ + int getCH2LYV(); + + /** + * int32 CH3_LY_H = 5; + * @return The cH3LYH. + */ + int getCH3LYH(); + + /** + * int32 CH4_SA = 6; + * @return The cH4SA. + */ + int getCH4SA(); + + /** + * int32 CH5_SB = 7; + * @return The cH5SB. + */ + int getCH5SB(); + + /** + * int32 CH6_SC = 8; + * @return The cH6SC. + */ + int getCH6SC(); + + /** + * int32 CH7_SD = 9; + * @return The cH7SD. + */ + int getCH7SD(); + + /** + * int32 CH8_SE = 10; + * @return The cH8SE. + */ + int getCH8SE(); + + /** + * int32 CH9_SF = 11; + * @return The cH9SF. + */ + int getCH9SF(); + + /** + * int32 CH10_LD1 = 12; + * @return The cH10LD1. + */ + int getCH10LD1(); + + /** + * int32 CH11_RD1 = 13; + * @return The cH11RD1. + */ + int getCH11RD1(); + + /** + * int32 CH12_S1 = 14; + * @return The cH12S1. + */ + int getCH12S1(); + + /** + * int32 CH13_S2 = 15; + * @return The cH13S2. + */ + int getCH13S2(); + + /** + * int32 CH14_LT = 16; + * @return The cH14LT. + */ + int getCH14LT(); + + /** + * int32 CH15_RT = 17; + * @return The cH15RT. + */ + int getCH15RT(); + + /** + * int32 IsOnline = 18; + * @return The isOnline. + */ + int getIsOnline(); + } + /** + * Protobuf type {@code SP_MSP_MK32_Button} + */ + public static final class SP_MSP_MK32_Button extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:SP_MSP_MK32_Button) + SP_MSP_MK32_ButtonOrBuilder { + 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= */ "", + SP_MSP_MK32_Button.class.getName()); + } + // Use SP_MSP_MK32_Button.newBuilder() to construct. + private SP_MSP_MK32_Button(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private SP_MSP_MK32_Button() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.internal_static_SP_MSP_MK32_Button_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.internal_static_SP_MSP_MK32_Button_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.class, com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.Builder.class); + } + + public static final int RXINDEX_FIELD_NUMBER = 1; + private int rxIndex_ = 0; + /** + * int32 RxIndex = 1; + * @return The rxIndex. + */ + @java.lang.Override + public int getRxIndex() { + return rxIndex_; + } + + public static final int CH0_RY_H_FIELD_NUMBER = 2; + private int cH0RYH_ = 0; + /** + * int32 CH0_RY_H = 2; + * @return The cH0RYH. + */ + @java.lang.Override + public int getCH0RYH() { + return cH0RYH_; + } + + public static final int CH1_RY_V_FIELD_NUMBER = 3; + private int cH1RYV_ = 0; + /** + * int32 CH1_RY_V = 3; + * @return The cH1RYV. + */ + @java.lang.Override + public int getCH1RYV() { + return cH1RYV_; + } + + public static final int CH2_LY_V_FIELD_NUMBER = 4; + private int cH2LYV_ = 0; + /** + * int32 CH2_LY_V = 4; + * @return The cH2LYV. + */ + @java.lang.Override + public int getCH2LYV() { + return cH2LYV_; + } + + public static final int CH3_LY_H_FIELD_NUMBER = 5; + private int cH3LYH_ = 0; + /** + * int32 CH3_LY_H = 5; + * @return The cH3LYH. + */ + @java.lang.Override + public int getCH3LYH() { + return cH3LYH_; + } + + public static final int CH4_SA_FIELD_NUMBER = 6; + private int cH4SA_ = 0; + /** + * int32 CH4_SA = 6; + * @return The cH4SA. + */ + @java.lang.Override + public int getCH4SA() { + return cH4SA_; + } + + public static final int CH5_SB_FIELD_NUMBER = 7; + private int cH5SB_ = 0; + /** + * int32 CH5_SB = 7; + * @return The cH5SB. + */ + @java.lang.Override + public int getCH5SB() { + return cH5SB_; + } + + public static final int CH6_SC_FIELD_NUMBER = 8; + private int cH6SC_ = 0; + /** + * int32 CH6_SC = 8; + * @return The cH6SC. + */ + @java.lang.Override + public int getCH6SC() { + return cH6SC_; + } + + public static final int CH7_SD_FIELD_NUMBER = 9; + private int cH7SD_ = 0; + /** + * int32 CH7_SD = 9; + * @return The cH7SD. + */ + @java.lang.Override + public int getCH7SD() { + return cH7SD_; + } + + public static final int CH8_SE_FIELD_NUMBER = 10; + private int cH8SE_ = 0; + /** + * int32 CH8_SE = 10; + * @return The cH8SE. + */ + @java.lang.Override + public int getCH8SE() { + return cH8SE_; + } + + public static final int CH9_SF_FIELD_NUMBER = 11; + private int cH9SF_ = 0; + /** + * int32 CH9_SF = 11; + * @return The cH9SF. + */ + @java.lang.Override + public int getCH9SF() { + return cH9SF_; + } + + public static final int CH10_LD1_FIELD_NUMBER = 12; + private int cH10LD1_ = 0; + /** + * int32 CH10_LD1 = 12; + * @return The cH10LD1. + */ + @java.lang.Override + public int getCH10LD1() { + return cH10LD1_; + } + + public static final int CH11_RD1_FIELD_NUMBER = 13; + private int cH11RD1_ = 0; + /** + * int32 CH11_RD1 = 13; + * @return The cH11RD1. + */ + @java.lang.Override + public int getCH11RD1() { + return cH11RD1_; + } + + public static final int CH12_S1_FIELD_NUMBER = 14; + private int cH12S1_ = 0; + /** + * int32 CH12_S1 = 14; + * @return The cH12S1. + */ + @java.lang.Override + public int getCH12S1() { + return cH12S1_; + } + + public static final int CH13_S2_FIELD_NUMBER = 15; + private int cH13S2_ = 0; + /** + * int32 CH13_S2 = 15; + * @return The cH13S2. + */ + @java.lang.Override + public int getCH13S2() { + return cH13S2_; + } + + public static final int CH14_LT_FIELD_NUMBER = 16; + private int cH14LT_ = 0; + /** + * int32 CH14_LT = 16; + * @return The cH14LT. + */ + @java.lang.Override + public int getCH14LT() { + return cH14LT_; + } + + public static final int CH15_RT_FIELD_NUMBER = 17; + private int cH15RT_ = 0; + /** + * int32 CH15_RT = 17; + * @return The cH15RT. + */ + @java.lang.Override + public int getCH15RT() { + return cH15RT_; + } + + public static final int ISONLINE_FIELD_NUMBER = 18; + private int isOnline_ = 0; + /** + * int32 IsOnline = 18; + * @return The isOnline. + */ + @java.lang.Override + public int getIsOnline() { + return isOnline_; + } + + 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 (rxIndex_ != 0) { + output.writeInt32(1, rxIndex_); + } + if (cH0RYH_ != 0) { + output.writeInt32(2, cH0RYH_); + } + if (cH1RYV_ != 0) { + output.writeInt32(3, cH1RYV_); + } + if (cH2LYV_ != 0) { + output.writeInt32(4, cH2LYV_); + } + if (cH3LYH_ != 0) { + output.writeInt32(5, cH3LYH_); + } + if (cH4SA_ != 0) { + output.writeInt32(6, cH4SA_); + } + if (cH5SB_ != 0) { + output.writeInt32(7, cH5SB_); + } + if (cH6SC_ != 0) { + output.writeInt32(8, cH6SC_); + } + if (cH7SD_ != 0) { + output.writeInt32(9, cH7SD_); + } + if (cH8SE_ != 0) { + output.writeInt32(10, cH8SE_); + } + if (cH9SF_ != 0) { + output.writeInt32(11, cH9SF_); + } + if (cH10LD1_ != 0) { + output.writeInt32(12, cH10LD1_); + } + if (cH11RD1_ != 0) { + output.writeInt32(13, cH11RD1_); + } + if (cH12S1_ != 0) { + output.writeInt32(14, cH12S1_); + } + if (cH13S2_ != 0) { + output.writeInt32(15, cH13S2_); + } + if (cH14LT_ != 0) { + output.writeInt32(16, cH14LT_); + } + if (cH15RT_ != 0) { + output.writeInt32(17, cH15RT_); + } + if (isOnline_ != 0) { + output.writeInt32(18, isOnline_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rxIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, rxIndex_); + } + if (cH0RYH_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, cH0RYH_); + } + if (cH1RYV_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, cH1RYV_); + } + if (cH2LYV_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, cH2LYV_); + } + if (cH3LYH_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, cH3LYH_); + } + if (cH4SA_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, cH4SA_); + } + if (cH5SB_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, cH5SB_); + } + if (cH6SC_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, cH6SC_); + } + if (cH7SD_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, cH7SD_); + } + if (cH8SE_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, cH8SE_); + } + if (cH9SF_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, cH9SF_); + } + if (cH10LD1_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(12, cH10LD1_); + } + if (cH11RD1_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(13, cH11RD1_); + } + if (cH12S1_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(14, cH12S1_); + } + if (cH13S2_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(15, cH13S2_); + } + if (cH14LT_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(16, cH14LT_); + } + if (cH15RT_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(17, cH15RT_); + } + if (isOnline_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(18, isOnline_); + } + 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.MspMK32.SP_MSP_MK32_Button)) { + return super.equals(obj); + } + com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button other = (com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button) obj; + + if (getRxIndex() + != other.getRxIndex()) return false; + if (getCH0RYH() + != other.getCH0RYH()) return false; + if (getCH1RYV() + != other.getCH1RYV()) return false; + if (getCH2LYV() + != other.getCH2LYV()) return false; + if (getCH3LYH() + != other.getCH3LYH()) return false; + if (getCH4SA() + != other.getCH4SA()) return false; + if (getCH5SB() + != other.getCH5SB()) return false; + if (getCH6SC() + != other.getCH6SC()) return false; + if (getCH7SD() + != other.getCH7SD()) return false; + if (getCH8SE() + != other.getCH8SE()) return false; + if (getCH9SF() + != other.getCH9SF()) return false; + if (getCH10LD1() + != other.getCH10LD1()) return false; + if (getCH11RD1() + != other.getCH11RD1()) return false; + if (getCH12S1() + != other.getCH12S1()) return false; + if (getCH13S2() + != other.getCH13S2()) return false; + if (getCH14LT() + != other.getCH14LT()) return false; + if (getCH15RT() + != other.getCH15RT()) return false; + if (getIsOnline() + != other.getIsOnline()) 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) + RXINDEX_FIELD_NUMBER; + hash = (53 * hash) + getRxIndex(); + hash = (37 * hash) + CH0_RY_H_FIELD_NUMBER; + hash = (53 * hash) + getCH0RYH(); + hash = (37 * hash) + CH1_RY_V_FIELD_NUMBER; + hash = (53 * hash) + getCH1RYV(); + hash = (37 * hash) + CH2_LY_V_FIELD_NUMBER; + hash = (53 * hash) + getCH2LYV(); + hash = (37 * hash) + CH3_LY_H_FIELD_NUMBER; + hash = (53 * hash) + getCH3LYH(); + hash = (37 * hash) + CH4_SA_FIELD_NUMBER; + hash = (53 * hash) + getCH4SA(); + hash = (37 * hash) + CH5_SB_FIELD_NUMBER; + hash = (53 * hash) + getCH5SB(); + hash = (37 * hash) + CH6_SC_FIELD_NUMBER; + hash = (53 * hash) + getCH6SC(); + hash = (37 * hash) + CH7_SD_FIELD_NUMBER; + hash = (53 * hash) + getCH7SD(); + hash = (37 * hash) + CH8_SE_FIELD_NUMBER; + hash = (53 * hash) + getCH8SE(); + hash = (37 * hash) + CH9_SF_FIELD_NUMBER; + hash = (53 * hash) + getCH9SF(); + hash = (37 * hash) + CH10_LD1_FIELD_NUMBER; + hash = (53 * hash) + getCH10LD1(); + hash = (37 * hash) + CH11_RD1_FIELD_NUMBER; + hash = (53 * hash) + getCH11RD1(); + hash = (37 * hash) + CH12_S1_FIELD_NUMBER; + hash = (53 * hash) + getCH12S1(); + hash = (37 * hash) + CH13_S2_FIELD_NUMBER; + hash = (53 * hash) + getCH13S2(); + hash = (37 * hash) + CH14_LT_FIELD_NUMBER; + hash = (53 * hash) + getCH14LT(); + hash = (37 * hash) + CH15_RT_FIELD_NUMBER; + hash = (53 * hash) + getCH15RT(); + hash = (37 * hash) + ISONLINE_FIELD_NUMBER; + hash = (53 * hash) + getIsOnline(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button 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.MspMK32.SP_MSP_MK32_Button parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button 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.MspMK32.SP_MSP_MK32_Button parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button 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.MspMK32.SP_MSP_MK32_Button parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button 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.MspMK32.SP_MSP_MK32_Button parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button 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.MspMK32.SP_MSP_MK32_Button 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 SP_MSP_MK32_Button} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:SP_MSP_MK32_Button) + com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_ButtonOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.internal_static_SP_MSP_MK32_Button_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.internal_static_SP_MSP_MK32_Button_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.class, com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.Builder.class); + } + + // Construct using com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rxIndex_ = 0; + cH0RYH_ = 0; + cH1RYV_ = 0; + cH2LYV_ = 0; + cH3LYH_ = 0; + cH4SA_ = 0; + cH5SB_ = 0; + cH6SC_ = 0; + cH7SD_ = 0; + cH8SE_ = 0; + cH9SF_ = 0; + cH10LD1_ = 0; + cH11RD1_ = 0; + cH12S1_ = 0; + cH13S2_ = 0; + cH14LT_ = 0; + cH15RT_ = 0; + isOnline_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.internal_static_SP_MSP_MK32_Button_descriptor; + } + + @java.lang.Override + public com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button getDefaultInstanceForType() { + return com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.getDefaultInstance(); + } + + @java.lang.Override + public com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button build() { + com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button buildPartial() { + com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button result = new com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rxIndex_ = rxIndex_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cH0RYH_ = cH0RYH_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cH1RYV_ = cH1RYV_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cH2LYV_ = cH2LYV_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.cH3LYH_ = cH3LYH_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.cH4SA_ = cH4SA_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.cH5SB_ = cH5SB_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.cH6SC_ = cH6SC_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.cH7SD_ = cH7SD_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.cH8SE_ = cH8SE_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.cH9SF_ = cH9SF_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.cH10LD1_ = cH10LD1_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.cH11RD1_ = cH11RD1_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.cH12S1_ = cH12S1_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.cH13S2_ = cH13S2_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.cH14LT_ = cH14LT_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.cH15RT_ = cH15RT_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.isOnline_ = isOnline_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button) { + return mergeFrom((com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button other) { + if (other == com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button.getDefaultInstance()) return this; + if (other.getRxIndex() != 0) { + setRxIndex(other.getRxIndex()); + } + if (other.getCH0RYH() != 0) { + setCH0RYH(other.getCH0RYH()); + } + if (other.getCH1RYV() != 0) { + setCH1RYV(other.getCH1RYV()); + } + if (other.getCH2LYV() != 0) { + setCH2LYV(other.getCH2LYV()); + } + if (other.getCH3LYH() != 0) { + setCH3LYH(other.getCH3LYH()); + } + if (other.getCH4SA() != 0) { + setCH4SA(other.getCH4SA()); + } + if (other.getCH5SB() != 0) { + setCH5SB(other.getCH5SB()); + } + if (other.getCH6SC() != 0) { + setCH6SC(other.getCH6SC()); + } + if (other.getCH7SD() != 0) { + setCH7SD(other.getCH7SD()); + } + if (other.getCH8SE() != 0) { + setCH8SE(other.getCH8SE()); + } + if (other.getCH9SF() != 0) { + setCH9SF(other.getCH9SF()); + } + if (other.getCH10LD1() != 0) { + setCH10LD1(other.getCH10LD1()); + } + if (other.getCH11RD1() != 0) { + setCH11RD1(other.getCH11RD1()); + } + if (other.getCH12S1() != 0) { + setCH12S1(other.getCH12S1()); + } + if (other.getCH13S2() != 0) { + setCH13S2(other.getCH13S2()); + } + if (other.getCH14LT() != 0) { + setCH14LT(other.getCH14LT()); + } + if (other.getCH15RT() != 0) { + setCH15RT(other.getCH15RT()); + } + if (other.getIsOnline() != 0) { + setIsOnline(other.getIsOnline()); + } + 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: { + rxIndex_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + cH0RYH_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + cH1RYV_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + cH2LYV_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + cH3LYH_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + cH4SA_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + cH5SB_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + cH6SC_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + cH7SD_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + cH8SE_ = input.readInt32(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + cH9SF_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + cH10LD1_ = input.readInt32(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 104: { + cH11RD1_ = input.readInt32(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 112: { + cH12S1_ = input.readInt32(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 120: { + cH13S2_ = input.readInt32(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 128: { + cH14LT_ = input.readInt32(); + bitField0_ |= 0x00008000; + break; + } // case 128 + case 136: { + cH15RT_ = input.readInt32(); + bitField0_ |= 0x00010000; + break; + } // case 136 + case 144: { + isOnline_ = input.readInt32(); + bitField0_ |= 0x00020000; + break; + } // case 144 + 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 rxIndex_ ; + /** + * int32 RxIndex = 1; + * @return The rxIndex. + */ + @java.lang.Override + public int getRxIndex() { + return rxIndex_; + } + /** + * int32 RxIndex = 1; + * @param value The rxIndex to set. + * @return This builder for chaining. + */ + public Builder setRxIndex(int value) { + + rxIndex_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 RxIndex = 1; + * @return This builder for chaining. + */ + public Builder clearRxIndex() { + bitField0_ = (bitField0_ & ~0x00000001); + rxIndex_ = 0; + onChanged(); + return this; + } + + private int cH0RYH_ ; + /** + * int32 CH0_RY_H = 2; + * @return The cH0RYH. + */ + @java.lang.Override + public int getCH0RYH() { + return cH0RYH_; + } + /** + * int32 CH0_RY_H = 2; + * @param value The cH0RYH to set. + * @return This builder for chaining. + */ + public Builder setCH0RYH(int value) { + + cH0RYH_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 CH0_RY_H = 2; + * @return This builder for chaining. + */ + public Builder clearCH0RYH() { + bitField0_ = (bitField0_ & ~0x00000002); + cH0RYH_ = 0; + onChanged(); + return this; + } + + private int cH1RYV_ ; + /** + * int32 CH1_RY_V = 3; + * @return The cH1RYV. + */ + @java.lang.Override + public int getCH1RYV() { + return cH1RYV_; + } + /** + * int32 CH1_RY_V = 3; + * @param value The cH1RYV to set. + * @return This builder for chaining. + */ + public Builder setCH1RYV(int value) { + + cH1RYV_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int32 CH1_RY_V = 3; + * @return This builder for chaining. + */ + public Builder clearCH1RYV() { + bitField0_ = (bitField0_ & ~0x00000004); + cH1RYV_ = 0; + onChanged(); + return this; + } + + private int cH2LYV_ ; + /** + * int32 CH2_LY_V = 4; + * @return The cH2LYV. + */ + @java.lang.Override + public int getCH2LYV() { + return cH2LYV_; + } + /** + * int32 CH2_LY_V = 4; + * @param value The cH2LYV to set. + * @return This builder for chaining. + */ + public Builder setCH2LYV(int value) { + + cH2LYV_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int32 CH2_LY_V = 4; + * @return This builder for chaining. + */ + public Builder clearCH2LYV() { + bitField0_ = (bitField0_ & ~0x00000008); + cH2LYV_ = 0; + onChanged(); + return this; + } + + private int cH3LYH_ ; + /** + * int32 CH3_LY_H = 5; + * @return The cH3LYH. + */ + @java.lang.Override + public int getCH3LYH() { + return cH3LYH_; + } + /** + * int32 CH3_LY_H = 5; + * @param value The cH3LYH to set. + * @return This builder for chaining. + */ + public Builder setCH3LYH(int value) { + + cH3LYH_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int32 CH3_LY_H = 5; + * @return This builder for chaining. + */ + public Builder clearCH3LYH() { + bitField0_ = (bitField0_ & ~0x00000010); + cH3LYH_ = 0; + onChanged(); + return this; + } + + private int cH4SA_ ; + /** + * int32 CH4_SA = 6; + * @return The cH4SA. + */ + @java.lang.Override + public int getCH4SA() { + return cH4SA_; + } + /** + * int32 CH4_SA = 6; + * @param value The cH4SA to set. + * @return This builder for chaining. + */ + public Builder setCH4SA(int value) { + + cH4SA_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int32 CH4_SA = 6; + * @return This builder for chaining. + */ + public Builder clearCH4SA() { + bitField0_ = (bitField0_ & ~0x00000020); + cH4SA_ = 0; + onChanged(); + return this; + } + + private int cH5SB_ ; + /** + * int32 CH5_SB = 7; + * @return The cH5SB. + */ + @java.lang.Override + public int getCH5SB() { + return cH5SB_; + } + /** + * int32 CH5_SB = 7; + * @param value The cH5SB to set. + * @return This builder for chaining. + */ + public Builder setCH5SB(int value) { + + cH5SB_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * int32 CH5_SB = 7; + * @return This builder for chaining. + */ + public Builder clearCH5SB() { + bitField0_ = (bitField0_ & ~0x00000040); + cH5SB_ = 0; + onChanged(); + return this; + } + + private int cH6SC_ ; + /** + * int32 CH6_SC = 8; + * @return The cH6SC. + */ + @java.lang.Override + public int getCH6SC() { + return cH6SC_; + } + /** + * int32 CH6_SC = 8; + * @param value The cH6SC to set. + * @return This builder for chaining. + */ + public Builder setCH6SC(int value) { + + cH6SC_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * int32 CH6_SC = 8; + * @return This builder for chaining. + */ + public Builder clearCH6SC() { + bitField0_ = (bitField0_ & ~0x00000080); + cH6SC_ = 0; + onChanged(); + return this; + } + + private int cH7SD_ ; + /** + * int32 CH7_SD = 9; + * @return The cH7SD. + */ + @java.lang.Override + public int getCH7SD() { + return cH7SD_; + } + /** + * int32 CH7_SD = 9; + * @param value The cH7SD to set. + * @return This builder for chaining. + */ + public Builder setCH7SD(int value) { + + cH7SD_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * int32 CH7_SD = 9; + * @return This builder for chaining. + */ + public Builder clearCH7SD() { + bitField0_ = (bitField0_ & ~0x00000100); + cH7SD_ = 0; + onChanged(); + return this; + } + + private int cH8SE_ ; + /** + * int32 CH8_SE = 10; + * @return The cH8SE. + */ + @java.lang.Override + public int getCH8SE() { + return cH8SE_; + } + /** + * int32 CH8_SE = 10; + * @param value The cH8SE to set. + * @return This builder for chaining. + */ + public Builder setCH8SE(int value) { + + cH8SE_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * int32 CH8_SE = 10; + * @return This builder for chaining. + */ + public Builder clearCH8SE() { + bitField0_ = (bitField0_ & ~0x00000200); + cH8SE_ = 0; + onChanged(); + return this; + } + + private int cH9SF_ ; + /** + * int32 CH9_SF = 11; + * @return The cH9SF. + */ + @java.lang.Override + public int getCH9SF() { + return cH9SF_; + } + /** + * int32 CH9_SF = 11; + * @param value The cH9SF to set. + * @return This builder for chaining. + */ + public Builder setCH9SF(int value) { + + cH9SF_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * int32 CH9_SF = 11; + * @return This builder for chaining. + */ + public Builder clearCH9SF() { + bitField0_ = (bitField0_ & ~0x00000400); + cH9SF_ = 0; + onChanged(); + return this; + } + + private int cH10LD1_ ; + /** + * int32 CH10_LD1 = 12; + * @return The cH10LD1. + */ + @java.lang.Override + public int getCH10LD1() { + return cH10LD1_; + } + /** + * int32 CH10_LD1 = 12; + * @param value The cH10LD1 to set. + * @return This builder for chaining. + */ + public Builder setCH10LD1(int value) { + + cH10LD1_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * int32 CH10_LD1 = 12; + * @return This builder for chaining. + */ + public Builder clearCH10LD1() { + bitField0_ = (bitField0_ & ~0x00000800); + cH10LD1_ = 0; + onChanged(); + return this; + } + + private int cH11RD1_ ; + /** + * int32 CH11_RD1 = 13; + * @return The cH11RD1. + */ + @java.lang.Override + public int getCH11RD1() { + return cH11RD1_; + } + /** + * int32 CH11_RD1 = 13; + * @param value The cH11RD1 to set. + * @return This builder for chaining. + */ + public Builder setCH11RD1(int value) { + + cH11RD1_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * int32 CH11_RD1 = 13; + * @return This builder for chaining. + */ + public Builder clearCH11RD1() { + bitField0_ = (bitField0_ & ~0x00001000); + cH11RD1_ = 0; + onChanged(); + return this; + } + + private int cH12S1_ ; + /** + * int32 CH12_S1 = 14; + * @return The cH12S1. + */ + @java.lang.Override + public int getCH12S1() { + return cH12S1_; + } + /** + * int32 CH12_S1 = 14; + * @param value The cH12S1 to set. + * @return This builder for chaining. + */ + public Builder setCH12S1(int value) { + + cH12S1_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * int32 CH12_S1 = 14; + * @return This builder for chaining. + */ + public Builder clearCH12S1() { + bitField0_ = (bitField0_ & ~0x00002000); + cH12S1_ = 0; + onChanged(); + return this; + } + + private int cH13S2_ ; + /** + * int32 CH13_S2 = 15; + * @return The cH13S2. + */ + @java.lang.Override + public int getCH13S2() { + return cH13S2_; + } + /** + * int32 CH13_S2 = 15; + * @param value The cH13S2 to set. + * @return This builder for chaining. + */ + public Builder setCH13S2(int value) { + + cH13S2_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * int32 CH13_S2 = 15; + * @return This builder for chaining. + */ + public Builder clearCH13S2() { + bitField0_ = (bitField0_ & ~0x00004000); + cH13S2_ = 0; + onChanged(); + return this; + } + + private int cH14LT_ ; + /** + * int32 CH14_LT = 16; + * @return The cH14LT. + */ + @java.lang.Override + public int getCH14LT() { + return cH14LT_; + } + /** + * int32 CH14_LT = 16; + * @param value The cH14LT to set. + * @return This builder for chaining. + */ + public Builder setCH14LT(int value) { + + cH14LT_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * int32 CH14_LT = 16; + * @return This builder for chaining. + */ + public Builder clearCH14LT() { + bitField0_ = (bitField0_ & ~0x00008000); + cH14LT_ = 0; + onChanged(); + return this; + } + + private int cH15RT_ ; + /** + * int32 CH15_RT = 17; + * @return The cH15RT. + */ + @java.lang.Override + public int getCH15RT() { + return cH15RT_; + } + /** + * int32 CH15_RT = 17; + * @param value The cH15RT to set. + * @return This builder for chaining. + */ + public Builder setCH15RT(int value) { + + cH15RT_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * int32 CH15_RT = 17; + * @return This builder for chaining. + */ + public Builder clearCH15RT() { + bitField0_ = (bitField0_ & ~0x00010000); + cH15RT_ = 0; + onChanged(); + return this; + } + + private int isOnline_ ; + /** + * int32 IsOnline = 18; + * @return The isOnline. + */ + @java.lang.Override + public int getIsOnline() { + return isOnline_; + } + /** + * int32 IsOnline = 18; + * @param value The isOnline to set. + * @return This builder for chaining. + */ + public Builder setIsOnline(int value) { + + isOnline_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * int32 IsOnline = 18; + * @return This builder for chaining. + */ + public Builder clearIsOnline() { + bitField0_ = (bitField0_ & ~0x00020000); + isOnline_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:SP_MSP_MK32_Button) + } + + // @@protoc_insertion_point(class_scope:SP_MSP_MK32_Button) + private static final com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button(); + } + + public static com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SP_MSP_MK32_Button parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.bingoorobot.foreignobjectcuttingapp.models.MspMK32.SP_MSP_MK32_Button getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_SP_MSP_MK32_Button_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_SP_MSP_MK32_Button_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\016msp_MK32.proto\"\307\002\n\022SP_MSP_MK32_Button\022" + + "\017\n\007RxIndex\030\001 \001(\005\022\020\n\010CH0_RY_H\030\002 \001(\005\022\020\n\010CH" + + "1_RY_V\030\003 \001(\005\022\020\n\010CH2_LY_V\030\004 \001(\005\022\020\n\010CH3_LY" + + "_H\030\005 \001(\005\022\016\n\006CH4_SA\030\006 \001(\005\022\016\n\006CH5_SB\030\007 \001(\005" + + "\022\016\n\006CH6_SC\030\010 \001(\005\022\016\n\006CH7_SD\030\t \001(\005\022\016\n\006CH8_" + + "SE\030\n \001(\005\022\016\n\006CH9_SF\030\013 \001(\005\022\020\n\010CH10_LD1\030\014 \001" + + "(\005\022\020\n\010CH11_RD1\030\r \001(\005\022\017\n\007CH12_S1\030\016 \001(\005\022\017\n" + + "\007CH13_S2\030\017 \001(\005\022\017\n\007CH14_LT\030\020 \001(\005\022\017\n\007CH15_" + + "RT\030\021 \001(\005\022\020\n\010IsOnline\030\022 \001(\005B2\n.com.bingoo" + + "robot.foreignobjectcuttingapp.modelsP\000b\006" + + "proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_SP_MSP_MK32_Button_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_SP_MSP_MK32_Button_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_SP_MSP_MK32_Button_descriptor, + new java.lang.String[] { "RxIndex", "CH0RYH", "CH1RYV", "CH2LYV", "CH3LYH", "CH4SA", "CH5SB", "CH6SC", "CH7SD", "CH8SE", "CH9SF", "CH10LD1", "CH11RD1", "CH12S1", "CH13S2", "CH14LT", "CH15RT", "IsOnline", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/ScrollBottomScrollView.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/models/ScrollBottomScrollView.java new file mode 100644 index 0000000..fcf68f5 --- /dev/null +++ b/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; + } + } +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/CustomProber.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/CustomProber.java new file mode 100644 index 0000000..651b52b --- /dev/null +++ b/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); + } + +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/DataExchangeHelper.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/DataExchangeHelper.java new file mode 100644 index 0000000..065546d --- /dev/null +++ b/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; + } +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ErrorDeocdeHelper.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ErrorDeocdeHelper.java new file mode 100644 index 0000000..926e22a --- /dev/null +++ b/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; + } +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/FilpViewHelper.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/FilpViewHelper.java new file mode 100644 index 0000000..782d72a --- /dev/null +++ b/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) {} + + + +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ModbusCRC.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ModbusCRC.java new file mode 100644 index 0000000..f74c227 --- /dev/null +++ b/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; + } +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/MyDataHelper.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/MyDataHelper.java new file mode 100644 index 0000000..d677e0f --- /dev/null +++ b/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"; + } +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/PopupHelper.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/PopupHelper.java new file mode 100644 index 0000000..be70412 --- /dev/null +++ b/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(); // 显示弹窗 + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ReceiivedDataHandler.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ReceiivedDataHandler.java new file mode 100644 index 0000000..e333678 --- /dev/null +++ b/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); + } + +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/UDPHelper.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/UDPHelper.java new file mode 100644 index 0000000..9f0cad9 --- /dev/null +++ b/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(); + } + } + +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/VideoPlayerHelper.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/VideoPlayerHelper.java new file mode 100644 index 0000000..3d7edd8 --- /dev/null +++ b/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(); + } +} + diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/WebViewHelper.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/WebViewHelper.java new file mode 100644 index 0000000..5a6ee08 --- /dev/null +++ b/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); + } +} diff --git a/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ttySerialPortHelper.java b/app/src/main/java/com/bingoorobot/foreignobjectcuttingapp/services/ttySerialPortHelper.java new file mode 100644 index 0000000..5095fcd --- /dev/null +++ b/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(); + } + +} diff --git a/app/src/main/java/generate_Csharp.bat b/app/src/main/java/generate_Csharp.bat new file mode 100644 index 0000000..76f0ecc --- /dev/null +++ b/app/src/main/java/generate_Csharp.bat @@ -0,0 +1 @@ +protoc --csharp_out=. *.proto \ No newline at end of file diff --git a/app/src/main/java/generate_java.bat b/app/src/main/java/generate_java.bat new file mode 100644 index 0000000..59085ae --- /dev/null +++ b/app/src/main/java/generate_java.bat @@ -0,0 +1 @@ + protoc --java_out . *.proto diff --git a/app/src/main/java/msp_MK32.proto b/app/src/main/java/msp_MK32.proto new file mode 100644 index 0000000..f6f6d18 --- /dev/null +++ b/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; + } + diff --git a/app/src/main/java/protoc.exe b/app/src/main/java/protoc.exe new file mode 100644 index 0000000..f1ffb02 Binary files /dev/null and b/app/src/main/java/protoc.exe differ diff --git a/app/src/main/res/drawable/background.xml b/app/src/main/res/drawable/background.xml new file mode 100644 index 0000000..9c77c74 --- /dev/null +++ b/app/src/main/res/drawable/background.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/bgr.png b/app/src/main/res/drawable/bgr.png new file mode 100644 index 0000000..4d6154f Binary files /dev/null and b/app/src/main/res/drawable/bgr.png differ diff --git a/app/src/main/res/drawable/bigackground.png b/app/src/main/res/drawable/bigackground.png new file mode 100644 index 0000000..8466de6 Binary files /dev/null and b/app/src/main/res/drawable/bigackground.png differ diff --git a/app/src/main/res/drawable/blue_rounded_rectangle.xml b/app/src/main/res/drawable/blue_rounded_rectangle.xml new file mode 100644 index 0000000..81841b0 --- /dev/null +++ b/app/src/main/res/drawable/blue_rounded_rectangle.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/border.xml b/app/src/main/res/drawable/border.xml new file mode 100644 index 0000000..4f76948 --- /dev/null +++ b/app/src/main/res/drawable/border.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/app/src/main/res/drawable/borderblue.xml b/app/src/main/res/drawable/borderblue.xml new file mode 100644 index 0000000..ca7bf05 --- /dev/null +++ b/app/src/main/res/drawable/borderblue.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/borderbluegreen.xml b/app/src/main/res/drawable/borderbluegreen.xml new file mode 100644 index 0000000..25d3346 --- /dev/null +++ b/app/src/main/res/drawable/borderbluegreen.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/bordergreen.xml b/app/src/main/res/drawable/bordergreen.xml new file mode 100644 index 0000000..ceb3020 --- /dev/null +++ b/app/src/main/res/drawable/bordergreen.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/borderlog.xml b/app/src/main/res/drawable/borderlog.xml new file mode 100644 index 0000000..1a1b34c --- /dev/null +++ b/app/src/main/res/drawable/borderlog.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/borderorange.xml b/app/src/main/res/drawable/borderorange.xml new file mode 100644 index 0000000..9451689 --- /dev/null +++ b/app/src/main/res/drawable/borderorange.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/borderwhite.xml b/app/src/main/res/drawable/borderwhite.xml new file mode 100644 index 0000000..e013ef8 --- /dev/null +++ b/app/src/main/res/drawable/borderwhite.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/buttonborderwhite.xml b/app/src/main/res/drawable/buttonborderwhite.xml new file mode 100644 index 0000000..ec98fab --- /dev/null +++ b/app/src/main/res/drawable/buttonborderwhite.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/dash_line.xml b/app/src/main/res/drawable/dash_line.xml new file mode 100644 index 0000000..c83a8c5 --- /dev/null +++ b/app/src/main/res/drawable/dash_line.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/divider.xml b/app/src/main/res/drawable/divider.xml new file mode 100644 index 0000000..f54ce33 --- /dev/null +++ b/app/src/main/res/drawable/divider.xml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/orange_rounded_rectangle.xml b/app/src/main/res/drawable/orange_rounded_rectangle.xml new file mode 100644 index 0000000..6545563 --- /dev/null +++ b/app/src/main/res/drawable/orange_rounded_rectangle.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/radio_button_selected.xml b/app/src/main/res/drawable/radio_button_selected.xml new file mode 100644 index 0000000..c745d8c --- /dev/null +++ b/app/src/main/res/drawable/radio_button_selected.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/radio_button_textcolor.xml b/app/src/main/res/drawable/radio_button_textcolor.xml new file mode 100644 index 0000000..9fe93c7 --- /dev/null +++ b/app/src/main/res/drawable/radio_button_textcolor.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/app/src/main/res/drawable/radio_button_unselected.xml b/app/src/main/res/drawable/radio_button_unselected.xml new file mode 100644 index 0000000..ccb6bf8 --- /dev/null +++ b/app/src/main/res/drawable/radio_button_unselected.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/app/src/main/res/drawable/radiobutton_background.xml b/app/src/main/res/drawable/radiobutton_background.xml new file mode 100644 index 0000000..6eb6a48 --- /dev/null +++ b/app/src/main/res/drawable/radiobutton_background.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/rounded_edittext.xml b/app/src/main/res/drawable/rounded_edittext.xml new file mode 100644 index 0000000..9f845ce --- /dev/null +++ b/app/src/main/res/drawable/rounded_edittext.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/smallbackground.png b/app/src/main/res/drawable/smallbackground.png new file mode 100644 index 0000000..1f6f84f Binary files /dev/null and b/app/src/main/res/drawable/smallbackground.png differ diff --git a/app/src/main/res/drawable/squrelogo.png b/app/src/main/res/drawable/squrelogo.png new file mode 100644 index 0000000..f7cafaf Binary files /dev/null and b/app/src/main/res/drawable/squrelogo.png differ diff --git a/app/src/main/res/drawable/submenu.xml b/app/src/main/res/drawable/submenu.xml new file mode 100644 index 0000000..64f9e41 --- /dev/null +++ b/app/src/main/res/drawable/submenu.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/font/font_you_yuan.ttf b/app/src/main/res/font/font_you_yuan.ttf new file mode 100644 index 0000000..0d6e9c2 Binary files /dev/null and b/app/src/main/res/font/font_you_yuan.ttf differ diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..4c23489 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,714 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/log_item.xml b/app/src/main/res/layout/log_item.xml new file mode 100644 index 0000000..f6397a4 --- /dev/null +++ b/app/src/main/res/layout/log_item.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/manualmodepopup.xml b/app/src/main/res/layout/manualmodepopup.xml new file mode 100644 index 0000000..c2909ca --- /dev/null +++ b/app/src/main/res/layout/manualmodepopup.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..b228900 --- /dev/null +++ b/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..a592923 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,165 @@ + + + #FF000000 + #FFFFFFFF + #FFFFFFFF + + #3F51B5 + #303F9F + #FF4081 + + + #FBE5D6 + #1F4E79 + #00ACFC + #DEEBF7 + #FBE5D6 + #FF713D + #001E54 + #00194d + #00ADFC + + + #fffafa + #fffaf0 + #ffebcd + #f8f8ff + #f5f5f5 + #faebd7 + #ffdead + #808080 + #dcdcdc + #d3d3d3 + #a9a9a9 + #696969 + #708090 + #778899 + #2f4f4f + #c0c0c0 + + #ff0000 + #8b0000 + #dc143c + #8b008b + #ff00ff + #ff6347 + #f08080 + #e9967a + #ffdab9 + #dda0dd + #ffc0cb + #ffb6c1 + #ff1493 + #ff69b4 + #fff0f5 + #cd5c5c + #bc8f8f + #b22222 + #800000 + #f0fff0 + #ff4500 + #ffa500 + #32cd32 + #00ff00 + #ffff00 + #f5deb3 + #f0e68c + #deb887 + #ffe4c4 + #ffffe0 + #b8860b + #ff8c00 + #fafad2 + #fffacd + #fff8dc + #fff5ee + #ffefd5 + #ffe4e1 + #ffe4b5 + #fffff0 + #ffd700 + #daa520 + #ffa07a + #ff7f50 + #f5fffa + #f5f5dc + #f4a460 + #fdf5e6 + #faf0e6 + #fa8072 + #d8bfd8 + #d2b48c + #d2691e + #cd853f + #bdb76b + #eee8aa + #a52a2a + #8b4513 + #a0522d + #808000 + #7fff00 + #adff2f + #008000 + #006400 + #556b2f + #6b8e23 + #7cfc00 + #228b22 + #7fffd4 + #afeeee + #98fb98 + #48d1cc + #66cdaa + #00ffff + #00ff7f + #00fa9a + #00ced1 + #2e8b57 + #90ee90 + #8fbc8f + #40e0d0 + #00ffff + #008b8b + #e0ffff + #008080 + #4b0082 + #0000ff + #00008b + #0000cd + #191970 + #000080 + #4169e1 + #f0ffff + #87ceeb + #00bfff + #87cefa + #20b2aa + #add8e6 + #b0e0e6 + #f0f8ff + #7b68ee + #6a5acd + #483d8b + #3cb371 + #4682b4 + #b0c4de + #6495ed + #1e90ff + #5f9ea0 + #8a2be2 + #800080 + #e6e6fa + #da70d6 + #9370db + #9932cc + #ee82ee + #c71585 + #db7093 + #9400d3 + #ba55d3 + #00000000 + + #6efe00 + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..a9f8aab --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,12 @@ + + 负压吸附1.2 + 状\u3000态 + 速\u3000度 + 风\u3000速 + 压\u3000力 + 角\u3000度 + 方\u3000向 + 高\u3000度 + 手动\n模式 + 20 + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..38cfb14 --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/data_extraction_rules.xml b/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/device_filter.xml b/app/src/main/res/xml/device_filter.xml new file mode 100644 index 0000000..b2a252c --- /dev/null +++ b/app/src/main/res/xml/device_filter.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/test/java/com/bingoorobot/foreignobjectcuttingapp/ExampleUnitTest.java b/app/src/test/java/com/bingoorobot/foreignobjectcuttingapp/ExampleUnitTest.java new file mode 100644 index 0000000..d69e9aa --- /dev/null +++ b/app/src/test/java/com/bingoorobot/foreignobjectcuttingapp/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.bingoorobot.foreignobjectcuttingapp; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..ea2bb78 --- /dev/null +++ b/build.gradle @@ -0,0 +1,4 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { +id 'com.android.application' version '8.2.2' apply false +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..72611fe --- /dev/null +++ b/gradle.properties @@ -0,0 +1,23 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true + +android.enableJetifier=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ba4e821 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Sat Aug 23 10:02:51 CST 2025 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..4f906e0 --- /dev/null +++ b/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/local.properties b/local.properties new file mode 100644 index 0000000..1b1a619 --- /dev/null +++ b/local.properties @@ -0,0 +1,8 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Wed May 27 16:58:43 CST 2026 +sdk.dir=D\:\\Program Files\\Android\\Sdk diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..f1dbb7d --- /dev/null +++ b/settings.gradle @@ -0,0 +1,18 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven { url 'https://jitpack.io' } + } +} + +rootProject.name = "Negative_Pressure_AppV1.2" +include ':app'