Browse Source

摆臂app 去除参数调用和 边打边退 打一退1

master
xsq1-admin 10 months ago
parent
commit
d991c12df9
  1. 3
      plusapp-decrease/SwingArmApp2/.idea/.gitignore
  2. 9
      plusapp-decrease/SwingArmApp2/.idea/SwingArmApp1.iml
  3. 6
      plusapp-decrease/SwingArmApp2/.idea/misc.xml
  4. 8
      plusapp-decrease/SwingArmApp2/.idea/modules.xml
  5. 15
      plusapp-decrease/SwingArmApp2/swing_armapp2/.gitignore
  6. 3
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/.gitignore
  7. 1
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/.name
  8. 6
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/compiler.xml
  9. 10
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/deploymentTargetDropDown.xml
  10. 10
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/deploymentTargetSelector.xml
  11. 20
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/gradle.xml
  12. 10
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/migrations.xml
  13. 9
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/misc.xml
  14. 6
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/render.experimental.xml
  15. 17
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/runConfigurations.xml
  16. 6
      plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/vcs.xml
  17. 0
      plusapp-decrease/SwingArmApp2/swing_armapp2/README.md
  18. 1
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/.gitignore
  19. 58
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/build.gradle
  20. 21
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/proguard-rules.pro
  21. 20
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/release/output-metadata.json
  22. 26
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/androidTest/java/com/example/swingarmapp/ExampleInstrumentedTest.java
  23. 53
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/AndroidManifest.xml
  24. 2
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/bsp_IV.options
  25. 15
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/bsp_IV.proto
  26. 15
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/bsp_PV.proto
  27. 335
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/MainActivity.java
  28. 937
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/models/BspIV.java
  29. 1163
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/models/BspPV.java
  30. 50
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/models/DisplayIV.java
  31. 92
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/models/DisplayPV.java
  32. 26
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/ConvertHelper.java
  33. 22
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/CustomProber.java
  34. 39
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/LogUtil.java
  35. 72
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/ModbusCRC.java
  36. 136
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/MyDataHelper.java
  37. 443
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/PopupHelper.java
  38. 63
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/RobotDataHanlder.java
  39. 402
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/USBSerialPortHelper.java
  40. 27
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/VideoPlayerHelper.java
  41. 11
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/viewmodels/MainViewModel.java
  42. 2
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/generate_java.bat
  43. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/protoc.exe
  44. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/baibi_back.png
  45. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/bgr.png
  46. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/bigackground.png
  47. 10
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/border.xml
  48. 24
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/borderblue.xml
  49. 24
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/borderbluegreen.xml
  50. 24
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/borderorange.xml
  51. 24
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/borderwhite.xml
  52. 24
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/buttonborderwhite.xml
  53. 14
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/dash_line.xml
  54. 170
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/ic_launcher_background.xml
  55. 30
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/ic_launcher_foreground.xml
  56. 11
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/radio_button_selected.xml
  57. 8
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/radio_button_textcolor.xml
  58. 9
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/radio_button_unselected.xml
  59. 5
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/radiobutton_background.xml
  60. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/smallbackground.png
  61. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/squrelogo.png
  62. 791
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/activity_main.xml
  63. 109
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/backdistancepopup.xml
  64. 109
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/lanechangepopup.xml
  65. 208
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/operationmodepopup.xml
  66. 168
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/parameters_call.xml
  67. 109
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/swingarmanglepopup.xml
  68. 109
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/swingarmspeedpopup.xml
  69. 35
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/systemerrorpopup.xml
  70. 109
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/worklengthpopup.xml
  71. 110
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/workwidthpopup.xml
  72. 6
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  73. 6
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  74. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-hdpi/ic_launcher.webp
  75. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
  76. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-mdpi/ic_launcher.webp
  77. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
  78. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
  79. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
  80. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
  81. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
  82. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
  83. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
  84. 16
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/values-night/themes.xml
  85. 156
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/values/colors.xml
  86. 35
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/values/strings.xml
  87. 17
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/values/themes.xml
  88. 13
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/xml/backup_rules.xml
  89. 15
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/xml/check_boxs.xml
  90. 19
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/xml/data_extraction_rules.xml
  91. 38
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/xml/device_filter.xml
  92. 17
      plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/test/java/com/example/swingarmapp/ExampleUnitTest.java
  93. 4
      plusapp-decrease/SwingArmApp2/swing_armapp2/build.gradle
  94. 21
      plusapp-decrease/SwingArmApp2/swing_armapp2/gradle.properties
  95. BIN
      plusapp-decrease/SwingArmApp2/swing_armapp2/gradle/wrapper/gradle-wrapper.jar
  96. 6
      plusapp-decrease/SwingArmApp2/swing_armapp2/gradle/wrapper/gradle-wrapper.properties
  97. 185
      plusapp-decrease/SwingArmApp2/swing_armapp2/gradlew
  98. 89
      plusapp-decrease/SwingArmApp2/swing_armapp2/gradlew.bat
  99. 18
      plusapp-decrease/SwingArmApp2/swing_armapp2/settings.gradle
  100. 1
      plusapp-decrease/新建文本文档.txt

3
plusapp-decrease/SwingArmApp2/.idea/.gitignore

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

9
plusapp-decrease/SwingArmApp2/.idea/SwingArmApp1.iml

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

6
plusapp-decrease/SwingArmApp2/.idea/misc.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Android API 35, extension level 13 Platform" project-jdk-type="Android SDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
plusapp-decrease/SwingArmApp2/.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/SwingArmApp1.iml" filepath="$PROJECT_DIR$/.idea/SwingArmApp1.iml" />
</modules>
</component>
</project>

15
plusapp-decrease/SwingArmApp2/swing_armapp2/.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

3
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/.gitignore

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

1
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/.name

@ -0,0 +1 @@
swing_armapp2

6
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/compiler.xml

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

10
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/deploymentTargetDropDown.xml

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

10
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/deploymentTargetSelector.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

20
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/gradle.xml

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

10
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/migrations.xml

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

9
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/misc.xml

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

6
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/render.experimental.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RenderSettings">
<option name="showDecorations" value="true" />
</component>
</project>

17
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/runConfigurations.xml

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

6
plusapp-decrease/SwingArmApp2/swing_armapp2/.idea/vcs.xml

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

0
plusapp-decrease/SwingArmApp2/swing_armapp2/README.md

1
plusapp-decrease/SwingArmApp2/swing_armapp2/app/.gitignore

@ -0,0 +1 @@
/build

58
plusapp-decrease/SwingArmApp2/swing_armapp2/app/build.gradle

@ -0,0 +1,58 @@
plugins {
id 'com.android.application'
}
android {
namespace 'com.example.swingarmapp'
compileSdk 34
viewBinding
{
enabled true
}
// //add this feature
dataBinding
{
enabled true
}
defaultConfig {
applicationId "com.example.swingarmapp2"
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
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'
}

21
plusapp-decrease/SwingArmApp2/swing_armapp2/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

20
plusapp-decrease/SwingArmApp2/swing_armapp2/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"
}

26
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/androidTest/java/com/example/swingarmapp/ExampleInstrumentedTest.java

@ -0,0 +1,26 @@
package com.example.swingarmapp;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.rougheningapp", appContext.getPackageName());
}
}

53
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/AndroidManifest.xml

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

2
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/bsp_IV.options

@ -0,0 +1,2 @@
# lock.options
IV_struct_define.Buff_Data max_size:30 fixed_length:true

15
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/bsp_IV.proto

@ -0,0 +1,15 @@
syntax = "proto3";
option java_multiple_files = false;
option java_package = "com.example.swingarmapp.models";
message IV_struct_define
{
int32 LeftCompensation= 1;
int32 RightCompensation= 2;
int32 Robot_Move_Deri_Speed= 3;//
int32 Robot_Gyro= 4;//
int32 MK32_Isonline= 5;//
int32 SystemError=6; //
};

15
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/bsp_PV.proto

@ -0,0 +1,15 @@
syntax = "proto3";
option java_multiple_files = false;
option java_package = "com.example.swingarmapp.models";
message PV_struct_define{
int32 Robot_Operation_Mode= 1; //1
int32 Swing_Range_Angle= 2;//
int32 Swing_Speed= 3;//
int32 Robot_Back_Distance= 4; //退
int32 Robot_Change_Lane_Distance= 5;//
int32 Length_Homework=6;//
int32 Width_Homework=7;//
int32 Fight_Retreat=8;//2
};

335
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/MainActivity.java

