diff --git a/diaoerqiege/diaoerqige_V1.0/.gitignore b/diaoerqiege/diaoerqige_V1.0/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/.gitignore b/diaoerqiege/diaoerqige_V1.0/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/.name b/diaoerqiege/diaoerqige_V1.0/.idea/.name new file mode 100644 index 0000000..5126a6f --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/.name @@ -0,0 +1 @@ +diaoerqiegeapp \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/AndroidProjectSystem.xml b/diaoerqiege/diaoerqige_V1.0/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/compiler.xml b/diaoerqiege/diaoerqige_V1.0/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/deploymentTargetDropDown.xml b/diaoerqiege/diaoerqige_V1.0/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..0c0c338 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/deploymentTargetSelector.xml b/diaoerqiege/diaoerqige_V1.0/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..f09202a --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/deploymentTargetSelector.xml @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/gradle.xml b/diaoerqiege/diaoerqige_V1.0/.idea/gradle.xml new file mode 100644 index 0000000..7b3006b --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/migrations.xml b/diaoerqiege/diaoerqige_V1.0/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/misc.xml b/diaoerqiege/diaoerqige_V1.0/.idea/misc.xml new file mode 100644 index 0000000..b2c751a --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/render.experimental.xml b/diaoerqiege/diaoerqige_V1.0/.idea/render.experimental.xml new file mode 100644 index 0000000..8ec256a --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/render.experimental.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/runConfigurations.xml b/diaoerqiege/diaoerqige_V1.0/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/.idea/vcs.xml b/diaoerqiege/diaoerqige_V1.0/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/README.md b/diaoerqiege/diaoerqige_V1.0/README.md new file mode 100644 index 0000000..e69de29 diff --git a/diaoerqiege/diaoerqige_V1.0/app/.gitignore b/diaoerqiege/diaoerqige_V1.0/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/build.gradle b/diaoerqiege/diaoerqige_V1.0/app/build.gradle new file mode 100644 index 0000000..cf511b8 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/build.gradle @@ -0,0 +1,58 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.diaoerqiegeapp' + compileSdk 35 + viewBinding + { + enabled true + } + // //add this feature + dataBinding + { + enabled true + } + defaultConfig { + applicationId "com.example.guohuawindpowerapp" + minSdk 24 + targetSdk 35 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + buildFeatures{ + buildConfig true + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.9.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + implementation 'com.github.mik3y:usb-serial-for-android:3.7.0' + implementation 'com.google.protobuf:protobuf-java:4.27.2' + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20") + implementation 'com.github.nodemedia:nodemediaclient-android:2.9.20' + implementation 'io.github.xmaihh:serialport:2.1.1' + + + +} \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/proguard-rules.pro b/diaoerqiege/diaoerqige_V1.0/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/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/diaoerqiege/diaoerqige_V1.0/app/release/output-metadata.json b/diaoerqiege/diaoerqige_V1.0/app/release/output-metadata.json new file mode 100644 index 0000000..b20c26e --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/release/output-metadata.json @@ -0,0 +1,20 @@ +{ + "version": 3, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.example.rougheningapp", + "variantName": "release", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "attributes": [], + "versionCode": 1, + "versionName": "1.0", + "outputFile": "app-release.apk" + } + ], + "elementType": "File" +} \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/androidTest/java/com/example/diaoerqiegeapp/ExampleInstrumentedTest.java b/diaoerqiege/diaoerqige_V1.0/app/src/androidTest/java/com/example/diaoerqiegeapp/ExampleInstrumentedTest.java new file mode 100644 index 0000000..7769389 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/androidTest/java/com/example/diaoerqiegeapp/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.diaoerqiegeapp; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.example.rougheningapp", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/AndroidManifest.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ea648b1 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/AndroidManifest.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/bsp_IV.proto b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/bsp_IV.proto new file mode 100644 index 0000000..b92ec98 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/bsp_IV.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +option java_multiple_files = false; +option java_package = "com.example.diaoerqiegeapp.models"; + +message IV_struct_define +{ + double Robot_Move_Speed= 1; + int32 RF_Angle_Roll = 2; + int32 Remote_Status = 3; + int32 laser_sensor_1_measure_distance = 4; + int32 laser_sensor_2_measure_distance = 5; + int32 laser_sensor_3_measure_distance = 6; +}; diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/bsp_PV.proto b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/bsp_PV.proto new file mode 100644 index 0000000..c1ab6c5 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/bsp_PV.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +option java_multiple_files = false; +option java_package = "com.example.diaoerqiegeapp.models"; +message PV_struct_define{ + + int32 robot_operation_mode = 1; + int32 knife_descending_height = 2; + int32 main_axis_speed = 3; +}; diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/MainActivity.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/MainActivity.java new file mode 100644 index 0000000..edf2b2a --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/MainActivity.java @@ -0,0 +1,272 @@ +package com.example.diaoerqiegeapp; + +import android.app.AlertDialog; +import android.content.DialogInterface; +import android.os.Bundle; +import android.text.Editable; +import android.text.InputFilter; +import android.text.TextUtils; +import android.text.TextWatcher; +import android.view.View; +import android.view.WindowManager; +import android.widget.Toast; +import androidx.appcompat.app.AppCompatActivity; +import androidx.databinding.DataBindingUtil; +import androidx.databinding.adapters.TextViewBindingAdapter; + +import com.example.diaoerqiegeapp.databinding.ActivityPolishBinding; +import com.example.diaoerqiegeapp.models.BspPV; +import com.example.diaoerqiegeapp.models.DisplayPV; +import com.example.diaoerqiegeapp.services.DecimalDigitsInputFilter; +import com.example.diaoerqiegeapp.services.ModbusCRC; +import com.example.diaoerqiegeapp.services.MyDataHelper; +import com.example.diaoerqiegeapp.services.PopupHelper; +import com.example.diaoerqiegeapp.services.USBSerialPortHelper; +import com.example.diaoerqiegeapp.services.VideoPlayerHelper; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.Timer; +import java.util.TimerTask; +import cn.nodemedia.NodePlayer; + +public class MainActivity extends AppCompatActivity { + public ActivityPolishBinding mainBinding; + public USBSerialPortHelper serialPortHelper;//串口接收类 + private BspPV.PV_struct_define _toSendPV; + Timer timer = new Timer(); + Timer timer_saveData = new Timer(); + public MyDataHelper myDataHelper = new MyDataHelper(this);//数据库类 + public PopupHelper popupHelper = new PopupHelper(this);//对话框类,把主界面实例传过去 + public String _Operate_Mode_Call_Value = "手动作业"; // 默认为手动作业 + /*报错相关*/ + private List errorHistory = new LinkedList<>(); + private Set uniqueErrors = new HashSet<>(); + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + //设置全屏显示 + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); + mainBinding= DataBindingUtil.setContentView(this,R.layout.activity_polish); + + /* USB串口 控制区域*/ + serialPortHelper = new USBSerialPortHelper(this); + serialPortHelper.intialize(); + serialPortHelper.connect(); + + myDataHelper.IntializeDataBasePolish(); + //读取并显示数据 + List pvList = myDataHelper.getDisplayDataPolish(1); //按id查询数据赋值给界面 + mainBinding.knifeDescent.setText(String.valueOf(pvList.get(0).getKinfeDescendHeight())); + mainBinding.mainAxisSpeed.setText(String.valueOf(pvList.get(0).getMainAxisSpeed())); + + /*发往32*/ + timer.schedule(new TimerTask() { + @Override + public void run() { + // 使用 Handler 或 runOnUiThread 更新 UI + runOnUiThread(new Runnable() { + @Override + public void run() { + + // 更新 UI 的代码 + //必须有 + _toSendPV = BspPV.PV_struct_define.newBuilder() + .setRobotOperationMode(1) + .setKnifeDescendingHeight(1) + .setMainAxisSpeed(10) + + .build(); + + // 刀下降高度 + String knife_descent = mainBinding.knifeDescent.getText().toString(); + try { + if( knife_descent.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setKnifeDescendingHeight(1).build();} + + else { _toSendPV = _toSendPV.toBuilder() + .setKnifeDescendingHeight(Integer.parseInt(mainBinding.knifeDescent.getText().toString())).build(); + } + } + catch (Exception e) + { + + } + + // 强磨机主轴速度 + String main_axis_speed = mainBinding.mainAxisSpeed.getText().toString(); + try { + if( main_axis_speed.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setMainAxisSpeed(10).build();} + + else { _toSendPV = _toSendPV.toBuilder() + .setMainAxisSpeed(Integer.parseInt(mainBinding.mainAxisSpeed.getText().toString())).build(); + } + } + catch (Exception e) + { + + } + + + if(_Operate_Mode_Call_Value.equals("手动作业")) + { + _toSendPV = _toSendPV.toBuilder().setRobotOperationMode(1).build(); + } + if(_Operate_Mode_Call_Value.equals("自动作业")) + { + _toSendPV = _toSendPV.toBuilder().setRobotOperationMode(2).build(); + } + + byte[] byteArray = _toSendPV.toByteArray(); + byte[] sendbyteArray = new byte[byteArray.length + 4]; + byte[] sendbyteArray3 = new byte[byteArray.length + 6]; + if (byteArray.length != 0) { + System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); + } + sendbyteArray[0] = (byte) 0x55; + sendbyteArray[1] = (byte) 0x55; + sendbyteArray[2] = (byte) 0x01; + sendbyteArray[3] = (byte) 0x01; + + byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); + + System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); + + System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); + + serialPortHelper.SendData(sendbyteArray3); + } + }); + } + }, 0, 1000); // 延迟 0 毫秒,每隔 1000 毫秒执行一次 + + + mainBinding.operateModeDisplay.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + popupHelper.OperateModePolishPopup(this); + } + }); + + mainBinding.mainAxisSpeed.addTextChangedListener(new TextWatcher() { + // 用于标记是否正在处理输入,避免无限循环 + private boolean isEditing = false; + + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + } + + @Override + public void afterTextChanged(Editable s) { + if (isEditing) { + return; + } + + isEditing = true; + try { + String input = s.toString().trim(); + + // 空内容直接放行 + if (input.isEmpty()) { + isEditing = false; + return; + } + + // 转整数 + int value = Integer.parseInt(input); + + // 限制范围 0 ~ 3000 + if (value < 0) { + s.replace(0, s.length(), "0"); + } else if (value > 3000) { + s.replace(0, s.length(), "3000"); + } + + } catch (NumberFormatException e) { + // 非数字 → 清空 + s.clear(); + } finally { + isEditing = false; + } + } + }); + + timer_saveData.schedule(new TimerTask() { + @Override + public void run() { + try { + //获取界面参数以写进数据库 + int paraIndex = 1; +// double verticalAdjust = Double.parseDouble(mainBinding.MaintvVerticalAdjustTo32.getText().toString()); + int knifeDescent = Integer.parseInt(mainBinding.knifeDescent.getText().toString()); + int mainAxisSpeed = Integer.parseInt(mainBinding.mainAxisSpeed.getText().toString()); + + // 把界面中的值放进PV类的变量中 + DisplayPV displayPV = new DisplayPV(paraIndex, knifeDescent,mainAxisSpeed); + myDataHelper.addOrUpdateDisplayDataPolish(displayPV); //创建数据库的实例在这里 PV传进去保存到数据库 +// Toast.makeText(MainActivity.this, "保存成功", Toast.LENGTH_SHORT).show(); + } + catch (Exception e) + { + + } + + } + },0,1000); + +// mainBinding.btnSave.setOnClickListener(new View.OnClickListener() { +// @Override +// public void onClick(View v) { +// //获取界面参数以写进数据库 +// int paraIndex = 1; +//// double verticalAdjust = Double.parseDouble(mainBinding.MaintvVerticalAdjustTo32.getText().toString()); +// int knifeDescent = Integer.parseInt(mainBinding.knifeDescent.getText().toString()); +// int mainAxisSpeed = Integer.parseInt(mainBinding.mainAxisSpeed.getText().toString()); +// +// // 把界面中的值放进PV类的变量中 +// DisplayPV displayPV = new DisplayPV(paraIndex, knifeDescent,mainAxisSpeed); +// myDataHelper.addOrUpdateDisplayDataPolish(displayPV); //创建数据库的实例在这里 PV传进去保存到数据库 +// Toast.makeText(MainActivity.this, "保存成功", Toast.LENGTH_SHORT).show(); +// } +// }); + } + + private void showToast(String message) + { + Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); + } + public void showError(String errorMessage) { + if (uniqueErrors.add(errorMessage)) { + errorHistory.add(errorMessage); + mainBinding.errorTextView.setText(errorMessage); + } + } + public void showErrorHistoryDialog() { + if (errorHistory.isEmpty()) { + return; + } + + StringBuilder historyText = new StringBuilder(); + for (String error : errorHistory) { + historyText.append(error).append("\n"); + } + + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle("历史报错信息") + .setMessage(historyText.toString()) + .setPositiveButton("关闭", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + + AlertDialog dialog = builder.create(); + dialog.show(); + } +} \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/BspIV.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/BspIV.java new file mode 100644 index 0000000..9816a3a --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/BspIV.java @@ -0,0 +1,860 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: bsp_IV.proto +// Protobuf Java Version: 4.27.2 + +package com.example.diaoerqiegeapp.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 { + + /** + * double Robot_Move_Speed = 1; + * @return The robotMoveSpeed. + */ + double getRobotMoveSpeed(); + + /** + * int32 RF_Angle_Roll = 2; + * @return The rFAngleRoll. + */ + int getRFAngleRoll(); + + /** + * int32 Remote_Status = 3; + * @return The remoteStatus. + */ + int getRemoteStatus(); + + /** + * int32 laser_sensor_1_measure_distance = 4; + * @return The laserSensor1MeasureDistance. + */ + int getLaserSensor1MeasureDistance(); + + /** + * int32 laser_sensor_2_measure_distance = 5; + * @return The laserSensor2MeasureDistance. + */ + int getLaserSensor2MeasureDistance(); + + /** + * int32 laser_sensor_3_measure_distance = 6; + * @return The laserSensor3MeasureDistance. + */ + int getLaserSensor3MeasureDistance(); + } + /** + * Protobuf type {@code IV_struct_define} + */ + public static final class IV_struct_define extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:IV_struct_define) + IV_struct_defineOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + IV_struct_define.class.getName()); + } + // Use IV_struct_define.newBuilder() to construct. + private IV_struct_define(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private IV_struct_define() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.diaoerqiegeapp.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.diaoerqiegeapp.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.diaoerqiegeapp.models.BspIV.IV_struct_define.class, com.example.diaoerqiegeapp.models.BspIV.IV_struct_define.Builder.class); + } + + public static final int ROBOT_MOVE_SPEED_FIELD_NUMBER = 1; + private double robotMoveSpeed_ = 0D; + /** + * double Robot_Move_Speed = 1; + * @return The robotMoveSpeed. + */ + @java.lang.Override + public double getRobotMoveSpeed() { + return robotMoveSpeed_; + } + + public static final int RF_ANGLE_ROLL_FIELD_NUMBER = 2; + private int rFAngleRoll_ = 0; + /** + * int32 RF_Angle_Roll = 2; + * @return The rFAngleRoll. + */ + @java.lang.Override + public int getRFAngleRoll() { + return rFAngleRoll_; + } + + public static final int REMOTE_STATUS_FIELD_NUMBER = 3; + private int remoteStatus_ = 0; + /** + * int32 Remote_Status = 3; + * @return The remoteStatus. + */ + @java.lang.Override + public int getRemoteStatus() { + return remoteStatus_; + } + + public static final int LASER_SENSOR_1_MEASURE_DISTANCE_FIELD_NUMBER = 4; + private int laserSensor1MeasureDistance_ = 0; + /** + * int32 laser_sensor_1_measure_distance = 4; + * @return The laserSensor1MeasureDistance. + */ + @java.lang.Override + public int getLaserSensor1MeasureDistance() { + return laserSensor1MeasureDistance_; + } + + public static final int LASER_SENSOR_2_MEASURE_DISTANCE_FIELD_NUMBER = 5; + private int laserSensor2MeasureDistance_ = 0; + /** + * int32 laser_sensor_2_measure_distance = 5; + * @return The laserSensor2MeasureDistance. + */ + @java.lang.Override + public int getLaserSensor2MeasureDistance() { + return laserSensor2MeasureDistance_; + } + + public static final int LASER_SENSOR_3_MEASURE_DISTANCE_FIELD_NUMBER = 6; + private int laserSensor3MeasureDistance_ = 0; + /** + * int32 laser_sensor_3_measure_distance = 6; + * @return The laserSensor3MeasureDistance. + */ + @java.lang.Override + public int getLaserSensor3MeasureDistance() { + return laserSensor3MeasureDistance_; + } + + 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 (java.lang.Double.doubleToRawLongBits(robotMoveSpeed_) != 0) { + output.writeDouble(1, robotMoveSpeed_); + } + if (rFAngleRoll_ != 0) { + output.writeInt32(2, rFAngleRoll_); + } + if (remoteStatus_ != 0) { + output.writeInt32(3, remoteStatus_); + } + if (laserSensor1MeasureDistance_ != 0) { + output.writeInt32(4, laserSensor1MeasureDistance_); + } + if (laserSensor2MeasureDistance_ != 0) { + output.writeInt32(5, laserSensor2MeasureDistance_); + } + if (laserSensor3MeasureDistance_ != 0) { + output.writeInt32(6, laserSensor3MeasureDistance_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(robotMoveSpeed_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(1, robotMoveSpeed_); + } + if (rFAngleRoll_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, rFAngleRoll_); + } + if (remoteStatus_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, remoteStatus_); + } + if (laserSensor1MeasureDistance_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, laserSensor1MeasureDistance_); + } + if (laserSensor2MeasureDistance_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, laserSensor2MeasureDistance_); + } + if (laserSensor3MeasureDistance_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, laserSensor3MeasureDistance_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.example.diaoerqiegeapp.models.BspIV.IV_struct_define)) { + return super.equals(obj); + } + com.example.diaoerqiegeapp.models.BspIV.IV_struct_define other = (com.example.diaoerqiegeapp.models.BspIV.IV_struct_define) obj; + + if (java.lang.Double.doubleToLongBits(getRobotMoveSpeed()) + != java.lang.Double.doubleToLongBits( + other.getRobotMoveSpeed())) return false; + if (getRFAngleRoll() + != other.getRFAngleRoll()) return false; + if (getRemoteStatus() + != other.getRemoteStatus()) return false; + if (getLaserSensor1MeasureDistance() + != other.getLaserSensor1MeasureDistance()) return false; + if (getLaserSensor2MeasureDistance() + != other.getLaserSensor2MeasureDistance()) return false; + if (getLaserSensor3MeasureDistance() + != other.getLaserSensor3MeasureDistance()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ROBOT_MOVE_SPEED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getRobotMoveSpeed())); + hash = (37 * hash) + RF_ANGLE_ROLL_FIELD_NUMBER; + hash = (53 * hash) + getRFAngleRoll(); + hash = (37 * hash) + REMOTE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getRemoteStatus(); + hash = (37 * hash) + LASER_SENSOR_1_MEASURE_DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + getLaserSensor1MeasureDistance(); + hash = (37 * hash) + LASER_SENSOR_2_MEASURE_DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + getLaserSensor2MeasureDistance(); + hash = (37 * hash) + LASER_SENSOR_3_MEASURE_DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + getLaserSensor3MeasureDistance(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.example.diaoerqiegeapp.models.BspIV.IV_struct_define prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code IV_struct_define} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:IV_struct_define) + com.example.diaoerqiegeapp.models.BspIV.IV_struct_defineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.diaoerqiegeapp.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.diaoerqiegeapp.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.diaoerqiegeapp.models.BspIV.IV_struct_define.class, com.example.diaoerqiegeapp.models.BspIV.IV_struct_define.Builder.class); + } + + // Construct using com.example.diaoerqiegeapp.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; + robotMoveSpeed_ = 0D; + rFAngleRoll_ = 0; + remoteStatus_ = 0; + laserSensor1MeasureDistance_ = 0; + laserSensor2MeasureDistance_ = 0; + laserSensor3MeasureDistance_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.diaoerqiegeapp.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + public com.example.diaoerqiegeapp.models.BspIV.IV_struct_define getDefaultInstanceForType() { + return com.example.diaoerqiegeapp.models.BspIV.IV_struct_define.getDefaultInstance(); + } + + @java.lang.Override + public com.example.diaoerqiegeapp.models.BspIV.IV_struct_define build() { + com.example.diaoerqiegeapp.models.BspIV.IV_struct_define result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.diaoerqiegeapp.models.BspIV.IV_struct_define buildPartial() { + com.example.diaoerqiegeapp.models.BspIV.IV_struct_define result = new com.example.diaoerqiegeapp.models.BspIV.IV_struct_define(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.example.diaoerqiegeapp.models.BspIV.IV_struct_define result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.robotMoveSpeed_ = robotMoveSpeed_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rFAngleRoll_ = rFAngleRoll_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.remoteStatus_ = remoteStatus_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.laserSensor1MeasureDistance_ = laserSensor1MeasureDistance_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.laserSensor2MeasureDistance_ = laserSensor2MeasureDistance_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.laserSensor3MeasureDistance_ = laserSensor3MeasureDistance_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.diaoerqiegeapp.models.BspIV.IV_struct_define) { + return mergeFrom((com.example.diaoerqiegeapp.models.BspIV.IV_struct_define)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.diaoerqiegeapp.models.BspIV.IV_struct_define other) { + if (other == com.example.diaoerqiegeapp.models.BspIV.IV_struct_define.getDefaultInstance()) return this; + if (other.getRobotMoveSpeed() != 0D) { + setRobotMoveSpeed(other.getRobotMoveSpeed()); + } + if (other.getRFAngleRoll() != 0) { + setRFAngleRoll(other.getRFAngleRoll()); + } + if (other.getRemoteStatus() != 0) { + setRemoteStatus(other.getRemoteStatus()); + } + if (other.getLaserSensor1MeasureDistance() != 0) { + setLaserSensor1MeasureDistance(other.getLaserSensor1MeasureDistance()); + } + if (other.getLaserSensor2MeasureDistance() != 0) { + setLaserSensor2MeasureDistance(other.getLaserSensor2MeasureDistance()); + } + if (other.getLaserSensor3MeasureDistance() != 0) { + setLaserSensor3MeasureDistance(other.getLaserSensor3MeasureDistance()); + } + 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 9: { + robotMoveSpeed_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + case 16: { + rFAngleRoll_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + remoteStatus_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + laserSensor1MeasureDistance_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + laserSensor2MeasureDistance_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + laserSensor3MeasureDistance_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + 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 double robotMoveSpeed_ ; + /** + * double Robot_Move_Speed = 1; + * @return The robotMoveSpeed. + */ + @java.lang.Override + public double getRobotMoveSpeed() { + return robotMoveSpeed_; + } + /** + * double Robot_Move_Speed = 1; + * @param value The robotMoveSpeed to set. + * @return This builder for chaining. + */ + public Builder setRobotMoveSpeed(double value) { + + robotMoveSpeed_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * double Robot_Move_Speed = 1; + * @return This builder for chaining. + */ + public Builder clearRobotMoveSpeed() { + bitField0_ = (bitField0_ & ~0x00000001); + robotMoveSpeed_ = 0D; + onChanged(); + return this; + } + + private int rFAngleRoll_ ; + /** + * int32 RF_Angle_Roll = 2; + * @return The rFAngleRoll. + */ + @java.lang.Override + public int getRFAngleRoll() { + return rFAngleRoll_; + } + /** + * int32 RF_Angle_Roll = 2; + * @param value The rFAngleRoll to set. + * @return This builder for chaining. + */ + public Builder setRFAngleRoll(int value) { + + rFAngleRoll_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 RF_Angle_Roll = 2; + * @return This builder for chaining. + */ + public Builder clearRFAngleRoll() { + bitField0_ = (bitField0_ & ~0x00000002); + rFAngleRoll_ = 0; + onChanged(); + return this; + } + + private int remoteStatus_ ; + /** + * int32 Remote_Status = 3; + * @return The remoteStatus. + */ + @java.lang.Override + public int getRemoteStatus() { + return remoteStatus_; + } + /** + * int32 Remote_Status = 3; + * @param value The remoteStatus to set. + * @return This builder for chaining. + */ + public Builder setRemoteStatus(int value) { + + remoteStatus_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int32 Remote_Status = 3; + * @return This builder for chaining. + */ + public Builder clearRemoteStatus() { + bitField0_ = (bitField0_ & ~0x00000004); + remoteStatus_ = 0; + onChanged(); + return this; + } + + private int laserSensor1MeasureDistance_ ; + /** + * int32 laser_sensor_1_measure_distance = 4; + * @return The laserSensor1MeasureDistance. + */ + @java.lang.Override + public int getLaserSensor1MeasureDistance() { + return laserSensor1MeasureDistance_; + } + /** + * int32 laser_sensor_1_measure_distance = 4; + * @param value The laserSensor1MeasureDistance to set. + * @return This builder for chaining. + */ + public Builder setLaserSensor1MeasureDistance(int value) { + + laserSensor1MeasureDistance_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int32 laser_sensor_1_measure_distance = 4; + * @return This builder for chaining. + */ + public Builder clearLaserSensor1MeasureDistance() { + bitField0_ = (bitField0_ & ~0x00000008); + laserSensor1MeasureDistance_ = 0; + onChanged(); + return this; + } + + private int laserSensor2MeasureDistance_ ; + /** + * int32 laser_sensor_2_measure_distance = 5; + * @return The laserSensor2MeasureDistance. + */ + @java.lang.Override + public int getLaserSensor2MeasureDistance() { + return laserSensor2MeasureDistance_; + } + /** + * int32 laser_sensor_2_measure_distance = 5; + * @param value The laserSensor2MeasureDistance to set. + * @return This builder for chaining. + */ + public Builder setLaserSensor2MeasureDistance(int value) { + + laserSensor2MeasureDistance_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int32 laser_sensor_2_measure_distance = 5; + * @return This builder for chaining. + */ + public Builder clearLaserSensor2MeasureDistance() { + bitField0_ = (bitField0_ & ~0x00000010); + laserSensor2MeasureDistance_ = 0; + onChanged(); + return this; + } + + private int laserSensor3MeasureDistance_ ; + /** + * int32 laser_sensor_3_measure_distance = 6; + * @return The laserSensor3MeasureDistance. + */ + @java.lang.Override + public int getLaserSensor3MeasureDistance() { + return laserSensor3MeasureDistance_; + } + /** + * int32 laser_sensor_3_measure_distance = 6; + * @param value The laserSensor3MeasureDistance to set. + * @return This builder for chaining. + */ + public Builder setLaserSensor3MeasureDistance(int value) { + + laserSensor3MeasureDistance_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int32 laser_sensor_3_measure_distance = 6; + * @return This builder for chaining. + */ + public Builder clearLaserSensor3MeasureDistance() { + bitField0_ = (bitField0_ & ~0x00000020); + laserSensor3MeasureDistance_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:IV_struct_define) + } + + // @@protoc_insertion_point(class_scope:IV_struct_define) + private static final com.example.diaoerqiegeapp.models.BspIV.IV_struct_define DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.diaoerqiegeapp.models.BspIV.IV_struct_define(); + } + + public static com.example.diaoerqiegeapp.models.BspIV.IV_struct_define getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IV_struct_define parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.example.diaoerqiegeapp.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\"\325\001\n\020IV_struct_define\022\030\n\020R" + + "obot_Move_Speed\030\001 \001(\001\022\025\n\rRF_Angle_Roll\030\002" + + " \001(\005\022\025\n\rRemote_Status\030\003 \001(\005\022\'\n\037laser_sen" + + "sor_1_measure_distance\030\004 \001(\005\022\'\n\037laser_se" + + "nsor_2_measure_distance\030\005 \001(\005\022\'\n\037laser_s" + + "ensor_3_measure_distance\030\006 \001(\005B%\n!com.ex" + + "ample.diaoerqiegeapp.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[] { "RobotMoveSpeed", "RFAngleRoll", "RemoteStatus", "LaserSensor1MeasureDistance", "LaserSensor2MeasureDistance", "LaserSensor3MeasureDistance", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/BspPV.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/BspPV.java new file mode 100644 index 0000000..cfc0a80 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/BspPV.java @@ -0,0 +1,640 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: bsp_PV.proto +// Protobuf Java Version: 4.27.2 + +package com.example.diaoerqiegeapp.models; + +public final class BspPV { + private BspPV() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + BspPV.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface PV_struct_defineOrBuilder extends + // @@protoc_insertion_point(interface_extends:PV_struct_define) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 robot_operation_mode = 1; + * @return The robotOperationMode. + */ + int getRobotOperationMode(); + + /** + * int32 knife_descending_height = 2; + * @return The knifeDescendingHeight. + */ + int getKnifeDescendingHeight(); + + /** + * int32 main_axis_speed = 3; + * @return The mainAxisSpeed. + */ + int getMainAxisSpeed(); + } + /** + * Protobuf type {@code PV_struct_define} + */ + public static final class PV_struct_define extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:PV_struct_define) + PV_struct_defineOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + PV_struct_define.class.getName()); + } + // Use PV_struct_define.newBuilder() to construct. + private PV_struct_define(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private PV_struct_define() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.diaoerqiegeapp.models.BspPV.internal_static_PV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.diaoerqiegeapp.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.diaoerqiegeapp.models.BspPV.PV_struct_define.class, com.example.diaoerqiegeapp.models.BspPV.PV_struct_define.Builder.class); + } + + public static final int ROBOT_OPERATION_MODE_FIELD_NUMBER = 1; + private int robotOperationMode_ = 0; + /** + * int32 robot_operation_mode = 1; + * @return The robotOperationMode. + */ + @java.lang.Override + public int getRobotOperationMode() { + return robotOperationMode_; + } + + public static final int KNIFE_DESCENDING_HEIGHT_FIELD_NUMBER = 2; + private int knifeDescendingHeight_ = 0; + /** + * int32 knife_descending_height = 2; + * @return The knifeDescendingHeight. + */ + @java.lang.Override + public int getKnifeDescendingHeight() { + return knifeDescendingHeight_; + } + + public static final int MAIN_AXIS_SPEED_FIELD_NUMBER = 3; + private int mainAxisSpeed_ = 0; + /** + * int32 main_axis_speed = 3; + * @return The mainAxisSpeed. + */ + @java.lang.Override + public int getMainAxisSpeed() { + return mainAxisSpeed_; + } + + 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 (robotOperationMode_ != 0) { + output.writeInt32(1, robotOperationMode_); + } + if (knifeDescendingHeight_ != 0) { + output.writeInt32(2, knifeDescendingHeight_); + } + if (mainAxisSpeed_ != 0) { + output.writeInt32(3, mainAxisSpeed_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (robotOperationMode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, robotOperationMode_); + } + if (knifeDescendingHeight_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, knifeDescendingHeight_); + } + if (mainAxisSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, mainAxisSpeed_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.example.diaoerqiegeapp.models.BspPV.PV_struct_define)) { + return super.equals(obj); + } + com.example.diaoerqiegeapp.models.BspPV.PV_struct_define other = (com.example.diaoerqiegeapp.models.BspPV.PV_struct_define) obj; + + if (getRobotOperationMode() + != other.getRobotOperationMode()) return false; + if (getKnifeDescendingHeight() + != other.getKnifeDescendingHeight()) return false; + if (getMainAxisSpeed() + != other.getMainAxisSpeed()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ROBOT_OPERATION_MODE_FIELD_NUMBER; + hash = (53 * hash) + getRobotOperationMode(); + hash = (37 * hash) + KNIFE_DESCENDING_HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getKnifeDescendingHeight(); + hash = (37 * hash) + MAIN_AXIS_SPEED_FIELD_NUMBER; + hash = (53 * hash) + getMainAxisSpeed(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.example.diaoerqiegeapp.models.BspPV.PV_struct_define prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code PV_struct_define} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:PV_struct_define) + com.example.diaoerqiegeapp.models.BspPV.PV_struct_defineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.diaoerqiegeapp.models.BspPV.internal_static_PV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.diaoerqiegeapp.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.diaoerqiegeapp.models.BspPV.PV_struct_define.class, com.example.diaoerqiegeapp.models.BspPV.PV_struct_define.Builder.class); + } + + // Construct using com.example.diaoerqiegeapp.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; + robotOperationMode_ = 0; + knifeDescendingHeight_ = 0; + mainAxisSpeed_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.diaoerqiegeapp.models.BspPV.internal_static_PV_struct_define_descriptor; + } + + @java.lang.Override + public com.example.diaoerqiegeapp.models.BspPV.PV_struct_define getDefaultInstanceForType() { + return com.example.diaoerqiegeapp.models.BspPV.PV_struct_define.getDefaultInstance(); + } + + @java.lang.Override + public com.example.diaoerqiegeapp.models.BspPV.PV_struct_define build() { + com.example.diaoerqiegeapp.models.BspPV.PV_struct_define result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.diaoerqiegeapp.models.BspPV.PV_struct_define buildPartial() { + com.example.diaoerqiegeapp.models.BspPV.PV_struct_define result = new com.example.diaoerqiegeapp.models.BspPV.PV_struct_define(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.example.diaoerqiegeapp.models.BspPV.PV_struct_define result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.robotOperationMode_ = robotOperationMode_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.knifeDescendingHeight_ = knifeDescendingHeight_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.mainAxisSpeed_ = mainAxisSpeed_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.diaoerqiegeapp.models.BspPV.PV_struct_define) { + return mergeFrom((com.example.diaoerqiegeapp.models.BspPV.PV_struct_define)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.diaoerqiegeapp.models.BspPV.PV_struct_define other) { + if (other == com.example.diaoerqiegeapp.models.BspPV.PV_struct_define.getDefaultInstance()) return this; + if (other.getRobotOperationMode() != 0) { + setRobotOperationMode(other.getRobotOperationMode()); + } + if (other.getKnifeDescendingHeight() != 0) { + setKnifeDescendingHeight(other.getKnifeDescendingHeight()); + } + if (other.getMainAxisSpeed() != 0) { + setMainAxisSpeed(other.getMainAxisSpeed()); + } + 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: { + robotOperationMode_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + knifeDescendingHeight_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + mainAxisSpeed_ = 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 robotOperationMode_ ; + /** + * int32 robot_operation_mode = 1; + * @return The robotOperationMode. + */ + @java.lang.Override + public int getRobotOperationMode() { + return robotOperationMode_; + } + /** + * int32 robot_operation_mode = 1; + * @param value The robotOperationMode to set. + * @return This builder for chaining. + */ + public Builder setRobotOperationMode(int value) { + + robotOperationMode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 robot_operation_mode = 1; + * @return This builder for chaining. + */ + public Builder clearRobotOperationMode() { + bitField0_ = (bitField0_ & ~0x00000001); + robotOperationMode_ = 0; + onChanged(); + return this; + } + + private int knifeDescendingHeight_ ; + /** + * int32 knife_descending_height = 2; + * @return The knifeDescendingHeight. + */ + @java.lang.Override + public int getKnifeDescendingHeight() { + return knifeDescendingHeight_; + } + /** + * int32 knife_descending_height = 2; + * @param value The knifeDescendingHeight to set. + * @return This builder for chaining. + */ + public Builder setKnifeDescendingHeight(int value) { + + knifeDescendingHeight_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int32 knife_descending_height = 2; + * @return This builder for chaining. + */ + public Builder clearKnifeDescendingHeight() { + bitField0_ = (bitField0_ & ~0x00000002); + knifeDescendingHeight_ = 0; + onChanged(); + return this; + } + + private int mainAxisSpeed_ ; + /** + * int32 main_axis_speed = 3; + * @return The mainAxisSpeed. + */ + @java.lang.Override + public int getMainAxisSpeed() { + return mainAxisSpeed_; + } + /** + * int32 main_axis_speed = 3; + * @param value The mainAxisSpeed to set. + * @return This builder for chaining. + */ + public Builder setMainAxisSpeed(int value) { + + mainAxisSpeed_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int32 main_axis_speed = 3; + * @return This builder for chaining. + */ + public Builder clearMainAxisSpeed() { + bitField0_ = (bitField0_ & ~0x00000004); + mainAxisSpeed_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:PV_struct_define) + } + + // @@protoc_insertion_point(class_scope:PV_struct_define) + private static final com.example.diaoerqiegeapp.models.BspPV.PV_struct_define DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.diaoerqiegeapp.models.BspPV.PV_struct_define(); + } + + public static com.example.diaoerqiegeapp.models.BspPV.PV_struct_define getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PV_struct_define parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.example.diaoerqiegeapp.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\"j\n\020PV_struct_define\022\034\n\024ro" + + "bot_operation_mode\030\001 \001(\005\022\037\n\027knife_descen" + + "ding_height\030\002 \001(\005\022\027\n\017main_axis_speed\030\003 \001" + + "(\005B%\n!com.example.diaoerqiegeapp.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[] { "RobotOperationMode", "KnifeDescendingHeight", "MainAxisSpeed", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/DisplayIV.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/DisplayIV.java new file mode 100644 index 0000000..e2f34be --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/DisplayIV.java @@ -0,0 +1,50 @@ +package com.example.diaoerqiegeapp.models; + +import androidx.databinding.BaseObservable; + +public class DisplayIV extends BaseObservable { + private double leftCompensation; + private double rightCompensation; + private double currentAngle; + + public double getLeftCompensation() { + return leftCompensation; + } + + public void setLeftCompensation(double leftCompensation) { + this.leftCompensation = leftCompensation; + } + + public double getRightCompensation() { + return rightCompensation; + } + + public void setRightCompensation(double rightCompensation) { + this.rightCompensation = rightCompensation; + } + + public double getCurrentAngle() { + return currentAngle; + } + + public void setCurrentAngle(double currentAngle) { + this.currentAngle = currentAngle; + } + + public double getRobotMoveSpeed() { + return robotMoveSpeed; + } + + public void setRobotMoveSpeed(double robotMoveSpeed) { + this.robotMoveSpeed = robotMoveSpeed; + } + + private double robotMoveSpeed; + + public DisplayIV(double leftCompensation, double rightCompensation, double currentAngle, double robotMoveSpeed) { + this.leftCompensation = leftCompensation; + this.rightCompensation = rightCompensation; + this.currentAngle = currentAngle; + this.robotMoveSpeed = robotMoveSpeed; + } +} diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/DisplayPV.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/DisplayPV.java new file mode 100644 index 0000000..b0ed4cb --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/DisplayPV.java @@ -0,0 +1,26 @@ +package com.example.diaoerqiegeapp.models; + +import androidx.databinding.BaseObservable; + +public class DisplayPV extends BaseObservable { + + private int id; + private int KinfeDescendHeight; + private int MainAxisSpeed; + + public DisplayPV(int id, int knife_descent,int main_axis_speed) { + this.id = id; + this.KinfeDescendHeight = knife_descent; + this.MainAxisSpeed = main_axis_speed; + + } + + + public int getId() { return id; } + public void setId(int id) { + this.id = id; + } + + public int getKinfeDescendHeight(){return KinfeDescendHeight;} + public int getMainAxisSpeed(){return MainAxisSpeed;} +} diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/ErrorModel.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/ErrorModel.java new file mode 100644 index 0000000..71585be --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/models/ErrorModel.java @@ -0,0 +1,44 @@ +package com.example.diaoerqiegeapp.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/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/ConvertHelper.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/ConvertHelper.java new file mode 100644 index 0000000..b4d6b6c --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/ConvertHelper.java @@ -0,0 +1,26 @@ +package com.example.diaoerqiegeapp.services; + +import android.widget.EditText; +import android.widget.TextView; + +public class ConvertHelper { + + public static int convertEditTextToInt(TextView editText) { + // 获取 EditText 中的文本 + String input = editText.getText().toString().trim(); + try { + // 尝试将字符串转换为整数 + return Integer.parseInt(input); + } catch (NumberFormatException e) { + // 输入不是有效的整数格式,返回 -1 表示转换失败 + return -1; + } + } + + public static boolean isEditTextNullOrEmpty(EditText editText) { + + String str = String.valueOf(editText.getText()); + + return str == null || str.isEmpty(); + } +} diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/CustomProber.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/CustomProber.java new file mode 100644 index 0000000..4c7b4d7 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/CustomProber.java @@ -0,0 +1,22 @@ +package com.example.diaoerqiegeapp.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/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/DecimalDigitsInputFilter.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/DecimalDigitsInputFilter.java new file mode 100644 index 0000000..088a49d --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/DecimalDigitsInputFilter.java @@ -0,0 +1,71 @@ +package com.example.diaoerqiegeapp.services; + +import android.text.InputFilter; +import android.text.Spanned; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/* + 自定义 InputFilter 类,用于限制输入格式 + 支持整数、负数和最多一位小数的输入 + 使用方法:editText.setFilters(new InputFilter[]{new DecimalDigitsInputFilter()}); +*/ +public class DecimalDigitsInputFilter implements InputFilter { + // 最终验证的正则表达式 + private final Pattern mFinalPattern; + // 中间状态允许的正则表达式 + private final Pattern mIntermediatePattern; + + public DecimalDigitsInputFilter() { + // 最终验证:必须是完整的数字格式 + mFinalPattern = Pattern.compile("^-?(0|[1-9]\\d*)(\\.\\d)?$"); + + // 中间状态:允许临时的不完整格式(如 "-"、"0."、"-2.") + mIntermediatePattern = Pattern.compile("^-?(0|[1-9]\\d*)?(\\.)?$"); + } + + @Override + public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { + // 处理删除操作 + if (end - start == 0) { + return null; + } + + // 拼接新的输入内容 + String newText = dest.toString().substring(0, dstart) + + source.toString().substring(start, end) + + dest.toString().substring(dend); + + // 允许空字符串或单独的负号 + if (newText.isEmpty() || newText.equals("-")) { + return null; + } + + // 防止前导零(除非是 0 或 0.x) + if (newText.startsWith("0") && newText.length() > 1 && + !newText.startsWith("0.") && !newText.equals("0")) { + return ""; + } + + // 防止多个负号 + if (newText.indexOf('-') > 0) { + return ""; + } + + // 防止多个小数点 + if (newText.indexOf('.') != newText.lastIndexOf('.')) { + return ""; + } + + // 检查是否匹配最终模式或中间模式 + Matcher finalMatcher = mFinalPattern.matcher(newText); + Matcher intermediateMatcher = mIntermediatePattern.matcher(newText); + + if (finalMatcher.matches() || intermediateMatcher.matches()) { + return null; // 匹配成功,允许输入 + } + + return ""; // 匹配失败,阻止输入 + } +} \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/LogUtil.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/LogUtil.java new file mode 100644 index 0000000..be7ecaf --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/LogUtil.java @@ -0,0 +1,39 @@ +package com.example.diaoerqiegeapp.services; + +import android.util.Log; + +public class LogUtil { + private String TAG; + private boolean isRelease = false; + private boolean isDebug; + + public LogUtil(Class c, boolean isDebug) { + this.TAG = c.getName(); + this.isDebug = isDebug; + } + + public void d(String msg) { + if (!isRelease && isDebug) { + Log.d(TAG, "--------->" + msg); + } + } + + public void i(String msg) { + if (!isRelease && isDebug) { + Log.i(TAG, "--------->" + msg); + } + } + + public void w(String msg) { + if (!isRelease && isDebug) { + Log.w(TAG, "--------->" + msg); + } + } + + public void e(String msg) { + if (!isRelease && isDebug) { + Log.e(TAG, "--------->" + msg); + } + } +} + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/ModbusCRC.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/ModbusCRC.java new file mode 100644 index 0000000..7bb2a37 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/ModbusCRC.java @@ -0,0 +1,72 @@ +package com.example.diaoerqiegeapp.services; + +public class ModbusCRC { + +// /** +// * 一个字节包含位的数量 8 +// */ +// private static final int BITS_OF_BYTE = 8; +// /** +// * 多项式 +// */ +// private static final int POLYNOMIAL = 0xA001; +// /** +// * 初始值 +// */ +// private static final int INITIAL_VALUE = 0xFFFF; +// +// /** +// * CRC16 编码 +// * +// * @param bytes 编码内容 +// * @return 编码结果 +// */ +// public static int crc16(byte[] bytes) { +// int res = INITIAL_VALUE; +// for (int data : bytes) { +// res = res ^ data; +// for (int i = 0; i < BITS_OF_BYTE; i++) { +// res = (res & 0x0001) == 1 ? (res >> 1) ^ POLYNOMIAL : res >> 1; +// } +// } +// return revert(res); +// } +// +// /** +// * 翻转16位的高八位和低八位字节 +// * +// * @param src 翻转数字 +// * @return 翻转结果 +// */ +// private static int revert(int src) { +// int lowByte = (src & 0xFF00) >> 8; +// int highByte = (src & 0x00FF) << 8; +// return lowByte | highByte; +// } + + + /** + * 计算 Modbus CRC 校验值 + * @param data 要计算校验值的字节数组 + * @return CRC 校验值,以 2 字节的数组形式返回 + */ + public static byte[] calculateCRC(byte[] data) { + int crc = 0xFFFF; + for (byte b : data) { + crc ^= (b & 0xFF); + for (int i = 0; i < 8; i++) { + if ((crc & 0x0001) != 0) { + crc >>= 1; + crc ^= 0xA001; + } else { + crc >>= 1; + } + } + } + // 将 CRC 结果拆分为两个字节 + byte[] crcBytes = new byte[2]; + crcBytes[0] = (byte) (crc & 0xFF); + crcBytes[1] = (byte) ((crc >> 8) & 0xFF); + return crcBytes; + } +} diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/MyDataHelper.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/MyDataHelper.java new file mode 100644 index 0000000..6144367 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/MyDataHelper.java @@ -0,0 +1,96 @@ +package com.example.diaoerqiegeapp.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.example.diaoerqiegeapp.models.DisplayPV; + +import java.util.ArrayList; +import java.util.List; + +public class MyDataHelper extends SQLiteOpenHelper { + //定义字段 + public static final String TABLE_NAME_POLISH = "polish"; + public static final String COLUMN_ID= "id";//参数调用 + public static final String COLUMN_KINFE_DESCEND_HEIGHT = "kinfeDescendHeight"; + public static final String COLUMN_MAIN_AXIS_SPEED = "mainAxisSpeed"; + + public MyDataHelper(@Nullable Context context) { + super(context, "bingbot.db", null, 10); //数据库名称为 bingbot.db,数据库版本为 1。存放两个表 + } + + @Override + public void onCreate(SQLiteDatabase db) { + + // 打磨 + String sql = "CREATE TABLE " + TABLE_NAME_POLISH + " (" + + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + + COLUMN_KINFE_DESCEND_HEIGHT + " INTEGER, " + + COLUMN_MAIN_AXIS_SPEED + " INTEGER);"; + db.execSQL(sql); //执行sql语句 + } + + @Override + public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { + // 1. 删除所有旧表(如果存在) + db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_POLISH); // 打磨表 + + onCreate(db); + } + + //增 删 改 查 + public String addOrUpdateDisplayDataPolish(DisplayPV pv) { + ContentValues cv = new ContentValues(); //键值对的类 + cv.put(COLUMN_ID, pv.getId()); + cv.put(COLUMN_KINFE_DESCEND_HEIGHT, pv.getKinfeDescendHeight()); + cv.put(COLUMN_MAIN_AXIS_SPEED, pv.getMainAxisSpeed()); + + //获取数据库实例以实现增上查改等,如果没有就新建 并把sqliteDatabase作为参数传给oncreate方法 + SQLiteDatabase sqliteDatabase = this.getWritableDatabase(); + long insert = sqliteDatabase.insertWithOnConflict(TABLE_NAME_POLISH, null, cv, SQLiteDatabase.CONFLICT_REPLACE); + sqliteDatabase.close(); + if (insert == -1) { + return "failed"; + } + return "success"; + } + + public void IntializeDataBasePolish() { + + for (int i = 1; i < 2; i++) { + List list = getDisplayDataPolish(i); //从数据库中读 + if (list.size() == 0) { + DisplayPV pv = new DisplayPV(i, 0, 0); + addOrUpdateDisplayDataPolish(pv);//一行一行添加 + } + } + } + + public List getDisplayDataPolish(int id) { //初始化 + List list = new ArrayList<>(); + String sql = "SELECT * FROM " + TABLE_NAME_POLISH + " WHERE " + COLUMN_ID + " = " + String.valueOf(id); + SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();//获取可写数据库实例 + + Cursor cursor = sqLiteDatabase.rawQuery(sql, null); //按id查询 + + int idIndex = cursor.getColumnIndex(COLUMN_ID); + int _knifeDescendHeight = cursor.getColumnIndex(COLUMN_KINFE_DESCEND_HEIGHT); + int _mainAxisSpeed = cursor.getColumnIndex(COLUMN_MAIN_AXIS_SPEED); + + while (cursor.moveToNext()) { + + DisplayPV pv = new DisplayPV(cursor.getInt(idIndex), cursor.getInt(_knifeDescendHeight), + cursor.getInt(_mainAxisSpeed)); + + list.add(pv); + } + cursor.close(); + sqLiteDatabase.close(); + return list; + } +} diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/PopupHelper.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/PopupHelper.java new file mode 100644 index 0000000..db6d464 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/PopupHelper.java @@ -0,0 +1,103 @@ +package com.example.diaoerqiegeapp.services; + +import android.app.Dialog; +import android.view.View; +import android.widget.Button; +import android.widget.RadioButton; +import android.widget.RadioGroup; +import android.widget.Toast; + +import com.example.diaoerqiegeapp.MainActivity; +import com.example.diaoerqiegeapp.R; + +public class PopupHelper { + + private MainActivity mainActivitypolish; + + public String operateModeValuePolish="手动作业"; //打磨 + + + + public PopupHelper(MainActivity mainActivity) + { + this.mainActivitypolish = mainActivity; + } + + + + //打磨操作模式弹窗 + public void OperateModePolishPopup(View.OnClickListener context) { //手动模式弹窗 + Dialog dialog = new Dialog(mainActivitypolish); + + dialog.setContentView(R.layout.polishoperatemodepopup); // 设置自定义布局 + dialog.setCancelable(true); // 设置点击外部是否关闭弹窗 + + // 获取布局中的视图 + Button cancelButton = dialog.findViewById(R.id.manualModePolishCancel); + Button confirmButton = dialog.findViewById(R.id.manualModePolishApply); + + //获取按钮组 + RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.operateModePolishSelectorGroup); + + //4种模式 + radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(RadioGroup group, int checkedId) { + RadioButton radioButton = (RadioButton) group.findViewById(checkedId); + operateModeValuePolish=radioButton.getText().toString(); + + } + }); + + //下次进来保证是选中状态或者未远中 + String ii= mainActivitypolish.mainBinding.operateModeDisplay.getText().toString(); + switch (ii) + { + case "手动作业": { radioGroup.check(R.id.rb_polishone); + break; + } + case "自动作业": { radioGroup.check(R.id.rb_polishtwo); + break; + } + default: + radioGroup.clearCheck(); + break; + + } + + + // 设置确定按钮点击事件 + confirmButton.setOnClickListener(v -> { //手动模式弹窗确认 + if (radioGroup.getCheckedRadioButtonId() != -1) { //有按钮选中时按确定 更新值 + mainActivitypolish.mainBinding.operateModeDisplay.setText(operateModeValuePolish); + mainActivitypolish._Operate_Mode_Call_Value=operateModeValuePolish; + Toast.makeText(mainActivitypolish, "设置成功", Toast.LENGTH_SHORT).show(); + } + + dialog.dismiss(); // 关闭弹窗 + }); + + // 设置取消按钮点击事件 + cancelButton.setOnClickListener(v -> { + Toast.makeText(mainActivitypolish, "点击了取消", Toast.LENGTH_SHORT).show(); + + dialog.dismiss(); // 关闭弹窗 + }); + dialog.show(); // 显示弹窗 + + } + + + + + + + + + + + + +} //根类 + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/RobotDataHanlder.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/RobotDataHanlder.java new file mode 100644 index 0000000..afe45b8 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/RobotDataHanlder.java @@ -0,0 +1,63 @@ +package com.example.diaoerqiegeapp.services; + +import com.example.diaoerqiegeapp.models.BspIV; +import com.example.diaoerqiegeapp.models.BspPV; +import com.google.protobuf.InvalidProtocolBufferException; + +public class RobotDataHanlder { + + + public static void test() + { + //byte[] data=hexToByteArray("080110830118313A04B1CBBACF"); + byte[] data=hexToByteArray("100A180A28013A32B1CBBACF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"); + + + + } + public static void DeoodeDataFromRobot(byte[] data) + { + try + { + if(data[0]==0x55&&data[1]==0x55) + { + if (data[2]==0x01) + { + BspIV.IV_struct_define iv = BspIV.IV_struct_define.parseFrom(data); + }else if(data[2]==0x02) + { + BspPV.PV_struct_define pv = BspPV.PV_struct_define.parseFrom(data); + } + } + } catch (InvalidProtocolBufferException e) + { + + } + + + } + + public static byte[] hexToByteArray(String inHex){ + int hexlen = inHex.length(); + byte[] result; + if (hexlen % 2 == 1){ + //奇数 + hexlen++; + result = new byte[(hexlen/2)]; + inHex="0"+inHex; + }else { + //偶数 + result = new byte[(hexlen/2)]; + } + int j=0; + for (int i = 0; i < hexlen; i+=2){ + result[j]=hexToByte(inHex.substring(i,i+2)); + j++; + } + return result; + } + public static byte hexToByte(String inHex){ + return (byte)Integer.parseInt(inHex,16); + } + +} diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/USBSerialPortHelper.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/USBSerialPortHelper.java new file mode 100644 index 0000000..97e16d8 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/USBSerialPortHelper.java @@ -0,0 +1,407 @@ +package com.example.diaoerqiegeapp.services; + + +import android.app.Activity; +import android.app.PendingIntent; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.hardware.usb.UsbDevice; +import android.hardware.usb.UsbDeviceConnection; +import android.hardware.usb.UsbManager; +import android.os.Build; +import android.os.CountDownTimer; +import android.os.Handler; +import android.os.Looper; + +import androidx.core.content.ContextCompat; + +import com.example.diaoerqiegeapp.BuildConfig; +import com.example.diaoerqiegeapp.MainActivity; + +import com.example.diaoerqiegeapp.models.BspIV; +import com.hoho.android.usbserial.driver.UsbSerialDriver; +import com.hoho.android.usbserial.driver.UsbSerialPort; +import com.hoho.android.usbserial.driver.UsbSerialProber; +import com.hoho.android.usbserial.util.SerialInputOutputManager; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class USBSerialPortHelper implements SerialInputOutputManager.Listener { + + private Activity mActivity; + private MainActivity activityPolish; + public USBSerialPortHelper(MainActivity activityPolish) + { + if(activityPolish!=null) { + this.mActivity = activityPolish; + this.activityPolish=activityPolish; + } + } + + + private enum UsbPermission {Unknown, Requested, Granted, Denied} + + private final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB"; + + private int deviceId = 60000; + private int deviceId_test = 60000; + private int portNum; + private final int WRITE_WAIT_MILLIS = 500; + private final int READ_WAIT_MILLIS = 100; + private String PortNameContians = "SILICON";/**/ + // private static String PortNameContians="FTD"; + private int baudRate = 57600; + private boolean withIoManager = true; + + private BroadcastReceiver broadcastReceiver; + private Handler mainLooper; + + private SerialInputOutputManager usbIoManager; + private UsbSerialPort usbSerialPort; + private UsbPermission usbPermission = UsbPermission.Unknown; + public boolean connected = false; + BspIV.IV_struct_define _toReceiveIV1; + String errorLast = ""; + + public void intialize() { + + broadcastReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (INTENT_ACTION_GRANT_USB.equals(intent.getAction())) { + usbPermission = intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false) ? UsbPermission.Granted : UsbPermission.Denied; + connect(); + } + } + }; + mainLooper = new Handler(Looper.getMainLooper()); + _receiveBufferlist = new ArrayList(); + } + + /* + * Serial + */ + @Override + public void onNewData(byte[] data) { + // status("new data"); + mainLooper.post(() -> { + receive(data); + // receive data + }); + } + + @Override + public void onRunError(Exception e) { + mainLooper.post(() -> { + // status("connection lost: " + e.getMessage()); + disconnect(); + }); + } + + /* + * Serial + UI + */ + + public void connect() { + + UsbDevice device = null; + UsbManager usbManager = (UsbManager) mActivity.getSystemService(Context.USB_SERVICE); + for (UsbDevice v : usbManager.getDeviceList().values()) { + // status(v.getManufacturerName().toUpperCase()); + if (v.getManufacturerName().toUpperCase().contains(PortNameContians)) { + device = v; + break; + } + } + + if (device == null) { + // _serialPortSwitch.setChecked(false); + + // status("找不到设备"); + return; + } + UsbSerialDriver driver = UsbSerialProber.getDefaultProber().probeDevice(device); + if (driver == null) { + driver = CustomProber.getCustomProber().probeDevice(device); + } + if (driver == null) { + // _serialPortSwitch.setChecked(false); + // status("无驱动"); + return; + } + if (driver.getPorts().size() < portNum) //就是0 cp2102 或者同一个驱动,第一个 + { + //status("connection failed: not enough ports at device"); + //status("找不到设备"); + return; + } + usbSerialPort = driver.getPorts().get(portNum); + + UsbDeviceConnection usbConnection = usbManager.openDevice(driver.getDevice()); + if (usbConnection == null && usbPermission == UsbPermission.Unknown && !usbManager.hasPermission(driver.getDevice())) { + usbPermission = UsbPermission.Requested; + int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_MUTABLE : 0; + Intent intent = new Intent(INTENT_ACTION_GRANT_USB); + intent.setPackage(mActivity.getPackageName()); + PendingIntent usbPermissionIntent = PendingIntent.getBroadcast(mActivity, 0, intent, flags); + usbManager.requestPermission(driver.getDevice(), usbPermissionIntent); + return; + } + if (usbConnection == null) { + if (!usbManager.hasPermission(driver.getDevice())) { + // status("connection failed: permission denied"); + } else { + // status("connection failed: open failed"); + } + + return; + } + + try { + usbSerialPort.open(usbConnection); + try { + usbSerialPort.setParameters(baudRate, 8, 1, UsbSerialPort.PARITY_NONE); + // status("connected: "); + + } catch (UnsupportedOperationException e) { + //status("unsupport setparameters"); + } + if (withIoManager) { + usbIoManager = new SerialInputOutputManager(usbSerialPort, this); + usbIoManager.setReadBufferSize(40960); + usbIoManager.setReadTimeout(READ_WAIT_MILLIS); + usbIoManager.start(); + } + //status("connected"); + connected = true; + // _serialPortSwitch.setChecked(true); + //switch set true + + } catch (Exception e) { + // status("connection failed: " + e.getMessage()); + disconnect(); + } + } + + public void disconnect() { + connected = false; + + if (usbIoManager != null) { + usbIoManager.setListener(null); + usbIoManager.stop(); + } + usbIoManager = null; + try { + usbSerialPort.close(); + } catch (IOException ignored) { + + } + usbSerialPort = null; + } + + List _receiveBufferlist; + + private static byte[] listTobyte(List list) { + if (list == null || list.size() < 0) return null; + byte[] bytes = new byte[list.size()]; + int i = 0; + Iterator iterator = list.iterator(); + while (iterator.hasNext()) { + bytes[i] = iterator.next(); + i++; + } + return bytes; + } + + boolean StartCountDown = false; + + // byte _receivedData + private void receive(byte[] data) { + + // status("read data"); + for (int i = 0; i < data.length; i++) { + _receiveBufferlist.add(data[i]); + } + + //decodeRceive(data); + if (StartCountDown == false)//从收到第一个数据开始计时 + { + StartCountDown = true; + new CountDownTimer(400, 200) { + public void onTick(long millisUntilFinished) { + + } + public void onFinish() { + + // status("read finished"); + decodeRceive(listTobyte(_receiveBufferlist)); + _receiveBufferlist.clear(); + StartCountDown = false; + } + }.start(); + } + } + + + /* + 逐位检查并构建二进制字符串 + */ + 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位添加一个分隔符 + */ + 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(); + } + 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); + } + + private void decodeRceive(byte[] data) { + try { + byte[] crcbytes = new byte[data.length - 2]; + System.arraycopy(data, 0, crcbytes, 0, data.length - 2); + byte[] crc=ModbusCRC.calculateCRC(crcbytes); + if(data[data.length-2]==(byte)(crc[1]&0xff) && data[data.length-1]==(byte)(crc[0] & 0xff)) + { + + if ((data[0] == 0x55) && (data[1] == 0x55) ) + { + + byte[] bytes = new byte[data.length - 4]; + System.arraycopy(data, 2, bytes, 0, data.length - 4); + + BspIV.IV_struct_define _toReceiveIV=BspIV.IV_struct_define.parseFrom(bytes); + _toReceiveIV1=_toReceiveIV; + if (_toReceiveIV!=null) + { + PolishParaShow(); + }else + { + // status("null"); + } + + }else + { + + } + + }else + { + //status("crc failed"); + } + + + + + } catch (Exception e) { + + } + } + + public void PolishParaShow() + { + if(activityPolish!=null) + { + activityPolish.mainBinding.measureDistance1.setText(String.valueOf(_toReceiveIV1.getLaserSensor1MeasureDistance())); + activityPolish.mainBinding.measureDistance2.setText(String.valueOf(_toReceiveIV1.getLaserSensor2MeasureDistance())); + activityPolish.mainBinding.measureDistance3.setText(String.valueOf(_toReceiveIV1.getLaserSensor3MeasureDistance())); + + // 保留两位小数显示 + activityPolish.mainBinding.robotSpeed.setText(String.format("%.2f", _toReceiveIV1.getRobotMoveSpeed())); + + if(_toReceiveIV1.getRemoteStatus()==0) + { + activityPolish.mainBinding.tvSignal.setText("断开"); + } + else if(_toReceiveIV1.getRemoteStatus()==1) + { + activityPolish.mainBinding.tvSignal.setText("已连接"); + } + } + } + + public static String bytesToHex(byte[] bytes) { + StringBuilder result = new StringBuilder(); + for (byte b : bytes) { + result.append(String.format("%02X ", b & 0xFF)); + } + return result.toString(); + } + + public void onStart() { + + ContextCompat.registerReceiver(mActivity, broadcastReceiver, new IntentFilter(INTENT_ACTION_GRANT_USB), ContextCompat.RECEIVER_NOT_EXPORTED); + //status("onStart"); + + } + + public void onStop() { + mActivity.unregisterReceiver(broadcastReceiver); + // status("onStop"); + } + + + public void onResume() { + + if (!connected && (usbPermission == UsbPermission.Unknown || usbPermission == UsbPermission.Granted)) { + mainLooper.post(this::connect); + + } + } + + + public void onPause() { + if (connected) { + // status("串口断开"); + // _serialPortSwitch.setChecked(false); + disconnect(); + } + } + public void SendData(byte[] data) { + if (connected) { + try { + + usbSerialPort.write(data, WRITE_WAIT_MILLIS); + } catch (IOException e) + { + // status("Send Failed"); + connected = false; + } + } + else { + //status("usb serialport disconnected"); + + } + + + } + +} diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/VideoPlayerHelper.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/VideoPlayerHelper.java new file mode 100644 index 0000000..e02862b --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/services/VideoPlayerHelper.java @@ -0,0 +1,27 @@ +package com.example.diaoerqiegeapp.services; + + +import cn.nodemedia.NodePlayer; +import cn.nodemedia.NodePlayerView; + +public class VideoPlayerHelper { + + + + public static void startVedio(NodePlayerView nodePlayerView, NodePlayer nodePlayer,String address ){ + + + nodePlayerView.setRenderType(NodePlayerView.RenderType.SURFACEVIEW);//设置渲染器类型 + nodePlayerView.setUIViewContentMode(NodePlayerView.UIViewContentMode.ScaleToFill);//设置视频画面缩放模式 + //nodePlayer=new NodePlayer(this); + nodePlayer.setPlayerView(nodePlayerView);//设置播放视图 + //设置RTSP流使用的传输协议,支持的模式有: + nodePlayer.setRtspTransport(NodePlayer.RTSP_TRANSPORT_TCP);//设置传输 + nodePlayer.setInputUrl(address); + nodePlayer.setVideoEnable(true);//设置视频启用 + nodePlayer.setBufferTime(100);//设置缓冲时间 + nodePlayer.setMaxBufferTime(200);//设置最大缓冲时间 + nodePlayer.start(); + } +} + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/viewmodels/MainViewModel.java b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/viewmodels/MainViewModel.java new file mode 100644 index 0000000..8b51b97 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/com/example/diaoerqiegeapp/viewmodels/MainViewModel.java @@ -0,0 +1,11 @@ +package com.example.diaoerqiegeapp.viewmodels; + +import androidx.lifecycle.ViewModel; + +public class MainViewModel extends ViewModel { + + public MainViewModel() { + + } + +} \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/generate_java.bat b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/generate_java.bat new file mode 100644 index 0000000..97deb24 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/generate_java.bat @@ -0,0 +1,2 @@ + protoc --java_out . *.proto + pause diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/java/protoc.exe b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/protoc.exe new file mode 100644 index 0000000..f1ffb02 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/java/protoc.exe differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/background.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/background.xml new file mode 100644 index 0000000..9c77c74 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/background.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/bgr.png b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/bgr.png new file mode 100644 index 0000000..4d6154f Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/bgr.png differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/blue_rounded_rectangle.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/blue_rounded_rectangle.xml new file mode 100644 index 0000000..a973af9 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/blue_rounded_rectangle.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/border.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/border.xml new file mode 100644 index 0000000..4f76948 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/border.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/border_active.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/border_active.xml new file mode 100644 index 0000000..5919263 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/border_active.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/border_inactive.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/border_inactive.xml new file mode 100644 index 0000000..093780c --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/border_inactive.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderblue.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderblue.xml new file mode 100644 index 0000000..b234be6 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderblue.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderbluegreen.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderbluegreen.xml new file mode 100644 index 0000000..25d3346 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderbluegreen.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderlog.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderlog.xml new file mode 100644 index 0000000..1a1b34c --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderlog.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderorange.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderorange.xml new file mode 100644 index 0000000..eef56c3 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderorange.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderwhite.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderwhite.xml new file mode 100644 index 0000000..e013ef8 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/borderwhite.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/button_active.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/button_active.xml new file mode 100644 index 0000000..28f66f6 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/button_active.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/button_inactive.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/button_inactive.xml new file mode 100644 index 0000000..146bfd1 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/button_inactive.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/buttonborderwhite.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/buttonborderwhite.xml new file mode 100644 index 0000000..ec98fab --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/buttonborderwhite.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/clean3_1.png b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/clean3_1.png new file mode 100644 index 0000000..62d0786 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/clean3_1.png differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/container_active.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/container_active.xml new file mode 100644 index 0000000..dc691f7 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/container_active.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/container_inactive.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/container_inactive.xml new file mode 100644 index 0000000..edcae41 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/container_inactive.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/dash_line.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/dash_line.xml new file mode 100644 index 0000000..c83a8c5 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/dash_line.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/ic_launcher_background.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/ic_launcher_foreground.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/my_cursor.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/my_cursor.xml new file mode 100644 index 0000000..970a494 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/my_cursor.xml @@ -0,0 +1,9 @@ + + + + android:shape="rectangle"> + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/orange_rounded_rectangle.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/orange_rounded_rectangle.xml new file mode 100644 index 0000000..8835bab --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/orange_rounded_rectangle.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/paint1_1.png b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/paint1_1.png new file mode 100644 index 0000000..4a58140 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/paint1_1.png differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/polish2_1.png b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/polish2_1.png new file mode 100644 index 0000000..024fb4c Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/polish2_1.png differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radio_button_selected.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radio_button_selected.xml new file mode 100644 index 0000000..e7389bd --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radio_button_selected.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radio_button_textcolor.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radio_button_textcolor.xml new file mode 100644 index 0000000..9fe93c7 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radio_button_textcolor.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radio_button_unselected.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radio_button_unselected.xml new file mode 100644 index 0000000..ccb6bf8 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radio_button_unselected.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radiobutton_background.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radiobutton_background.xml new file mode 100644 index 0000000..6eb6a48 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/radiobutton_background.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/rounded_edittext.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/rounded_edittext.xml new file mode 100644 index 0000000..9f845ce --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/rounded_edittext.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/scrollbar_horizontal_thumb.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/scrollbar_horizontal_thumb.xml new file mode 100644 index 0000000..e4ea48c --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/scrollbar_horizontal_thumb.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/squrelogo.png b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/squrelogo.png new file mode 100644 index 0000000..f7cafaf Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/squrelogo.png differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/submenu.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/submenu.xml new file mode 100644 index 0000000..64f9e41 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/submenu.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/thicknessgauge4_1.png b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/thicknessgauge4_1.png new file mode 100644 index 0000000..176b9d3 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/drawable/thicknessgauge4_1.png differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/layout/activity_polish.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/layout/activity_polish.xml new file mode 100644 index 0000000..8ba0c96 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/layout/activity_polish.xml @@ -0,0 +1,731 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values-night/themes.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..d5516cd --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values/colors.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..7ed5a2f --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values/colors.xml @@ -0,0 +1,168 @@ + + + #FF000000 + #FFFFFFFF + #FFFFFFFF + #BDBDBD + #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/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values/strings.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..378e92b --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values/strings.xml @@ -0,0 +1,47 @@ + + 吊耳去余 + 状态\n信息 + 测量\n距离(左) + 测量\n距离(中) + 测量\n距离(右) + 滑台\n位置 + 主轴\n速度 + 作业\n模式 + 下降\n高度 + 车体\n速度 + 左侧\n补偿 + 右侧\n补偿 + + + 手动操作 + 竖直操作 + 水平操作 + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + + 20 + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values/themes.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..a645915 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/values/themes.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/backup_rules.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/check_boxs.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/check_boxs.xml new file mode 100644 index 0000000..df2d64a --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/check_boxs.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/data_extraction_rules.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/device_filter.xml b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/device_filter.xml new file mode 100644 index 0000000..b2a252c --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/main/res/xml/device_filter.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/diaoerqiege/diaoerqige_V1.0/app/src/test/java/com/example/diaoerqiegeapp/ExampleUnitTest.java b/diaoerqiege/diaoerqige_V1.0/app/src/test/java/com/example/diaoerqiegeapp/ExampleUnitTest.java new file mode 100644 index 0000000..58f4627 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/app/src/test/java/com/example/diaoerqiegeapp/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.diaoerqiegeapp; + +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/diaoerqiege/diaoerqige_V1.0/build.gradle b/diaoerqiege/diaoerqige_V1.0/build.gradle new file mode 100644 index 0000000..b99ec97 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/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.8.0' apply false +} \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/gradle.properties b/diaoerqiege/diaoerqige_V1.0/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/diaoerqiege/diaoerqige_V1.0/gradle/wrapper/gradle-wrapper.jar b/diaoerqiege/diaoerqige_V1.0/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/diaoerqiege/diaoerqige_V1.0/gradle/wrapper/gradle-wrapper.jar differ diff --git a/diaoerqiege/diaoerqige_V1.0/gradle/wrapper/gradle-wrapper.properties b/diaoerqiege/diaoerqige_V1.0/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ab0fcbf --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Feb 05 16:42:57 CST 2025 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/diaoerqiege/diaoerqige_V1.0/gradlew b/diaoerqiege/diaoerqige_V1.0/gradlew new file mode 100644 index 0000000..4f906e0 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/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/diaoerqiege/diaoerqige_V1.0/gradlew.bat b/diaoerqiege/diaoerqige_V1.0/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/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/diaoerqiege/diaoerqige_V1.0/settings.gradle b/diaoerqiege/diaoerqige_V1.0/settings.gradle new file mode 100644 index 0000000..7f4cda9 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/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 = "diaoerqiegeapp" +include ':app' diff --git a/diaoerqiege/diaoerqige_V1.0/备注.txt b/diaoerqiege/diaoerqige_V1.0/备注.txt new file mode 100644 index 0000000..b8df847 --- /dev/null +++ b/diaoerqiege/diaoerqige_V1.0/备注.txt @@ -0,0 +1 @@ +修改新的摆臂界面---2025.5.29 \ No newline at end of file