diff --git a/guohuafengdian/guohuawindpowerapp(1)/.gitignore b/guohuafengdian/guohuawindpowerapp(1)/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.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/guohuafengdian/guohuawindpowerapp(1)/.idea/.gitignore b/guohuafengdian/guohuawindpowerapp(1)/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/.name b/guohuafengdian/guohuawindpowerapp(1)/.idea/.name new file mode 100644 index 0000000..a035130 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/.name @@ -0,0 +1 @@ +guohuawindpowerapp \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/AndroidProjectSystem.xml b/guohuafengdian/guohuawindpowerapp(1)/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/compiler.xml b/guohuafengdian/guohuawindpowerapp(1)/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/deploymentTargetDropDown.xml b/guohuafengdian/guohuawindpowerapp(1)/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..0c0c338 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/deploymentTargetSelector.xml b/guohuafengdian/guohuawindpowerapp(1)/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..f09202a --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/deploymentTargetSelector.xml @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/gradle.xml b/guohuafengdian/guohuawindpowerapp(1)/.idea/gradle.xml new file mode 100644 index 0000000..7b3006b --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/migrations.xml b/guohuafengdian/guohuawindpowerapp(1)/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/misc.xml b/guohuafengdian/guohuawindpowerapp(1)/.idea/misc.xml new file mode 100644 index 0000000..b2c751a --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/render.experimental.xml b/guohuafengdian/guohuawindpowerapp(1)/.idea/render.experimental.xml new file mode 100644 index 0000000..8ec256a --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/render.experimental.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/runConfigurations.xml b/guohuafengdian/guohuawindpowerapp(1)/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/.idea/vcs.xml b/guohuafengdian/guohuawindpowerapp(1)/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/README.md b/guohuafengdian/guohuawindpowerapp(1)/README.md new file mode 100644 index 0000000..e69de29 diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/.gitignore b/guohuafengdian/guohuawindpowerapp(1)/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/build.gradle b/guohuafengdian/guohuawindpowerapp(1)/app/build.gradle new file mode 100644 index 0000000..39b0db2 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/build.gradle @@ -0,0 +1,58 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.guohuawindpowerapp' + 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/guohuafengdian/guohuawindpowerapp(1)/app/proguard-rules.pro b/guohuafengdian/guohuawindpowerapp(1)/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/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/guohuafengdian/guohuawindpowerapp(1)/app/release/output-metadata.json b/guohuafengdian/guohuawindpowerapp(1)/app/release/output-metadata.json new file mode 100644 index 0000000..b20c26e --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/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/guohuafengdian/guohuawindpowerapp(1)/app/src/androidTest/java/com/example/guohuawindpowerapp/ExampleInstrumentedTest.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/androidTest/java/com/example/guohuawindpowerapp/ExampleInstrumentedTest.java new file mode 100644 index 0000000..d6c6158 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/androidTest/java/com/example/guohuawindpowerapp/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.guohuawindpowerapp; + +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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/AndroidManifest.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e7283a8 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/AndroidManifest.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/bsp_IV.proto b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/bsp_IV.proto new file mode 100644 index 0000000..4b45260 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/bsp_IV.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +option java_multiple_files = false; +option java_package = "com.example.guohuawindpowerapp.models"; + +message IV_struct_define +{ + int32 TempatureE_2C=1;//0.01Celsius 0.01摄氏度 + int32 RunMode=2;//系统运行状态 + int32 LeftCompensationE_2D= 3; //左补偿值 0.01° E_2D= 0.01Degree + int32 RightCompensationE_2D= 4;//右补偿值 0.01° + int32 CurrentAngleE_2D= 5; //当前值 0.01° + int32 RobotMoveSpeedE_2MPMin= 6; //0.01m/min + int32 EndPressure=7; + int32 SystemError=8; + int32 Left_Motor_Err=9; + int32 Right_Motor_Err=10; + int32 Remote_Status = 11; + int32 Slide_Table_Position = 12; + int32 Slide_Table_Speed = 13; + int32 Spray_Paint_Motor = 14; + int32 Push_Rod = 15; + int32 Roll_Brush = 16; + int32 Water_Pump = 17; + int32 Thickness_Value = 18; + +}; diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/bsp_PV.proto b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/bsp_PV.proto new file mode 100644 index 0000000..6c921d3 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/bsp_PV.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +option java_multiple_files = false; +option java_package = "com.example.guohuawindpowerapp.models"; +message PV_struct_define{ + + // 喷漆项目 + int32 RunMode = 1; // 1 平面作业 2 竖直作业 3 自动作业 4 水平作业 + int32 RobotSpeed=2;//0-30m/min + + int32 SlidingDistance_cm = 3; //cm + int32 RobotBackwardDistance_cm = 4; //cm + int32 PumpFrequency = 5; + int32 PressureTargetValue = 6; + int32 VerticalCompensation = 7; + int32 RobotWorkingMode = 8; // 1 清洗 2 打磨 3 喷漆 4 测厚 + int32 SlidingTableSpeed = 9; + int32 HorizontalCompensationControl = 10; + int32 RobotSpeed_Clean_Mode = 11; + int32 RobotSpeed_Derust_Mode = 12; + int32 RobotSpeed_Spray_Paint_Mode = 13; + int32 RobotSpeed_Thickness_Measure_Mode = 14; + int32 PressureTargetValue_Derust = 15; + + int32 PumpStopFrequency = 16; + + int32 changeLaneBackwarkDistance = 17; + +}; diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/CleanActivity.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/CleanActivity.java new file mode 100644 index 0000000..d4c384e --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/CleanActivity.java @@ -0,0 +1,465 @@ +package com.example.guohuawindpowerapp; + +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 com.example.guohuawindpowerapp.databinding.ActivityCleanBinding; +import com.example.guohuawindpowerapp.models.BspPV; +import com.example.guohuawindpowerapp.models.DisplayPV; +import com.example.guohuawindpowerapp.services.DecimalDigitsInputFilter; +import com.example.guohuawindpowerapp.services.ModbusCRC; +import com.example.guohuawindpowerapp.services.MyDataHelper; +import com.example.guohuawindpowerapp.services.PopupHelper; +import com.example.guohuawindpowerapp.services.USBSerialPortHelper; +import com.example.guohuawindpowerapp.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 CleanActivity extends AppCompatActivity { + public ActivityCleanBinding mainBinding; + + public USBSerialPortHelper serialPortHelper;//串口接收类 + private BspPV.PV_struct_define _toSendPV; + + Timer timer = 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_clean); + + mainBinding.MaintvVerticalAdjustTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter()}); //editext 一位小数限制 + mainBinding.MaintvMoveSpeedTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter() }); + showError("无"); + + + /* USB串口 控制区域*/ + serialPortHelper = new USBSerialPortHelper(null,this,null,null,null); + serialPortHelper.intialize(); + serialPortHelper.connect(); + + /* NodePlayer 播放视频区域*/ + + NodePlayer nodePlayer0=new NodePlayer(this); + // String address0 = "rtsp://192.168.1.168:8554/0"; + // String address1 = "rtsp://192.168.1.169:8554/0"; + String address0 = "rtsp://192.168.144.3:8554/main.264"; + VideoPlayerHelper.startVedio(mainBinding.nodePlayerView0,nodePlayer0,address0); + +// NodePlayer nodePlayer1=new NodePlayer(this); +// // String address0 = "rtsp://192.168.1.168:8554/0"; +// // String address1 = "rtsp://192.168.1.169:8554/0"; +// String address1 = "rtsp://192.168.144.60:8554/main.264"; +// VideoPlayerHelper.startVedio(mainBinding.nodePlayerView5,nodePlayer1,address1); + + myDataHelper.IntializeDataBaseClean(); + //读取数据 + List pvList = myDataHelper.getDisplayDataClean(1); //按id查询数据赋值给界面 + mainBinding.MaintvVerticalAdjustTo32.setText(String.valueOf(pvList.get(0).getVerticalCompensation())); + mainBinding.MaintvMoveSpeedTo32.setText(String.valueOf(pvList.get(0).getmoveSpeedClean())); + mainBinding.MaintvPumpFrequencyTo32.setText(String.valueOf(pvList.get(0).getpumpFrequency())); + mainBinding.MaintvPressLimitTo32.setText(String.valueOf(pvList.get(0).getPressSetClean())); + mainBinding.MaintvPumpStopFrequencyTo32.setText(String.valueOf(pvList.get(0).getpumpStopFrequency())); + + + + /*发往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() + .setRunMode(1) + .setRobotSpeed(0) + .setSlidingDistanceCm(0) + .setRobotBackwardDistanceCm(0) + .setPumpFrequency(0) + .setPressureTargetValue(0) + .setVerticalCompensation(0) + .setRobotWorkingMode(2) + .setSlidingTableSpeed(0) + .setHorizontalCompensationControl(0) + .setRobotSpeedCleanMode(0) + .setRobotSpeedDerustMode(0) + .setRobotSpeedSprayPaintMode(0) + .setRobotSpeedThicknessMeasureMode(0) + .setPumpStopFrequency(0) + .build(); + + String VeticalAdjustStr = mainBinding.MaintvVerticalAdjustTo32.getText().toString(); + String MoveSpeedStr = mainBinding.MaintvMoveSpeedTo32.getText().toString(); + String PumpFrequencyStr = mainBinding.MaintvPumpFrequencyTo32.getText().toString(); + String PumpStopFrequencyStr = mainBinding.MaintvPumpStopFrequencyTo32.getText().toString(); + String PressLimitStr = mainBinding.MaintvPressLimitTo32.getText().toString(); + //竖直微调--小数 *10 + try { + + if( VeticalAdjustStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setVerticalCompensation(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setVerticalCompensation( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvVerticalAdjustTo32.getText()))*10 )) .build(); + + } + + } catch (Exception e) { + + } + //移动速度*10 + try { + if( MoveSpeedStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setRobotSpeedCleanMode(1).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setRobotSpeedCleanMode( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvMoveSpeedTo32.getText()))*10 )).build(); + } + } + catch (Exception e) + { + + } + + //水泵频率 + if(PumpFrequencyStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setPumpFrequency(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setPumpFrequency((Integer.parseInt(String.valueOf(mainBinding.MaintvPumpFrequencyTo32.getText())))).build();} + + //水泵停止频率 + if(PumpStopFrequencyStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setPumpStopFrequency(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setPumpStopFrequency((Integer.parseInt(String.valueOf(mainBinding.MaintvPumpStopFrequencyTo32.getText())))).build();} + + //压力上限 + if(PressLimitStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setPressureTargetValue(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setPressureTargetValue((Integer.parseInt(String.valueOf(mainBinding.MaintvPressLimitTo32.getText())))).build();} + + //工作模式 + _toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(1).build(); //1 清洗 + + if(_Operate_Mode_Call_Value.equals("手动作业")) + { + _toSendPV = _toSendPV.toBuilder().setRunMode(1).build(); + } + if(_Operate_Mode_Call_Value.equals("竖直作业")) + { + _toSendPV = _toSendPV.toBuilder().setRunMode(2).build(); + } + if(_Operate_Mode_Call_Value.equals("自动作业")) + { + _toSendPV = _toSendPV.toBuilder().setRunMode(3).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.OperateModeCleanPopup(this); + } + }); + //竖直补偿 + mainBinding.MaintvVerticalAdjustTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + String input = s.toString().trim(); + + // 1. 允许空输入(用户正在删除) + if (TextUtils.isEmpty(input)) { + return; + } + + // 2. 允许合法的中间状态(如"-10.") + if (input.matches("^-?\\d*(\\.\\d*)?$")) { + // 合法格式:整数、负数、小数、小数点开头 + try { + + int value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value < -10 || value > 10) { + showToast("请输入 -10 到 10 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvVerticalAdjustTo32.setText(""); + } else { + showToast("输入有效: " + value); + } + // 尝试转换为double(处理小数) + //lastValidValue = Double.parseDouble(input); + } catch (NumberFormatException e) { + // 中间状态,忽略 + } + } + } + }); + + //车体移动速度事件 + mainBinding.MaintvMoveSpeedTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + double value=0.0; + + if (!input.isEmpty()) { + try { + value = Double.parseDouble(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value < 0 || value > 30) { + showToast("请输入 0 到 30 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvMoveSpeedTo32.setText(""); + + } else { + showToast("输入有效: " + value); + + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + + + } + }); + //水泵启停频率 + mainBinding.MaintvPumpFrequencyTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + if (!input.isEmpty()) { + try { + int value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value <= 0 || value > 10) { + showToast("请输入 0 到 10 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvPumpFrequencyTo32.setText(""); + } else { + showToast("输入有效: " + value); + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + } + }); + + //水泵停止频率 + mainBinding.MaintvPumpStopFrequencyTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + if (!input.isEmpty()) { + try { + int value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value <= 0 || value > 10) { + showToast("请输入 0 到 10 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvPumpStopFrequencyTo32.setText(""); + } else { + showToast("输入有效: " + value); + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + } + }); + + + //压力上限 + mainBinding.MaintvPressLimitTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + if (!input.isEmpty()) { + try { + int value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value <= 0 || value > 3000) { + showToast("请输入 0 到 3000 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvPressLimitTo32.setText(""); + } else { + showToast("输入有效: " + value); + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + } + }); + //错误显示 + mainBinding.errorTextView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + showErrorHistoryDialog(); + } + }); + //保存 + mainBinding.btnSave.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //获取界面参数以写进数据库 + int paraIndex = 1; + double verticalAdjust = Double.parseDouble(mainBinding.MaintvVerticalAdjustTo32.getText().toString()); + double moveSpeedClean = Double.parseDouble(mainBinding.MaintvMoveSpeedTo32.getText().toString()); + + int pumpFrequency = Integer.parseInt(mainBinding.MaintvPumpFrequencyTo32.getText().toString()); + int pumpStopFrequency = Integer.parseInt(mainBinding.MaintvPumpStopFrequencyTo32.getText().toString()); + int pressSetClean = Integer.parseInt(mainBinding.MaintvPressLimitTo32.getText().toString()); + + //把界面中的值放进PV类的变量中 + DisplayPV displayPV = new DisplayPV(paraIndex, verticalAdjust,0,0, 0,0,moveSpeedClean, pumpFrequency, pressSetClean,0,0,0 ,0,pumpStopFrequency,0,0); + myDataHelper.addOrUpdateDisplayDataClean(displayPV); //创建数据库的实例在这里 PV传进去保存到数据库 + Toast.makeText(CleanActivity.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/MainActivity.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/MainActivity.java new file mode 100644 index 0000000..b2f4a7b --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/MainActivity.java @@ -0,0 +1,189 @@ +package com.example.guohuawindpowerapp; + +import android.content.Intent; +import android.os.Bundle; +import android.view.WindowManager; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.databinding.DataBindingUtil; + +import com.example.guohuawindpowerapp.databinding.ActivityMainBinding; +import com.example.guohuawindpowerapp.models.BspPV; +import com.example.guohuawindpowerapp.services.ModbusCRC; +import com.example.guohuawindpowerapp.services.USBSerialPortHelper; + +import java.util.Timer; +import java.util.TimerTask; + +public class MainActivity extends AppCompatActivity { + public ActivityMainBinding mainBinding; + private BspPV.PV_struct_define _toSendPV; + public USBSerialPortHelper serialPortHelper;//串口接收类 + Timer timer = new Timer(); + + @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_main); + // 必须在 AndroidManifest.xml 中注册,否则会报错 + mainBinding.btnPaint.setOnClickListener(v -> startActivity(new Intent(this, PaintActivity.class))); + mainBinding.btnClean.setOnClickListener(v -> startActivity(new Intent(this, CleanActivity.class))); + mainBinding.btnPolish.setOnClickListener(v -> startActivity(new Intent(this, PolishActivity.class))); + mainBinding.btnMeasure.setOnClickListener(v -> startActivity(new Intent(this, MeasureActivity.class))); + /* USB串口 控制区域*/ + serialPortHelper = new USBSerialPortHelper(null,null,null,null,this); + serialPortHelper.intialize(); + serialPortHelper.connect(); + /*发往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() + .setRunMode(0) + .setRobotSpeed(0) + .setSlidingDistanceCm(0) + .setRobotBackwardDistanceCm(0) + .setPumpFrequency(0) + .setPressureTargetValue(0) + .setVerticalCompensation(0) + .setRobotWorkingMode(0) + .setSlidingTableSpeed(0) + .setHorizontalCompensationControl(0) + .setPumpStopFrequency(0) + .build(); + + + _toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(0).build(); + _toSendPV = _toSendPV.toBuilder().setRunMode(0).build(); + + byte[] byteArray = _toSendPV.toByteArray(); + byte[] sendbyteArray = new byte[byteArray.length + 4]; + byte[] sendbyteArray3 = new byte[byteArray.length + 6]; + if (byteArray.length != 0) { + System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); + } + sendbyteArray[0] = (byte) 0x55; + sendbyteArray[1] = (byte) 0x55; + sendbyteArray[2] = (byte) 0x01; + sendbyteArray[3] = (byte) 0x01; + + byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); + + System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); + + System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); + + serialPortHelper.SendData(sendbyteArray3); + } + }); + } + }, 0, 1000); // 延迟 0 毫秒,每隔 1000 毫秒执行一次 + } + // 新增:当界面可见时调用(如从辅助界面返回时) + @Override + protected void onResume() { + super.onResume(); + // 启动串口连接 + + /* USB串口 控制区域*/ + serialPortHelper = new USBSerialPortHelper(null,null,null,null,this); + serialPortHelper.intialize(); + serialPortHelper.connect(); + + // 启动定时器(确保每次界面可见时都运行) + startTimer(); + } + // 新增:当界面不可见时调用(如跳转到辅助界面时) + @Override + protected void onPause() { + super.onPause(); + // 停止定时器(避免在后台浪费资源) + stopTimer(); + } + + // 新增:启动定时器的方法 + private void startTimer() { + // 先停止已有定时器,避免重复创建 + if (timer != null) { + timer.cancel(); + } + timer = new Timer(); + 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() + .setRunMode(0) + .setRobotSpeed(0) + .setSlidingDistanceCm(0) + .setRobotBackwardDistanceCm(0) + .setPumpFrequency(0) + .setPressureTargetValue(0) + .setVerticalCompensation(0) + .setRobotWorkingMode(0) + .setSlidingTableSpeed(0) + .setHorizontalCompensationControl(0) + .build(); + + + _toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(0).build(); + _toSendPV = _toSendPV.toBuilder().setRunMode(0).build(); + + byte[] byteArray = _toSendPV.toByteArray(); + byte[] sendbyteArray = new byte[byteArray.length + 4]; + byte[] sendbyteArray3 = new byte[byteArray.length + 6]; + if (byteArray.length != 0) { + System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); + } + sendbyteArray[0] = (byte) 0x55; + sendbyteArray[1] = (byte) 0x55; + sendbyteArray[2] = (byte) 0x01; + sendbyteArray[3] = (byte) 0x01; + + byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); + + System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); + + System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); + + serialPortHelper.SendData(sendbyteArray3); + } + }); + } + }, 0, 1000); // 延迟 0 毫秒,每隔 1000 毫秒执行一次 + } + // 新增:停止定时器的方法 + private void stopTimer() { + if (timer != null) { + timer.cancel(); + timer = null; // 置空,释放资源 + } + } + // 界面销毁时彻底释放资源 + @Override + protected void onDestroy() { + super.onDestroy(); + stopTimer(); + if (serialPortHelper != null) { + serialPortHelper.disconnect(); + serialPortHelper = null; + } + } +} \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/MeasureActivity.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/MeasureActivity.java new file mode 100644 index 0000000..878507c --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/MeasureActivity.java @@ -0,0 +1,259 @@ +package com.example.guohuawindpowerapp; + +import android.app.AlertDialog; +import android.content.DialogInterface; +import android.os.Bundle; +import android.text.Editable; +import android.text.InputFilter; +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.ViewDataBinding; + +import com.example.guohuawindpowerapp.databinding.ActivityMeasureBinding; +import com.example.guohuawindpowerapp.models.BspPV; +import com.example.guohuawindpowerapp.models.DisplayPV; +import com.example.guohuawindpowerapp.services.DecimalDigitsInputFilter; +import com.example.guohuawindpowerapp.services.ModbusCRC; +import com.example.guohuawindpowerapp.services.MyDataHelper; +import com.example.guohuawindpowerapp.services.PopupHelper; +import com.example.guohuawindpowerapp.services.USBSerialPortHelper; +import com.example.guohuawindpowerapp.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 MeasureActivity extends AppCompatActivity { + + public ActivityMeasureBinding mainBinding; + public USBSerialPortHelper serialPortHelper;//串口接收类 + private BspPV.PV_struct_define _toSendPV; + + Timer timer = new Timer(); + + public MyDataHelper myDataHelper = new MyDataHelper(this);//数据库类 + public PopupHelper popupHelper = new PopupHelper(this);//对话框类,把主界面实例传过去 + + /*报错相关*/ + 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_measure); + mainBinding.MaintvMoveSpeedTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter() }); + showError("无"); + + + /* USB串口 控制区域*/ + serialPortHelper = new USBSerialPortHelper(null,null,null,this,null); + serialPortHelper.intialize(); + serialPortHelper.connect(); + + + + /* NodePlayer 播放视频区域*/ + + NodePlayer nodePlayer0=new NodePlayer(this); + // String address0 = "rtsp://192.168.1.168:8554/0"; + // String address1 = "rtsp://192.168.1.169:8554/0"; + String address0 = "rtsp://192.168.144.3:8554/main.264"; + VideoPlayerHelper.startVedio(mainBinding.nodePlayerView1,nodePlayer0,address0); + +// NodePlayer nodePlayer2=new NodePlayer(this); +// // String address0 = "rtsp://192.168.1.168:8554/0"; +// // String address1 = "rtsp://192.168.1.169:8554/0"; +// String address2 = "rtsp://192.168.144.60:8554/main.264"; +// VideoPlayerHelper.startVedio(mainBinding.nodePlayerView6,nodePlayer2,address2); + + myDataHelper.IntializeDataBaseMeasure(); + //读取数据 + List pvList = myDataHelper.getDisplayDataMeasure(1); //按id查询数据赋值给界面 + + mainBinding.MaintvMoveSpeedTo32.setText(String.valueOf(pvList.get(0).getmoveSpeedMeasure())); + + + + /*发往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() + .setRunMode(1) + .setRobotSpeed(0) + .setSlidingDistanceCm(0) + .setRobotBackwardDistanceCm(0) + .setPumpFrequency(0) + .setPressureTargetValue(0) + .setVerticalCompensation(0) + .setRobotWorkingMode(0) + .setSlidingTableSpeed(0) + .setHorizontalCompensationControl(0) + .setRobotSpeedCleanMode(0) + .setRobotSpeedDerustMode(0) + .setRobotSpeedSprayPaintMode(0) + .setRobotSpeedThicknessMeasureMode(0) + .setPumpStopFrequency(0) + .build(); + + + String MoveSpeedStr = mainBinding.MaintvMoveSpeedTo32.getText().toString(); + + + //移动速度 + try { + if( MoveSpeedStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setRobotSpeedThicknessMeasureMode(1).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setRobotSpeedThicknessMeasureMode( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvMoveSpeedTo32.getText()))*10 )).build(); + } + } + catch (Exception e) + { + + } + + _toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(4).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.MaintvMoveSpeedTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + double value=0.0; + if (!input.isEmpty()) { + try { + value = Double.parseDouble(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value < 0 || value > 30) { + showToast("请输入 0 到 30 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvMoveSpeedTo32.setText(""); + + } else { + showToast("输入有效: " + value); + + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + + + } + }); + //错误显示 + mainBinding.errorTextView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + showErrorHistoryDialog(); + } + }); + + mainBinding.btnSave.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //获取界面参数以写进数据库 + int paraIndex = 1; + double moveSpeedMeasure = Double.parseDouble(mainBinding.MaintvMoveSpeedTo32.getText().toString()); + + + + //把界面中的值放进PV类的变量中 + DisplayPV displayPV = new DisplayPV(paraIndex, 0,0,0, 0,0,0, 0, 0,0,0,0,moveSpeedMeasure ,0,0,0); + myDataHelper.addOrUpdateDisplayDataMeasure(displayPV); //创建数据库的实例在这里 PV传进去保存到数据库 + Toast.makeText(MeasureActivity.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/PaintActivity.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/PaintActivity.java new file mode 100644 index 0000000..8e2ce5e --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/PaintActivity.java @@ -0,0 +1,543 @@ +package com.example.guohuawindpowerapp; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.databinding.DataBindingUtil; + +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 com.example.guohuawindpowerapp.databinding.ActivityPaintBinding; +import com.example.guohuawindpowerapp.models.BspPV; +import com.example.guohuawindpowerapp.models.DisplayPV; +import com.example.guohuawindpowerapp.services.DecimalDigitsInputFilter; +import com.example.guohuawindpowerapp.services.ModbusCRC; +import com.example.guohuawindpowerapp.services.MyDataHelper; +import com.example.guohuawindpowerapp.services.PopupHelper; +import com.example.guohuawindpowerapp.services.USBSerialPortHelper; +import com.example.guohuawindpowerapp.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 PaintActivity extends AppCompatActivity { + + public ActivityPaintBinding mainBinding;//通过Binding可以获取界面数据 + //USB 串口服务 + public USBSerialPortHelper serialPortHelper;//串口接收类 + private BspPV.PV_struct_define _toSendPV; + + Timer timer = new Timer(); + + public MyDataHelper myDataHelper = new MyDataHelper(this);//数据库类 + public PopupHelper popupHelper = new PopupHelper(this);//对话框类,把主界面实例传过去 + + public static byte[] stopgetAllChData = new byte[]{0x55, 0x66, 0x01, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, (byte) (0xf7 & 0xff), (byte) (0xe0 & 0xff)}; + public static int sendStopDataCount = 0; + + 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_paint); + showError("无"); + mainBinding.MaintvVerticalAdjustTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter()}); //editext 一位小数限制 + mainBinding.MaintvMoveSpeedTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter() }); + mainBinding.MaintvSlideSpeedTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter()}); + + /* USB串口 控制区域*/ + serialPortHelper = new USBSerialPortHelper(this,null,null,null,null); + serialPortHelper.intialize(); + serialPortHelper.connect(); + + + /* NodePlayer 播放视频区域*/ + + NodePlayer nodePlayer0=new NodePlayer(this); + // String address0 = "rtsp://192.168.1.168:8554/0"; + // String address1 = "rtsp://192.168.1.169:8554/0"; + String address0 = "rtsp://192.168.144.3:8554/main.264"; + VideoPlayerHelper.startVedio(mainBinding.nodePlayerView2,nodePlayer0,address0); + + /* NodePlayer 播放视频区域*/ + +// NodePlayer nodePlayer3=new NodePlayer(this); +// // String address0 = "rtsp://192.168.1.168:8554/0"; +// // String address1 = "rtsp://192.168.1.169:8554/0"; +// String address3 = "rtsp://192.168.144.60:8554/main.264"; +// VideoPlayerHelper.startVedio(mainBinding.nodePlayerView4,nodePlayer3,address3); + + + myDataHelper.IntializeDataBasePaint(); + //读取数据 + List pvList = myDataHelper.getDisplayDataPaint(1); //按id查询数据赋值给界面 + mainBinding.MaintvVerticalAdjustTo32.setText(String.valueOf(pvList.get(0).getVerticalCompensation())); + mainBinding.MaintvMoveSpeedTo32.setText(String.valueOf(pvList.get(0).getMoveSpeedPaint())); + mainBinding.MaintvBackDistanceTo32.setText(String.valueOf(pvList.get(0).getbackDistance())); + mainBinding.MaintvSlideSpeedTo32.setText(String.valueOf(pvList.get(0).getslideSpeed())); + mainBinding.MaintvSlideMoveDistanceTo32.setText(String.valueOf(pvList.get(0).getslideDistance())); + mainBinding.MaintvChangeLaneBackDistanceTo32.setText(String.valueOf(pvList.get(0).getChangeLaneDisPaint())); + + /*发往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() + .setRunMode(1) + .setRobotSpeed(0) + .setSlidingDistanceCm(0) + .setRobotBackwardDistanceCm(0) + .setPumpFrequency(0) + .setPressureTargetValue(0) + .setVerticalCompensation(0) + .setRobotWorkingMode(0) + .setSlidingTableSpeed(0) + .setHorizontalCompensationControl(0) + .setRobotSpeedCleanMode(0) + .setRobotSpeedDerustMode(0) + .setRobotSpeedSprayPaintMode(0) + .setRobotSpeedThicknessMeasureMode(0) + .setPumpStopFrequency(0) + .setChangeLaneBackwarkDistance(0) + .build(); + + String VeticalAdjustStr = mainBinding.MaintvVerticalAdjustTo32.getText().toString(); + String MoveSpeedStr = mainBinding.MaintvMoveSpeedTo32.getText().toString(); + String BackDistanceStr = mainBinding.MaintvBackDistanceTo32.getText().toString(); + String SlideSpeedStr = mainBinding.MaintvSlideSpeedTo32.getText().toString(); + String SlideMoveDistanceStr = mainBinding.MaintvSlideMoveDistanceTo32.getText().toString(); + String ChangeLaneDiatancev = mainBinding.MaintvChangeLaneBackDistanceTo32.getText().toString(); + + //竖直微调--小数 *10 + try { + + if( VeticalAdjustStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setVerticalCompensation(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setVerticalCompensation( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvVerticalAdjustTo32.getText()))*10 )) .build(); + + } + + } catch (Exception e) { + + } + //移动速度 + try { + if( MoveSpeedStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setRobotSpeedSprayPaintMode(1).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setRobotSpeedSprayPaintMode( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvMoveSpeedTo32.getText()))*10 )).build(); + } + } + catch (Exception e) + { + + } + //后退距离 + try { + if( BackDistanceStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setRobotBackwardDistanceCm(1).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setRobotBackwardDistanceCm( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvBackDistanceTo32.getText())) )).build(); + } + } catch (Exception e) { + + } + //滑台速度 + try { + if(SlideSpeedStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setSlidingTableSpeed(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setSlidingTableSpeed((Integer.parseInt(String.valueOf(mainBinding.MaintvSlideSpeedTo32.getText()))*10)).build();} + + } catch (Exception e) { + + } + + // 换道距离 + try { + if(ChangeLaneDiatancev.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setChangeLaneBackwarkDistance(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setChangeLaneBackwarkDistance((Integer.parseInt(String.valueOf(mainBinding.MaintvChangeLaneBackDistanceTo32.getText())))).build();} + + } catch (Exception e) { + + } + + //滑台移动距离 + if(SlideMoveDistanceStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setSlidingDistanceCm(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setSlidingDistanceCm((Integer.parseInt(String.valueOf(mainBinding.MaintvSlideMoveDistanceTo32.getText())))).build();} + + _toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(3).build(); + + if(_Operate_Mode_Call_Value.equals("手动作业")) + { + _toSendPV = _toSendPV.toBuilder().setRunMode(1).build(); + } + if(_Operate_Mode_Call_Value.equals("竖直作业")) + { + _toSendPV = _toSendPV.toBuilder().setRunMode(2).build(); + } + if(_Operate_Mode_Call_Value.equals("竖直自动")) + { + _toSendPV = _toSendPV.toBuilder().setRunMode(3).build(); + } + if(_Operate_Mode_Call_Value.equals("水平自动")) + { + _toSendPV = _toSendPV.toBuilder().setRunMode(5).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.OperateModePaintPopup(this); + } + }); + + + + + mainBinding.MaintvVerticalAdjustTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + String input = s.toString().trim(); + + // 1. 允许空输入(用户正在删除) + if (TextUtils.isEmpty(input)) { + return; + } + + // 2. 允许合法的中间状态(如"-10.") + if (input.matches("^-?\\d*(\\.\\d*)?$")) { + // 合法格式:整数、负数、小数、小数点开头 + try { + + int value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value < -10 || value > 10) { + showToast("请输入 -10 到 10 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvVerticalAdjustTo32.setText(""); + } else { + showToast("输入有效: " + value); + } + // 尝试转换为double(处理小数) + //lastValidValue = Double.parseDouble(input); + } catch (NumberFormatException e) { + // 中间状态,忽略 + } + } + + + } + }); + + //车体移动速度事件 + mainBinding.MaintvMoveSpeedTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + double value=0.0; + + if (!input.isEmpty()) { + try { + value = Double.parseDouble(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value < 0 || value > 30) { + showToast("请输入 0 到 30 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvMoveSpeedTo32.setText(""); + + } else { + showToast("输入有效: " + value); + + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + + + } + }); + //后退距离 + mainBinding.MaintvBackDistanceTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + if (!input.isEmpty()) { + try { + int value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value <= 0 || value > 100) { + showToast("请输入 0 到 100 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvBackDistanceTo32.setText(""); + } else { + showToast("输入有效: " + value); + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + + + } + }); + //滑台速度 + mainBinding.MaintvSlideSpeedTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + int value=0; + + if (!input.isEmpty()) { + try { + value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value <= 0 || value > 10) { + showToast("请输入 0 到 10 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvSlideSpeedTo32.setText(""); + + } else { + showToast("输入有效: " + value); + + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + } + }); + + mainBinding.MaintvSlideMoveDistanceTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + if (!input.isEmpty()) { + try { + int value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value <= 0 || value > 30) { + showToast("请输入 0 到 30 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvSlideMoveDistanceTo32.setText(""); + } else { + showToast("输入有效: " + value); + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + + + } + }); + //错误显示 + mainBinding.errorTextView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + showErrorHistoryDialog(); + } + }); + mainBinding.btnSave.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //获取界面参数以写进数据库 + int paraIndex = 1; + double verticalAdjust = Double.parseDouble(mainBinding.MaintvVerticalAdjustTo32.getText().toString()); + double moveSpeedPaint = Double.parseDouble(mainBinding.MaintvMoveSpeedTo32.getText().toString()); + int backDistance = Integer.parseInt(mainBinding.MaintvBackDistanceTo32.getText().toString()); + int slideSpeed = Integer.parseInt(mainBinding.MaintvSlideSpeedTo32.getText().toString()); + int slideDistance = Integer.parseInt(mainBinding.MaintvSlideMoveDistanceTo32.getText().toString()); + int changeLaneDis = Integer.parseInt(mainBinding.MaintvChangeLaneBackDistanceTo32.getText().toString()); + + + //把界面中的值放进PV类的变量中 + DisplayPV displayPV = new DisplayPV(paraIndex, verticalAdjust,moveSpeedPaint,backDistance, slideSpeed,slideDistance,0, 0, 0,0,0,0,0 ,0,0,changeLaneDis); + myDataHelper.addOrUpdateDisplayDataPaint(displayPV); //创建数据库的实例在这里 PV传进去保存到数据库 + Toast.makeText(PaintActivity.this, "保存成功", Toast.LENGTH_SHORT).show(); + } + }); + } //oncreate + + +//函数定义放create外 +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(); + } + + + + + @Override + protected void onStart() { + super.onStart(); + serialPortHelper.onStart(); + + } + + @Override + public void onStop() { + serialPortHelper.onStop(); + super.onStop(); + } + + @Override + public void onResume() { + super.onResume(); + serialPortHelper.onResume(); + + } + + @Override + public void onPause() { + serialPortHelper.onPause(); + super.onPause(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + if (timer != null) { + timer.cancel(); + } + } + + +} \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/PolishActivity.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/PolishActivity.java new file mode 100644 index 0000000..4f10a81 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/PolishActivity.java @@ -0,0 +1,430 @@ +package com.example.guohuawindpowerapp; + +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.ViewDataBinding; + +import com.example.guohuawindpowerapp.databinding.ActivityMainBinding; +import com.example.guohuawindpowerapp.databinding.ActivityPolishBinding; +import com.example.guohuawindpowerapp.models.BspPV; +import com.example.guohuawindpowerapp.models.DisplayPV; +import com.example.guohuawindpowerapp.services.DecimalDigitsInputFilter; +import com.example.guohuawindpowerapp.services.ModbusCRC; +import com.example.guohuawindpowerapp.services.MyDataHelper; +import com.example.guohuawindpowerapp.services.PopupHelper; +import com.example.guohuawindpowerapp.services.USBSerialPortHelper; +import com.example.guohuawindpowerapp.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 PolishActivity extends AppCompatActivity { + + public ActivityPolishBinding mainBinding; + + public USBSerialPortHelper serialPortHelper;//串口接收类 + private BspPV.PV_struct_define _toSendPV; + + Timer timer = 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); + + mainBinding.MaintvVerticalAdjustTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter()}); //editext 一位小数限制 + mainBinding.MaintvMoveSpeedTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter() }); + showError("无"); + + + /* USB串口 控制区域*/ + serialPortHelper = new USBSerialPortHelper(null,null,this,null,null); + serialPortHelper.intialize(); + serialPortHelper.connect(); + + + /* NodePlayer 播放视频区域*/ + + NodePlayer nodePlayer0=new NodePlayer(this); + // String address0 = "rtsp://192.168.1.168:8554/0"; + // String address1 = "rtsp://192.168.1.169:8554/0"; + String address0 = "rtsp://192.168.144.3:8554/main.264"; + VideoPlayerHelper.startVedio(mainBinding.nodePlayerView3,nodePlayer0,address0); + +// NodePlayer nodePlayer4=new NodePlayer(this); +// // String address0 = "rtsp://192.168.1.168:8554/0"; +// // String address1 = "rtsp://192.168.1.169:8554/0"; +// String address4 = "rtsp://192.168.144.60:8554/main.264"; +// VideoPlayerHelper.startVedio(mainBinding.nodePlayerView7,nodePlayer4,address4); + + myDataHelper.IntializeDataBasePolish(); + //读取并显示数据 + List pvList = myDataHelper.getDisplayDataPolish(1); //按id查询数据赋值给界面 + mainBinding.MaintvVerticalAdjustTo32.setText(String.valueOf(pvList.get(0).getVerticalCompensation())); + mainBinding.MaintvMoveSpeedTo32.setText(String.valueOf(pvList.get(0).getmoveSpeedPolish())); + mainBinding.MaintvHCompensationSwitchTo32.setText(String.valueOf(pvList.get(0).getHCompensationSwitch())); + mainBinding.MaintvPressLimitTo32.setText(String.valueOf(pvList.get(0).getPressSetPolish())); + mainBinding.changeLaneDisValue.setText(String.valueOf(pvList.get(0).getChangeLaneDistance())); + + + /*发往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() + .setRunMode(1) + .setRobotSpeed(0) + .setSlidingDistanceCm(0) + .setRobotBackwardDistanceCm(0) + .setPumpFrequency(0) + .setPressureTargetValue(0) + .setVerticalCompensation(0) + .setRobotWorkingMode(2) + .setSlidingTableSpeed(0) + .setHorizontalCompensationControl(0) + .setRobotSpeedCleanMode(0) + .setRobotSpeedDerustMode(0) + .setRobotSpeedSprayPaintMode(0) + .setRobotSpeedThicknessMeasureMode(0) + .setPumpStopFrequency(0) + .setChangeLaneBackwarkDistance(0) + .build(); + + String VeticalAdjustStr = mainBinding.MaintvVerticalAdjustTo32.getText().toString(); + String MoveSpeedStr = mainBinding.MaintvMoveSpeedTo32.getText().toString(); + String HCompensationSwitchStr = mainBinding.MaintvHCompensationSwitchTo32.getText().toString(); + String PressLimitStr = mainBinding.MaintvPressLimitTo32.getText().toString(); + String ChangeLaneDisValue = mainBinding.changeLaneDisValue.getText().toString(); + //竖直微调--小数 *10 + try { + + if( VeticalAdjustStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setVerticalCompensation(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setVerticalCompensation( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvVerticalAdjustTo32.getText()))*10 )) .build(); + + } + + } catch (Exception e) { + + } + //移动速度*10 + try { + if( MoveSpeedStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setRobotSpeed(1).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setRobotSpeedDerustMode( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvMoveSpeedTo32.getText()))*10 )).build(); + } + } + catch (Exception e) + { + + } + + //水平补偿开关 + if(HCompensationSwitchStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setHorizontalCompensationControl(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setHorizontalCompensationControl((Integer.parseInt(String.valueOf(mainBinding.MaintvHCompensationSwitchTo32.getText())))).build();} + + //压力上限 + if(PressLimitStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setPressureTargetValueDerust(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setPressureTargetValueDerust((Integer.parseInt(String.valueOf(mainBinding.MaintvPressLimitTo32.getText())))).build();} + + // 换道距离 + if(ChangeLaneDisValue.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setChangeLaneBackwarkDistance(0).build();} + else { _toSendPV = _toSendPV.toBuilder() + .setChangeLaneBackwarkDistance((Integer.parseInt(String.valueOf(mainBinding.changeLaneDisValue.getText())))).build();} + + //工作模式 + _toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(2).build(); //2 打磨 + + if(_Operate_Mode_Call_Value.equals("手动作业")) + { + _toSendPV = _toSendPV.toBuilder().setRunMode(1).build(); + } + if(_Operate_Mode_Call_Value.equals("竖直作业")) + { + _toSendPV = _toSendPV.toBuilder().setRunMode(2).build(); + } + if(_Operate_Mode_Call_Value.equals("水平作业")) + { + _toSendPV = _toSendPV.toBuilder().setRunMode(4).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.MaintvVerticalAdjustTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + String input = s.toString().trim(); + + // 1. 允许空输入(用户正在删除) + if (TextUtils.isEmpty(input)) { + return; + } + + // 2. 允许合法的中间状态(如"-10.") + if (input.matches("^-?\\d*(\\.\\d*)?$")) { + // 合法格式:整数、负数、小数、小数点开头 + try { + + int value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value < -10 || value > 10) { + showToast("请输入 -10 到 10 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvVerticalAdjustTo32.setText(""); + } else { + showToast("输入有效: " + value); + } + // 尝试转换为double(处理小数) + //lastValidValue = Double.parseDouble(input); + } catch (NumberFormatException e) { + // 中间状态,忽略 + } + } + } + }); + + //车体移动速度事件 + mainBinding.MaintvMoveSpeedTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + double value=0.0; + + if (!input.isEmpty()) { + try { + value = Double.parseDouble(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value < 0 || value > 30) { + showToast("请输入 0 到 30 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvMoveSpeedTo32.setText(""); + + } else { + showToast("输入有效: " + value); + + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + + + } + }); + + //压力上限 + mainBinding.MaintvPressLimitTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + if (!input.isEmpty()) { + try { + int value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value <= 0 || value > 3000) { + showToast("请输入 0 到 3000 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvPressLimitTo32.setText(""); + } else { + showToast("输入有效: " + value); + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + + + } + }); + //水平补偿开关 + mainBinding.MaintvHCompensationSwitchTo32.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void afterTextChanged(Editable s) { + // 文本变化后的回调,在这里进行范围检查 + String input = s.toString(); + if (!input.isEmpty()) { + try { + int value = Integer.parseInt(input); + // 检查输入值是否在 -50 到 100 范围内 + if (value < 0 || value > 1) { + showToast("请输入 0 到 1 之间的数字"); + // 可以选择清除输入或限制在范围内 + mainBinding.MaintvHCompensationSwitchTo32.setText(""); + } else { + showToast("输入有效: " + value); + } + } catch (NumberFormatException e) { + showToast("请输入有效的数字"); + } + } + } + }); + //错误显示 + mainBinding.errorTextView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + showErrorHistoryDialog(); + } + }); + + + mainBinding.btnSave.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //获取界面参数以写进数据库 + int paraIndex = 1; + double verticalAdjust = Double.parseDouble(mainBinding.MaintvVerticalAdjustTo32.getText().toString()); + double moveSpeedPolish = Double.parseDouble(mainBinding.MaintvMoveSpeedTo32.getText().toString()); + int HCompensationSwitch = Integer.parseInt(mainBinding.MaintvHCompensationSwitchTo32.getText().toString()); + int pressSetPolish = Integer.parseInt(mainBinding.MaintvPressLimitTo32.getText().toString()); + int changeLaneDis = Integer.parseInt(mainBinding.changeLaneDisValue.getText().toString()); + + // 把界面中的值放进PV类的变量中 + DisplayPV displayPV = new DisplayPV(paraIndex, verticalAdjust,0,0, 0,0,0, 0, 0,pressSetPolish,moveSpeedPolish,HCompensationSwitch ,0,0,changeLaneDis,0); + myDataHelper.addOrUpdateDisplayDataPolish(displayPV); //创建数据库的实例在这里 PV传进去保存到数据库 + Toast.makeText(PolishActivity.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/BspIV.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/BspIV.java new file mode 100644 index 0000000..074607d --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/BspIV.java @@ -0,0 +1,1849 @@ +// 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.guohuawindpowerapp.models; + +public final class BspIV { + private BspIV() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 2, + /* suffix= */ "", + BspIV.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface IV_struct_defineOrBuilder extends + // @@protoc_insertion_point(interface_extends:IV_struct_define) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * 0.01Celsius 0.01摄氏度
+     * 
+ * + * int32 TempatureE_2C = 1; + * @return The tempatureE2C. + */ + int getTempatureE2C(); + + /** + *
+     * 系统运行状态
+     * 
+ * + * int32 RunMode = 2; + * @return The runMode. + */ + int getRunMode(); + + /** + *
+     * 左补偿值 0.01° E_2D= 0.01Degree 
+     * 
+ * + * int32 LeftCompensationE_2D = 3; + * @return The leftCompensationE2D. + */ + int getLeftCompensationE2D(); + + /** + *
+     * 右补偿值 0.01° 
+     * 
+ * + * int32 RightCompensationE_2D = 4; + * @return The rightCompensationE2D. + */ + int getRightCompensationE2D(); + + /** + *
+     * 当前值 0.01°
+     * 
+ * + * int32 CurrentAngleE_2D = 5; + * @return The currentAngleE2D. + */ + int getCurrentAngleE2D(); + + /** + *
+     * 0.01m/min
+     * 
+ * + * int32 RobotMoveSpeedE_2MPMin = 6; + * @return The robotMoveSpeedE2MPMin. + */ + int getRobotMoveSpeedE2MPMin(); + + /** + * int32 EndPressure = 7; + * @return The endPressure. + */ + int getEndPressure(); + + /** + * int32 SystemError = 8; + * @return The systemError. + */ + int getSystemError(); + + /** + * int32 Left_Motor_Err = 9; + * @return The leftMotorErr. + */ + int getLeftMotorErr(); + + /** + * int32 Right_Motor_Err = 10; + * @return The rightMotorErr. + */ + int getRightMotorErr(); + + /** + * int32 Remote_Status = 11; + * @return The remoteStatus. + */ + int getRemoteStatus(); + + /** + * int32 Slide_Table_Position = 12; + * @return The slideTablePosition. + */ + int getSlideTablePosition(); + + /** + * int32 Slide_Table_Speed = 13; + * @return The slideTableSpeed. + */ + int getSlideTableSpeed(); + + /** + * int32 Spray_Paint_Motor = 14; + * @return The sprayPaintMotor. + */ + int getSprayPaintMotor(); + + /** + * int32 Push_Rod = 15; + * @return The pushRod. + */ + int getPushRod(); + + /** + * int32 Roll_Brush = 16; + * @return The rollBrush. + */ + int getRollBrush(); + + /** + * int32 Water_Pump = 17; + * @return The waterPump. + */ + int getWaterPump(); + + /** + * int32 Thickness_Value = 18; + * @return The thicknessValue. + */ + int getThicknessValue(); + } + /** + * 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.guohuawindpowerapp.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.guohuawindpowerapp.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.guohuawindpowerapp.models.BspIV.IV_struct_define.class, com.example.guohuawindpowerapp.models.BspIV.IV_struct_define.Builder.class); + } + + public static final int TEMPATUREE_2C_FIELD_NUMBER = 1; + private int tempatureE2C_ = 0; + /** + *
+     * 0.01Celsius 0.01摄氏度
+     * 
+ * + * int32 TempatureE_2C = 1; + * @return The tempatureE2C. + */ + @java.lang.Override + public int getTempatureE2C() { + return tempatureE2C_; + } + + public static final int RUNMODE_FIELD_NUMBER = 2; + private int runMode_ = 0; + /** + *
+     * 系统运行状态
+     * 
+ * + * int32 RunMode = 2; + * @return The runMode. + */ + @java.lang.Override + public int getRunMode() { + return runMode_; + } + + public static final int LEFTCOMPENSATIONE_2D_FIELD_NUMBER = 3; + private int leftCompensationE2D_ = 0; + /** + *
+     * 左补偿值 0.01° E_2D= 0.01Degree 
+     * 
+ * + * int32 LeftCompensationE_2D = 3; + * @return The leftCompensationE2D. + */ + @java.lang.Override + public int getLeftCompensationE2D() { + return leftCompensationE2D_; + } + + public static final int RIGHTCOMPENSATIONE_2D_FIELD_NUMBER = 4; + private int rightCompensationE2D_ = 0; + /** + *
+     * 右补偿值 0.01° 
+     * 
+ * + * int32 RightCompensationE_2D = 4; + * @return The rightCompensationE2D. + */ + @java.lang.Override + public int getRightCompensationE2D() { + return rightCompensationE2D_; + } + + public static final int CURRENTANGLEE_2D_FIELD_NUMBER = 5; + private int currentAngleE2D_ = 0; + /** + *
+     * 当前值 0.01°
+     * 
+ * + * int32 CurrentAngleE_2D = 5; + * @return The currentAngleE2D. + */ + @java.lang.Override + public int getCurrentAngleE2D() { + return currentAngleE2D_; + } + + public static final int ROBOTMOVESPEEDE_2MPMIN_FIELD_NUMBER = 6; + private int robotMoveSpeedE2MPMin_ = 0; + /** + *
+     * 0.01m/min
+     * 
+ * + * int32 RobotMoveSpeedE_2MPMin = 6; + * @return The robotMoveSpeedE2MPMin. + */ + @java.lang.Override + public int getRobotMoveSpeedE2MPMin() { + return robotMoveSpeedE2MPMin_; + } + + public static final int ENDPRESSURE_FIELD_NUMBER = 7; + private int endPressure_ = 0; + /** + * int32 EndPressure = 7; + * @return The endPressure. + */ + @java.lang.Override + public int getEndPressure() { + return endPressure_; + } + + public static final int SYSTEMERROR_FIELD_NUMBER = 8; + private int systemError_ = 0; + /** + * int32 SystemError = 8; + * @return The systemError. + */ + @java.lang.Override + public int getSystemError() { + return systemError_; + } + + public static final int LEFT_MOTOR_ERR_FIELD_NUMBER = 9; + private int leftMotorErr_ = 0; + /** + * int32 Left_Motor_Err = 9; + * @return The leftMotorErr. + */ + @java.lang.Override + public int getLeftMotorErr() { + return leftMotorErr_; + } + + public static final int RIGHT_MOTOR_ERR_FIELD_NUMBER = 10; + private int rightMotorErr_ = 0; + /** + * int32 Right_Motor_Err = 10; + * @return The rightMotorErr. + */ + @java.lang.Override + public int getRightMotorErr() { + return rightMotorErr_; + } + + public static final int REMOTE_STATUS_FIELD_NUMBER = 11; + private int remoteStatus_ = 0; + /** + * int32 Remote_Status = 11; + * @return The remoteStatus. + */ + @java.lang.Override + public int getRemoteStatus() { + return remoteStatus_; + } + + public static final int SLIDE_TABLE_POSITION_FIELD_NUMBER = 12; + private int slideTablePosition_ = 0; + /** + * int32 Slide_Table_Position = 12; + * @return The slideTablePosition. + */ + @java.lang.Override + public int getSlideTablePosition() { + return slideTablePosition_; + } + + public static final int SLIDE_TABLE_SPEED_FIELD_NUMBER = 13; + private int slideTableSpeed_ = 0; + /** + * int32 Slide_Table_Speed = 13; + * @return The slideTableSpeed. + */ + @java.lang.Override + public int getSlideTableSpeed() { + return slideTableSpeed_; + } + + public static final int SPRAY_PAINT_MOTOR_FIELD_NUMBER = 14; + private int sprayPaintMotor_ = 0; + /** + * int32 Spray_Paint_Motor = 14; + * @return The sprayPaintMotor. + */ + @java.lang.Override + public int getSprayPaintMotor() { + return sprayPaintMotor_; + } + + public static final int PUSH_ROD_FIELD_NUMBER = 15; + private int pushRod_ = 0; + /** + * int32 Push_Rod = 15; + * @return The pushRod. + */ + @java.lang.Override + public int getPushRod() { + return pushRod_; + } + + public static final int ROLL_BRUSH_FIELD_NUMBER = 16; + private int rollBrush_ = 0; + /** + * int32 Roll_Brush = 16; + * @return The rollBrush. + */ + @java.lang.Override + public int getRollBrush() { + return rollBrush_; + } + + public static final int WATER_PUMP_FIELD_NUMBER = 17; + private int waterPump_ = 0; + /** + * int32 Water_Pump = 17; + * @return The waterPump. + */ + @java.lang.Override + public int getWaterPump() { + return waterPump_; + } + + public static final int THICKNESS_VALUE_FIELD_NUMBER = 18; + private int thicknessValue_ = 0; + /** + * int32 Thickness_Value = 18; + * @return The thicknessValue. + */ + @java.lang.Override + public int getThicknessValue() { + return thicknessValue_; + } + + 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 (tempatureE2C_ != 0) { + output.writeInt32(1, tempatureE2C_); + } + if (runMode_ != 0) { + output.writeInt32(2, runMode_); + } + if (leftCompensationE2D_ != 0) { + output.writeInt32(3, leftCompensationE2D_); + } + if (rightCompensationE2D_ != 0) { + output.writeInt32(4, rightCompensationE2D_); + } + if (currentAngleE2D_ != 0) { + output.writeInt32(5, currentAngleE2D_); + } + if (robotMoveSpeedE2MPMin_ != 0) { + output.writeInt32(6, robotMoveSpeedE2MPMin_); + } + if (endPressure_ != 0) { + output.writeInt32(7, endPressure_); + } + if (systemError_ != 0) { + output.writeInt32(8, systemError_); + } + if (leftMotorErr_ != 0) { + output.writeInt32(9, leftMotorErr_); + } + if (rightMotorErr_ != 0) { + output.writeInt32(10, rightMotorErr_); + } + if (remoteStatus_ != 0) { + output.writeInt32(11, remoteStatus_); + } + if (slideTablePosition_ != 0) { + output.writeInt32(12, slideTablePosition_); + } + if (slideTableSpeed_ != 0) { + output.writeInt32(13, slideTableSpeed_); + } + if (sprayPaintMotor_ != 0) { + output.writeInt32(14, sprayPaintMotor_); + } + if (pushRod_ != 0) { + output.writeInt32(15, pushRod_); + } + if (rollBrush_ != 0) { + output.writeInt32(16, rollBrush_); + } + if (waterPump_ != 0) { + output.writeInt32(17, waterPump_); + } + if (thicknessValue_ != 0) { + output.writeInt32(18, thicknessValue_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (tempatureE2C_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, tempatureE2C_); + } + if (runMode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, runMode_); + } + if (leftCompensationE2D_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, leftCompensationE2D_); + } + if (rightCompensationE2D_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, rightCompensationE2D_); + } + if (currentAngleE2D_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, currentAngleE2D_); + } + if (robotMoveSpeedE2MPMin_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, robotMoveSpeedE2MPMin_); + } + if (endPressure_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, endPressure_); + } + if (systemError_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, systemError_); + } + if (leftMotorErr_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, leftMotorErr_); + } + if (rightMotorErr_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, rightMotorErr_); + } + if (remoteStatus_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, remoteStatus_); + } + if (slideTablePosition_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(12, slideTablePosition_); + } + if (slideTableSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(13, slideTableSpeed_); + } + if (sprayPaintMotor_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(14, sprayPaintMotor_); + } + if (pushRod_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(15, pushRod_); + } + if (rollBrush_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(16, rollBrush_); + } + if (waterPump_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(17, waterPump_); + } + if (thicknessValue_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(18, thicknessValue_); + } + 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.guohuawindpowerapp.models.BspIV.IV_struct_define)) { + return super.equals(obj); + } + com.example.guohuawindpowerapp.models.BspIV.IV_struct_define other = (com.example.guohuawindpowerapp.models.BspIV.IV_struct_define) obj; + + if (getTempatureE2C() + != other.getTempatureE2C()) return false; + if (getRunMode() + != other.getRunMode()) return false; + if (getLeftCompensationE2D() + != other.getLeftCompensationE2D()) return false; + if (getRightCompensationE2D() + != other.getRightCompensationE2D()) return false; + if (getCurrentAngleE2D() + != other.getCurrentAngleE2D()) return false; + if (getRobotMoveSpeedE2MPMin() + != other.getRobotMoveSpeedE2MPMin()) return false; + if (getEndPressure() + != other.getEndPressure()) return false; + if (getSystemError() + != other.getSystemError()) return false; + if (getLeftMotorErr() + != other.getLeftMotorErr()) return false; + if (getRightMotorErr() + != other.getRightMotorErr()) return false; + if (getRemoteStatus() + != other.getRemoteStatus()) return false; + if (getSlideTablePosition() + != other.getSlideTablePosition()) return false; + if (getSlideTableSpeed() + != other.getSlideTableSpeed()) return false; + if (getSprayPaintMotor() + != other.getSprayPaintMotor()) return false; + if (getPushRod() + != other.getPushRod()) return false; + if (getRollBrush() + != other.getRollBrush()) return false; + if (getWaterPump() + != other.getWaterPump()) return false; + if (getThicknessValue() + != other.getThicknessValue()) 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) + TEMPATUREE_2C_FIELD_NUMBER; + hash = (53 * hash) + getTempatureE2C(); + hash = (37 * hash) + RUNMODE_FIELD_NUMBER; + hash = (53 * hash) + getRunMode(); + hash = (37 * hash) + LEFTCOMPENSATIONE_2D_FIELD_NUMBER; + hash = (53 * hash) + getLeftCompensationE2D(); + hash = (37 * hash) + RIGHTCOMPENSATIONE_2D_FIELD_NUMBER; + hash = (53 * hash) + getRightCompensationE2D(); + hash = (37 * hash) + CURRENTANGLEE_2D_FIELD_NUMBER; + hash = (53 * hash) + getCurrentAngleE2D(); + hash = (37 * hash) + ROBOTMOVESPEEDE_2MPMIN_FIELD_NUMBER; + hash = (53 * hash) + getRobotMoveSpeedE2MPMin(); + hash = (37 * hash) + ENDPRESSURE_FIELD_NUMBER; + hash = (53 * hash) + getEndPressure(); + hash = (37 * hash) + SYSTEMERROR_FIELD_NUMBER; + hash = (53 * hash) + getSystemError(); + hash = (37 * hash) + LEFT_MOTOR_ERR_FIELD_NUMBER; + hash = (53 * hash) + getLeftMotorErr(); + hash = (37 * hash) + RIGHT_MOTOR_ERR_FIELD_NUMBER; + hash = (53 * hash) + getRightMotorErr(); + hash = (37 * hash) + REMOTE_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getRemoteStatus(); + hash = (37 * hash) + SLIDE_TABLE_POSITION_FIELD_NUMBER; + hash = (53 * hash) + getSlideTablePosition(); + hash = (37 * hash) + SLIDE_TABLE_SPEED_FIELD_NUMBER; + hash = (53 * hash) + getSlideTableSpeed(); + hash = (37 * hash) + SPRAY_PAINT_MOTOR_FIELD_NUMBER; + hash = (53 * hash) + getSprayPaintMotor(); + hash = (37 * hash) + PUSH_ROD_FIELD_NUMBER; + hash = (53 * hash) + getPushRod(); + hash = (37 * hash) + ROLL_BRUSH_FIELD_NUMBER; + hash = (53 * hash) + getRollBrush(); + hash = (37 * hash) + WATER_PUMP_FIELD_NUMBER; + hash = (53 * hash) + getWaterPump(); + hash = (37 * hash) + THICKNESS_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getThicknessValue(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.guohuawindpowerapp.models.BspIV.IV_struct_define parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.guohuawindpowerapp.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.guohuawindpowerapp.models.BspIV.IV_struct_define parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.guohuawindpowerapp.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.guohuawindpowerapp.models.BspIV.IV_struct_define parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.models.BspIV.IV_struct_defineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.guohuawindpowerapp.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.guohuawindpowerapp.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.guohuawindpowerapp.models.BspIV.IV_struct_define.class, com.example.guohuawindpowerapp.models.BspIV.IV_struct_define.Builder.class); + } + + // Construct using com.example.guohuawindpowerapp.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; + tempatureE2C_ = 0; + runMode_ = 0; + leftCompensationE2D_ = 0; + rightCompensationE2D_ = 0; + currentAngleE2D_ = 0; + robotMoveSpeedE2MPMin_ = 0; + endPressure_ = 0; + systemError_ = 0; + leftMotorErr_ = 0; + rightMotorErr_ = 0; + remoteStatus_ = 0; + slideTablePosition_ = 0; + slideTableSpeed_ = 0; + sprayPaintMotor_ = 0; + pushRod_ = 0; + rollBrush_ = 0; + waterPump_ = 0; + thicknessValue_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.guohuawindpowerapp.models.BspIV.internal_static_IV_struct_define_descriptor; + } + + @java.lang.Override + public com.example.guohuawindpowerapp.models.BspIV.IV_struct_define getDefaultInstanceForType() { + return com.example.guohuawindpowerapp.models.BspIV.IV_struct_define.getDefaultInstance(); + } + + @java.lang.Override + public com.example.guohuawindpowerapp.models.BspIV.IV_struct_define build() { + com.example.guohuawindpowerapp.models.BspIV.IV_struct_define result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.guohuawindpowerapp.models.BspIV.IV_struct_define buildPartial() { + com.example.guohuawindpowerapp.models.BspIV.IV_struct_define result = new com.example.guohuawindpowerapp.models.BspIV.IV_struct_define(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.example.guohuawindpowerapp.models.BspIV.IV_struct_define result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.tempatureE2C_ = tempatureE2C_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.runMode_ = runMode_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.leftCompensationE2D_ = leftCompensationE2D_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rightCompensationE2D_ = rightCompensationE2D_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.currentAngleE2D_ = currentAngleE2D_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.robotMoveSpeedE2MPMin_ = robotMoveSpeedE2MPMin_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.endPressure_ = endPressure_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.systemError_ = systemError_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.leftMotorErr_ = leftMotorErr_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.rightMotorErr_ = rightMotorErr_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.remoteStatus_ = remoteStatus_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.slideTablePosition_ = slideTablePosition_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.slideTableSpeed_ = slideTableSpeed_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.sprayPaintMotor_ = sprayPaintMotor_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.pushRod_ = pushRod_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.rollBrush_ = rollBrush_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.waterPump_ = waterPump_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.thicknessValue_ = thicknessValue_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.guohuawindpowerapp.models.BspIV.IV_struct_define) { + return mergeFrom((com.example.guohuawindpowerapp.models.BspIV.IV_struct_define)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.guohuawindpowerapp.models.BspIV.IV_struct_define other) { + if (other == com.example.guohuawindpowerapp.models.BspIV.IV_struct_define.getDefaultInstance()) return this; + if (other.getTempatureE2C() != 0) { + setTempatureE2C(other.getTempatureE2C()); + } + if (other.getRunMode() != 0) { + setRunMode(other.getRunMode()); + } + if (other.getLeftCompensationE2D() != 0) { + setLeftCompensationE2D(other.getLeftCompensationE2D()); + } + if (other.getRightCompensationE2D() != 0) { + setRightCompensationE2D(other.getRightCompensationE2D()); + } + if (other.getCurrentAngleE2D() != 0) { + setCurrentAngleE2D(other.getCurrentAngleE2D()); + } + if (other.getRobotMoveSpeedE2MPMin() != 0) { + setRobotMoveSpeedE2MPMin(other.getRobotMoveSpeedE2MPMin()); + } + if (other.getEndPressure() != 0) { + setEndPressure(other.getEndPressure()); + } + if (other.getSystemError() != 0) { + setSystemError(other.getSystemError()); + } + if (other.getLeftMotorErr() != 0) { + setLeftMotorErr(other.getLeftMotorErr()); + } + if (other.getRightMotorErr() != 0) { + setRightMotorErr(other.getRightMotorErr()); + } + if (other.getRemoteStatus() != 0) { + setRemoteStatus(other.getRemoteStatus()); + } + if (other.getSlideTablePosition() != 0) { + setSlideTablePosition(other.getSlideTablePosition()); + } + if (other.getSlideTableSpeed() != 0) { + setSlideTableSpeed(other.getSlideTableSpeed()); + } + if (other.getSprayPaintMotor() != 0) { + setSprayPaintMotor(other.getSprayPaintMotor()); + } + if (other.getPushRod() != 0) { + setPushRod(other.getPushRod()); + } + if (other.getRollBrush() != 0) { + setRollBrush(other.getRollBrush()); + } + if (other.getWaterPump() != 0) { + setWaterPump(other.getWaterPump()); + } + if (other.getThicknessValue() != 0) { + setThicknessValue(other.getThicknessValue()); + } + 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: { + tempatureE2C_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + runMode_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + leftCompensationE2D_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + rightCompensationE2D_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + currentAngleE2D_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + robotMoveSpeedE2MPMin_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + endPressure_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + systemError_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + leftMotorErr_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + rightMotorErr_ = input.readInt32(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + remoteStatus_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + slideTablePosition_ = input.readInt32(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 104: { + slideTableSpeed_ = input.readInt32(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 112: { + sprayPaintMotor_ = input.readInt32(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 120: { + pushRod_ = input.readInt32(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 128: { + rollBrush_ = input.readInt32(); + bitField0_ |= 0x00008000; + break; + } // case 128 + case 136: { + waterPump_ = input.readInt32(); + bitField0_ |= 0x00010000; + break; + } // case 136 + case 144: { + thicknessValue_ = input.readInt32(); + bitField0_ |= 0x00020000; + break; + } // case 144 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int tempatureE2C_ ; + /** + *
+       * 0.01Celsius 0.01摄氏度
+       * 
+ * + * int32 TempatureE_2C = 1; + * @return The tempatureE2C. + */ + @java.lang.Override + public int getTempatureE2C() { + return tempatureE2C_; + } + /** + *
+       * 0.01Celsius 0.01摄氏度
+       * 
+ * + * int32 TempatureE_2C = 1; + * @param value The tempatureE2C to set. + * @return This builder for chaining. + */ + public Builder setTempatureE2C(int value) { + + tempatureE2C_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * 0.01Celsius 0.01摄氏度
+       * 
+ * + * int32 TempatureE_2C = 1; + * @return This builder for chaining. + */ + public Builder clearTempatureE2C() { + bitField0_ = (bitField0_ & ~0x00000001); + tempatureE2C_ = 0; + onChanged(); + return this; + } + + private int runMode_ ; + /** + *
+       * 系统运行状态
+       * 
+ * + * int32 RunMode = 2; + * @return The runMode. + */ + @java.lang.Override + public int getRunMode() { + return runMode_; + } + /** + *
+       * 系统运行状态
+       * 
+ * + * int32 RunMode = 2; + * @param value The runMode to set. + * @return This builder for chaining. + */ + public Builder setRunMode(int value) { + + runMode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * 系统运行状态
+       * 
+ * + * int32 RunMode = 2; + * @return This builder for chaining. + */ + public Builder clearRunMode() { + bitField0_ = (bitField0_ & ~0x00000002); + runMode_ = 0; + onChanged(); + return this; + } + + private int leftCompensationE2D_ ; + /** + *
+       * 左补偿值 0.01° E_2D= 0.01Degree 
+       * 
+ * + * int32 LeftCompensationE_2D = 3; + * @return The leftCompensationE2D. + */ + @java.lang.Override + public int getLeftCompensationE2D() { + return leftCompensationE2D_; + } + /** + *
+       * 左补偿值 0.01° E_2D= 0.01Degree 
+       * 
+ * + * int32 LeftCompensationE_2D = 3; + * @param value The leftCompensationE2D to set. + * @return This builder for chaining. + */ + public Builder setLeftCompensationE2D(int value) { + + leftCompensationE2D_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * 左补偿值 0.01° E_2D= 0.01Degree 
+       * 
+ * + * int32 LeftCompensationE_2D = 3; + * @return This builder for chaining. + */ + public Builder clearLeftCompensationE2D() { + bitField0_ = (bitField0_ & ~0x00000004); + leftCompensationE2D_ = 0; + onChanged(); + return this; + } + + private int rightCompensationE2D_ ; + /** + *
+       * 右补偿值 0.01° 
+       * 
+ * + * int32 RightCompensationE_2D = 4; + * @return The rightCompensationE2D. + */ + @java.lang.Override + public int getRightCompensationE2D() { + return rightCompensationE2D_; + } + /** + *
+       * 右补偿值 0.01° 
+       * 
+ * + * int32 RightCompensationE_2D = 4; + * @param value The rightCompensationE2D to set. + * @return This builder for chaining. + */ + public Builder setRightCompensationE2D(int value) { + + rightCompensationE2D_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * 右补偿值 0.01° 
+       * 
+ * + * int32 RightCompensationE_2D = 4; + * @return This builder for chaining. + */ + public Builder clearRightCompensationE2D() { + bitField0_ = (bitField0_ & ~0x00000008); + rightCompensationE2D_ = 0; + onChanged(); + return this; + } + + private int currentAngleE2D_ ; + /** + *
+       * 当前值 0.01°
+       * 
+ * + * int32 CurrentAngleE_2D = 5; + * @return The currentAngleE2D. + */ + @java.lang.Override + public int getCurrentAngleE2D() { + return currentAngleE2D_; + } + /** + *
+       * 当前值 0.01°
+       * 
+ * + * int32 CurrentAngleE_2D = 5; + * @param value The currentAngleE2D to set. + * @return This builder for chaining. + */ + public Builder setCurrentAngleE2D(int value) { + + currentAngleE2D_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       * 当前值 0.01°
+       * 
+ * + * int32 CurrentAngleE_2D = 5; + * @return This builder for chaining. + */ + public Builder clearCurrentAngleE2D() { + bitField0_ = (bitField0_ & ~0x00000010); + currentAngleE2D_ = 0; + onChanged(); + return this; + } + + private int robotMoveSpeedE2MPMin_ ; + /** + *
+       * 0.01m/min
+       * 
+ * + * int32 RobotMoveSpeedE_2MPMin = 6; + * @return The robotMoveSpeedE2MPMin. + */ + @java.lang.Override + public int getRobotMoveSpeedE2MPMin() { + return robotMoveSpeedE2MPMin_; + } + /** + *
+       * 0.01m/min
+       * 
+ * + * int32 RobotMoveSpeedE_2MPMin = 6; + * @param value The robotMoveSpeedE2MPMin to set. + * @return This builder for chaining. + */ + public Builder setRobotMoveSpeedE2MPMin(int value) { + + robotMoveSpeedE2MPMin_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+       * 0.01m/min
+       * 
+ * + * int32 RobotMoveSpeedE_2MPMin = 6; + * @return This builder for chaining. + */ + public Builder clearRobotMoveSpeedE2MPMin() { + bitField0_ = (bitField0_ & ~0x00000020); + robotMoveSpeedE2MPMin_ = 0; + onChanged(); + return this; + } + + private int endPressure_ ; + /** + * int32 EndPressure = 7; + * @return The endPressure. + */ + @java.lang.Override + public int getEndPressure() { + return endPressure_; + } + /** + * int32 EndPressure = 7; + * @param value The endPressure to set. + * @return This builder for chaining. + */ + public Builder setEndPressure(int value) { + + endPressure_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * int32 EndPressure = 7; + * @return This builder for chaining. + */ + public Builder clearEndPressure() { + bitField0_ = (bitField0_ & ~0x00000040); + endPressure_ = 0; + onChanged(); + return this; + } + + private int systemError_ ; + /** + * int32 SystemError = 8; + * @return The systemError. + */ + @java.lang.Override + public int getSystemError() { + return systemError_; + } + /** + * int32 SystemError = 8; + * @param value The systemError to set. + * @return This builder for chaining. + */ + public Builder setSystemError(int value) { + + systemError_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * int32 SystemError = 8; + * @return This builder for chaining. + */ + public Builder clearSystemError() { + bitField0_ = (bitField0_ & ~0x00000080); + systemError_ = 0; + onChanged(); + return this; + } + + private int leftMotorErr_ ; + /** + * int32 Left_Motor_Err = 9; + * @return The leftMotorErr. + */ + @java.lang.Override + public int getLeftMotorErr() { + return leftMotorErr_; + } + /** + * int32 Left_Motor_Err = 9; + * @param value The leftMotorErr to set. + * @return This builder for chaining. + */ + public Builder setLeftMotorErr(int value) { + + leftMotorErr_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * int32 Left_Motor_Err = 9; + * @return This builder for chaining. + */ + public Builder clearLeftMotorErr() { + bitField0_ = (bitField0_ & ~0x00000100); + leftMotorErr_ = 0; + onChanged(); + return this; + } + + private int rightMotorErr_ ; + /** + * int32 Right_Motor_Err = 10; + * @return The rightMotorErr. + */ + @java.lang.Override + public int getRightMotorErr() { + return rightMotorErr_; + } + /** + * int32 Right_Motor_Err = 10; + * @param value The rightMotorErr to set. + * @return This builder for chaining. + */ + public Builder setRightMotorErr(int value) { + + rightMotorErr_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * int32 Right_Motor_Err = 10; + * @return This builder for chaining. + */ + public Builder clearRightMotorErr() { + bitField0_ = (bitField0_ & ~0x00000200); + rightMotorErr_ = 0; + onChanged(); + return this; + } + + private int remoteStatus_ ; + /** + * int32 Remote_Status = 11; + * @return The remoteStatus. + */ + @java.lang.Override + public int getRemoteStatus() { + return remoteStatus_; + } + /** + * int32 Remote_Status = 11; + * @param value The remoteStatus to set. + * @return This builder for chaining. + */ + public Builder setRemoteStatus(int value) { + + remoteStatus_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * int32 Remote_Status = 11; + * @return This builder for chaining. + */ + public Builder clearRemoteStatus() { + bitField0_ = (bitField0_ & ~0x00000400); + remoteStatus_ = 0; + onChanged(); + return this; + } + + private int slideTablePosition_ ; + /** + * int32 Slide_Table_Position = 12; + * @return The slideTablePosition. + */ + @java.lang.Override + public int getSlideTablePosition() { + return slideTablePosition_; + } + /** + * int32 Slide_Table_Position = 12; + * @param value The slideTablePosition to set. + * @return This builder for chaining. + */ + public Builder setSlideTablePosition(int value) { + + slideTablePosition_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * int32 Slide_Table_Position = 12; + * @return This builder for chaining. + */ + public Builder clearSlideTablePosition() { + bitField0_ = (bitField0_ & ~0x00000800); + slideTablePosition_ = 0; + onChanged(); + return this; + } + + private int slideTableSpeed_ ; + /** + * int32 Slide_Table_Speed = 13; + * @return The slideTableSpeed. + */ + @java.lang.Override + public int getSlideTableSpeed() { + return slideTableSpeed_; + } + /** + * int32 Slide_Table_Speed = 13; + * @param value The slideTableSpeed to set. + * @return This builder for chaining. + */ + public Builder setSlideTableSpeed(int value) { + + slideTableSpeed_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * int32 Slide_Table_Speed = 13; + * @return This builder for chaining. + */ + public Builder clearSlideTableSpeed() { + bitField0_ = (bitField0_ & ~0x00001000); + slideTableSpeed_ = 0; + onChanged(); + return this; + } + + private int sprayPaintMotor_ ; + /** + * int32 Spray_Paint_Motor = 14; + * @return The sprayPaintMotor. + */ + @java.lang.Override + public int getSprayPaintMotor() { + return sprayPaintMotor_; + } + /** + * int32 Spray_Paint_Motor = 14; + * @param value The sprayPaintMotor to set. + * @return This builder for chaining. + */ + public Builder setSprayPaintMotor(int value) { + + sprayPaintMotor_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * int32 Spray_Paint_Motor = 14; + * @return This builder for chaining. + */ + public Builder clearSprayPaintMotor() { + bitField0_ = (bitField0_ & ~0x00002000); + sprayPaintMotor_ = 0; + onChanged(); + return this; + } + + private int pushRod_ ; + /** + * int32 Push_Rod = 15; + * @return The pushRod. + */ + @java.lang.Override + public int getPushRod() { + return pushRod_; + } + /** + * int32 Push_Rod = 15; + * @param value The pushRod to set. + * @return This builder for chaining. + */ + public Builder setPushRod(int value) { + + pushRod_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * int32 Push_Rod = 15; + * @return This builder for chaining. + */ + public Builder clearPushRod() { + bitField0_ = (bitField0_ & ~0x00004000); + pushRod_ = 0; + onChanged(); + return this; + } + + private int rollBrush_ ; + /** + * int32 Roll_Brush = 16; + * @return The rollBrush. + */ + @java.lang.Override + public int getRollBrush() { + return rollBrush_; + } + /** + * int32 Roll_Brush = 16; + * @param value The rollBrush to set. + * @return This builder for chaining. + */ + public Builder setRollBrush(int value) { + + rollBrush_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * int32 Roll_Brush = 16; + * @return This builder for chaining. + */ + public Builder clearRollBrush() { + bitField0_ = (bitField0_ & ~0x00008000); + rollBrush_ = 0; + onChanged(); + return this; + } + + private int waterPump_ ; + /** + * int32 Water_Pump = 17; + * @return The waterPump. + */ + @java.lang.Override + public int getWaterPump() { + return waterPump_; + } + /** + * int32 Water_Pump = 17; + * @param value The waterPump to set. + * @return This builder for chaining. + */ + public Builder setWaterPump(int value) { + + waterPump_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * int32 Water_Pump = 17; + * @return This builder for chaining. + */ + public Builder clearWaterPump() { + bitField0_ = (bitField0_ & ~0x00010000); + waterPump_ = 0; + onChanged(); + return this; + } + + private int thicknessValue_ ; + /** + * int32 Thickness_Value = 18; + * @return The thicknessValue. + */ + @java.lang.Override + public int getThicknessValue() { + return thicknessValue_; + } + /** + * int32 Thickness_Value = 18; + * @param value The thicknessValue to set. + * @return This builder for chaining. + */ + public Builder setThicknessValue(int value) { + + thicknessValue_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * int32 Thickness_Value = 18; + * @return This builder for chaining. + */ + public Builder clearThicknessValue() { + bitField0_ = (bitField0_ & ~0x00020000); + thicknessValue_ = 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.guohuawindpowerapp.models.BspIV.IV_struct_define DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.guohuawindpowerapp.models.BspIV.IV_struct_define(); + } + + public static com.example.guohuawindpowerapp.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.guohuawindpowerapp.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\"\312\003\n\020IV_struct_define\022\025\n\rT" + + "empatureE_2C\030\001 \001(\005\022\017\n\007RunMode\030\002 \001(\005\022\034\n\024L" + + "eftCompensationE_2D\030\003 \001(\005\022\035\n\025RightCompen" + + "sationE_2D\030\004 \001(\005\022\030\n\020CurrentAngleE_2D\030\005 \001" + + "(\005\022\036\n\026RobotMoveSpeedE_2MPMin\030\006 \001(\005\022\023\n\013En" + + "dPressure\030\007 \001(\005\022\023\n\013SystemError\030\010 \001(\005\022\026\n\016" + + "Left_Motor_Err\030\t \001(\005\022\027\n\017Right_Motor_Err\030" + + "\n \001(\005\022\025\n\rRemote_Status\030\013 \001(\005\022\034\n\024Slide_Ta" + + "ble_Position\030\014 \001(\005\022\031\n\021Slide_Table_Speed\030" + + "\r \001(\005\022\031\n\021Spray_Paint_Motor\030\016 \001(\005\022\020\n\010Push" + + "_Rod\030\017 \001(\005\022\022\n\nRoll_Brush\030\020 \001(\005\022\022\n\nWater_" + + "Pump\030\021 \001(\005\022\027\n\017Thickness_Value\030\022 \001(\005B)\n%c" + + "om.example.guohuawindpowerapp.modelsP\000b\006" + + "proto3" + }; + 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[] { "TempatureE2C", "RunMode", "LeftCompensationE2D", "RightCompensationE2D", "CurrentAngleE2D", "RobotMoveSpeedE2MPMin", "EndPressure", "SystemError", "LeftMotorErr", "RightMotorErr", "RemoteStatus", "SlideTablePosition", "SlideTableSpeed", "SprayPaintMotor", "PushRod", "RollBrush", "WaterPump", "ThicknessValue", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/BspPV.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/BspPV.java new file mode 100644 index 0000000..7783320 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/BspPV.java @@ -0,0 +1,1759 @@ +// 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.guohuawindpowerapp.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 RunMode = 1; + * @return The runMode. + */ + int getRunMode(); + + /** + *
+     * 0-30m/min
+     * 
+ * + * int32 RobotSpeed = 2; + * @return The robotSpeed. + */ + int getRobotSpeed(); + + /** + *
+     * cm
+     * 
+ * + * int32 SlidingDistance_cm = 3; + * @return The slidingDistanceCm. + */ + int getSlidingDistanceCm(); + + /** + *
+     * cm
+     * 
+ * + * int32 RobotBackwardDistance_cm = 4; + * @return The robotBackwardDistanceCm. + */ + int getRobotBackwardDistanceCm(); + + /** + * int32 PumpFrequency = 5; + * @return The pumpFrequency. + */ + int getPumpFrequency(); + + /** + * int32 PressureTargetValue = 6; + * @return The pressureTargetValue. + */ + int getPressureTargetValue(); + + /** + * int32 VerticalCompensation = 7; + * @return The verticalCompensation. + */ + int getVerticalCompensation(); + + /** + *
+     * 1 清洗  2 打磨  3 喷漆  4 测厚
+     * 
+ * + * int32 RobotWorkingMode = 8; + * @return The robotWorkingMode. + */ + int getRobotWorkingMode(); + + /** + * int32 SlidingTableSpeed = 9; + * @return The slidingTableSpeed. + */ + int getSlidingTableSpeed(); + + /** + * int32 HorizontalCompensationControl = 10; + * @return The horizontalCompensationControl. + */ + int getHorizontalCompensationControl(); + + /** + * int32 RobotSpeed_Clean_Mode = 11; + * @return The robotSpeedCleanMode. + */ + int getRobotSpeedCleanMode(); + + /** + * int32 RobotSpeed_Derust_Mode = 12; + * @return The robotSpeedDerustMode. + */ + int getRobotSpeedDerustMode(); + + /** + * int32 RobotSpeed_Spray_Paint_Mode = 13; + * @return The robotSpeedSprayPaintMode. + */ + int getRobotSpeedSprayPaintMode(); + + /** + * int32 RobotSpeed_Thickness_Measure_Mode = 14; + * @return The robotSpeedThicknessMeasureMode. + */ + int getRobotSpeedThicknessMeasureMode(); + + /** + * int32 PressureTargetValue_Derust = 15; + * @return The pressureTargetValueDerust. + */ + int getPressureTargetValueDerust(); + + /** + * int32 PumpStopFrequency = 16; + * @return The pumpStopFrequency. + */ + int getPumpStopFrequency(); + + /** + * int32 changeLaneBackwarkDistance = 17; + * @return The changeLaneBackwarkDistance. + */ + int getChangeLaneBackwarkDistance(); + } + /** + * 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.guohuawindpowerapp.models.BspPV.internal_static_PV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.guohuawindpowerapp.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.guohuawindpowerapp.models.BspPV.PV_struct_define.class, com.example.guohuawindpowerapp.models.BspPV.PV_struct_define.Builder.class); + } + + public static final int RUNMODE_FIELD_NUMBER = 1; + private int runMode_ = 0; + /** + *
+     * 喷漆项目
+     * 
+ * + * int32 RunMode = 1; + * @return The runMode. + */ + @java.lang.Override + public int getRunMode() { + return runMode_; + } + + public static final int ROBOTSPEED_FIELD_NUMBER = 2; + private int robotSpeed_ = 0; + /** + *
+     * 0-30m/min
+     * 
+ * + * int32 RobotSpeed = 2; + * @return The robotSpeed. + */ + @java.lang.Override + public int getRobotSpeed() { + return robotSpeed_; + } + + public static final int SLIDINGDISTANCE_CM_FIELD_NUMBER = 3; + private int slidingDistanceCm_ = 0; + /** + *
+     * cm
+     * 
+ * + * int32 SlidingDistance_cm = 3; + * @return The slidingDistanceCm. + */ + @java.lang.Override + public int getSlidingDistanceCm() { + return slidingDistanceCm_; + } + + public static final int ROBOTBACKWARDDISTANCE_CM_FIELD_NUMBER = 4; + private int robotBackwardDistanceCm_ = 0; + /** + *
+     * cm
+     * 
+ * + * int32 RobotBackwardDistance_cm = 4; + * @return The robotBackwardDistanceCm. + */ + @java.lang.Override + public int getRobotBackwardDistanceCm() { + return robotBackwardDistanceCm_; + } + + public static final int PUMPFREQUENCY_FIELD_NUMBER = 5; + private int pumpFrequency_ = 0; + /** + * int32 PumpFrequency = 5; + * @return The pumpFrequency. + */ + @java.lang.Override + public int getPumpFrequency() { + return pumpFrequency_; + } + + public static final int PRESSURETARGETVALUE_FIELD_NUMBER = 6; + private int pressureTargetValue_ = 0; + /** + * int32 PressureTargetValue = 6; + * @return The pressureTargetValue. + */ + @java.lang.Override + public int getPressureTargetValue() { + return pressureTargetValue_; + } + + public static final int VERTICALCOMPENSATION_FIELD_NUMBER = 7; + private int verticalCompensation_ = 0; + /** + * int32 VerticalCompensation = 7; + * @return The verticalCompensation. + */ + @java.lang.Override + public int getVerticalCompensation() { + return verticalCompensation_; + } + + public static final int ROBOTWORKINGMODE_FIELD_NUMBER = 8; + private int robotWorkingMode_ = 0; + /** + *
+     * 1 清洗  2 打磨  3 喷漆  4 测厚
+     * 
+ * + * int32 RobotWorkingMode = 8; + * @return The robotWorkingMode. + */ + @java.lang.Override + public int getRobotWorkingMode() { + return robotWorkingMode_; + } + + public static final int SLIDINGTABLESPEED_FIELD_NUMBER = 9; + private int slidingTableSpeed_ = 0; + /** + * int32 SlidingTableSpeed = 9; + * @return The slidingTableSpeed. + */ + @java.lang.Override + public int getSlidingTableSpeed() { + return slidingTableSpeed_; + } + + public static final int HORIZONTALCOMPENSATIONCONTROL_FIELD_NUMBER = 10; + private int horizontalCompensationControl_ = 0; + /** + * int32 HorizontalCompensationControl = 10; + * @return The horizontalCompensationControl. + */ + @java.lang.Override + public int getHorizontalCompensationControl() { + return horizontalCompensationControl_; + } + + public static final int ROBOTSPEED_CLEAN_MODE_FIELD_NUMBER = 11; + private int robotSpeedCleanMode_ = 0; + /** + * int32 RobotSpeed_Clean_Mode = 11; + * @return The robotSpeedCleanMode. + */ + @java.lang.Override + public int getRobotSpeedCleanMode() { + return robotSpeedCleanMode_; + } + + public static final int ROBOTSPEED_DERUST_MODE_FIELD_NUMBER = 12; + private int robotSpeedDerustMode_ = 0; + /** + * int32 RobotSpeed_Derust_Mode = 12; + * @return The robotSpeedDerustMode. + */ + @java.lang.Override + public int getRobotSpeedDerustMode() { + return robotSpeedDerustMode_; + } + + public static final int ROBOTSPEED_SPRAY_PAINT_MODE_FIELD_NUMBER = 13; + private int robotSpeedSprayPaintMode_ = 0; + /** + * int32 RobotSpeed_Spray_Paint_Mode = 13; + * @return The robotSpeedSprayPaintMode. + */ + @java.lang.Override + public int getRobotSpeedSprayPaintMode() { + return robotSpeedSprayPaintMode_; + } + + public static final int ROBOTSPEED_THICKNESS_MEASURE_MODE_FIELD_NUMBER = 14; + private int robotSpeedThicknessMeasureMode_ = 0; + /** + * int32 RobotSpeed_Thickness_Measure_Mode = 14; + * @return The robotSpeedThicknessMeasureMode. + */ + @java.lang.Override + public int getRobotSpeedThicknessMeasureMode() { + return robotSpeedThicknessMeasureMode_; + } + + public static final int PRESSURETARGETVALUE_DERUST_FIELD_NUMBER = 15; + private int pressureTargetValueDerust_ = 0; + /** + * int32 PressureTargetValue_Derust = 15; + * @return The pressureTargetValueDerust. + */ + @java.lang.Override + public int getPressureTargetValueDerust() { + return pressureTargetValueDerust_; + } + + public static final int PUMPSTOPFREQUENCY_FIELD_NUMBER = 16; + private int pumpStopFrequency_ = 0; + /** + * int32 PumpStopFrequency = 16; + * @return The pumpStopFrequency. + */ + @java.lang.Override + public int getPumpStopFrequency() { + return pumpStopFrequency_; + } + + public static final int CHANGELANEBACKWARKDISTANCE_FIELD_NUMBER = 17; + private int changeLaneBackwarkDistance_ = 0; + /** + * int32 changeLaneBackwarkDistance = 17; + * @return The changeLaneBackwarkDistance. + */ + @java.lang.Override + public int getChangeLaneBackwarkDistance() { + return changeLaneBackwarkDistance_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (runMode_ != 0) { + output.writeInt32(1, runMode_); + } + if (robotSpeed_ != 0) { + output.writeInt32(2, robotSpeed_); + } + if (slidingDistanceCm_ != 0) { + output.writeInt32(3, slidingDistanceCm_); + } + if (robotBackwardDistanceCm_ != 0) { + output.writeInt32(4, robotBackwardDistanceCm_); + } + if (pumpFrequency_ != 0) { + output.writeInt32(5, pumpFrequency_); + } + if (pressureTargetValue_ != 0) { + output.writeInt32(6, pressureTargetValue_); + } + if (verticalCompensation_ != 0) { + output.writeInt32(7, verticalCompensation_); + } + if (robotWorkingMode_ != 0) { + output.writeInt32(8, robotWorkingMode_); + } + if (slidingTableSpeed_ != 0) { + output.writeInt32(9, slidingTableSpeed_); + } + if (horizontalCompensationControl_ != 0) { + output.writeInt32(10, horizontalCompensationControl_); + } + if (robotSpeedCleanMode_ != 0) { + output.writeInt32(11, robotSpeedCleanMode_); + } + if (robotSpeedDerustMode_ != 0) { + output.writeInt32(12, robotSpeedDerustMode_); + } + if (robotSpeedSprayPaintMode_ != 0) { + output.writeInt32(13, robotSpeedSprayPaintMode_); + } + if (robotSpeedThicknessMeasureMode_ != 0) { + output.writeInt32(14, robotSpeedThicknessMeasureMode_); + } + if (pressureTargetValueDerust_ != 0) { + output.writeInt32(15, pressureTargetValueDerust_); + } + if (pumpStopFrequency_ != 0) { + output.writeInt32(16, pumpStopFrequency_); + } + if (changeLaneBackwarkDistance_ != 0) { + output.writeInt32(17, changeLaneBackwarkDistance_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (runMode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, runMode_); + } + if (robotSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, robotSpeed_); + } + if (slidingDistanceCm_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, slidingDistanceCm_); + } + if (robotBackwardDistanceCm_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, robotBackwardDistanceCm_); + } + if (pumpFrequency_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, pumpFrequency_); + } + if (pressureTargetValue_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, pressureTargetValue_); + } + if (verticalCompensation_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, verticalCompensation_); + } + if (robotWorkingMode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, robotWorkingMode_); + } + if (slidingTableSpeed_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, slidingTableSpeed_); + } + if (horizontalCompensationControl_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, horizontalCompensationControl_); + } + if (robotSpeedCleanMode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, robotSpeedCleanMode_); + } + if (robotSpeedDerustMode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(12, robotSpeedDerustMode_); + } + if (robotSpeedSprayPaintMode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(13, robotSpeedSprayPaintMode_); + } + if (robotSpeedThicknessMeasureMode_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(14, robotSpeedThicknessMeasureMode_); + } + if (pressureTargetValueDerust_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(15, pressureTargetValueDerust_); + } + if (pumpStopFrequency_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(16, pumpStopFrequency_); + } + if (changeLaneBackwarkDistance_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(17, changeLaneBackwarkDistance_); + } + 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.guohuawindpowerapp.models.BspPV.PV_struct_define)) { + return super.equals(obj); + } + com.example.guohuawindpowerapp.models.BspPV.PV_struct_define other = (com.example.guohuawindpowerapp.models.BspPV.PV_struct_define) obj; + + if (getRunMode() + != other.getRunMode()) return false; + if (getRobotSpeed() + != other.getRobotSpeed()) return false; + if (getSlidingDistanceCm() + != other.getSlidingDistanceCm()) return false; + if (getRobotBackwardDistanceCm() + != other.getRobotBackwardDistanceCm()) return false; + if (getPumpFrequency() + != other.getPumpFrequency()) return false; + if (getPressureTargetValue() + != other.getPressureTargetValue()) return false; + if (getVerticalCompensation() + != other.getVerticalCompensation()) return false; + if (getRobotWorkingMode() + != other.getRobotWorkingMode()) return false; + if (getSlidingTableSpeed() + != other.getSlidingTableSpeed()) return false; + if (getHorizontalCompensationControl() + != other.getHorizontalCompensationControl()) return false; + if (getRobotSpeedCleanMode() + != other.getRobotSpeedCleanMode()) return false; + if (getRobotSpeedDerustMode() + != other.getRobotSpeedDerustMode()) return false; + if (getRobotSpeedSprayPaintMode() + != other.getRobotSpeedSprayPaintMode()) return false; + if (getRobotSpeedThicknessMeasureMode() + != other.getRobotSpeedThicknessMeasureMode()) return false; + if (getPressureTargetValueDerust() + != other.getPressureTargetValueDerust()) return false; + if (getPumpStopFrequency() + != other.getPumpStopFrequency()) return false; + if (getChangeLaneBackwarkDistance() + != other.getChangeLaneBackwarkDistance()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RUNMODE_FIELD_NUMBER; + hash = (53 * hash) + getRunMode(); + hash = (37 * hash) + ROBOTSPEED_FIELD_NUMBER; + hash = (53 * hash) + getRobotSpeed(); + hash = (37 * hash) + SLIDINGDISTANCE_CM_FIELD_NUMBER; + hash = (53 * hash) + getSlidingDistanceCm(); + hash = (37 * hash) + ROBOTBACKWARDDISTANCE_CM_FIELD_NUMBER; + hash = (53 * hash) + getRobotBackwardDistanceCm(); + hash = (37 * hash) + PUMPFREQUENCY_FIELD_NUMBER; + hash = (53 * hash) + getPumpFrequency(); + hash = (37 * hash) + PRESSURETARGETVALUE_FIELD_NUMBER; + hash = (53 * hash) + getPressureTargetValue(); + hash = (37 * hash) + VERTICALCOMPENSATION_FIELD_NUMBER; + hash = (53 * hash) + getVerticalCompensation(); + hash = (37 * hash) + ROBOTWORKINGMODE_FIELD_NUMBER; + hash = (53 * hash) + getRobotWorkingMode(); + hash = (37 * hash) + SLIDINGTABLESPEED_FIELD_NUMBER; + hash = (53 * hash) + getSlidingTableSpeed(); + hash = (37 * hash) + HORIZONTALCOMPENSATIONCONTROL_FIELD_NUMBER; + hash = (53 * hash) + getHorizontalCompensationControl(); + hash = (37 * hash) + ROBOTSPEED_CLEAN_MODE_FIELD_NUMBER; + hash = (53 * hash) + getRobotSpeedCleanMode(); + hash = (37 * hash) + ROBOTSPEED_DERUST_MODE_FIELD_NUMBER; + hash = (53 * hash) + getRobotSpeedDerustMode(); + hash = (37 * hash) + ROBOTSPEED_SPRAY_PAINT_MODE_FIELD_NUMBER; + hash = (53 * hash) + getRobotSpeedSprayPaintMode(); + hash = (37 * hash) + ROBOTSPEED_THICKNESS_MEASURE_MODE_FIELD_NUMBER; + hash = (53 * hash) + getRobotSpeedThicknessMeasureMode(); + hash = (37 * hash) + PRESSURETARGETVALUE_DERUST_FIELD_NUMBER; + hash = (53 * hash) + getPressureTargetValueDerust(); + hash = (37 * hash) + PUMPSTOPFREQUENCY_FIELD_NUMBER; + hash = (53 * hash) + getPumpStopFrequency(); + hash = (37 * hash) + CHANGELANEBACKWARKDISTANCE_FIELD_NUMBER; + hash = (53 * hash) + getChangeLaneBackwarkDistance(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.example.guohuawindpowerapp.models.BspPV.PV_struct_define parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.guohuawindpowerapp.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.guohuawindpowerapp.models.BspPV.PV_struct_define parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.guohuawindpowerapp.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.guohuawindpowerapp.models.BspPV.PV_struct_define parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.example.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.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.guohuawindpowerapp.models.BspPV.PV_struct_defineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.example.guohuawindpowerapp.models.BspPV.internal_static_PV_struct_define_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.example.guohuawindpowerapp.models.BspPV.internal_static_PV_struct_define_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.example.guohuawindpowerapp.models.BspPV.PV_struct_define.class, com.example.guohuawindpowerapp.models.BspPV.PV_struct_define.Builder.class); + } + + // Construct using com.example.guohuawindpowerapp.models.BspPV.PV_struct_define.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + runMode_ = 0; + robotSpeed_ = 0; + slidingDistanceCm_ = 0; + robotBackwardDistanceCm_ = 0; + pumpFrequency_ = 0; + pressureTargetValue_ = 0; + verticalCompensation_ = 0; + robotWorkingMode_ = 0; + slidingTableSpeed_ = 0; + horizontalCompensationControl_ = 0; + robotSpeedCleanMode_ = 0; + robotSpeedDerustMode_ = 0; + robotSpeedSprayPaintMode_ = 0; + robotSpeedThicknessMeasureMode_ = 0; + pressureTargetValueDerust_ = 0; + pumpStopFrequency_ = 0; + changeLaneBackwarkDistance_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.example.guohuawindpowerapp.models.BspPV.internal_static_PV_struct_define_descriptor; + } + + @java.lang.Override + public com.example.guohuawindpowerapp.models.BspPV.PV_struct_define getDefaultInstanceForType() { + return com.example.guohuawindpowerapp.models.BspPV.PV_struct_define.getDefaultInstance(); + } + + @java.lang.Override + public com.example.guohuawindpowerapp.models.BspPV.PV_struct_define build() { + com.example.guohuawindpowerapp.models.BspPV.PV_struct_define result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.example.guohuawindpowerapp.models.BspPV.PV_struct_define buildPartial() { + com.example.guohuawindpowerapp.models.BspPV.PV_struct_define result = new com.example.guohuawindpowerapp.models.BspPV.PV_struct_define(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(com.example.guohuawindpowerapp.models.BspPV.PV_struct_define result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.runMode_ = runMode_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.robotSpeed_ = robotSpeed_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.slidingDistanceCm_ = slidingDistanceCm_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.robotBackwardDistanceCm_ = robotBackwardDistanceCm_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pumpFrequency_ = pumpFrequency_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.pressureTargetValue_ = pressureTargetValue_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.verticalCompensation_ = verticalCompensation_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.robotWorkingMode_ = robotWorkingMode_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.slidingTableSpeed_ = slidingTableSpeed_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.horizontalCompensationControl_ = horizontalCompensationControl_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.robotSpeedCleanMode_ = robotSpeedCleanMode_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.robotSpeedDerustMode_ = robotSpeedDerustMode_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.robotSpeedSprayPaintMode_ = robotSpeedSprayPaintMode_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.robotSpeedThicknessMeasureMode_ = robotSpeedThicknessMeasureMode_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.pressureTargetValueDerust_ = pressureTargetValueDerust_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.pumpStopFrequency_ = pumpStopFrequency_; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.changeLaneBackwarkDistance_ = changeLaneBackwarkDistance_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.example.guohuawindpowerapp.models.BspPV.PV_struct_define) { + return mergeFrom((com.example.guohuawindpowerapp.models.BspPV.PV_struct_define)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.example.guohuawindpowerapp.models.BspPV.PV_struct_define other) { + if (other == com.example.guohuawindpowerapp.models.BspPV.PV_struct_define.getDefaultInstance()) return this; + if (other.getRunMode() != 0) { + setRunMode(other.getRunMode()); + } + if (other.getRobotSpeed() != 0) { + setRobotSpeed(other.getRobotSpeed()); + } + if (other.getSlidingDistanceCm() != 0) { + setSlidingDistanceCm(other.getSlidingDistanceCm()); + } + if (other.getRobotBackwardDistanceCm() != 0) { + setRobotBackwardDistanceCm(other.getRobotBackwardDistanceCm()); + } + if (other.getPumpFrequency() != 0) { + setPumpFrequency(other.getPumpFrequency()); + } + if (other.getPressureTargetValue() != 0) { + setPressureTargetValue(other.getPressureTargetValue()); + } + if (other.getVerticalCompensation() != 0) { + setVerticalCompensation(other.getVerticalCompensation()); + } + if (other.getRobotWorkingMode() != 0) { + setRobotWorkingMode(other.getRobotWorkingMode()); + } + if (other.getSlidingTableSpeed() != 0) { + setSlidingTableSpeed(other.getSlidingTableSpeed()); + } + if (other.getHorizontalCompensationControl() != 0) { + setHorizontalCompensationControl(other.getHorizontalCompensationControl()); + } + if (other.getRobotSpeedCleanMode() != 0) { + setRobotSpeedCleanMode(other.getRobotSpeedCleanMode()); + } + if (other.getRobotSpeedDerustMode() != 0) { + setRobotSpeedDerustMode(other.getRobotSpeedDerustMode()); + } + if (other.getRobotSpeedSprayPaintMode() != 0) { + setRobotSpeedSprayPaintMode(other.getRobotSpeedSprayPaintMode()); + } + if (other.getRobotSpeedThicknessMeasureMode() != 0) { + setRobotSpeedThicknessMeasureMode(other.getRobotSpeedThicknessMeasureMode()); + } + if (other.getPressureTargetValueDerust() != 0) { + setPressureTargetValueDerust(other.getPressureTargetValueDerust()); + } + if (other.getPumpStopFrequency() != 0) { + setPumpStopFrequency(other.getPumpStopFrequency()); + } + if (other.getChangeLaneBackwarkDistance() != 0) { + setChangeLaneBackwarkDistance(other.getChangeLaneBackwarkDistance()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + runMode_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + robotSpeed_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + slidingDistanceCm_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + robotBackwardDistanceCm_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + pumpFrequency_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + pressureTargetValue_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + verticalCompensation_ = input.readInt32(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + robotWorkingMode_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + slidingTableSpeed_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + horizontalCompensationControl_ = input.readInt32(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + robotSpeedCleanMode_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + robotSpeedDerustMode_ = input.readInt32(); + bitField0_ |= 0x00000800; + break; + } // case 96 + case 104: { + robotSpeedSprayPaintMode_ = input.readInt32(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 112: { + robotSpeedThicknessMeasureMode_ = input.readInt32(); + bitField0_ |= 0x00002000; + break; + } // case 112 + case 120: { + pressureTargetValueDerust_ = input.readInt32(); + bitField0_ |= 0x00004000; + break; + } // case 120 + case 128: { + pumpStopFrequency_ = input.readInt32(); + bitField0_ |= 0x00008000; + break; + } // case 128 + case 136: { + changeLaneBackwarkDistance_ = input.readInt32(); + bitField0_ |= 0x00010000; + break; + } // case 136 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int runMode_ ; + /** + *
+       * 喷漆项目
+       * 
+ * + * int32 RunMode = 1; + * @return The runMode. + */ + @java.lang.Override + public int getRunMode() { + return runMode_; + } + /** + *
+       * 喷漆项目
+       * 
+ * + * int32 RunMode = 1; + * @param value The runMode to set. + * @return This builder for chaining. + */ + public Builder setRunMode(int value) { + + runMode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * 喷漆项目
+       * 
+ * + * int32 RunMode = 1; + * @return This builder for chaining. + */ + public Builder clearRunMode() { + bitField0_ = (bitField0_ & ~0x00000001); + runMode_ = 0; + onChanged(); + return this; + } + + private int robotSpeed_ ; + /** + *
+       * 0-30m/min
+       * 
+ * + * int32 RobotSpeed = 2; + * @return The robotSpeed. + */ + @java.lang.Override + public int getRobotSpeed() { + return robotSpeed_; + } + /** + *
+       * 0-30m/min
+       * 
+ * + * int32 RobotSpeed = 2; + * @param value The robotSpeed to set. + * @return This builder for chaining. + */ + public Builder setRobotSpeed(int value) { + + robotSpeed_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * 0-30m/min
+       * 
+ * + * int32 RobotSpeed = 2; + * @return This builder for chaining. + */ + public Builder clearRobotSpeed() { + bitField0_ = (bitField0_ & ~0x00000002); + robotSpeed_ = 0; + onChanged(); + return this; + } + + private int slidingDistanceCm_ ; + /** + *
+       * cm
+       * 
+ * + * int32 SlidingDistance_cm = 3; + * @return The slidingDistanceCm. + */ + @java.lang.Override + public int getSlidingDistanceCm() { + return slidingDistanceCm_; + } + /** + *
+       * cm
+       * 
+ * + * int32 SlidingDistance_cm = 3; + * @param value The slidingDistanceCm to set. + * @return This builder for chaining. + */ + public Builder setSlidingDistanceCm(int value) { + + slidingDistanceCm_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * cm
+       * 
+ * + * int32 SlidingDistance_cm = 3; + * @return This builder for chaining. + */ + public Builder clearSlidingDistanceCm() { + bitField0_ = (bitField0_ & ~0x00000004); + slidingDistanceCm_ = 0; + onChanged(); + return this; + } + + private int robotBackwardDistanceCm_ ; + /** + *
+       * cm
+       * 
+ * + * int32 RobotBackwardDistance_cm = 4; + * @return The robotBackwardDistanceCm. + */ + @java.lang.Override + public int getRobotBackwardDistanceCm() { + return robotBackwardDistanceCm_; + } + /** + *
+       * cm
+       * 
+ * + * int32 RobotBackwardDistance_cm = 4; + * @param value The robotBackwardDistanceCm to set. + * @return This builder for chaining. + */ + public Builder setRobotBackwardDistanceCm(int value) { + + robotBackwardDistanceCm_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * cm
+       * 
+ * + * int32 RobotBackwardDistance_cm = 4; + * @return This builder for chaining. + */ + public Builder clearRobotBackwardDistanceCm() { + bitField0_ = (bitField0_ & ~0x00000008); + robotBackwardDistanceCm_ = 0; + onChanged(); + return this; + } + + private int pumpFrequency_ ; + /** + * int32 PumpFrequency = 5; + * @return The pumpFrequency. + */ + @java.lang.Override + public int getPumpFrequency() { + return pumpFrequency_; + } + /** + * int32 PumpFrequency = 5; + * @param value The pumpFrequency to set. + * @return This builder for chaining. + */ + public Builder setPumpFrequency(int value) { + + pumpFrequency_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int32 PumpFrequency = 5; + * @return This builder for chaining. + */ + public Builder clearPumpFrequency() { + bitField0_ = (bitField0_ & ~0x00000010); + pumpFrequency_ = 0; + onChanged(); + return this; + } + + private int pressureTargetValue_ ; + /** + * int32 PressureTargetValue = 6; + * @return The pressureTargetValue. + */ + @java.lang.Override + public int getPressureTargetValue() { + return pressureTargetValue_; + } + /** + * int32 PressureTargetValue = 6; + * @param value The pressureTargetValue to set. + * @return This builder for chaining. + */ + public Builder setPressureTargetValue(int value) { + + pressureTargetValue_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int32 PressureTargetValue = 6; + * @return This builder for chaining. + */ + public Builder clearPressureTargetValue() { + bitField0_ = (bitField0_ & ~0x00000020); + pressureTargetValue_ = 0; + onChanged(); + return this; + } + + private int verticalCompensation_ ; + /** + * int32 VerticalCompensation = 7; + * @return The verticalCompensation. + */ + @java.lang.Override + public int getVerticalCompensation() { + return verticalCompensation_; + } + /** + * int32 VerticalCompensation = 7; + * @param value The verticalCompensation to set. + * @return This builder for chaining. + */ + public Builder setVerticalCompensation(int value) { + + verticalCompensation_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * int32 VerticalCompensation = 7; + * @return This builder for chaining. + */ + public Builder clearVerticalCompensation() { + bitField0_ = (bitField0_ & ~0x00000040); + verticalCompensation_ = 0; + onChanged(); + return this; + } + + private int robotWorkingMode_ ; + /** + *
+       * 1 清洗  2 打磨  3 喷漆  4 测厚
+       * 
+ * + * int32 RobotWorkingMode = 8; + * @return The robotWorkingMode. + */ + @java.lang.Override + public int getRobotWorkingMode() { + return robotWorkingMode_; + } + /** + *
+       * 1 清洗  2 打磨  3 喷漆  4 测厚
+       * 
+ * + * int32 RobotWorkingMode = 8; + * @param value The robotWorkingMode to set. + * @return This builder for chaining. + */ + public Builder setRobotWorkingMode(int value) { + + robotWorkingMode_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + *
+       * 1 清洗  2 打磨  3 喷漆  4 测厚
+       * 
+ * + * int32 RobotWorkingMode = 8; + * @return This builder for chaining. + */ + public Builder clearRobotWorkingMode() { + bitField0_ = (bitField0_ & ~0x00000080); + robotWorkingMode_ = 0; + onChanged(); + return this; + } + + private int slidingTableSpeed_ ; + /** + * int32 SlidingTableSpeed = 9; + * @return The slidingTableSpeed. + */ + @java.lang.Override + public int getSlidingTableSpeed() { + return slidingTableSpeed_; + } + /** + * int32 SlidingTableSpeed = 9; + * @param value The slidingTableSpeed to set. + * @return This builder for chaining. + */ + public Builder setSlidingTableSpeed(int value) { + + slidingTableSpeed_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * int32 SlidingTableSpeed = 9; + * @return This builder for chaining. + */ + public Builder clearSlidingTableSpeed() { + bitField0_ = (bitField0_ & ~0x00000100); + slidingTableSpeed_ = 0; + onChanged(); + return this; + } + + private int horizontalCompensationControl_ ; + /** + * int32 HorizontalCompensationControl = 10; + * @return The horizontalCompensationControl. + */ + @java.lang.Override + public int getHorizontalCompensationControl() { + return horizontalCompensationControl_; + } + /** + * int32 HorizontalCompensationControl = 10; + * @param value The horizontalCompensationControl to set. + * @return This builder for chaining. + */ + public Builder setHorizontalCompensationControl(int value) { + + horizontalCompensationControl_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * int32 HorizontalCompensationControl = 10; + * @return This builder for chaining. + */ + public Builder clearHorizontalCompensationControl() { + bitField0_ = (bitField0_ & ~0x00000200); + horizontalCompensationControl_ = 0; + onChanged(); + return this; + } + + private int robotSpeedCleanMode_ ; + /** + * int32 RobotSpeed_Clean_Mode = 11; + * @return The robotSpeedCleanMode. + */ + @java.lang.Override + public int getRobotSpeedCleanMode() { + return robotSpeedCleanMode_; + } + /** + * int32 RobotSpeed_Clean_Mode = 11; + * @param value The robotSpeedCleanMode to set. + * @return This builder for chaining. + */ + public Builder setRobotSpeedCleanMode(int value) { + + robotSpeedCleanMode_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * int32 RobotSpeed_Clean_Mode = 11; + * @return This builder for chaining. + */ + public Builder clearRobotSpeedCleanMode() { + bitField0_ = (bitField0_ & ~0x00000400); + robotSpeedCleanMode_ = 0; + onChanged(); + return this; + } + + private int robotSpeedDerustMode_ ; + /** + * int32 RobotSpeed_Derust_Mode = 12; + * @return The robotSpeedDerustMode. + */ + @java.lang.Override + public int getRobotSpeedDerustMode() { + return robotSpeedDerustMode_; + } + /** + * int32 RobotSpeed_Derust_Mode = 12; + * @param value The robotSpeedDerustMode to set. + * @return This builder for chaining. + */ + public Builder setRobotSpeedDerustMode(int value) { + + robotSpeedDerustMode_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * int32 RobotSpeed_Derust_Mode = 12; + * @return This builder for chaining. + */ + public Builder clearRobotSpeedDerustMode() { + bitField0_ = (bitField0_ & ~0x00000800); + robotSpeedDerustMode_ = 0; + onChanged(); + return this; + } + + private int robotSpeedSprayPaintMode_ ; + /** + * int32 RobotSpeed_Spray_Paint_Mode = 13; + * @return The robotSpeedSprayPaintMode. + */ + @java.lang.Override + public int getRobotSpeedSprayPaintMode() { + return robotSpeedSprayPaintMode_; + } + /** + * int32 RobotSpeed_Spray_Paint_Mode = 13; + * @param value The robotSpeedSprayPaintMode to set. + * @return This builder for chaining. + */ + public Builder setRobotSpeedSprayPaintMode(int value) { + + robotSpeedSprayPaintMode_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * int32 RobotSpeed_Spray_Paint_Mode = 13; + * @return This builder for chaining. + */ + public Builder clearRobotSpeedSprayPaintMode() { + bitField0_ = (bitField0_ & ~0x00001000); + robotSpeedSprayPaintMode_ = 0; + onChanged(); + return this; + } + + private int robotSpeedThicknessMeasureMode_ ; + /** + * int32 RobotSpeed_Thickness_Measure_Mode = 14; + * @return The robotSpeedThicknessMeasureMode. + */ + @java.lang.Override + public int getRobotSpeedThicknessMeasureMode() { + return robotSpeedThicknessMeasureMode_; + } + /** + * int32 RobotSpeed_Thickness_Measure_Mode = 14; + * @param value The robotSpeedThicknessMeasureMode to set. + * @return This builder for chaining. + */ + public Builder setRobotSpeedThicknessMeasureMode(int value) { + + robotSpeedThicknessMeasureMode_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * int32 RobotSpeed_Thickness_Measure_Mode = 14; + * @return This builder for chaining. + */ + public Builder clearRobotSpeedThicknessMeasureMode() { + bitField0_ = (bitField0_ & ~0x00002000); + robotSpeedThicknessMeasureMode_ = 0; + onChanged(); + return this; + } + + private int pressureTargetValueDerust_ ; + /** + * int32 PressureTargetValue_Derust = 15; + * @return The pressureTargetValueDerust. + */ + @java.lang.Override + public int getPressureTargetValueDerust() { + return pressureTargetValueDerust_; + } + /** + * int32 PressureTargetValue_Derust = 15; + * @param value The pressureTargetValueDerust to set. + * @return This builder for chaining. + */ + public Builder setPressureTargetValueDerust(int value) { + + pressureTargetValueDerust_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * int32 PressureTargetValue_Derust = 15; + * @return This builder for chaining. + */ + public Builder clearPressureTargetValueDerust() { + bitField0_ = (bitField0_ & ~0x00004000); + pressureTargetValueDerust_ = 0; + onChanged(); + return this; + } + + private int pumpStopFrequency_ ; + /** + * int32 PumpStopFrequency = 16; + * @return The pumpStopFrequency. + */ + @java.lang.Override + public int getPumpStopFrequency() { + return pumpStopFrequency_; + } + /** + * int32 PumpStopFrequency = 16; + * @param value The pumpStopFrequency to set. + * @return This builder for chaining. + */ + public Builder setPumpStopFrequency(int value) { + + pumpStopFrequency_ = value; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + /** + * int32 PumpStopFrequency = 16; + * @return This builder for chaining. + */ + public Builder clearPumpStopFrequency() { + bitField0_ = (bitField0_ & ~0x00008000); + pumpStopFrequency_ = 0; + onChanged(); + return this; + } + + private int changeLaneBackwarkDistance_ ; + /** + * int32 changeLaneBackwarkDistance = 17; + * @return The changeLaneBackwarkDistance. + */ + @java.lang.Override + public int getChangeLaneBackwarkDistance() { + return changeLaneBackwarkDistance_; + } + /** + * int32 changeLaneBackwarkDistance = 17; + * @param value The changeLaneBackwarkDistance to set. + * @return This builder for chaining. + */ + public Builder setChangeLaneBackwarkDistance(int value) { + + changeLaneBackwarkDistance_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * int32 changeLaneBackwarkDistance = 17; + * @return This builder for chaining. + */ + public Builder clearChangeLaneBackwarkDistance() { + bitField0_ = (bitField0_ & ~0x00010000); + changeLaneBackwarkDistance_ = 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.guohuawindpowerapp.models.BspPV.PV_struct_define DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.example.guohuawindpowerapp.models.BspPV.PV_struct_define(); + } + + public static com.example.guohuawindpowerapp.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.guohuawindpowerapp.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\"\225\004\n\020PV_struct_define\022\017\n\007R" + + "unMode\030\001 \001(\005\022\022\n\nRobotSpeed\030\002 \001(\005\022\032\n\022Slid" + + "ingDistance_cm\030\003 \001(\005\022 \n\030RobotBackwardDis" + + "tance_cm\030\004 \001(\005\022\025\n\rPumpFrequency\030\005 \001(\005\022\033\n" + + "\023PressureTargetValue\030\006 \001(\005\022\034\n\024VerticalCo" + + "mpensation\030\007 \001(\005\022\030\n\020RobotWorkingMode\030\010 \001" + + "(\005\022\031\n\021SlidingTableSpeed\030\t \001(\005\022%\n\035Horizon" + + "talCompensationControl\030\n \001(\005\022\035\n\025RobotSpe" + + "ed_Clean_Mode\030\013 \001(\005\022\036\n\026RobotSpeed_Derust" + + "_Mode\030\014 \001(\005\022#\n\033RobotSpeed_Spray_Paint_Mo" + + "de\030\r \001(\005\022)\n!RobotSpeed_Thickness_Measure" + + "_Mode\030\016 \001(\005\022\"\n\032PressureTargetValue_Derus" + + "t\030\017 \001(\005\022\031\n\021PumpStopFrequency\030\020 \001(\005\022\"\n\032ch" + + "angeLaneBackwarkDistance\030\021 \001(\005B)\n%com.ex" + + "ample.guohuawindpowerapp.modelsP\000b\006proto" + + "3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_PV_struct_define_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_PV_struct_define_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_PV_struct_define_descriptor, + new java.lang.String[] { "RunMode", "RobotSpeed", "SlidingDistanceCm", "RobotBackwardDistanceCm", "PumpFrequency", "PressureTargetValue", "VerticalCompensation", "RobotWorkingMode", "SlidingTableSpeed", "HorizontalCompensationControl", "RobotSpeedCleanMode", "RobotSpeedDerustMode", "RobotSpeedSprayPaintMode", "RobotSpeedThicknessMeasureMode", "PressureTargetValueDerust", "PumpStopFrequency", "ChangeLaneBackwarkDistance", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/DisplayIV.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/DisplayIV.java new file mode 100644 index 0000000..a2ffa5b --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/DisplayIV.java @@ -0,0 +1,50 @@ +package com.example.guohuawindpowerapp.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/DisplayPV.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/DisplayPV.java new file mode 100644 index 0000000..4976c1d --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/DisplayPV.java @@ -0,0 +1,122 @@ +package com.example.guohuawindpowerapp.models; + +import androidx.databinding.BaseObservable; + +public class DisplayPV extends BaseObservable { + + private int id; + private double verticalCompensation; + private double moveSpeedPaint; + + private int backDistance; + private int slideSpeed; + private int slideDistance; + + private double moveSpeedClean; + private int pumpFrequency; + private int pumpStopFrequency; + + private int pressSet_Clean; + private int pressSet_Polish; + + private double moveSpeedPolish; + private int HCompensationSwitch; + + private double moveSpeedMeasure; + + private int changeLaneDistance; + + private int changeLaneDisPaint; + + + + + + + + public DisplayPV(int id, double verticalCompensation, double moveSpeedPaint, int backDistance, int slideSpeed, int slideDistance, + double moveSpeedClean,int pumpFrequency ,int pressSet_Clean, int pressSet_Polish, double moveSpeedPolish,int HCompensationSwitch,double moveSpeedMeasure,int pumpStopFrequency,int changelanedis,int changelinedisPaint) { + this.id = id; + this.verticalCompensation=verticalCompensation; + this.moveSpeedPaint = moveSpeedPaint; + this.backDistance = backDistance; + this.slideSpeed=slideSpeed; + this.slideDistance=slideDistance; + + this.moveSpeedClean=moveSpeedClean; + this.pumpFrequency=pumpFrequency; + this.pressSet_Clean=pressSet_Clean; + this.pumpStopFrequency=pumpStopFrequency; + this.pressSet_Polish=pressSet_Polish; + this.moveSpeedPolish=moveSpeedPolish; + this.HCompensationSwitch=HCompensationSwitch; + + this.moveSpeedMeasure=moveSpeedMeasure; + this.changeLaneDistance = changelanedis; + this.changeLaneDisPaint = changelinedisPaint; + + } + + + public int getId() { return id; } + public void setId(int id) { + this.id = id; + } + + public int getChangeLaneDistance(){return changeLaneDistance;} + + public int getChangeLaneDisPaint(){return changeLaneDisPaint;} + + public double getVerticalCompensation() { + return verticalCompensation; + } + public double getMoveSpeedPaint() { + return moveSpeedPaint; + } + public int getbackDistance() { + return backDistance; + } + + public int getslideSpeed() { + return slideSpeed; + } + public int getslideDistance() { + return slideDistance; + } + + public double getmoveSpeedClean() { + return moveSpeedClean; + } + public int getpumpFrequency() { + return pumpFrequency; + } + public int getpumpStopFrequency() { + return pumpStopFrequency; + } + public int getPressSetClean() { + return pressSet_Clean; + } + public int getPressSetPolish() { + return pressSet_Polish; + } + public double getmoveSpeedPolish() { + return moveSpeedPolish; + } + + public int getHCompensationSwitch() { + return HCompensationSwitch; + } + + public double getmoveSpeedMeasure() { + return moveSpeedMeasure; + } + + + + + + + + + +} diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/ErrorModel.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/ErrorModel.java new file mode 100644 index 0000000..bcf1b5b --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/models/ErrorModel.java @@ -0,0 +1,44 @@ +package com.example.guohuawindpowerapp.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/ConvertHelper.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/ConvertHelper.java new file mode 100644 index 0000000..abf5869 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/ConvertHelper.java @@ -0,0 +1,26 @@ +package com.example.guohuawindpowerapp.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/CustomProber.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/CustomProber.java new file mode 100644 index 0000000..c1b12db --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/CustomProber.java @@ -0,0 +1,22 @@ +package com.example.guohuawindpowerapp.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/DecimalDigitsInputFilter.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/DecimalDigitsInputFilter.java new file mode 100644 index 0000000..2579f2c --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/DecimalDigitsInputFilter.java @@ -0,0 +1,71 @@ +package com.example.guohuawindpowerapp.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/LogUtil.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/LogUtil.java new file mode 100644 index 0000000..921b068 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/LogUtil.java @@ -0,0 +1,39 @@ +package com.example.guohuawindpowerapp.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/ModbusCRC.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/ModbusCRC.java new file mode 100644 index 0000000..e8b5a41 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/ModbusCRC.java @@ -0,0 +1,72 @@ +package com.example.guohuawindpowerapp.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/MyDataHelper.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/MyDataHelper.java new file mode 100644 index 0000000..230f77c --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/MyDataHelper.java @@ -0,0 +1,342 @@ +package com.example.guohuawindpowerapp.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.guohuawindpowerapp.models.DisplayPV; +import com.example.guohuawindpowerapp.models.ErrorModel; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.TimeZone; + +public class MyDataHelper extends SQLiteOpenHelper { + //定义字段 + public static final String TABLE_NAME_PAINT = "paint"; + public static final String COLUMN_ID= "id";//参数调用 + + public static final String COLUMN_VERTICAL_COMPENSATION = "verticalAdjust";//Maintv_VerticalAdjustTo32 竖直补偿 + public static final String COLUMN_MOVE_SPEED_PAINT = "moveSpeedPaint"; + public static final String COLUMN_BACK_DISTANCE = "backDistance"; + public static final String COLUMN_SLIDE_SPEED = "slideSpeed"; + public static final String COLUMN_SLIDE_DISTANCE = "slideDistance"; + /*******************************************************************/ + public static final String TABLE_NAME_CLEAN = "clean"; + public static final String COLUMN_MOVE_SPEED_CLEAN = "moveSpeedClean"; + public static final String COLUMN_PUMP_FREQUENCY = "pumpFrequency"; + public static final String COLUMN_PRESS_SET_CLEAN = "pressSetClean"; + public static final String COLUMN_PUMP_STOP_FREQUENCY = "pumpStopFrequency"; +/**************************************************************************************************/ + public static final String TABLE_NAME_POLISH = "polish"; + public static final String COLUMN_MOVE_SPEED_POLISH="moveSpeedPolish"; + public static final String COLUMN_H_COMPENSATIONSWITCH="HCompensationSwitch"; + public static final String COLUMN_PRESS_SET_POLISH = "pressSetPolish"; + +/***********************************************************************************************/ + public static final String TABLE_NAME_MEASURE = "measure"; + public static final String COLUMN_MOVE_SPEED_MEASURE="moveSpeedMeasure"; + + public static final String COLUMN_CHANGELANEDIS_POLISH = "changeLaneDisPolish"; + + public static final String COLUMN_CHANGELANEDIS_PAINT = "changeLaneDisPaint"; + + + public MyDataHelper(@Nullable Context context) { + super(context, "bingbot.db", null, 5); //数据库名称为 bingbot.db,数据库版本为 1。存放两个表 + } + + @Override + public void onCreate(SQLiteDatabase db) { + + + //INTEGER前加空格 + String sql = "CREATE TABLE " + TABLE_NAME_PAINT + " (" + + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + + COLUMN_VERTICAL_COMPENSATION + " DOUBLE, " + + COLUMN_MOVE_SPEED_PAINT + " DOUBLE, " + + COLUMN_BACK_DISTANCE + " DOUBLE, " + + COLUMN_SLIDE_SPEED + " INTEGER, " + + COLUMN_CHANGELANEDIS_PAINT + " INTEGER, " + + COLUMN_SLIDE_DISTANCE + " INTEGER);"; + db.execSQL(sql); //执行sql语句 + //清洗 + sql = "CREATE TABLE " + TABLE_NAME_CLEAN + " (" + + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + + COLUMN_VERTICAL_COMPENSATION + " DOUBLE, " + + COLUMN_MOVE_SPEED_CLEAN + " DOUBLE, " + + COLUMN_PUMP_FREQUENCY + " INTEGER, " + + COLUMN_PUMP_STOP_FREQUENCY + " INTEGER, " + + COLUMN_PRESS_SET_CLEAN + " INTEGER);"; + db.execSQL(sql); //执行sql语句 + // 打磨 + sql = "CREATE TABLE " + TABLE_NAME_POLISH + " (" + + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + + COLUMN_VERTICAL_COMPENSATION + " DOUBLE, " + + COLUMN_MOVE_SPEED_POLISH + " DOUBLE, " + + COLUMN_H_COMPENSATIONSWITCH + " INTEGER, " + + COLUMN_CHANGELANEDIS_POLISH + " INTEGER, " + + COLUMN_PRESS_SET_POLISH + " INTEGER);"; + db.execSQL(sql); //执行sql语句 + + // 测厚 + sql = "CREATE TABLE " + TABLE_NAME_MEASURE + " (" + + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + + COLUMN_MOVE_SPEED_MEASURE + " DOUBLE);"; + db.execSQL(sql); //执行sql语句 + + } + + @Override + public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { + // 1. 删除所有旧表(如果存在) + db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_PAINT); // 喷漆表 + db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_CLEAN); // 清洗表 + db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_POLISH); // 打磨表 + db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_MEASURE); // 测厚表 + onCreate(db); + } + + //增 删 改 查 + public String addOrUpdateDisplayDataPaint(DisplayPV pv) { + ContentValues cv = new ContentValues(); //键值对的类 + cv.put(COLUMN_ID, pv.getId()); + cv.put(COLUMN_VERTICAL_COMPENSATION, pv.getVerticalCompensation()); + cv.put(COLUMN_MOVE_SPEED_PAINT, pv.getMoveSpeedPaint()); + cv.put(COLUMN_BACK_DISTANCE, pv.getbackDistance()); + cv.put(COLUMN_SLIDE_SPEED, pv.getslideSpeed()); + cv.put(COLUMN_SLIDE_DISTANCE, pv.getslideDistance()); + cv.put(COLUMN_CHANGELANEDIS_PAINT, pv.getChangeLaneDisPaint()); + + SQLiteDatabase sqliteDatabase = this.getWritableDatabase();//获取数据库实例以实现增上查改等,如果没有就新建 并把sqliteDatabase作为参数传给oncreate方法 +// try { + long insert = sqliteDatabase.insertWithOnConflict(TABLE_NAME_PAINT, null, cv, SQLiteDatabase.CONFLICT_REPLACE); + sqliteDatabase.close(); + if (insert == -1) { + return "failed"; + } + return "success"; +// } catch (Exception e) { +// +// } + } + public String addOrUpdateDisplayDataClean(DisplayPV pv) { + ContentValues cv = new ContentValues(); //键值对的类 + cv.put(COLUMN_ID, pv.getId()); + cv.put(COLUMN_VERTICAL_COMPENSATION, pv.getVerticalCompensation()); + cv.put(COLUMN_MOVE_SPEED_CLEAN, pv.getmoveSpeedClean()); + cv.put(COLUMN_PUMP_FREQUENCY, pv.getpumpFrequency()); + cv.put(COLUMN_PUMP_STOP_FREQUENCY, pv.getpumpStopFrequency()); + cv.put(COLUMN_PRESS_SET_CLEAN, pv.getPressSetClean()); + + SQLiteDatabase sqliteDatabase = this.getWritableDatabase();//获取数据库实例以实现增上查改等,如果没有就新建 并把sqliteDatabase作为参数传给oncreate方法 + long insert = sqliteDatabase.insertWithOnConflict(TABLE_NAME_CLEAN, null, cv, SQLiteDatabase.CONFLICT_REPLACE); + sqliteDatabase.close(); + if (insert == -1) { + return "failed"; + } + return "success"; + } + public String addOrUpdateDisplayDataPolish(DisplayPV pv) { + ContentValues cv = new ContentValues(); //键值对的类 + cv.put(COLUMN_ID, pv.getId()); + cv.put(COLUMN_VERTICAL_COMPENSATION, pv.getVerticalCompensation()); + cv.put(COLUMN_MOVE_SPEED_POLISH, pv.getmoveSpeedPolish()); + cv.put(COLUMN_H_COMPENSATIONSWITCH, pv.getHCompensationSwitch()); + cv.put(COLUMN_PRESS_SET_POLISH, pv.getPressSetPolish()); + cv.put(COLUMN_CHANGELANEDIS_POLISH, pv.getChangeLaneDistance()); + + + + SQLiteDatabase sqliteDatabase = this.getWritableDatabase();//获取数据库实例以实现增上查改等,如果没有就新建 并把sqliteDatabase作为参数传给oncreate方法 + long insert = sqliteDatabase.insertWithOnConflict(TABLE_NAME_POLISH, null, cv, SQLiteDatabase.CONFLICT_REPLACE); + sqliteDatabase.close(); + if (insert == -1) { + return "failed"; + } + return "success"; + } + public String addOrUpdateDisplayDataMeasure(DisplayPV pv) { + ContentValues cv = new ContentValues(); //键值对的类 + cv.put(COLUMN_ID, pv.getId()); + cv.put(COLUMN_MOVE_SPEED_MEASURE, pv.getmoveSpeedMeasure()); + + + SQLiteDatabase sqliteDatabase = this.getWritableDatabase();//获取数据库实例以实现增上查改等,如果没有就新建 并把sqliteDatabase作为参数传给oncreate方法 + long insert = sqliteDatabase.insertWithOnConflict(TABLE_NAME_MEASURE, null, cv, SQLiteDatabase.CONFLICT_REPLACE); + sqliteDatabase.close(); + if (insert == -1) { + return "failed"; + } + return "success"; + } + +// public String deleteAll() { +//// SQLiteDatabase sqLiteDatabase = this.getWritableDatabase(); +//// int delete = sqLiteDatabase.delete(TABLE_NAME, null, null); +//// +//// sqLiteDatabase.close(); +//// if (delete == 0) { +//// return "failed"; +//// } +//// return "success"; +// +// } + + public void IntializeDataBasePaint() { + + for (int i = 1; i < 2; i++) { + List list = getDisplayDataPaint(i); //从数据库中读 + if (list.size() == 0) { + DisplayPV pv = new DisplayPV(i, 0, 0, 0, 0, 0, 0,0, 0, 0,0,0,0,0,0,0); + addOrUpdateDisplayDataPaint(pv);//一行一行添加 + } + } + } + public void IntializeDataBaseClean() { + + for (int i = 1; i < 2; i++) { + List list = getDisplayDataClean(i); //从数据库中读 + if (list.size() == 0) { + DisplayPV pv = new DisplayPV(i, 0, 0, 0, 0, 0, 0,0, 0, 0,0,0,0,0,0,0); + addOrUpdateDisplayDataClean(pv);//一行一行添加 + } + } + } + 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, 0, 0, 0, 0,0, 0, 0,0,0,0,0,0,0); + addOrUpdateDisplayDataPolish(pv);//一行一行添加 + } + } + } + public void IntializeDataBaseMeasure() { + + for (int i = 1; i < 2; i++) { + List list = getDisplayDataMeasure(i); //从数据库中读 + if (list.size() == 0) { + DisplayPV pv = new DisplayPV(i, 0, 0, 0, 0, 0, 0,0, 0, 0,0,0,0,0,0,0); + addOrUpdateDisplayDataMeasure(pv);//一行一行添加 + } + } + } + + + public List getDisplayDataPaint(int id) { //初始化 + List list = new ArrayList<>(); + String sql = "SELECT * FROM " + TABLE_NAME_PAINT + " WHERE " + COLUMN_ID + " = " + String.valueOf(id); + SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();//获取可写数据库实例 + + + Cursor cursor = sqLiteDatabase.rawQuery(sql, null); //按id查询 + + int idIndex = cursor.getColumnIndex(COLUMN_ID); + int _verticalAdjustIndex = cursor.getColumnIndex(COLUMN_VERTICAL_COMPENSATION); + int _moveSpeedPaintIndex = cursor.getColumnIndex(COLUMN_MOVE_SPEED_PAINT); + int _backDistanceIndex = cursor.getColumnIndex(COLUMN_BACK_DISTANCE); + int _slideSpeedIndex = cursor.getColumnIndex(COLUMN_SLIDE_SPEED); + int _slideDistanceIndex = cursor.getColumnIndex(COLUMN_SLIDE_DISTANCE); + int _changelanedistance = cursor.getColumnIndex(COLUMN_CHANGELANEDIS_PAINT); + + while (cursor.moveToNext()) { + + DisplayPV pv = new DisplayPV(cursor.getInt(idIndex), cursor.getInt(_verticalAdjustIndex), + cursor.getInt(_moveSpeedPaintIndex), cursor.getInt(_backDistanceIndex), cursor.getInt(_slideSpeedIndex), cursor.getInt(_slideDistanceIndex), 0, + 0, 0, 0, 0, 0,0,0,0,cursor.getInt(_changelanedistance)); + + + list.add(pv); + } + cursor.close(); + sqLiteDatabase.close(); + return list; + } + + public List getDisplayDataClean(int id) { //初始化 + List list = new ArrayList<>(); + String sql = "SELECT * FROM " + TABLE_NAME_CLEAN+ " WHERE " + COLUMN_ID + " = " + String.valueOf(id); + SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();//获取可写数据库实例 + + + Cursor cursor = sqLiteDatabase.rawQuery(sql, null); //按id查询 + + int idIndex = cursor.getColumnIndex(COLUMN_ID); + int _verticalAdjustIndex = cursor.getColumnIndex(COLUMN_VERTICAL_COMPENSATION); + int _moveSpeedCleanIndex = cursor.getColumnIndex(COLUMN_MOVE_SPEED_CLEAN); + int _pumpFrequencyIndex = cursor.getColumnIndex(COLUMN_PUMP_FREQUENCY); + int _pumpStopFrequencyIndex = cursor.getColumnIndex(COLUMN_PUMP_STOP_FREQUENCY); + int _pressSetIndex = cursor.getColumnIndex(COLUMN_PRESS_SET_CLEAN); + + while (cursor.moveToNext()) { + + DisplayPV pv = new DisplayPV(cursor.getInt(idIndex), cursor.getInt(_verticalAdjustIndex), + 0, 0, 0, 0, cursor.getInt(_moveSpeedCleanIndex), + cursor.getInt(_pumpFrequencyIndex), cursor.getInt(_pressSetIndex), 0, 0, 0,0,cursor.getInt(_pumpStopFrequencyIndex),0,0); + + list.add(pv); + } + cursor.close(); + sqLiteDatabase.close(); + return list; + } + 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 _verticalAdjustIndex = cursor.getColumnIndex(COLUMN_VERTICAL_COMPENSATION); + int _pressSetIndex = cursor.getColumnIndex(COLUMN_PRESS_SET_POLISH); + int _moveSpeedPolishIndex = cursor.getColumnIndex(COLUMN_MOVE_SPEED_POLISH); + int _HCompensationSwitchIndex = cursor.getColumnIndex(COLUMN_H_COMPENSATIONSWITCH); + int _changeLaneDistance = cursor.getColumnIndex(COLUMN_CHANGELANEDIS_POLISH); + + + while (cursor.moveToNext()) { + + DisplayPV pv = new DisplayPV(cursor.getInt(idIndex), cursor.getInt(_verticalAdjustIndex), + 0, 0, 0, 0, 0, + 0, 0, cursor.getInt(_pressSetIndex), cursor.getInt(_moveSpeedPolishIndex), + cursor.getInt(_HCompensationSwitchIndex),0,0,cursor.getInt(_changeLaneDistance),0); + + list.add(pv); + } + cursor.close(); + sqLiteDatabase.close(); + return list; + } + public List getDisplayDataMeasure(int id) { //初始化 + List list = new ArrayList<>(); + String sql = "SELECT * FROM " + TABLE_NAME_MEASURE + " WHERE " + COLUMN_ID + " = " + String.valueOf(id); + SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();//获取可写数据库实例 + + Cursor cursor = sqLiteDatabase.rawQuery(sql, null); //按id查询 + + int idIndex = cursor.getColumnIndex(COLUMN_ID); + int _moveSpeedMeasureIndex = cursor.getColumnIndex(COLUMN_MOVE_SPEED_MEASURE); + + while (cursor.moveToNext()) { + + DisplayPV pv = new DisplayPV(cursor.getInt(idIndex), 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, cursor.getInt(_moveSpeedMeasureIndex),0,0,0); + + list.add(pv); + } + cursor.close(); + sqLiteDatabase.close(); + return list; + } +} diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/PopupHelper.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/PopupHelper.java new file mode 100644 index 0000000..0e24317 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/PopupHelper.java @@ -0,0 +1,259 @@ +package com.example.guohuawindpowerapp.services; + +import android.app.Dialog; +import android.icu.text.CaseMap; +import android.view.View; +import android.widget.Button; +import android.widget.RadioButton; +import android.widget.RadioGroup; +import android.widget.Toast; + +import com.example.guohuawindpowerapp.CleanActivity; +import com.example.guohuawindpowerapp.MeasureActivity; +import com.example.guohuawindpowerapp.PaintActivity; +import com.example.guohuawindpowerapp.PolishActivity; +import com.example.guohuawindpowerapp.R; + +public class PopupHelper { + + private PaintActivity mainActivitypaint; + private CleanActivity mainActivityclean; + private PolishActivity mainActivitypolish; + private MeasureActivity mainActivitymeasure; + + public String operateModeValuePaint="手动作业";//喷漆 + public String operateModeValueClean="手动作业"; //清洗 + public String operateModeValuePolish="手动作业"; //打磨 + + public PopupHelper(PaintActivity mainActivity) + { + this.mainActivitypaint = mainActivity; + + } + public PopupHelper(CleanActivity mainActivity) + { + this.mainActivityclean = mainActivity; + } + public PopupHelper(PolishActivity mainActivity) + { + this.mainActivitypolish = mainActivity; + } + public PopupHelper(MeasureActivity mainActivity) + { + this.mainActivitymeasure = mainActivity; + } + //喷漆操作模式弹窗 + public void OperateModePaintPopup(View.OnClickListener context) { //手动模式弹窗 + Dialog dialog = new Dialog(mainActivitypaint); + + dialog.setContentView(R.layout.paintoperatemodepopup); // 设置自定义布局 + dialog.setCancelable(true); // 设置点击外部是否关闭弹窗 + + // 获取布局中的视图 + Button cancelButton = dialog.findViewById(R.id.manualModePaintCancel); + Button confirmButton = dialog.findViewById(R.id.manualModePaintApply); + + //获取按钮组 + RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.operateModePaintSelectorGroup); + + //4种模式 + radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(RadioGroup group, int checkedId) { + RadioButton radioButton = (RadioButton) group.findViewById(checkedId); + operateModeValuePaint=radioButton.getText().toString(); + + } + }); + + //下次进来保证是选中状态或者未远中 + String ii= mainActivitypaint.mainBinding.operateModeDisplay.getText().toString(); + switch (ii) + { + case "手动作业": { radioGroup.check(R.id.rb_paintone); + break; + } + case "竖直作业": { radioGroup.check(R.id.rb_painttwo); + break; + } + case "竖直自动": { radioGroup.check(R.id.rb_paintthree); + break; + } + case "水平自动":{radioGroup.check(R.id.rb_paintfour); + break; + } + default: + radioGroup.clearCheck(); + break; + + } + + + // 设置确定按钮点击事件 + confirmButton.setOnClickListener(v -> { //手动模式弹窗确认 + if (radioGroup.getCheckedRadioButtonId() != -1) { //有按钮选中时按确定 更新值 + mainActivitypaint.mainBinding.operateModeDisplay.setText(operateModeValuePaint); + mainActivitypaint._Operate_Mode_Call_Value=operateModeValuePaint; + Toast.makeText(mainActivitypaint, "设置成功", Toast.LENGTH_SHORT).show(); + } + + dialog.dismiss(); // 关闭弹窗 + }); + + // 设置取消按钮点击事件 + cancelButton.setOnClickListener(v -> { + Toast.makeText(mainActivitypaint, "点击了取消", Toast.LENGTH_SHORT).show(); + + dialog.dismiss(); // 关闭弹窗 + }); + dialog.show(); // 显示弹窗 + + } + + + //清洗操作模式弹窗 + public void OperateModeCleanPopup(View.OnClickListener context) { //手动模式弹窗 + Dialog dialog = new Dialog(mainActivityclean); + + dialog.setContentView(R.layout.cleanoperatemodepopup); // 设置自定义布局 + dialog.setCancelable(true); // 设置点击外部是否关闭弹窗 + + // 获取布局中的视图 + Button cancelButton = dialog.findViewById(R.id.manualModeCleanCancel); + Button confirmButton = dialog.findViewById(R.id.manualModeCleanApply); + + //获取按钮组 + RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.operateModeCleanSelectorGroup); + + //4种模式 + radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(RadioGroup group, int checkedId) { + RadioButton radioButton = (RadioButton) group.findViewById(checkedId); + operateModeValueClean=radioButton.getText().toString(); + } + }); + + //下次进来保证是选中状态或者未远中 + String ii= mainActivityclean.mainBinding.operateModeDisplay.getText().toString(); + switch (ii) + { + case "手动作业": { radioGroup.check(R.id.rb_cleanone); + break; + } + case "竖直作业": { radioGroup.check(R.id.rb_cleantwo); + break; + } + case "自动作业": { radioGroup.check(R.id.rb_cleanthree); + break; + + } + default: + radioGroup.clearCheck(); + break; + + } + + + // 设置确定按钮点击事件 + confirmButton.setOnClickListener(v -> { //手动模式弹窗确认 + if (radioGroup.getCheckedRadioButtonId() != -1) { //有按钮选中时按确定 更新值 + mainActivityclean.mainBinding.operateModeDisplay.setText(operateModeValueClean); + mainActivityclean._Operate_Mode_Call_Value=operateModeValueClean; + Toast.makeText(mainActivityclean, "设置成功", Toast.LENGTH_SHORT).show(); + } + + + dialog.dismiss(); // 关闭弹窗 + }); + + // 设置取消按钮点击事件 + cancelButton.setOnClickListener(v -> { + Toast.makeText(mainActivityclean, "点击了取消", Toast.LENGTH_SHORT).show(); + + dialog.dismiss(); // 关闭弹窗 + }); + dialog.show(); // 显示弹窗 + + } + + //打磨操作模式弹窗 + 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; + } + case "水平作业": { radioGroup.check(R.id.rb_polishthree); + 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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/RobotDataHanlder.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/RobotDataHanlder.java new file mode 100644 index 0000000..530c8fc --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/RobotDataHanlder.java @@ -0,0 +1,63 @@ +package com.example.guohuawindpowerapp.services; + +import com.example.guohuawindpowerapp.models.BspIV; +import com.example.guohuawindpowerapp.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/USBSerialPortHelper.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/USBSerialPortHelper.java new file mode 100644 index 0000000..a9ce343 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/USBSerialPortHelper.java @@ -0,0 +1,562 @@ +package com.example.guohuawindpowerapp.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.icu.text.CaseMap; +import android.os.Build; +import android.os.CountDownTimer; +import android.os.Handler; +import android.os.Looper; +import android.widget.Toast; + +import androidx.core.content.ContextCompat; + +import com.example.guohuawindpowerapp.BuildConfig; +import com.example.guohuawindpowerapp.CleanActivity; +import com.example.guohuawindpowerapp.MainActivity; +import com.example.guohuawindpowerapp.MeasureActivity; +import com.example.guohuawindpowerapp.PaintActivity; +import com.example.guohuawindpowerapp.PolishActivity; +import com.example.guohuawindpowerapp.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 CleanActivity activityClean; + private PaintActivity activityPaint; + private PolishActivity activityPolish; + private MeasureActivity activityMesaure; + public USBSerialPortHelper(PaintActivity activityPaint, CleanActivity activityClean, PolishActivity activityPolish, MeasureActivity activityMesaure, MainActivity mainActivity) + { + if(activityPaint!=null) { + this.mActivity = activityPaint; + this.activityPaint=activityPaint; + } + if(activityClean!=null) { + this.mActivity = activityClean; + this.activityClean=activityClean; + } + if(activityPolish!=null) { + this.mActivity = activityPolish; + this.activityPolish=activityPolish; + } + + if(activityMesaure!=null) { + this.mActivity = activityMesaure; + this.activityMesaure=activityMesaure; + } + if(mainActivity!=null) { + this.mActivity = mainActivity; + + } + + } + + + + //sserial port part start + + private enum UsbPermission {Unknown, Requested, Granted, Denied} + + private final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB"; + + + // + // + // + + + private int deviceId = 60000; + private int deviceId_test = 60000; + private int portNum; + private final int WRITE_WAIT_MILLIS = 500; + private final int READ_WAIT_MILLIS = 100; + private String PortNameContians = "SILICON";/**/ + // private static String PortNameContians="FTD"; + private int baudRate = 57600; + private boolean withIoManager = true; + + private BroadcastReceiver broadcastReceiver; + private Handler mainLooper; + + private SerialInputOutputManager usbIoManager; + private UsbSerialPort usbSerialPort; + private UsbPermission usbPermission = UsbPermission.Unknown; + 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 { + + // String dataReceived = bytesToHex(data); + //status(dataReceived); + // if ((data[0] == 0xFE) && (data[1] == 0xFE)) + byte[] crcbytes = new byte[data.length - 2]; + System.arraycopy(data, 0, crcbytes, 0, data.length - 2); + byte[] crc=ModbusCRC.calculateCRC(crcbytes); + // status(bytesToHex(data)); + // status(String.valueOf(crc[0]+" "+ String.valueOf(crc[1]))); + 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) + { + PaintParaShow(); + CleanParaShow(); + PolishParaShow(); + MeasureParaShow(); + _toReceiveIV.getSystemError(); + // Toast.makeText(mActivity, String.valueOf(_toReceiveIV.getSystemError()), Toast.LENGTH_SHORT).show(); + + activityErrorShow(String.valueOf(_toReceiveIV.getSystemError()), + String.valueOf(_toReceiveIV.getLeftMotorErr()), String.valueOf(_toReceiveIV.getRightMotorErr()) ); + + + + }else + { + // status("null"); + } + + + + + + }else + { + + } + + }else + { + //status("crc failed"); + } + + + + + } catch (Exception e) { + + } + } + public void activityErrorShow(String errmessage,String leftmotorErr,String rightmotorError) + { + if(activityPaint!=null) + { + int errorCode = Integer.parseInt(errmessage); + if ((errorCode & (1 << 5)) != 0){ + activityPaint.showError("请将所有遥控器按键回零位"); + } + else{ + activityPaint.showError(errmessage+"#"+leftmotorErr+"#"+rightmotorError); + } + } + if(activityClean!=null) + { + int errorCode = Integer.parseInt(errmessage); + if ((errorCode & (1 << 5)) != 0){ + activityClean.showError("请将所有遥控器按键回零位"); + } + else{ + activityClean.showError(errmessage+"#"+leftmotorErr+"#"+rightmotorError); + } + } + if(activityPolish!=null) + { + int errorCode = Integer.parseInt(errmessage); + if ((errorCode & (1 << 5)) != 0){ + activityPolish.showError("请将遥控器所有按键回零位"); + } + else{ + activityPolish.showError(errmessage+"#"+leftmotorErr+"#"+rightmotorError); + } + } + if(activityMesaure!=null) + { + int errorCode = Integer.parseInt(errmessage); + if ((errorCode & (1 << 5)) != 0){ + activityMesaure.showError("请将遥控器所有按键回零位"); + } + else{ + activityMesaure.showError(errmessage+"#"+leftmotorErr+"#"+rightmotorError); + } + } + + } + + public void PaintParaShow() + { + if(activityPaint!=null) + { + activityPaint.mainBinding.tvSpeedFrom32.setText(String.valueOf((double)_toReceiveIV1.getRobotMoveSpeedE2MPMin()/10)); + activityPaint.mainBinding.tvBodyAttitudeFrom32.setText(String.valueOf((double)_toReceiveIV1.getCurrentAngleE2D()/100)); + activityPaint.mainBinding.tvPressFrom32.setText( String.valueOf(_toReceiveIV1.getEndPressure()) ); + activityPaint.mainBinding.tvSlidePositionFrom32.setText(String.valueOf(_toReceiveIV1.getSlideTablePosition())); + activityPaint.mainBinding.tvSlideSpeedFrom32.setText(String.valueOf(_toReceiveIV1.getSlideTableSpeed())); + activityPaint.mainBinding.tvRightCompensationFrom32Paint.setText(String.valueOf((double)_toReceiveIV1.getRightCompensationE2D()/100)); + activityPaint.mainBinding.tvLeftCompensationFrom32Paint.setText(String.valueOf((double)_toReceiveIV1.getLeftCompensationE2D()/100)); + if(_toReceiveIV1.getRemoteStatus()==0) + { + activityPaint.mainBinding.tvSignal.setText("断开"); + } + else if(_toReceiveIV1.getRemoteStatus()==1) + { + activityPaint.mainBinding.tvSignal.setText("已连接"); + } + } + } + public void CleanParaShow() + { + if(activityClean!=null) + { + activityClean.mainBinding.tvSpeedFrom32.setText(String.valueOf((double)_toReceiveIV1.getRobotMoveSpeedE2MPMin()/10)); + activityClean.mainBinding.tvBodyAttitudeFrom32.setText(String.valueOf((double)_toReceiveIV1.getCurrentAngleE2D()/100)); + activityClean.mainBinding.tvPressFrom32.setText( String.valueOf(_toReceiveIV1.getEndPressure()) ); + + if(_toReceiveIV1.getRemoteStatus()==0) + { + activityClean.mainBinding.tvSignal.setText("断开"); + } + else if(_toReceiveIV1.getRemoteStatus()==1) + { + activityClean.mainBinding.tvSignal.setText("已连接"); + } + } + } + public void PolishParaShow() + { + if(activityPolish!=null) + { + activityPolish.mainBinding.tvSpeedFrom32.setText(String.valueOf((double)_toReceiveIV1.getRobotMoveSpeedE2MPMin()/10)); + activityPolish.mainBinding.tvBodyAttitudeFrom32.setText(String.valueOf((double)_toReceiveIV1.getCurrentAngleE2D()/100)); + activityPolish.mainBinding.tvPressFrom32.setText( String.valueOf(_toReceiveIV1.getEndPressure()) ); + activityPolish.mainBinding.tvLeftCompensationFrom32.setText(String.valueOf((double)_toReceiveIV1.getLeftCompensationE2D()/100)); + activityPolish.mainBinding.tvRightCompensationFrom32.setText(String.valueOf((double)_toReceiveIV1.getRightCompensationE2D()/100)); + if(_toReceiveIV1.getRemoteStatus()==0) + { + activityPolish.mainBinding.tvSignal.setText("断开"); + } + else if(_toReceiveIV1.getRemoteStatus()==1) + { + activityPolish.mainBinding.tvSignal.setText("已连接"); + } + } + } + public void MeasureParaShow() + { + if(activityMesaure!=null) + { + activityMesaure.mainBinding.tvSpeedFrom32.setText(String.valueOf((double)_toReceiveIV1.getRobotMoveSpeedE2MPMin()/10)); + activityMesaure.mainBinding.tvBodyAttitudeFrom32.setText(String.valueOf((double)_toReceiveIV1.getCurrentAngleE2D()/100)); + activityMesaure.mainBinding.tvPressFrom32.setText( String.valueOf(_toReceiveIV1.getEndPressure()) ); + activityMesaure.mainBinding.tvMeasureFrom32.setText(String.valueOf((double) _toReceiveIV1.getThicknessValue()/100)); + + if(_toReceiveIV1.getRemoteStatus()==0) + { + activityMesaure.mainBinding.tvSignal.setText("断开"); + } + else if(_toReceiveIV1.getRemoteStatus()==1) + { + activityMesaure.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/VideoPlayerHelper.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/VideoPlayerHelper.java new file mode 100644 index 0000000..7941bbc --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/services/VideoPlayerHelper.java @@ -0,0 +1,27 @@ +package com.example.guohuawindpowerapp.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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/viewmodels/MainViewModel.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/viewmodels/MainViewModel.java new file mode 100644 index 0000000..498500e --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/com/example/guohuawindpowerapp/viewmodels/MainViewModel.java @@ -0,0 +1,11 @@ +package com.example.guohuawindpowerapp.viewmodels; + +import androidx.lifecycle.ViewModel; + +public class MainViewModel extends ViewModel { + + public MainViewModel() { + + } + +} \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/generate_java.bat b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/generate_java.bat new file mode 100644 index 0000000..97deb24 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/generate_java.bat @@ -0,0 +1,2 @@ + protoc --java_out . *.proto + pause diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/protoc.exe b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/protoc.exe new file mode 100644 index 0000000..f1ffb02 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/java/protoc.exe differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/background.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/background.xml new file mode 100644 index 0000000..9c77c74 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/background.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/bgr.png b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/bgr.png new file mode 100644 index 0000000..4d6154f Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/bgr.png differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/blue_rounded_rectangle.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/blue_rounded_rectangle.xml new file mode 100644 index 0000000..a973af9 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/blue_rounded_rectangle.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/border.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/border.xml new file mode 100644 index 0000000..4f76948 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/border.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/border_active.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/border_active.xml new file mode 100644 index 0000000..5919263 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/border_active.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/border_inactive.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/border_inactive.xml new file mode 100644 index 0000000..093780c --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/border_inactive.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderblue.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderblue.xml new file mode 100644 index 0000000..b234be6 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderblue.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderbluegreen.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderbluegreen.xml new file mode 100644 index 0000000..25d3346 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderbluegreen.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderlog.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderlog.xml new file mode 100644 index 0000000..1a1b34c --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderlog.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderorange.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderorange.xml new file mode 100644 index 0000000..eef56c3 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderorange.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderwhite.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderwhite.xml new file mode 100644 index 0000000..e013ef8 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/borderwhite.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/button_active.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/button_active.xml new file mode 100644 index 0000000..28f66f6 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/button_active.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/button_inactive.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/button_inactive.xml new file mode 100644 index 0000000..146bfd1 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/button_inactive.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/buttonborderwhite.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/buttonborderwhite.xml new file mode 100644 index 0000000..ec98fab --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/buttonborderwhite.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/clean3_1.png b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/clean3_1.png new file mode 100644 index 0000000..62d0786 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/clean3_1.png differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/container_active.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/container_active.xml new file mode 100644 index 0000000..dc691f7 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/container_active.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/container_inactive.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/container_inactive.xml new file mode 100644 index 0000000..edcae41 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/container_inactive.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/dash_line.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/dash_line.xml new file mode 100644 index 0000000..c83a8c5 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/dash_line.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/ic_launcher_background.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/ic_launcher_foreground.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/my_cursor.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/my_cursor.xml new file mode 100644 index 0000000..970a494 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/my_cursor.xml @@ -0,0 +1,9 @@ + + + + android:shape="rectangle"> + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/orange_rounded_rectangle.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/orange_rounded_rectangle.xml new file mode 100644 index 0000000..8835bab --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/orange_rounded_rectangle.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/paint1_1.png b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/paint1_1.png new file mode 100644 index 0000000..4a58140 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/paint1_1.png differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/polish2_1.png b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/polish2_1.png new file mode 100644 index 0000000..024fb4c Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/polish2_1.png differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radio_button_selected.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radio_button_selected.xml new file mode 100644 index 0000000..e7389bd --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radio_button_selected.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radio_button_textcolor.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radio_button_textcolor.xml new file mode 100644 index 0000000..9fe93c7 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radio_button_textcolor.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radio_button_unselected.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radio_button_unselected.xml new file mode 100644 index 0000000..ccb6bf8 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radio_button_unselected.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radiobutton_background.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radiobutton_background.xml new file mode 100644 index 0000000..6eb6a48 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/radiobutton_background.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/rounded_edittext.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/rounded_edittext.xml new file mode 100644 index 0000000..9f845ce --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/rounded_edittext.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/scrollbar_horizontal_thumb.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/scrollbar_horizontal_thumb.xml new file mode 100644 index 0000000..e4ea48c --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/scrollbar_horizontal_thumb.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/squrelogo.png b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/squrelogo.png new file mode 100644 index 0000000..f7cafaf Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/squrelogo.png differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/submenu.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/submenu.xml new file mode 100644 index 0000000..64f9e41 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/submenu.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/thicknessgauge4_1.png b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/thicknessgauge4_1.png new file mode 100644 index 0000000..176b9d3 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/drawable/thicknessgauge4_1.png differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/layout/activity_clean.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/layout/activity_clean.xml new file mode 100644 index 0000000..c1a0210 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/layout/activity_clean.xml @@ -0,0 +1,636 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/layout/paintoperatemodepopup.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/layout/paintoperatemodepopup.xml new file mode 100644 index 0000000..15f1aaf --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/layout/paintoperatemodepopup.xml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/layout/polishoperatemodepopup.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/layout/polishoperatemodepopup.xml new file mode 100644 index 0000000..d3bb60b --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/layout/polishoperatemodepopup.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/values-night/themes.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..d5516cd --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/values/colors.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..7ed5a2f --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/values/strings.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..a09f920 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/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/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/values/themes.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..a645915 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/values/themes.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/backup_rules.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/check_boxs.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/check_boxs.xml new file mode 100644 index 0000000..df2d64a --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/check_boxs.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/data_extraction_rules.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/device_filter.xml b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/device_filter.xml new file mode 100644 index 0000000..b2a252c --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/main/res/xml/device_filter.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/guohuafengdian/guohuawindpowerapp(1)/app/src/test/java/com/example/guohuawindpowerapp/ExampleUnitTest.java b/guohuafengdian/guohuawindpowerapp(1)/app/src/test/java/com/example/guohuawindpowerapp/ExampleUnitTest.java new file mode 100644 index 0000000..8eeaa7d --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/app/src/test/java/com/example/guohuawindpowerapp/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.guohuawindpowerapp; + +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/guohuafengdian/guohuawindpowerapp(1)/build.gradle b/guohuafengdian/guohuawindpowerapp(1)/build.gradle new file mode 100644 index 0000000..b99ec97 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/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/guohuafengdian/guohuawindpowerapp(1)/gradle.properties b/guohuafengdian/guohuawindpowerapp(1)/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/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/guohuafengdian/guohuawindpowerapp(1)/gradle/wrapper/gradle-wrapper.jar b/guohuafengdian/guohuawindpowerapp(1)/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/guohuafengdian/guohuawindpowerapp(1)/gradle/wrapper/gradle-wrapper.jar differ diff --git a/guohuafengdian/guohuawindpowerapp(1)/gradle/wrapper/gradle-wrapper.properties b/guohuafengdian/guohuawindpowerapp(1)/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ab0fcbf --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/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/guohuafengdian/guohuawindpowerapp(1)/gradlew b/guohuafengdian/guohuawindpowerapp(1)/gradlew new file mode 100644 index 0000000..4f906e0 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/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/guohuafengdian/guohuawindpowerapp(1)/gradlew.bat b/guohuafengdian/guohuawindpowerapp(1)/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/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/guohuafengdian/guohuawindpowerapp(1)/settings.gradle b/guohuafengdian/guohuawindpowerapp(1)/settings.gradle new file mode 100644 index 0000000..5f415f2 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/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 = "guohuawindpowerapp" +include ':app' diff --git a/guohuafengdian/guohuawindpowerapp(1)/备注.txt b/guohuafengdian/guohuawindpowerapp(1)/备注.txt new file mode 100644 index 0000000..b8df847 --- /dev/null +++ b/guohuafengdian/guohuawindpowerapp(1)/备注.txt @@ -0,0 +1 @@ +修改新的摆臂界面---2025.5.29 \ No newline at end of file