@ -0,0 +1,335 @@
package com.example.swingarmapp;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.Toast;
import com.example.swingarmapp.databinding.ActivityMainBinding;
import com.example.swingarmapp.models.DisplayPV;
import com.example.swingarmapp.services.ModbusCRC;
import com.example.swingarmapp.services.MyDataHelper;
import com.example.swingarmapp.services.PopupHelper;
import com.example.swingarmapp.services.USBSerialPortHelper;
import com.example.swingarmapp.models.BspPV;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
public class MainActivity extends AppCompatActivity {
public ActivityMainBinding 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 _parameters_Call_Value = "1";
public String _operation_Mode_Call_Value = "手动";
public String WorkMode_Call_Value = "边打边退";
/*报错相关*/
private List<String> errorHistory = new LinkedList<>();
private Set<String> 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_main);
showError("无");//初始化报错信息
/* USB串口 控制区域*/
serialPortHelper = new USBSerialPortHelper(this);
serialPortHelper.intialize();
serialPortHelper.connect();
mainBinding.MaintvParameterCallTo32.setText("未开放");
//程序初始化,读取数据库,进行界面显示
myDataHelper.IntializeDataBase();
String parame = _parameters_Call_Value;
//读取数据
int paraIndex = Integer.parseInt(parame);
List<DisplayPV> pvList = myDataHelper.getDisplayData(paraIndex); //
mainBinding.MaintvSwingArmAngleTo32.setText(String.valueOf(pvList.get(0).getSwingArmAngle()));
mainBinding.MaintvSwingArmSpeedTo32.setText(String.valueOf(pvList.get(0).getSwingArmSpeed()));
mainBinding.MaintvBackDistanceTo32.setText(String.valueOf(pvList.get(0).getBackDistance()));
mainBinding.MaintvLaneChangeDistanceTo32.setText(String.valueOf(pvList.get(0).getLaneChangeDistance()));
mainBinding.MaintvWorkLenthTo32.setText(String.valueOf(pvList.get(0).getWorkLength()));
mainBinding.MaintvWorkWidthTo32.setText(String.valueOf(pvList.get(0).getWorkWidth()));
/*发往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()
.setSwingRangeAngle(0)
.setSwingSpeed(0)
.setRobotBackDistance(0)
.setRobotChangeLaneDistance(0)
.setLengthHomework(0)
.setWidthHomework(0)
.build();
_toSendPV = _toSendPV.toBuilder().
setSwingRangeAngle((Integer.parseInt(String.valueOf(mainBinding.MaintvSwingArmAngleTo32.getText()))))
.setSwingSpeed((Integer.parseInt(String.valueOf(mainBinding.MaintvSwingArmSpeedTo32.getText()))))
.setRobotBackDistance((Integer.parseInt(String.valueOf(mainBinding.MaintvBackDistanceTo32.getText()))))
.setRobotChangeLaneDistance((Integer.parseInt(String.valueOf(mainBinding.MaintvLaneChangeDistanceTo32.getText())))*10)
.setLengthHomework((Integer.parseInt(String.valueOf(mainBinding.MaintvWorkLenthTo32.getText()))))
.setWidthHomework((Integer.parseInt(String.valueOf(mainBinding.MaintvWorkWidthTo32.getText()))))
.build();
String Data = mainBinding.operationModeDisplay.getText().toString();
if (mainBinding.operationModeDisplay.getText().toString().equals("水平")) {
_toSendPV = _toSendPV.toBuilder().setRobotOperationMode(1).build();
} else if (mainBinding.operationModeDisplay.getText().toString().equals("竖直")) {
_toSendPV = _toSendPV.toBuilder().setRobotOperationMode(2).build();
} else if (mainBinding.operationModeDisplay.getText().toString().equals("反底")) {
_toSendPV = _toSendPV.toBuilder().setRobotOperationMode(3).build();
} else if (mainBinding.operationModeDisplay.getText().toString().equals("手动")) {
_toSendPV = _toSendPV.toBuilder().setRobotOperationMode(4).build();
}
if(WorkMode_Call_Value.equals("边打边退"))
{
_toSendPV = _toSendPV.toBuilder().setFightRetreat(5).build();
}
else if(WorkMode_Call_Value.equals("打退交替"))
{
_toSendPV = _toSendPV.toBuilder().setFightRetreat(6).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.setOperationModeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupHelper.OperationModePopup(this);
}
});
// mainBinding.setcallParametersBtn.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// popupHelper.ParametersCallPopup(this);
// }
// });
mainBinding.setswingArmAngleBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupHelper.SingArmAngleSetPopUp(this);
}
});
mainBinding.setswingArmSpeedBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupHelper.SingArmSpeedSetPopUp(this);
}
});
mainBinding.setBackDistanceBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupHelper.BackDistanceSetPopup(this);
}
});
mainBinding.setLaneChangeDistanceBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupHelper.LaneChangeDistanceSetPopup(this);
}
});
mainBinding.setWorkLenthBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupHelper.WorkLengthSetPopUp(this);
}
});
mainBinding.setWorkWidthBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupHelper.WorkWidthSetPopUp(this);
}
});
/* 保存数据 */
mainBinding.saveParametersBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//获取界面参数以写进数据库
int paraIndex = Integer.parseInt(_parameters_Call_Value);
int swingArmAngle = Integer.parseInt(mainBinding.MaintvSwingArmAngleTo32.getText().toString());
int swingArmSpeed = Integer.parseInt(mainBinding.MaintvSwingArmSpeedTo32.getText().toString());
int backDistance = Integer.parseInt(mainBinding.MaintvBackDistanceTo32.getText().toString());
int laneChangeDistance = Integer.parseInt(mainBinding.MaintvLaneChangeDistanceTo32.getText().toString());
int workLength = Integer.parseInt(mainBinding.MaintvWorkLenthTo32.getText().toString());
int workWidth = Integer.parseInt(mainBinding.MaintvWorkWidthTo32.getText().toString());
DisplayPV displayPV = new DisplayPV(paraIndex, swingArmAngle, swingArmSpeed, backDistance, laneChangeDistance, workLength, workWidth);
myDataHelper.addOrUpdateDisplayData(displayPV); //创建数据库的实例在这里
Toast.makeText(MainActivity.this, "保存成功", Toast.LENGTH_SHORT).show();
}
});
//Clear parameters 清除参数
mainBinding.clearParametersBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mainBinding.MaintvSwingArmAngleTo32.setText(String.valueOf(120));
mainBinding.MaintvSwingArmSpeedTo32.setText(String.valueOf(1));
mainBinding.MaintvBackDistanceTo32.setText(String.valueOf(25));
mainBinding.MaintvLaneChangeDistanceTo32.setText(String.valueOf(25));
mainBinding.MaintvWorkLenthTo32.setText(String.valueOf(10));
mainBinding.MaintvWorkWidthTo32.setText(String.valueOf(10));
int paraIndex = Integer.parseInt(_parameters_Call_Value);
int swingArmAngle = Integer.parseInt(mainBinding.MaintvSwingArmAngleTo32.getText().toString());
int swingArmSpeed = Integer.parseInt(mainBinding.MaintvSwingArmSpeedTo32.getText().toString());
int backDistance = Integer.parseInt(mainBinding.MaintvBackDistanceTo32.getText().toString());
int laneChangeDistance = Integer.parseInt(mainBinding.MaintvLaneChangeDistanceTo32.getText().toString());
int workLength = Integer.parseInt(mainBinding.MaintvWorkLenthTo32.getText().toString());
int workWidth = Integer.parseInt(mainBinding.MaintvWorkWidthTo32.getText().toString());
DisplayPV displayPV = new DisplayPV(paraIndex, swingArmAngle, swingArmSpeed, backDistance, laneChangeDistance, workLength, workWidth);
myDataHelper.addOrUpdateDisplayData(displayPV);
Toast.makeText(MainActivity.this, "清除成功", Toast.LENGTH_SHORT).show();
}
});
/**/
/*报错**/
mainBinding.errorTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showErrorHistoryDialog();
}
});
}
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();
}
}
}

937
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/models/BspIV.java

@ -0,0 +1,937 @@
// 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.swingarmapp.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 {
/**
* <code>int32 LeftCompensation = 1;</code>
* @return The leftCompensation.
*/
int getLeftCompensation();
/**
* <code>int32 RightCompensation = 2;</code>
* @return The rightCompensation.
*/
int getRightCompensation();
/**
* <pre>
* 速度
* </pre>
*
* <code>int32 Robot_Move_Deri_Speed = 3;</code>
* @return The robotMoveDeriSpeed.
*/
int getRobotMoveDeriSpeed();
/**
* <pre>
* 角度
* </pre>
*
* <code>int32 Robot_Gyro = 4;</code>
* @return The robotGyro.
*/
int getRobotGyro();
/**
* <pre>
* 信号
* </pre>
*
* <code>int32 MK32_Isonline = 5;</code>
* @return The mK32Isonline.
*/
int getMK32Isonline();
/**
* <pre>
* 报错
* </pre>
*
* <code>int32 SystemError = 6;</code>
* @return The systemError.
*/
int getSystemError();
}
/**
* 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.swingarmapp.models.BspIV.internal_static_IV_struct_define_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.example.swingarmapp.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.example.swingarmapp.models.BspIV.IV_struct_define.class, com.example.swingarmapp.models.BspIV.IV_struct_define.Builder.class);
}
public static final int LEFTCOMPENSATION_FIELD_NUMBER = 1;
private int leftCompensation_ = 0;
/**
* <code>int32 LeftCompensation = 1;</code>
* @return The leftCompensation.
*/
@java.lang.Override
public int getLeftCompensation() {
return leftCompensation_;
}
public static final int RIGHTCOMPENSATION_FIELD_NUMBER = 2;
private int rightCompensation_ = 0;
/**
* <code>int32 RightCompensation = 2;</code>
* @return The rightCompensation.
*/
@java.lang.Override
public int getRightCompensation() {
return rightCompensation_;
}
public static final int ROBOT_MOVE_DERI_SPEED_FIELD_NUMBER = 3;
private int robotMoveDeriSpeed_ = 0;
/**
* <pre>
* 速度
* </pre>
*
* <code>int32 Robot_Move_Deri_Speed = 3;</code>
* @return The robotMoveDeriSpeed.
*/
@java.lang.Override
public int getRobotMoveDeriSpeed() {
return robotMoveDeriSpeed_;
}
public static final int ROBOT_GYRO_FIELD_NUMBER = 4;
private int robotGyro_ = 0;
/**
* <pre>
* 角度
* </pre>
*
* <code>int32 Robot_Gyro = 4;</code>
* @return The robotGyro.
*/
@java.lang.Override
public int getRobotGyro() {
return robotGyro_;
}
public static final int MK32_ISONLINE_FIELD_NUMBER = 5;
private int mK32Isonline_ = 0;
/**
* <pre>
* 信号
* </pre>
*
* <code>int32 MK32_Isonline = 5;</code>
* @return The mK32Isonline.
*/
@java.lang.Override
public int getMK32Isonline() {
return mK32Isonline_;
}
public static final int SYSTEMERROR_FIELD_NUMBER = 6;
private int systemError_ = 0;
/**
* <pre>
* 报错
* </pre>
*
* <code>int32 SystemError = 6;</code>
* @return The systemError.
*/
@java.lang.Override
public int getSystemError() {
return systemError_;
}
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 (leftCompensation_ != 0) {
output.writeInt32(1, leftCompensation_);
}
if (rightCompensation_ != 0) {
output.writeInt32(2, rightCompensation_);
}
if (robotMoveDeriSpeed_ != 0) {
output.writeInt32(3, robotMoveDeriSpeed_);
}
if (robotGyro_ != 0) {
output.writeInt32(4, robotGyro_);
}
if (mK32Isonline_ != 0) {
output.writeInt32(5, mK32Isonline_);
}
if (systemError_ != 0) {
output.writeInt32(6, systemError_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (leftCompensation_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, leftCompensation_);
}
if (rightCompensation_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, rightCompensation_);
}
if (robotMoveDeriSpeed_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, robotMoveDeriSpeed_);
}
if (robotGyro_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, robotGyro_);
}
if (mK32Isonline_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(5, mK32Isonline_);
}
if (systemError_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(6, systemError_);
}
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.swingarmapp.models.BspIV.IV_struct_define)) {
return super.equals(obj);
}
com.example.swingarmapp.models.BspIV.IV_struct_define other = (com.example.swingarmapp.models.BspIV.IV_struct_define) obj;
if (getLeftCompensation()
!= other.getLeftCompensation()) return false;
if (getRightCompensation()
!= other.getRightCompensation()) return false;
if (getRobotMoveDeriSpeed()
!= other.getRobotMoveDeriSpeed()) return false;
if (getRobotGyro()
!= other.getRobotGyro()) return false;
if (getMK32Isonline()
!= other.getMK32Isonline()) return false;
if (getSystemError()
!= other.getSystemError()) 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) + LEFTCOMPENSATION_FIELD_NUMBER;
hash = (53 * hash) + getLeftCompensation();
hash = (37 * hash) + RIGHTCOMPENSATION_FIELD_NUMBER;
hash = (53 * hash) + getRightCompensation();
hash = (37 * hash) + ROBOT_MOVE_DERI_SPEED_FIELD_NUMBER;
hash = (53 * hash) + getRobotMoveDeriSpeed();
hash = (37 * hash) + ROBOT_GYRO_FIELD_NUMBER;
hash = (53 * hash) + getRobotGyro();
hash = (37 * hash) + MK32_ISONLINE_FIELD_NUMBER;
hash = (53 * hash) + getMK32Isonline();
hash = (37 * hash) + SYSTEMERROR_FIELD_NUMBER;
hash = (53 * hash) + getSystemError();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.example.swingarmapp.models.BspIV.IV_struct_define parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.example.swingarmapp.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.swingarmapp.models.BspIV.IV_struct_define parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.example.swingarmapp.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.swingarmapp.models.BspIV.IV_struct_define parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.example.swingarmapp.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.swingarmapp.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.swingarmapp.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.swingarmapp.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.swingarmapp.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.swingarmapp.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.swingarmapp.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.swingarmapp.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<Builder> implements
// @@protoc_insertion_point(builder_implements:IV_struct_define)
com.example.swingarmapp.models.BspIV.IV_struct_defineOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.example.swingarmapp.models.BspIV.internal_static_IV_struct_define_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.example.swingarmapp.models.BspIV.internal_static_IV_struct_define_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.example.swingarmapp.models.BspIV.IV_struct_define.class, com.example.swingarmapp.models.BspIV.IV_struct_define.Builder.class);
}
// Construct using com.example.swingarmapp.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;
leftCompensation_ = 0;
rightCompensation_ = 0;
robotMoveDeriSpeed_ = 0;
robotGyro_ = 0;
mK32Isonline_ = 0;
systemError_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.example.swingarmapp.models.BspIV.internal_static_IV_struct_define_descriptor;
}
@java.lang.Override
public com.example.swingarmapp.models.BspIV.IV_struct_define getDefaultInstanceForType() {
return com.example.swingarmapp.models.BspIV.IV_struct_define.getDefaultInstance();
}
@java.lang.Override
public com.example.swingarmapp.models.BspIV.IV_struct_define build() {
com.example.swingarmapp.models.BspIV.IV_struct_define result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.example.swingarmapp.models.BspIV.IV_struct_define buildPartial() {
com.example.swingarmapp.models.BspIV.IV_struct_define result = new com.example.swingarmapp.models.BspIV.IV_struct_define(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(com.example.swingarmapp.models.BspIV.IV_struct_define result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.leftCompensation_ = leftCompensation_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.rightCompensation_ = rightCompensation_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.robotMoveDeriSpeed_ = robotMoveDeriSpeed_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.robotGyro_ = robotGyro_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.mK32Isonline_ = mK32Isonline_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.systemError_ = systemError_;
}
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.example.swingarmapp.models.BspIV.IV_struct_define) {
return mergeFrom((com.example.swingarmapp.models.BspIV.IV_struct_define)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.example.swingarmapp.models.BspIV.IV_struct_define other) {
if (other == com.example.swingarmapp.models.BspIV.IV_struct_define.getDefaultInstance()) return this;
if (other.getLeftCompensation() != 0) {
setLeftCompensation(other.getLeftCompensation());
}
if (other.getRightCompensation() != 0) {
setRightCompensation(other.getRightCompensation());
}
if (other.getRobotMoveDeriSpeed() != 0) {
setRobotMoveDeriSpeed(other.getRobotMoveDeriSpeed());
}
if (other.getRobotGyro() != 0) {
setRobotGyro(other.getRobotGyro());
}
if (other.getMK32Isonline() != 0) {
setMK32Isonline(other.getMK32Isonline());
}
if (other.getSystemError() != 0) {
setSystemError(other.getSystemError());
}
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: {
leftCompensation_ = input.readInt32();
bitField0_ |= 0x00000001;
break;
} // case 8
case 16: {
rightCompensation_ = input.readInt32();
bitField0_ |= 0x00000002;
break;
} // case 16
case 24: {
robotMoveDeriSpeed_ = input.readInt32();
bitField0_ |= 0x00000004;
break;
} // case 24
case 32: {
robotGyro_ = input.readInt32();
bitField0_ |= 0x00000008;
break;
} // case 32
case 40: {
mK32Isonline_ = input.readInt32();
bitField0_ |= 0x00000010;
break;
} // case 40
case 48: {
systemError_ = input.readInt32();
bitField0_ |= 0x00000020;
break;
} // case 48
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private int leftCompensation_ ;
/**
* <code>int32 LeftCompensation = 1;</code>
* @return The leftCompensation.
*/
@java.lang.Override
public int getLeftCompensation() {
return leftCompensation_;
}
/**
* <code>int32 LeftCompensation = 1;</code>
* @param value The leftCompensation to set.
* @return This builder for chaining.
*/
public Builder setLeftCompensation(int value) {
leftCompensation_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <code>int32 LeftCompensation = 1;</code>
* @return This builder for chaining.
*/
public Builder clearLeftCompensation() {
bitField0_ = (bitField0_ & ~0x00000001);
leftCompensation_ = 0;
onChanged();
return this;
}
private int rightCompensation_ ;
/**
* <code>int32 RightCompensation = 2;</code>
* @return The rightCompensation.
*/
@java.lang.Override
public int getRightCompensation() {
return rightCompensation_;
}
/**
* <code>int32 RightCompensation = 2;</code>
* @param value The rightCompensation to set.
* @return This builder for chaining.
*/
public Builder setRightCompensation(int value) {
rightCompensation_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <code>int32 RightCompensation = 2;</code>
* @return This builder for chaining.
*/
public Builder clearRightCompensation() {
bitField0_ = (bitField0_ & ~0x00000002);
rightCompensation_ = 0;
onChanged();
return this;
}
private int robotMoveDeriSpeed_ ;
/**
* <pre>
* 速度
* </pre>
*
* <code>int32 Robot_Move_Deri_Speed = 3;</code>
* @return The robotMoveDeriSpeed.
*/
@java.lang.Override
public int getRobotMoveDeriSpeed() {
return robotMoveDeriSpeed_;
}
/**
* <pre>
* 速度
* </pre>
*
* <code>int32 Robot_Move_Deri_Speed = 3;</code>
* @param value The robotMoveDeriSpeed to set.
* @return This builder for chaining.
*/
public Builder setRobotMoveDeriSpeed(int value) {
robotMoveDeriSpeed_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
* <pre>
* 速度
* </pre>
*
* <code>int32 Robot_Move_Deri_Speed = 3;</code>
* @return This builder for chaining.
*/
public Builder clearRobotMoveDeriSpeed() {
bitField0_ = (bitField0_ & ~0x00000004);
robotMoveDeriSpeed_ = 0;
onChanged();
return this;
}
private int robotGyro_ ;
/**
* <pre>
* 角度
* </pre>
*
* <code>int32 Robot_Gyro = 4;</code>
* @return The robotGyro.
*/
@java.lang.Override
public int getRobotGyro() {
return robotGyro_;
}
/**
* <pre>
* 角度
* </pre>
*
* <code>int32 Robot_Gyro = 4;</code>
* @param value The robotGyro to set.
* @return This builder for chaining.
*/
public Builder setRobotGyro(int value) {
robotGyro_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
* <pre>
* 角度
* </pre>
*
* <code>int32 Robot_Gyro = 4;</code>
* @return This builder for chaining.
*/
public Builder clearRobotGyro() {
bitField0_ = (bitField0_ & ~0x00000008);
robotGyro_ = 0;
onChanged();
return this;
}
private int mK32Isonline_ ;
/**
* <pre>
* 信号
* </pre>
*
* <code>int32 MK32_Isonline = 5;</code>
* @return The mK32Isonline.
*/
@java.lang.Override
public int getMK32Isonline() {
return mK32Isonline_;
}
/**
* <pre>
* 信号
* </pre>
*
* <code>int32 MK32_Isonline = 5;</code>
* @param value The mK32Isonline to set.
* @return This builder for chaining.
*/
public Builder setMK32Isonline(int value) {
mK32Isonline_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
* <pre>
* 信号
* </pre>
*
* <code>int32 MK32_Isonline = 5;</code>
* @return This builder for chaining.
*/
public Builder clearMK32Isonline() {
bitField0_ = (bitField0_ & ~0x00000010);
mK32Isonline_ = 0;
onChanged();
return this;
}
private int systemError_ ;
/**
* <pre>
* 报错
* </pre>
*
* <code>int32 SystemError = 6;</code>
* @return The systemError.
*/
@java.lang.Override
public int getSystemError() {
return systemError_;
}
/**
* <pre>
* 报错
* </pre>
*
* <code>int32 SystemError = 6;</code>
* @param value The systemError to set.
* @return This builder for chaining.
*/
public Builder setSystemError(int value) {
systemError_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
* <pre>
* 报错
* </pre>
*
* <code>int32 SystemError = 6;</code>
* @return This builder for chaining.
*/
public Builder clearSystemError() {
bitField0_ = (bitField0_ & ~0x00000020);
systemError_ = 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.swingarmapp.models.BspIV.IV_struct_define DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.example.swingarmapp.models.BspIV.IV_struct_define();
}
public static com.example.swingarmapp.models.BspIV.IV_struct_define getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<IV_struct_define>
PARSER = new com.google.protobuf.AbstractParser<IV_struct_define>() {
@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<IV_struct_define> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<IV_struct_define> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.example.swingarmapp.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\"\246\001\n\020IV_struct_define\022\030\n\020L" +
"eftCompensation\030\001 \001(\005\022\031\n\021RightCompensati" +
"on\030\002 \001(\005\022\035\n\025Robot_Move_Deri_Speed\030\003 \001(\005\022" +
"\022\n\nRobot_Gyro\030\004 \001(\005\022\025\n\rMK32_Isonline\030\005 \001" +
"(\005\022\023\n\013SystemError\030\006 \001(\005B\"\n\036com.example.s" +
"wingarmapp.modelsP\000b\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_IV_struct_define_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_IV_struct_define_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_IV_struct_define_descriptor,
new java.lang.String[] { "LeftCompensation", "RightCompensation", "RobotMoveDeriSpeed", "RobotGyro", "MK32Isonline", "SystemError", });
descriptor.resolveAllFeaturesImmutable();
}
// @@protoc_insertion_point(outer_class_scope)
}

1163
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/models/BspPV.java

File diff suppressed because it is too large

50
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/models/DisplayIV.java

@ -0,0 +1,50 @@
package com.example.swingarmapp.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;
}
}

92
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/models/DisplayPV.java

@ -0,0 +1,92 @@
package com.example.swingarmapp.models;
import androidx.databinding.BaseObservable;
public class DisplayPV extends BaseObservable {
private int id;
private int operationMode;
private int parameterCall;
private int swingArmAngle;
private int swingArmSpeed;
private int backDistance;
private int laneChangeDistance;
private int workLength;
private int workWidth;
public DisplayPV(int id, int swingArmAngle, int swingArmSpeed, int backDistance, int laneChangeDistance, int workLength,int workWidth) {
this.id = id;
//this.operationMode = operationMode;
//this.parameterCall = parameterCall;
this.swingArmAngle = swingArmAngle;
this.swingArmSpeed = swingArmSpeed;
this.backDistance = backDistance;
this.laneChangeDistance=laneChangeDistance;
this.workLength=workLength;
this.workWidth=workWidth;
}
public int getId() { return id; }
public void setId(int id) {
this.id = id;
}
public int getOperationMode() { return operationMode; }
public void setOperationMode(int operationMode) {
this.operationMode = operationMode;
}
public int getParameterCall() {
return parameterCall;
}
public void setParameterCall(int parameterCall) {
this.parameterCall = parameterCall;
}
public int getSwingArmAngle() {
return swingArmAngle;
}
public void setSwingArmAngle(int swingArmAngle) {
this.swingArmAngle = swingArmAngle;
}
public int getSwingArmSpeed() {
return swingArmSpeed;
}
public void setSwingArmSpeed(int swingArmSpeed) { this.swingArmSpeed = swingArmSpeed;}
public int getBackDistance() {
return backDistance;
}
public void setBackDistance(int backDistance) {
this.backDistance = backDistance;
}
public int getLaneChangeDistance() {
return laneChangeDistance;
}
public void setLaneChangeDistance(int laneChangeDistance) { this.laneChangeDistance = laneChangeDistance;}
public int getWorkLength() {
return workLength;
}
public void setWorkLength(int workLength) {
this.workLength = workLength;
}
public int getWorkWidth() {
return workWidth;
}
public void setWorkWidth(int workWidth) {
this.workWidth = workWidth;
}
}

26
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/ConvertHelper.java

@ -0,0 +1,26 @@
package com.example.swingarmapp.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();
}
}

22
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/CustomProber.java

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

39
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/LogUtil.java

@ -0,0 +1,39 @@
package com.example.swingarmapp.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);
}
}
}

72
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/ModbusCRC.java

@ -0,0 +1,72 @@
package com.example.swingarmapp.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;
}
}

136
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/MyDataHelper.java

@ -0,0 +1,136 @@
package com.example.swingarmapp.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.swingarmapp.models.DisplayPV;
import java.util.ArrayList;
import java.util.List;
public class MyDataHelper extends SQLiteOpenHelper {
//定义字段
public static final String COLUMN_ID = "id";//参数调用
public static final String TABLE_NAME = "information";
// public static final String COLUMN_OPERATION_MODE = "operationMode";//作业模式
// public static final String COLUMN_PARAMETER_CALL = "parameterCall";//参数调用
public static final String COLUMN_SWING_ARM_ANGLE = "swingArmAngle";//Maintv_swingArmAngleTo32摆臂角度
public static final String COLUMN_SWING_ARM_SPEED = "swingArmSpeed";//Maintv_swingArmSpeedTo32摆臂速度
public static final String COLUMN_BACK_DISTANCE = "backDistance";//Maintv_BackDistanceTo32后退距离
public static final String COLUMN_LANE_CHANGE_DISTANCE = "laneChangeDistance";//换道距离
public static final String COLUMN_WORK_LENGTH = "workLength";//Maintv_WorkLenthTo32作业长度
public static final String COLUMN_WORK_WIDTH = "workWidth";//Maintv_WorkLenthTo32作业宽度
public MyDataHelper(@Nullable Context context) {
super(context, "bingbot.db", null, 1); //数据库名称为 bingbot.db,数据库版本为 1。
}
@Override
public void onCreate(SQLiteDatabase db) {
String sql = "CREATE TABLE " + TABLE_NAME + " (" +
COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
COLUMN_SWING_ARM_ANGLE + " INTEGER, " +
COLUMN_SWING_ARM_SPEED + " INTEGER, " +
COLUMN_BACK_DISTANCE + " INTEGER, " +
COLUMN_LANE_CHANGE_DISTANCE + " INTEGER, " +
COLUMN_WORK_LENGTH + " INTEGER, " +
COLUMN_WORK_WIDTH + " INTEGER);";
db.execSQL(sql); //执行sql语句
// (int id, int leftCompSelect, int rightCompSelect, int speedSelect, int laneChangeSelect, int endForceValue)
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
onCreate(db);
}
//增 删 改 查
public String addOrUpdateDisplayData(DisplayPV pv) {
ContentValues cv = new ContentValues(); //键值对的类
cv.put(COLUMN_ID, pv.getId());
cv.put(COLUMN_SWING_ARM_ANGLE, pv.getSwingArmAngle());
cv.put(COLUMN_SWING_ARM_SPEED, pv.getSwingArmSpeed());
cv.put(COLUMN_BACK_DISTANCE, pv.getBackDistance());
cv.put(COLUMN_LANE_CHANGE_DISTANCE, pv.getLaneChangeDistance());
cv.put(COLUMN_WORK_LENGTH, pv.getWorkLength());
cv.put(COLUMN_WORK_WIDTH, pv.getWorkWidth());
SQLiteDatabase sqliteDatabase = this.getWritableDatabase();//获取数据库实例以实现增上查改等,如果没有就新建 并把sqliteDatabase作为参数传给oncreate方法
long insert = sqliteDatabase.insertWithOnConflict(TABLE_NAME, 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 IntializeDataBase()
{
for (int i=1;i<6;i++)
{
List<DisplayPV> list =getDisplayData(i);
if (list.size()==0)
{
DisplayPV pv = new DisplayPV(i,0,0,0,100,0,0);
addOrUpdateDisplayData(pv);
}
}
}
public List<DisplayPV> getDisplayData(int id) { //初始化
List<DisplayPV> list = new ArrayList<>();
String sql = "SELECT * FROM " + TABLE_NAME + " WHERE " + COLUMN_ID + " = " + String.valueOf(id);
SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();//获取可写数据库实例
Cursor cursor = sqLiteDatabase.rawQuery(sql, null); //按id查询
int idIndex = cursor.getColumnIndex(COLUMN_ID);
int _swingArmAngleIndex = cursor.getColumnIndex(COLUMN_SWING_ARM_ANGLE);
int _swingArmSpeedIndex = cursor.getColumnIndex(COLUMN_SWING_ARM_SPEED);
int _backDistanceIndex = cursor.getColumnIndex(COLUMN_BACK_DISTANCE);
int _laneChangeDistanceIndex = cursor.getColumnIndex(COLUMN_LANE_CHANGE_DISTANCE);
int _workLengthIndex = cursor.getColumnIndex(COLUMN_WORK_LENGTH);
int _workWidthIndex = cursor.getColumnIndex(COLUMN_WORK_WIDTH);
while (cursor.moveToNext()) {
DisplayPV pv = new DisplayPV(cursor.getInt(idIndex),
cursor.getInt(_swingArmAngleIndex), cursor.getInt(_swingArmSpeedIndex), cursor.getInt(_backDistanceIndex),
cursor.getInt(_laneChangeDistanceIndex),cursor.getInt(_workLengthIndex),cursor.getInt(_workWidthIndex)
);
list.add(pv);
}
cursor.close();
sqLiteDatabase.close();
return list;
}
}

443
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/PopupHelper.java

@ -0,0 +1,443 @@
package com.example.swingarmapp.services;
import android.app.Dialog;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Toast;
import com.example.swingarmapp.MainActivity;
import com.example.swingarmapp.R;
import com.example.swingarmapp.models.DisplayPV;
import java.util.List;
public class PopupHelper {
private MainActivity mainActivity;
public PopupHelper(MainActivity mainActivity)
{
this.mainActivity = mainActivity;
}
public void OperationModePopup(View.OnClickListener context) {
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.operationmodepopup); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// 获取布局中的视图
Button cancelButton = dialog.findViewById(R.id.operationModeCancel);
Button confirmButton = dialog.findViewById(R.id.operationModeApply);
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.operationSelectorGroup);
RadioGroup radioGroup2 = (RadioGroup) dialog.findViewById(R.id.operationSelector2Group);
//四种模式
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
RadioButton radioButton = (RadioButton) group.findViewById(checkedId);
mainActivity._operation_Mode_Call_Value = radioButton.getText().toString();
}
});
radioGroup2.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
RadioButton radioButton = (RadioButton) group.findViewById(checkedId);
mainActivity.WorkMode_Call_Value = radioButton.getText().toString();
}
});
String ii= mainActivity.mainBinding.operationModeDisplay.getText().toString();
String workmode = mainActivity.WorkMode_Call_Value;
switch (ii)
{
case "手动": { radioGroup.check(R.id.rb_four);
break;
}
case "水平": { radioGroup.check(R.id.rb_one);
break;
}
case "竖直": { radioGroup.check(R.id.rb_two);
break;
}
case "反底": { radioGroup.check(R.id.rb_three);
break;
}
}
switch (workmode)
{
case "边打边退": { radioGroup2.check(R.id.rb_five);
break;
}
case "打退交替": { radioGroup2.check(R.id.rb_six);
break;
}
}
// 设置确定按钮点击事件
confirmButton.setOnClickListener(v -> {
mainActivity.mainBinding.operationModeDisplay.setText(mainActivity._operation_Mode_Call_Value);
//读取数据库,并对其他控件进行赋值
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 设置取消按钮点击事件
cancelButton.setOnClickListener(v -> {
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
dialog.show(); // 显示弹窗
}
public void ParametersCallPopup(View.OnClickListener context) {
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.parameters_call); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// 获取布局中的视图
Button cancelButton = dialog.findViewById(R.id.parametersCancel);
Button confirmButton = dialog.findViewById(R.id.parametersApply);
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.parameters_call_group);
Integer ii= ConvertHelper.convertEditTextToInt(mainActivity.mainBinding.MaintvParameterCallTo32);
switch (ii)
{
case 1: { radioGroup.check(R.id.rb_one);
break;
}
case 2: { radioGroup.check(R.id.rb_two);
break;
}
case 3: { radioGroup.check(R.id.rb_three);
break;
}
case 4: { radioGroup.check(R.id.rb_four);
break;
}
case 5: { radioGroup.check(R.id.rb_five);
break;
}
}
dialog.show(); // 显示弹窗
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
RadioButton radioButton = (RadioButton) group.findViewById(checkedId);
String result = radioButton.getText().toString();
mainActivity._parameters_Call_Value = result;
}
});
// 设置确定按钮点击事件
confirmButton.setOnClickListener(v -> {
mainActivity.mainBinding.MaintvParameterCallTo32.setText(mainActivity._parameters_Call_Value);//把主界面改了
//读取数据
int paraIndex = Integer.parseInt(mainActivity._parameters_Call_Value);
List<DisplayPV> pvList = mainActivity.myDataHelper.getDisplayData(paraIndex);//从数据库中读,,并对其他控件进行赋值
mainActivity.mainBinding.MaintvSwingArmAngleTo32.setText(String.valueOf(pvList.get(0).getSwingArmAngle()));
mainActivity.mainBinding.MaintvSwingArmSpeedTo32.setText(String.valueOf(pvList.get(0).getSwingArmSpeed()));
mainActivity.mainBinding.MaintvBackDistanceTo32.setText(String.valueOf(pvList.get(0).getBackDistance()));
mainActivity.mainBinding.MaintvLaneChangeDistanceTo32.setText(String.valueOf(pvList.get(0).getLaneChangeDistance()));
mainActivity.mainBinding.MaintvWorkLenthTo32.setText(String.valueOf(pvList.get(0).getWorkLength()));
mainActivity.mainBinding.MaintvWorkWidthTo32.setText(String.valueOf(pvList.get(0).getWorkWidth()));
//读取数据库,并对其他控件进行赋值
Toast.makeText(mainActivity, "调用成功", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 设置取消按钮点击事件
cancelButton.setOnClickListener(v -> {
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
}
public void SingArmAngleSetPopUp(View.OnClickListener context) {
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.swingarmanglepopup); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// 获取布局中的视图
Button cancelButton = dialog.findViewById(R.id.swingangleCancel);
Button confirmButton = dialog.findViewById(R.id.swingangleApply);
EditText swingangleEditText = dialog.findViewById(R.id.swingangle_input);
swingangleEditText.setText(mainActivity.mainBinding.MaintvSwingArmAngleTo32.getText());
dialog.show(); // 显示弹窗
// 设置取消按钮点击事件
cancelButton.setOnClickListener(v -> {
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 设置确定按钮点击事件
confirmButton.setOnClickListener(v -> {
String swingangle = swingangleEditText.getText().toString();
if(swingangle.equals(""))
{
dialog.dismiss(); // 关闭弹窗
return;
}
int _tempValue = Integer.parseInt(swingangle);
if (_tempValue <= 180 && _tempValue >= 0) {
mainActivity.mainBinding.MaintvSwingArmAngleTo32.setText(String.valueOf(_tempValue));//改
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(mainActivity, "输入数据不应大于180或者小于0", Toast.LENGTH_SHORT).show();
}
dialog.dismiss(); // 关闭对话框
});
}
public void SingArmSpeedSetPopUp(View.OnClickListener context) {
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.swingarmspeedpopup); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// 获取布局中的视图
Button cancelButton = dialog.findViewById(R.id.swingspeedCancel);
Button confirmButton = dialog.findViewById(R.id.swingspeedApply);
EditText swingspeedEditText = dialog.findViewById(R.id.swingspeed_input);
swingspeedEditText.setText(mainActivity.mainBinding.MaintvSwingArmSpeedTo32.getText());//改
dialog.show(); // 显示弹窗
// 设置取消按钮点击事件
cancelButton.setOnClickListener(v -> {
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 设置确定按钮点击事件
confirmButton.setOnClickListener(v -> {
String swingspeed = swingspeedEditText.getText().toString();
if(swingspeed.equals(""))
{
dialog.dismiss(); // 关闭弹窗
return;
}
int _tempValue = Integer.parseInt(swingspeed);
if (_tempValue <= 90 && _tempValue >= 0) {
mainActivity.mainBinding.MaintvSwingArmSpeedTo32.setText(String.valueOf(_tempValue));//改
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(mainActivity, "输入数据不应大于90或者小于0", Toast.LENGTH_SHORT).show();
}
dialog.dismiss(); // 关闭对话框
});
}
public void LaneChangeDistanceSetPopup(View.OnClickListener context) {
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.lanechangepopup); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// 获取布局中的视图
Button cancelButton = dialog.findViewById(R.id.laneChangeDistanceCancel);
Button confirmButton = dialog.findViewById(R.id.laneChangeDistanceApply);
EditText landeChangeDistanceEditText = dialog.findViewById(R.id.laneChangeDistance_input);
landeChangeDistanceEditText.setText(mainActivity.mainBinding.MaintvLaneChangeDistanceTo32.getText());
// 设置取消按钮点击事件
cancelButton.setOnClickListener(v -> {
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 设置确定按钮点击事件
confirmButton.setOnClickListener(v -> {
String laneChangeDistance = landeChangeDistanceEditText.getText().toString();
if(laneChangeDistance.equals(""))
{
dialog.dismiss(); // 关闭弹窗
return;
}
Integer _tempValue = Integer.parseInt(laneChangeDistance);
if (_tempValue <= 1000 && _tempValue >= 0)
{
mainActivity.mainBinding.MaintvLaneChangeDistanceTo32.setText(String.valueOf(_tempValue));
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(mainActivity, "输入数据不应大于1000或者小于0", Toast.LENGTH_SHORT).show();
}
dialog.dismiss(); // 关闭弹窗
});
dialog.show(); // 显示弹窗
}
public void BackDistanceSetPopup(View.OnClickListener context) {
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.backdistancepopup); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// 获取布局中的视图
Button cancelButton = dialog.findViewById(R.id.backDistanceCancel);
Button confirmButton = dialog.findViewById(R.id.backDistanceApply);
EditText backdistanceEditText = dialog.findViewById(R.id.backDistance_input);
backdistanceEditText.setText(mainActivity.mainBinding.MaintvBackDistanceTo32.getText());
// 设置取消按钮点击事件
cancelButton.setOnClickListener(v -> {
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 设置确定按钮点击事件
confirmButton.setOnClickListener(v -> {
String backDistance = backdistanceEditText.getText().toString();
if(backDistance.equals(""))
{
dialog.dismiss(); // 关闭弹窗
return;
}
Integer _tempValue = Integer.parseInt(backDistance);
if (_tempValue <= 100 && _tempValue >= 0)
{
mainActivity.mainBinding.MaintvBackDistanceTo32.setText(String.valueOf(_tempValue));
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(mainActivity, "输入数据不应大于100或者小于0", Toast.LENGTH_SHORT).show();
}
dialog.dismiss(); // 关闭弹窗
});
dialog.show(); // 显示弹窗
}
public void WorkLengthSetPopUp(View.OnClickListener context) {
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.worklengthpopup); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// 获取布局中的视图
Button cancelButton = dialog.findViewById(R.id.workLengthCancel);
Button confirmButton = dialog.findViewById(R.id.workLengthApply);
EditText inputEditText = dialog.findViewById(R.id.workLength_input);
inputEditText.setText(mainActivity.mainBinding.MaintvWorkLenthTo32.getText());
// 设置取消按钮点击事件
cancelButton.setOnClickListener(v -> {
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 设置确定按钮点击事件
confirmButton.setOnClickListener(v -> {
String inputValueStr = inputEditText.getText().toString();
if(inputValueStr.equals(""))
{
dialog.dismiss(); // 关闭弹窗
return;
}
int _tempValue = Integer.parseInt(inputValueStr);
if (_tempValue <= 200 && _tempValue >= 0)
{
mainActivity.mainBinding.MaintvWorkLenthTo32.setText(String.valueOf(_tempValue));
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(mainActivity, "输入数据不应大于200或者小于0", Toast.LENGTH_SHORT).show();
}
dialog.dismiss(); // 关闭弹窗
});
dialog.show(); // 显示弹窗
}
public void WorkWidthSetPopUp(View.OnClickListener context) {
Dialog dialog = new Dialog(mainActivity);
dialog.setContentView(R.layout.workwidthpopup); // 设置自定义布局
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
// 获取布局中的视图
Button cancelButton = dialog.findViewById(R.id.workWidthCancel);
Button confirmButton = dialog.findViewById(R.id.workWidthApply);
EditText inputEditText = dialog.findViewById(R.id.workWidth_input);
inputEditText.setText(mainActivity.mainBinding.MaintvWorkWidthTo32.getText());
// 设置取消按钮点击事件
cancelButton.setOnClickListener(v -> {
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show();
dialog.dismiss(); // 关闭弹窗
});
// 设置确定按钮点击事件
confirmButton.setOnClickListener(v -> {
String inputValueStr = inputEditText.getText().toString();
if(inputValueStr.equals(""))
{
dialog.dismiss(); // 关闭弹窗
return;
}
int _tempValue = Integer.parseInt(inputValueStr);
if (_tempValue <= 200 && _tempValue >= 0)
{
mainActivity.mainBinding.MaintvWorkWidthTo32.setText(String.valueOf(_tempValue));
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(mainActivity, "输入数据不应大于200或者小于0", Toast.LENGTH_SHORT).show();
}
dialog.dismiss(); // 关闭弹窗
});
dialog.show(); // 显示弹窗
}
}

63
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/RobotDataHanlder.java

@ -0,0 +1,63 @@
package com.example.swingarmapp.services;
import com.example.swingarmapp.models.BspIV;
import com.example.swingarmapp.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);
}
}

402
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/USBSerialPortHelper.java

@ -0,0 +1,402 @@
package com.example.swingarmapp.services;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbManager;
import android.os.Build;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Looper;
import androidx.core.content.ContextCompat;
import com.example.swingarmapp.BuildConfig;
import com.example.swingarmapp.MainActivity;
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 com.example.swingarmapp.models.BspIV;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class USBSerialPortHelper implements SerialInputOutputManager.Listener {
public USBSerialPortHelper(MainActivity mainActivity)
{
this.MainActivity=mainActivity;
}
private MainActivity MainActivity;
//sserial port part start
private enum UsbPermission {Unknown, Requested, Granted, Denied}
private final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB";
// <usb-device vendor-id="4292" product-id="60000" /> <!-- 0xea60: CP2102 and other CP210x single port devices -->
// <usb-device vendor-id="4292" product-id="60016" /> <!-- 0xea70: CP2105 -->
// <usb-device vendor-id="4292" product-id="60017" /> <!-- 0xea71: CP2108 -->
private int deviceId = 60000;
private int deviceId_test = 60000;
private int portNum;
private final int WRITE_WAIT_MILLIS = 500;
private final int READ_WAIT_MILLIS = 100;
private String PortNameContians = "SILICON";/**/
// private static String PortNameContians="FTD";
private int baudRate = 57600;
private boolean withIoManager = true;
private BroadcastReceiver broadcastReceiver;
private Handler mainLooper;
private SerialInputOutputManager usbIoManager;
private UsbSerialPort usbSerialPort;
private UsbPermission usbPermission = UsbPermission.Unknown;
private boolean connected = false;
public void intialize() {
broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (INTENT_ACTION_GRANT_USB.equals(intent.getAction())) {
usbPermission = intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false) ? UsbPermission.Granted : UsbPermission.Denied;
connect();
}
}
};
mainLooper = new Handler(Looper.getMainLooper());
_receiveBufferlist = new ArrayList<Byte>();
}
/*
* Serial
*/
@Override
public void onNewData(byte[] data) {
// status("new data");
mainLooper.post(() -> {
receive(data);
// receive data
});
}
@Override
public void onRunError(Exception e) {
mainLooper.post(() -> {
// status("connection lost: " + e.getMessage());
disconnect();
});
}
/*
* Serial + UI
*/
public void connect() {
UsbDevice device = null;
UsbManager usbManager = (UsbManager) MainActivity.getSystemService(Context.USB_SERVICE);
for (UsbDevice v : usbManager.getDeviceList().values()) {
// status(v.getManufacturerName().toUpperCase());
if (v.getManufacturerName().toUpperCase().contains(PortNameContians)) {
device = v;
break;
}
}
if (device == null) {
// _serialPortSwitch.setChecked(false);
// status("找不到设备");
return;
}
UsbSerialDriver driver = UsbSerialProber.getDefaultProber().probeDevice(device);
if (driver == null) {
driver = CustomProber.getCustomProber().probeDevice(device);
}
if (driver == null) {
// _serialPortSwitch.setChecked(false);
// status("无驱动");
return;
}
if (driver.getPorts().size() < portNum) //就是0 cp2102 或者同一个驱动,第一个
{
//status("connection failed: not enough ports at device");
//status("找不到设备");
return;
}
usbSerialPort = driver.getPorts().get(portNum);
UsbDeviceConnection usbConnection = usbManager.openDevice(driver.getDevice());
if (usbConnection == null && usbPermission == UsbPermission.Unknown && !usbManager.hasPermission(driver.getDevice())) {
usbPermission = UsbPermission.Requested;
int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_MUTABLE : 0;
Intent intent = new Intent(INTENT_ACTION_GRANT_USB);
intent.setPackage(MainActivity.getPackageName());
PendingIntent usbPermissionIntent = PendingIntent.getBroadcast(MainActivity, 0, intent, flags);
usbManager.requestPermission(driver.getDevice(), usbPermissionIntent);
return;
}
if (usbConnection == null) {
if (!usbManager.hasPermission(driver.getDevice())) {
// status("connection failed: permission denied");
} else {
// status("connection failed: open failed");
}
return;
}
try {
usbSerialPort.open(usbConnection);
try {
usbSerialPort.setParameters(baudRate, 8, 1, UsbSerialPort.PARITY_NONE);
// status("connected: ");
} catch (UnsupportedOperationException e) {
//status("unsupport setparameters");
}
if (withIoManager) {
usbIoManager = new SerialInputOutputManager(usbSerialPort, this);
usbIoManager.setReadBufferSize(40960);
usbIoManager.setReadTimeout(READ_WAIT_MILLIS);
usbIoManager.start();
}
//status("connected");
connected = true;
// _serialPortSwitch.setChecked(true);
//switch set true
} catch (Exception e) {
// status("connection failed: " + e.getMessage());
disconnect();
}
}
private void disconnect() {
connected = false;
if (usbIoManager != null) {
usbIoManager.setListener(null);
usbIoManager.stop();
}
usbIoManager = null;
try {
usbSerialPort.close();
} catch (IOException ignored) {
}
usbSerialPort = null;
}
List<Byte> _receiveBufferlist;
private static byte[] listTobyte(List<Byte> list) {
if (list == null || list.size() < 0) return null;
byte[] bytes = new byte[list.size()];
int i = 0;
Iterator<Byte> 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();
}
}
void status(String str) {
MainActivity.mainBinding.errorTextView.setText(str);
}
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) )
{
// status("verified");
byte[] bytes = new byte[data.length - 4];
System.arraycopy(data, 2, bytes, 0, data.length - 4);
// status("verified1");
BspIV.IV_struct_define _toReceiveIV=BspIV.IV_struct_define.parseFrom(bytes);
// status(bytesToHex(bytes));
if (_toReceiveIV!=null)
{
MainActivity.mainBinding.tvSpeedFrom32.setText(String.valueOf((double)_toReceiveIV.getRobotMoveDeriSpeed()/10));
MainActivity.mainBinding.tvAngleFrom32.setText(String.valueOf((double)_toReceiveIV.getRobotGyro()/100));
MainActivity.mainBinding.tvLCompensationFrom32.setText(String.valueOf((double)_toReceiveIV.getLeftCompensation()/100));
MainActivity.mainBinding.tvRCopmpensationFrom32.setText(String.valueOf(((double) _toReceiveIV.getRightCompensation()/100)));
switch (_toReceiveIV.getSystemError())
{
case 1:
MainActivity.showError("错误1");
break;
case 2:
MainActivity.showError("错误2");
break;
case 3:
MainActivity.showError("错误3");
break;
case 4:
MainActivity.showError("错误4");
break;
case 5:
MainActivity.showError("错误5");
break;
case 6:
MainActivity.showError("错误6");
break;
}
if(_toReceiveIV.getMK32Isonline()==0)
{
MainActivity.mainBinding.tvSignal.setText("断开");
}
else if(_toReceiveIV.getMK32Isonline()==1)
{
MainActivity.mainBinding.tvSignal.setText("已连接");
}
}else
{
// status("null");
}
}else
{
}
}else
{
//status("crc failed");
}
} catch (Exception e) {
}
}
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(MainActivity, broadcastReceiver, new IntentFilter(INTENT_ACTION_GRANT_USB), ContextCompat.RECEIVER_NOT_EXPORTED);
//status("onStart");
}
public void onStop() {
MainActivity.unregisterReceiver(broadcastReceiver);
// status("onStop");
}
public void onResume() {
if (!connected && (usbPermission == UsbPermission.Unknown || usbPermission == UsbPermission.Granted)) {
mainLooper.post(this::connect);
}
}
public void onPause() {
if (connected) {
// status("串口断开");
// _serialPortSwitch.setChecked(false);
disconnect();
}
}
public void SendData(byte[] data) {
if (connected) {
try {
usbSerialPort.write(data, WRITE_WAIT_MILLIS);
} catch (IOException e)
{
// status("Send Failed");
connected = false;
}
}
else {
//status("usb serialport disconnected");
}
}
}

27
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/services/VideoPlayerHelper.java

@ -0,0 +1,27 @@
package com.example.swingarmapp.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();
}
}

11
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/com/example/swingarmapp/viewmodels/MainViewModel.java

@ -0,0 +1,11 @@
package com.example.swingarmapp.viewmodels;
import androidx.lifecycle.ViewModel;
public class MainViewModel extends ViewModel {
public MainViewModel() {
}
}

2
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/generate_java.bat

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

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/java/protoc.exe

Binary file not shown.

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/baibi_back.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/bgr.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/bigackground.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

10
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/border.xml

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

24
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/borderblue.xml

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

24
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/borderbluegreen.xml

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

24
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/borderorange.xml

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

24
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/borderwhite.xml

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

24
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/buttonborderwhite.xml

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

14
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/dash_line.xml

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

170
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/ic_launcher_background.xml

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

30
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/ic_launcher_foreground.xml

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

11
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/radio_button_selected.xml

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

8
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/radio_button_textcolor.xml

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

9
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/radio_button_unselected.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充 -->
<!-- <solid android:color="@color/bgrgreen" />-->
<stroke android:width="4px" android:color="@color/grey"/>
<!-- 圆角 -->
<corners android:radius="5dp" />
</shape>

5
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/radiobutton_background.xml

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

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/smallbackground.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/drawable/squrelogo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

791
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/activity_main.xml

@ -0,0 +1,791 @@
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".MainActivity">
<!--根布局-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:background="@drawable/baibi_back"
android:orientation="vertical">
<!--上半框-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="7"
android:layout_margin="4dp"
android:orientation="vertical">
<!--上框参数设定区域-->
<!-- 第一行,3个帧布局-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<!-- 第一行,第1个帧布局-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<!--机器人信号-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="left"
android:text="信号:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_signal"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="断开"
android:textColor="@color/dark_ink_blue"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="left|center"
android:text="作业模式:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/operationModeDisplay"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="手动"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
<Button
android:id="@+id/setOperationModeBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="4"
android:gravity="left|center"
android:text="参数调用:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/Maintv_ParameterCallTo32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="1"
android:textColor="@color/blue_green"
android:textSize="13dp"
android:textStyle="bold" />
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center"
android:text=""
android:textColor="@color/blue_green"
android:textSize="20dp" />
</LinearLayout>
<Button
android:id="@+id/setcallParametersBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
</LinearLayout>
<!--第二行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<!--机器人角度-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="left|center"
android:text="角度:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvAngleFrom32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="5.00"
android:textColor="@color/dark_ink_blue"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="°"
android:textColor="@color/dark_ink_blue"
android:textSize="20dp" />
</LinearLayout>
</FrameLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:gravity="left|center"
android:text="摆臂角度:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/Maintv_swingArmAngleTo32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="120"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="°"
android:textColor="@color/blue_green"
android:textSize="20dp" />
</LinearLayout>
<Button
android:id="@+id/setswingArmAngleBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:gravity="left|center"
android:text="摆臂速度:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/Maintv_swingArmSpeedTo32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="0.5"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="°/s"
android:textColor="@color/blue_green"
android:textSize="20dp" />
</LinearLayout>
<Button
android:id="@+id/setswingArmSpeedBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
</LinearLayout>
<!--第三行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<!--1-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<!--机器人速度-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="left|center"
android:text="速度:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_speedFrom32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="111"
android:textColor="@color/dark_ink_blue"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="m/min"
android:textColor="@color/dark_ink_blue"
android:textSize="10dp" />
</LinearLayout>
</FrameLayout>
<!--2-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:gravity="left|center"
android:text="后退距离:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/Maintv_BackDistanceTo32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="25"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="cm"
android:textColor="@color/blue_green"
android:textSize="20dp" />
</LinearLayout>
<Button
android:id="@+id/setBackDistanceBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
<!--3-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:gravity="left|center"
android:text="换道距离:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/Maintv_LaneChangeDistanceTo32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="25"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="cm"
android:textColor="@color/blue_green"
android:textSize="20dp" />
</LinearLayout>
<Button
android:id="@+id/setLaneChangeDistanceBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
</LinearLayout>
<!--第四行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<!--第四行 1-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<!--机器人左补偿-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="left|center"
android:text="左补偿:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_LCompensationFrom32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="0.66"
android:textColor="@color/dark_ink_blue"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="°"
android:textColor="@color/dark_ink_blue"
android:textSize="20dp" />
</LinearLayout>
</FrameLayout>
<!--第四行 2-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:gravity="left|center"
android:text="作业长度:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/Maintv_WorkLenthTo32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="10"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="m"
android:textColor="@color/blue_green"
android:textSize="20dp" />
</LinearLayout>
<Button
android:id="@+id/setWorkLenthBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
<!--第四行 3-->
<FrameLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="4dp"
android:layout_weight="1"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="2"
android:gravity="left|center"
android:text="作业宽度:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/Maintv_WorkWidthTo32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="10"
android:textColor="@color/blue_green"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="50dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="m"
android:textColor="@color/blue_green"
android:textSize="20dp" />
</LinearLayout>
<Button
android:id="@+id/setWorkWidthBtn"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/trasnparent"
android:textAlignment="center" />
</FrameLayout>
</LinearLayout>
<!--第五行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<!--机器人右补偿-->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_margin="4dp"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="left|center"
android:text="右补偿:"
android:textColor="@color/dark_ink_blue"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_RCopmpensationFrom32"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="0.66"
android:textColor="@color/dark_ink_blue"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:layout_width="30dp"
android:layout_height="match_parent"
android:gravity="center"
android:text="°"
android:textColor="@color/dark_ink_blue"
android:textSize="20dp" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="4dp"
android:background="@color/white">
<Button
android:id="@+id/saveParametersBtn"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:background="@color/trasnparent"
android:text="参数保存"
android:textAlignment="center"
android:textColor="@color/blue_green"
android:textSize="15dp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="4dp"
android:background="@color/white">
<Button
android:id="@+id/clearParametersBtn"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:background="@color/trasnparent"
android:text="参数清除"
android:textAlignment="center"
android:textColor="@color/blue_green"
android:textSize="15dp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!--Bottom View-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="4dp"
android:orientation="horizontal"
android:layout_weight="1"
android:background="@drawable/border">
<TextView
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_margin="4dp"
android:gravity="center"
android:background="@color/white"
android:text="报错信息"
android:textColor="@color/blue"
android:textStyle="bold"/>
<TextView
android:id="@+id/error_text_view"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_margin="4dp"
android:gravity="center"
android:layout_weight="1"
android:background="@color/white"
android:text="无"
android:textColor="@color/blue"
android:textStyle="bold"/>
</LinearLayout>
</LinearLayout>
</layout>

109
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/backdistancepopup.xml

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="600dp"
android:layout_height="360dp"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="40dp"
android:letterSpacing="0.5"
android:text="后退距离"
android:textColor="@color/dark_ink_blue"
android:textSize="40sp"
android:textStyle="bold">
</TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:layout_marginTop="0dp"
android:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/backDistance_input"
android:inputType="number"
android:background="@drawable/borderbluegreen"
android:layout_width="200dp"
android:textColor="@color/blue_green"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:textSize="40sp">
</EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="cm"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="40dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderbluegreen">
<Button
android:id="@+id/backDistanceApply"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:padding="4dp"
android:background="@color/trasnparent"
android:text="确定"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderorange">
<Button
android:id="@+id/backDistanceCancel"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@color/trasnparent"
android:text="取消"
android:padding="4dp"
android:textColor="#ed7041"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>

109
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/lanechangepopup.xml

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="600dp"
android:layout_height="360dp"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="40dp"
android:letterSpacing="0.5"
android:text="换道距离"
android:textColor="@color/dark_ink_blue"
android:textSize="40sp"
android:textStyle="bold">
</TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:layout_marginTop="0dp"
android:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/laneChangeDistance_input"
android:inputType="number"
android:background="@drawable/borderbluegreen"
android:layout_width="200dp"
android:textColor="@color/blue_green"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:textSize="40sp">
</EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="cm"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="40dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderbluegreen">
<Button
android:id="@+id/laneChangeDistanceApply"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:padding="4dp"
android:background="@color/trasnparent"
android:text="确定"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderorange">
<Button
android:id="@+id/laneChangeDistanceCancel"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@color/trasnparent"
android:text="取消"
android:padding="4dp"
android:textColor="#ed7041"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>

208
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/operationmodepopup.xml

@ -0,0 +1,208 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="600dp"
android:layout_height="360dp"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="25dp"
android:letterSpacing="0.5"
android:text="作业模式"
android:textColor="@color/dark_ink_blue"
android:textSize="40sp"
android:textStyle="bold">
</TextView>
<!--第一行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal">
<RadioGroup
android:id="@+id/operationSelectorGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rb_one"
android:button="@null"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:background="@drawable/radiobutton_background"
android:layout_marginLeft="20dp"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:checked="true"
android:padding="10dp"
android:textSize="30sp"
android:text="水平" />
<RadioButton
android:id="@+id/rb_two"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:gravity="center"
android:padding="10dp"
android:text="竖直"
android:textColor="@drawable/radio_button_textcolor"
android:textSize="30sp"
android:textStyle="bold" />
<RadioButton
android:id="@+id/rb_three"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:layout_marginLeft="10dp"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:padding="10dp"
android:textSize="30sp"
android:text="反底" />
<RadioButton
android:id="@+id/rb_four"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:layout_marginLeft="10dp"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:padding="10dp"
android:textSize="30sp"
android:text="手动" />
</RadioGroup>
</LinearLayout>
<!--第二行-->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginTop="5dp">
<RadioGroup
android:id="@+id/operationSelector2Group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rb_five"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:layout_marginLeft="10dp"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:padding="10dp"
android:textSize="30sp"
android:text="边打边退"
android:visibility="gone"
/>
<RadioButton
android:id="@+id/rb_six"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:layout_marginLeft="10dp"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:padding="10dp"
android:textSize="30sp"
android:text="打退交替"
android:visibility="gone"
/>
</RadioGroup>
</LinearLayout>
<!--第三行-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/borderbluegreen">
<Button
android:id="@+id/operationModeApply"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@color/trasnparent"
android:padding="4dp"
android:text="确定"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/borderorange">
<Button
android:id="@+id/operationModeCancel"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@color/trasnparent"
android:padding="4dp"
android:text="取消"
android:textColor="#ed7041"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>

168
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/parameters_call.xml

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="600dp"
android:layout_height="360dp"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="40dp"
android:letterSpacing="0.5"
android:text="参数调用"
android:textColor="@color/dark_ink_blue"
android:textSize="40sp"
android:textStyle="bold">
</TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:layout_marginTop="0dp"
android:gravity="center"
android:orientation="horizontal">
<RadioGroup
android:id="@+id/parameters_call_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rb_one"
android:button="@null"
android:layout_width="80dp"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:background="@drawable/radiobutton_background"
android:layout_marginLeft="20dp"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:checked="true"
android:padding="10dp"
android:textSize="50sp"
android:text="1" />
<RadioButton
android:id="@+id/rb_two"
android:layout_width="80dp"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:layout_marginLeft="10dp"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:padding="10dp"
android:textSize="50sp"
android:text="2" />
<RadioButton
android:id="@+id/rb_three"
android:layout_width="80dp"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:layout_marginLeft="10dp"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:padding="10dp"
android:textSize="50sp"
android:text="3" />
<RadioButton
android:id="@+id/rb_four"
android:layout_width="80dp"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:layout_marginLeft="10dp"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:padding="10dp"
android:textSize="50sp"
android:text="4" />
<RadioButton
android:id="@+id/rb_five"
android:layout_width="80dp"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:background="@drawable/radiobutton_background"
android:button="@null"
android:layout_marginLeft="10dp"
android:textColor="@drawable/radio_button_textcolor"
android:gravity="center"
android:textStyle="bold"
android:padding="10dp"
android:textSize="50sp"
android:text="5" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="40dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderbluegreen">
<Button
android:id="@+id/parametersApply"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:padding="4dp"
android:background="@color/trasnparent"
android:text="确定"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderorange">
<Button
android:id="@+id/parametersCancel"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@color/trasnparent"
android:text="取消"
android:padding="4dp"
android:textColor="#ed7041"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>

109
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/swingarmanglepopup.xml

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="600dp"
android:layout_height="360dp"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="40dp"
android:letterSpacing="0.5"
android:text="摆臂角度"
android:textColor="@color/dark_ink_blue"
android:textSize="40sp"
android:textStyle="bold">
</TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:layout_marginTop="0dp"
android:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/swingangle_input"
android:inputType="number"
android:background="@drawable/borderbluegreen"
android:layout_width="200dp"
android:textColor="@color/blue_green"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:textSize="40sp">
</EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="°"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="40dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderbluegreen">
<Button
android:id="@+id/swingangleApply"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:padding="4dp"
android:background="@color/trasnparent"
android:text="确定"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderorange">
<Button
android:id="@+id/swingangleCancel"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@color/trasnparent"
android:text="取消"
android:padding="4dp"
android:textColor="#ed7041"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>

109
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/swingarmspeedpopup.xml

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="600dp"
android:layout_height="360dp"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="40dp"
android:letterSpacing="0.5"
android:text="摆臂速度"
android:textColor="@color/dark_ink_blue"
android:textSize="40sp"
android:textStyle="bold">
</TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:layout_marginTop="0dp"
android:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/swingspeed_input"
android:inputType="number"
android:background="@drawable/borderbluegreen"
android:layout_width="200dp"
android:textColor="@color/blue_green"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:textSize="40sp">
</EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="°/s"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="40dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderbluegreen">
<Button
android:id="@+id/swingspeedApply"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:padding="4dp"
android:background="@color/trasnparent"
android:text="确定"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderorange">
<Button
android:id="@+id/swingspeedCancel"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@color/trasnparent"
android:text="取消"
android:padding="4dp"
android:textColor="#ed7041"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>

35
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/systemerrorpopup.xml

@ -0,0 +1,35 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/current_error_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:background="@android:color/darker_gray"
android:textColor="@android:color/white"
android:textSize="18sp"
android:clickable="true"
android:onClick="showHistoryErrors"
android:text="当前报错信息将显示在这里" />
<ListView
android:id="@+id/history_error_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<Button
android:id="@+id/btn_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<EditText
android:id="@+id/error_Input"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

109
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/worklengthpopup.xml

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="600dp"
android:layout_height="360dp"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="40dp"
android:letterSpacing="0.5"
android:text="作业长度"
android:textColor="@color/dark_ink_blue"
android:textSize="40sp"
android:textStyle="bold">
</TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:layout_marginTop="0dp"
android:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/workLength_input"
android:inputType="number"
android:background="@drawable/borderbluegreen"
android:layout_width="200dp"
android:textColor="@color/blue_green"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:textSize="40sp">
</EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="m"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="40dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderbluegreen">
<Button
android:id="@+id/workLengthApply"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:padding="4dp"
android:background="@color/trasnparent"
android:text="确定"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderorange">
<Button
android:id="@+id/workLengthCancel"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@color/trasnparent"
android:text="取消"
android:padding="4dp"
android:textColor="#ed7041"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>

110
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/layout/workwidthpopup.xml

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="600dp"
android:layout_height="360dp"
android:layout_gravity="center"
android:background="@color/white"
android:orientation="vertical"
tools:ignore="MissingDefaultResource">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="40dp"
android:letterSpacing="0.5"
android:text="作业宽度"
android:textColor="@color/dark_ink_blue"
android:textSize="40sp"
android:textStyle="bold">
</TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:layout_marginTop="0dp"
android:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/workWidth_input"
android:inputType="number"
android:background="@drawable/borderbluegreen"
android:layout_width="200dp"
android:textColor="@color/blue_green"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:textSize="40sp">
</EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="m"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="40dp"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderbluegreen">
<Button
android:id="@+id/workWidthApply"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:padding="4dp"
android:background="@color/trasnparent"
android:text="确定"
android:textColor="@color/blue_green"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
<LinearLayout
android:layout_margin="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/borderorange">
<Button
android:id="@+id/workWidthCancel"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@color/trasnparent"
android:text="取消"
android:padding="4dp"
android:textColor="#ed7041"
android:textSize="20sp"
android:textStyle="bold">
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>

6
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

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

6
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

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

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-hdpi/ic_launcher.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-mdpi/ic_launcher.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xhdpi/ic_launcher.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

16
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/values-night/themes.xml

@ -0,0 +1,16 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.RougheningApp" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/blue</item>
<item name="colorPrimaryVariant">@color/blue</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/aliceblue</item>
<item name="colorSecondaryVariant">@color/blueviolet</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

156
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/values/colors.xml

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="purple_200">#FFFFFFFF</color>
<color name="colorPrimary">#3F51B5</color><!--首要颜色-->
<color name="colorPrimaryDark">#303F9F</color><!--首要颜色暗色-->
<color name="colorAccent">#FF4081</color><!--色彩强调-->
<!--自定义颜色-->
<color name="dark_ink_blue">#00194d</color><!--摆臂 深蓝黑色-->
<color name="blue_green">#00ADFC</color> <!--摆臂 蓝绿色-->
<color name="snow">#fffafa</color><!--雪白色 -->
<color name="floralwhite">#fffaf0</color><!--花白色 -->
<color name="blanchedalmond">#ffebcd</color><!--杏白色 -->
<color name="ghostwhite">#f8f8ff</color><!--幽灵白 -->
<color name="whitesmoke">#f5f5f5</color><!--烟白色 -->
<color name="antiquewhite">#faebd7</color><!--古董白 -->
<color name="navajowhite">#ffdead</color><!--纳瓦白 -->
<color name="grey">#808080</color><!--灰色 -->
<color name="gainsboro">#dcdcdc</color><!--淡灰色 -->
<color name="lightgrey">#d3d3d3</color><!--亮灰色 -->
<color name="darkgrey">#a9a9a9</color><!--暗灰色 -->
<color name="dimgrey">#696969</color><!--暗灰色 -->
<color name="slategrey">#708090</color><!--灰石色 -->
<color name="lightslategrey">#778899</color><!--亮蓝灰 -->
<color name="darkslategrey">#2f4f4f</color><!--暗瓦灰色 -->
<color name="silver">#c0c0c0</color><!--银色 -->
<color name="red">#ff0000</color><!--红色 -->
<color name="darkred">#8b0000</color><!--暗红色 -->
<color name="crimson">#dc143c</color><!--暗深红色 -->
<color name="darkmagenta">#8b008b</color><!--暗洋红 -->
<color name="fuchsia">#ff00ff</color><!--紫红色 -->
<color name="tomato">#ff6347</color><!--西红柿色 -->
<color name="lightcoral">#f08080</color><!--亮珊瑚色 -->
<color name="darksalmon">#e9967a</color><!--暗肉色 -->
<color name="peachpuff">#ffdab9</color><!--桃色 -->
<color name="plum">#dda0dd</color><!--洋李色 -->
<color name="pink">#ffc0cb</color><!--粉红色 -->
<color name="lightpink">#ffb6c1</color><!--亮粉红色 -->
<color name="deeppink">#ff1493</color><!--深粉红色 -->
<color name="hotpink">#ff69b4</color><!--热粉红色 -->
<color name="lavenderblush">#fff0f5</color><!--淡紫红 -->
<color name="indianred">#cd5c5c</color><!--印第安红 -->
<color name="rosybrown">#bc8f8f</color><!--褐玫瑰红 -->
<color name="firebrick">#b22222</color><!--红砖色 -->
<color name="maroon">#800000</color><!--粟色 -->
<color name="honeydew">#f0fff0</color><!--蜜色 -->
<color name="orangered">#ff4500</color><!--红橙色 -->
<color name="orange">#ffa500</color><!--橙色 -->
<color name="limegreen">#32cd32</color><!--橙绿色 -->
<color name="lime">#00ff00</color><!--酸橙色 -->
<color name="yellow">#ffff00</color><!--黄色 -->
<color name="wheat">#f5deb3</color><!--浅黄色 -->
<color name="khaki">#f0e68c</color><!--黄褐色 -->
<color name="burlywood">#deb887</color><!--实木色 -->
<color name="bisque">#ffe4c4</color><!--桔黄色 -->
<color name="lightyellow">#ffffe0</color><!--亮黄色 -->
<color name="darkgoldenrod">#b8860b</color><!--暗金黄色 -->
<color name="darkorange">#ff8c00</color><!--暗桔黄色 -->
<color name="lightgoldenrodyellow">#fafad2</color><!--亮金黄色 -->
<color name="lemonchiffon">#fffacd</color><!--柠檬绸色 -->
<color name="cornsilk">#fff8dc</color><!--米绸色 -->
<color name="seaShell">#fff5ee</color><!--海贝色 -->
<color name="papayawhip">#ffefd5</color><!--番木色 -->
<color name="mistyrose">#ffe4e1</color><!--浅玫瑰色 -->
<color name="moccasin">#ffe4b5</color><!--鹿皮色 -->
<color name="ivory">#fffff0</color><!--象牙色 -->
<color name="gold">#ffd700</color><!--金色 -->
<color name="goldenrod">#daa520</color><!--金麒麟色 -->
<color name="lightsalmon">#ffa07a</color><!--亮肉色 -->
<color name="coral">#ff7f50</color><!--珊瑚色 -->
<color name="mintcream">#f5fffa</color><!--薄荷色 -->
<color name="beige">#f5f5dc</color><!--米色 -->
<color name="sandybrown">#f4a460</color><!--沙褐色 -->
<color name="oldlace">#fdf5e6</color><!--老花色 -->
<color name="linen">#faf0e6</color><!--亚麻色 -->
<color name="salmon">#fa8072</color><!--鲜肉色 -->
<color name="thistle">#d8bfd8</color><!--蓟色 -->
<color name="tan">#d2b48c</color><!--茶色 -->
<color name="chocolate">#d2691e</color><!--巧可力色 -->
<color name="peru">#cd853f</color><!--秘鲁色 -->
<color name="darkkhaki">#bdb76b</color><!--暗黄褐色 -->
<color name="palegoldenrod">#eee8aa</color><!--苍麒麟色 -->
<color name="brown">#a52a2a</color><!--褐色 -->
<color name="saddlebrown">#8b4513</color><!--重褐色 -->
<color name="sienna">#a0522d</color><!--赭色 -->
<color name="olive">#808000</color><!--橄榄色 -->
<color name="chartreuse">#7fff00</color><!--黄绿色 -->
<color name="greenyellow">#adff2f</color><!--黄绿色 -->
<color name="green">#008000</color><!--绿色 -->
<color name="darkgreen">#006400</color><!--暗绿色 -->
<color name="darkolivegreen">#556b2f</color><!--暗橄榄绿 -->
<color name="olivedrab">#6b8e23</color><!--深绿褐色 -->
<color name="lawngreen">#7cfc00</color><!--草绿色 -->
<color name="forestgreen">#228b22</color><!--森林绿 -->
<color name="aquamarine">#7fffd4</color><!--碧绿色 -->
<color name="paleturquoise">#afeeee</color><!--苍宝石绿 -->
<color name="palegreen">#98fb98</color><!--苍绿色 -->
<color name="mediumturquoise">#48d1cc</color><!--中绿宝石 -->
<color name="mediumaquamarine">#66cdaa</color><!--中绿色 -->
<color name="aqua">#00ffff</color><!--浅绿色 -->
<color name="springgreen">#00ff7f</color><!--春绿色 -->
<color name="mediumspringgreen">#00fa9a</color><!--中春绿色 -->
<color name="darkturquoise">#00ced1</color><!--暗宝石绿 -->
<color name="seagreen">#2e8b57</color><!--海绿色 -->
<color name="lightgreen">#90ee90</color><!--亮绿色 -->
<color name="darkseagreen">#8fbc8f</color><!--暗海兰色 -->
<color name="turquoise">#40e0d0</color><!--青绿色 -->
<color name="cyan">#00ffff</color><!--青色 -->
<color name="darkcyan">#008b8b</color><!--暗青色 -->
<color name="lightcyan">#e0ffff</color><!--亮青色 -->
<color name="teal">#008080</color><!--水鸭色 -->
<color name="indigo">#4b0082</color><!--靛青色 -->
<color name="blue">#0000ff</color><!--蓝色 -->
<color name="darkblue">#00008b</color><!--暗蓝色 -->
<color name="mediumblue">#0000cd</color><!--中兰色 -->
<color name="midnightblue">#191970</color><!--中灰兰色 -->
<color name="navy">#000080</color><!--海军色 -->
<color name="royalblue">#4169e1</color><!--皇家蓝 -->
<color name="azure">#f0ffff</color><!--天蓝色 -->
<color name="skyblue">#87ceeb</color><!--天蓝色 -->
<color name="deepskyblue">#00bfff</color><!--深天蓝色 -->
<color name="lightskyblue">#87cefa</color><!--亮天蓝色 -->
<color name="lightseagreen">#20b2aa</color><!--亮海蓝色 -->
<color name="lightblue">#add8e6</color><!--亮蓝色 -->
<color name="powderblue">#b0e0e6</color><!--粉蓝色 -->
<color name="aliceblue">#f0f8ff</color><!--艾利斯兰 -->
<color name="mediumslateblue">#7b68ee</color><!--中暗蓝色 -->
<color name="slateblue">#6a5acd</color><!--石蓝色 -->
<color name="darkslateblue">#483d8b</color><!--暗灰蓝色 -->
<color name="mediumseagreen">#3cb371</color><!--中海蓝 -->
<color name="steelblue">#4682b4</color><!--钢兰色 -->
<color name="lightsteelblue">#b0c4de</color><!--亮钢兰色 -->
<color name="cornflowerblue">#6495ed</color><!--菊兰色 -->
<color name="dodgerblue">#1e90ff</color><!--闪兰色 -->
<color name="cadetblue">#5f9ea0</color><!--军兰色 -->
<color name="blueviolet">#8a2be2</color><!--紫罗兰蓝色 -->
<color name="purple">#800080</color><!--紫色 -->
<color name="lavender">#e6e6fa</color><!--淡紫色 -->
<color name="orchid">#da70d6</color><!--淡紫色 -->
<color name="mediumpurple">#9370db</color><!--中紫色 -->
<color name="darkorchid">#9932cc</color><!--暗紫色 -->
<color name="violet">#ee82ee</color><!--紫罗兰色 -->
<color name="mediumvioletred">#c71585</color><!--中紫罗兰色 -->
<color name="palevioletred">#db7093</color><!--苍紫罗兰色 -->
<color name="darkviolet">#9400d3</color><!--暗紫罗兰色 -->
<color name="mediumorchid">#ba55d3</color><!--中粉紫色 -->
<color name="trasnparent">#00000000</color><!--中粉紫色 -->
<color name="bgrgreen">#6efe00</color><!--中粉紫色 -->
</resources>

35
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/values/strings.xml

@ -0,0 +1,35 @@
<resources>
<string name="app_name">摆臂2</string>
<string-array name="operationMode">
<item>手动操作</item>
<item>竖直操作</item>
<item>水平操作</item>
</string-array>
<string-array name="speedSelection">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
</string-array>
<string-array name="laneChangeSelection">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
</string-array>
<integer name="leftRange">20</integer>
</resources>

17
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/values/themes.xml

@ -0,0 +1,17 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.RougheningApp" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/blue</item>
<item name="colorPrimaryVariant">@color/blue</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/aliceblue</item>
<item name="colorSecondaryVariant">@color/blueviolet</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>

13
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/xml/backup_rules.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older that API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>

15
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/xml/check_boxs.xml

@ -0,0 +1,15 @@
<?xml version ="1.0" encoding ="utf-8"?><!-- Learn More about how to use App Actions: https://developer.android.com/guide/actions/index.html -->
<actions>
<!-- App Actions are deprecated. Use shortcuts instead https://developers.google.com/assistant/app/action-schema -->
<!-- Example Action -->
<!-- <action intentName="Intent name (actions.intent.*)"> -->
<!-- <action-display -->
<!-- icon="@mipmap/..." -->
<!-- labelTemplate="@array/..." /> -->
<!-- <fulfillment urlTemplate="Action content URI or URL"> -->
<!-- <parameter-mapping -->
<!-- intentParameter="Parameter name in Intent URI" -->
<!-- urlParameter="Parameter name in URL" /> -->
<!-- </fulfillment> -->
<!-- </action> -->
</actions>

19
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/xml/data_extraction_rules.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>

38
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/main/res/xml/device_filter.xml

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 0x0403 / 0x60??: FTDI -->
<usb-device vendor-id="1027" product-id="24577" /> <!-- 0x6001: FT232R -->
<usb-device vendor-id="1027" product-id="24592" /> <!-- 0x6010: FT2232H -->
<usb-device vendor-id="1027" product-id="24593" /> <!-- 0x6011: FT4232H -->
<usb-device vendor-id="1027" product-id="24596" /> <!-- 0x6014: FT232H -->
<usb-device vendor-id="1027" product-id="24597" /> <!-- 0x6015: FT230X, FT231X, FT234XD -->
<!-- 0x10C4 / 0xEA??: Silabs CP210x -->
<usb-device vendor-id="4292" product-id="60000" /> <!-- 0xea60: CP2102 and other CP210x single port devices -->
<usb-device vendor-id="4292" product-id="60016" /> <!-- 0xea70: CP2105 -->
<usb-device vendor-id="4292" product-id="60017" /> <!-- 0xea71: CP2108 -->
<!-- 0x067B / 0x23?3: Prolific PL2303x -->
<usb-device vendor-id="1659" product-id="8963" /> <!-- 0x2303: PL2303HX, HXD, TA, ... -->
<usb-device vendor-id="1659" product-id="9123" /> <!-- 0x23a3: PL2303GC -->
<usb-device vendor-id="1659" product-id="9139" /> <!-- 0x23b3: PL2303GB -->
<usb-device vendor-id="1659" product-id="9155" /> <!-- 0x23c3: PL2303GT -->
<usb-device vendor-id="1659" product-id="9171" /> <!-- 0x23d3: PL2303GL -->
<usb-device vendor-id="1659" product-id="9187" /> <!-- 0x23e3: PL2303GE -->
<usb-device vendor-id="1659" product-id="9203" /> <!-- 0x23f3: PL2303GS -->
<!-- 0x1a86 / 0x?523: Qinheng CH34x -->
<usb-device vendor-id="6790" product-id="21795" /> <!-- 0x5523: CH341A -->
<usb-device vendor-id="6790" product-id="29987" /> <!-- 0x7523: CH340 -->
<!-- CDC driver -->
<usb-device vendor-id="9025" /> <!-- 0x2341 / ......: Arduino -->
<usb-device vendor-id="5824" product-id="1155" /> <!-- 0x16C0 / 0x0483: Teensyduino -->
<usb-device vendor-id="1003" product-id="8260" /> <!-- 0x03EB / 0x2044: Atmel Lufa -->
<usb-device vendor-id="7855" product-id="4" /> <!-- 0x1eaf / 0x0004: Leaflabs Maple -->
<usb-device vendor-id="3368" product-id="516" /> <!-- 0x0d28 / 0x0204: ARM mbed -->
<usb-device vendor-id="1155" product-id="22336" /><!-- 0x0483 / 0x5740: ST CDC -->
<usb-device vendor-id="11914" product-id="5" /> <!-- 0x2E8A / 0x0005: Raspberry Pi Pico Micropython -->
<usb-device vendor-id="11914" product-id="10" /> <!-- 0x2E8A / 0x000A: Raspberry Pi Pico SDK -->
<usb-device vendor-id="6790" product-id="21972" /><!-- 0x1A86 / 0x55D4: Qinheng CH9102F -->
</resources>

17
plusapp-decrease/SwingArmApp2/swing_armapp2/app/src/test/java/com/example/swingarmapp/ExampleUnitTest.java

@ -0,0 +1,17 @@
package com.example.swingarmapp;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}

4
plusapp-decrease/SwingArmApp2/swing_armapp2/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
}

21
plusapp-decrease/SwingArmApp2/swing_armapp2/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

BIN
plusapp-decrease/SwingArmApp2/swing_armapp2/gradle/wrapper/gradle-wrapper.jar

Binary file not shown.

6
plusapp-decrease/SwingArmApp2/swing_armapp2/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

185
plusapp-decrease/SwingArmApp2/swing_armapp2/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" "$@"

89
plusapp-decrease/SwingArmApp2/swing_armapp2/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

18
plusapp-decrease/SwingArmApp2/swing_armapp2/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 = "swing_armapp2"
include ':app'

1
plusapp-decrease/新建文本文档.txt

@ -0,0 +1 @@
隐藏边打边退和 参数调用
Loading…
Cancel
Save