@ -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 |
||||
@ -0,0 +1,3 @@ |
|||||
|
# Default ignored files |
||||
|
/shelf/ |
||||
|
/workspace.xml |
||||
@ -0,0 +1 @@ |
|||||
|
Paintingapp |
||||
@ -0,0 +1,6 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="CompilerConfiguration"> |
||||
|
<bytecodeTargetLevel target="21" /> |
||||
|
</component> |
||||
|
</project> |
||||
@ -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> |
||||
@ -0,0 +1,18 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project version="4"> |
||||
|
<component name="deploymentTargetSelector"> |
||||
|
<selectionStates> |
||||
|
<SelectionState runConfigName="app"> |
||||
|
<option name="selectionMode" value="DROPDOWN" /> |
||||
|
<DropdownSelection timestamp="2025-06-17T02:25:31.357049600Z"> |
||||
|
<Target type="DEFAULT_BOOT"> |
||||
|
<handle> |
||||
|
<DeviceId pluginId="PhysicalDevice" identifier="serial=f24acc66" /> |
||||
|
</handle> |
||||
|
</Target> |
||||
|
</DropdownSelection> |
||||
|
<DialogSelection /> |
||||
|
</SelectionState> |
||||
|
</selectionStates> |
||||
|
</component> |
||||
|
</project> |
||||
@ -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> |
||||
@ -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> |
||||
@ -0,0 +1,16 @@ |
|||||
|
<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> |
||||
|
<component name="VisualizationToolProject"> |
||||
|
<option name="state"> |
||||
|
<ProjectState> |
||||
|
<option name="scale" value="0.04120409906063194" /> |
||||
|
</ProjectState> |
||||
|
</option> |
||||
|
</component> |
||||
|
</project> |
||||
@ -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> |
||||
@ -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,0 +1 @@ |
|||||
|
/build |
||||
@ -0,0 +1,62 @@ |
|||||
|
plugins { |
||||
|
id 'com.android.application' |
||||
|
} |
||||
|
|
||||
|
android { |
||||
|
namespace 'com.example.paintingapp' |
||||
|
compileSdk 34 |
||||
|
viewBinding |
||||
|
{ |
||||
|
enabled true |
||||
|
} |
||||
|
// //add this feature |
||||
|
dataBinding |
||||
|
{ |
||||
|
enabled true |
||||
|
} |
||||
|
defaultConfig { |
||||
|
applicationId "com.example.paintingapp" |
||||
|
minSdk 24 |
||||
|
targetSdk 34 |
||||
|
versionCode 1 |
||||
|
versionName "1.0" |
||||
|
|
||||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
||||
|
} |
||||
|
android.applicationVariants.all { variant -> |
||||
|
variant.outputs.all { |
||||
|
outputFileName = "Painting.apk" |
||||
|
} |
||||
|
} |
||||
|
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' |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -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 |
||||
@ -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": "Roughening00.apk" |
||||
|
} |
||||
|
], |
||||
|
"elementType": "File" |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.example.rougheningapp; |
||||
|
|
||||
|
import static org.junit.Assert.assertEquals; |
||||
|
|
||||
|
import android.content.Context; |
||||
|
|
||||
|
import androidx.test.ext.junit.runners.AndroidJUnit4; |
||||
|
import androidx.test.platform.app.InstrumentationRegistry; |
||||
|
|
||||
|
import org.junit.Test; |
||||
|
import org.junit.runner.RunWith; |
||||
|
|
||||
|
/** |
||||
|
* 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()); |
||||
|
} |
||||
|
} |
||||
@ -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> |
||||
@ -0,0 +1,25 @@ |
|||||
|
syntax = "proto3"; |
||||
|
option java_multiple_files = false; |
||||
|
option java_package = "com.example.paintingapp.models"; |
||||
|
message ErrorData |
||||
|
{ |
||||
|
int32 Com_Error_Code=1; |
||||
|
int32 Left_Motor_Error_Code=2; |
||||
|
int32 Right_Motor_Error_Code=3; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
enum ComError //枚举消息类型 Error Bit Define |
||||
|
{ |
||||
|
MK32_SBus = 0; |
||||
|
MK32_Serial = 1; |
||||
|
MK32_InitialState = 2; |
||||
|
TL720D = 3; |
||||
|
LS_LeftMotor = 4; |
||||
|
LS_RightMotor = 5; |
||||
|
} |
||||
|
|
||||
|
//protoc --nanopb_out=. *.proto |
||||
|
|
||||
|
|
||||
|
|
||||
@ -0,0 +1,17 @@ |
|||||
|
syntax = "proto3"; |
||||
|
|
||||
|
option java_multiple_files = false; |
||||
|
option java_package = "com.example.paintingapp.models"; |
||||
|
|
||||
|
message IV_struct_define |
||||
|
{ |
||||
|
int32 Tempature=1; |
||||
|
int32 RunMode=2; |
||||
|
int32 LeftCompensation= 3; //单位0.01° |
||||
|
int32 RightCompensation= 4; //单位0.01° |
||||
|
int32 CurrentAngle= 5; //单位0.01° |
||||
|
int32 RobotMoveSpeed= 6; //单位m/min |
||||
|
int32 SystemError=7; //硬件通讯错误及按键未初始化错误 |
||||
|
int32 Left_Motor_Err=8;//左轮电机报警 |
||||
|
int32 Right_Motor_Err=9;//右轮电机报警 |
||||
|
}; |
||||
@ -0,0 +1,20 @@ |
|||||
|
syntax = "proto3"; |
||||
|
option java_multiple_files = false; |
||||
|
option java_package = "com.example.paintingapp.models"; |
||||
|
|
||||
|
message PV_struct_define{ |
||||
|
|
||||
|
// 喷漆项目 |
||||
|
int32 RunMode = 1; //1 手动无校准作业 2 手动水平作业 3 手动竖直向左作业 4 手动竖直向右作业 5 自动水平作业 6 自动竖直向左作业 7 自动竖直向右作业; |
||||
|
int32 RobotSpeed=2;//0-30m/min |
||||
|
int32 LaneChangeDistance= 3;//1-100cm |
||||
|
|
||||
|
int32 WorkDistanceMeters=4;//水平方向 作业长度0-200m |
||||
|
int32 WorkWidthMeters=5;//竖直方向 作业宽度度0-200m |
||||
|
|
||||
|
double Vertical_Calibration=6;// 1° |
||||
|
|
||||
|
int32 LeftCompensation= 7; //0.01° |
||||
|
int32 RightCompensation= 8;//0.01° |
||||
|
|
||||
|
}; |
||||
@ -0,0 +1,434 @@ |
|||||
|
package com.example.paintingapp; |
||||
|
|
||||
|
import static java.lang.Integer.parseInt; |
||||
|
|
||||
|
import android.os.Bundle; |
||||
|
import android.text.Editable; |
||||
|
import android.text.TextUtils; |
||||
|
import android.text.TextWatcher; |
||||
|
import android.view.View; |
||||
|
import android.view.WindowManager; |
||||
|
import android.widget.Toast; |
||||
|
|
||||
|
import androidx.appcompat.app.AppCompatActivity; |
||||
|
import androidx.databinding.DataBindingUtil; |
||||
|
|
||||
|
import com.example.paintingapp.databinding.ActivityMainBinding; |
||||
|
import com.example.paintingapp.models.BspPV; |
||||
|
import com.example.paintingapp.models.DisplayPV; |
||||
|
import com.example.paintingapp.services.ModbusCRC; |
||||
|
import com.example.paintingapp.services.MyDataHelper; |
||||
|
import com.example.paintingapp.services.PopupHelper; |
||||
|
import com.example.paintingapp.services.USBSerialPortHelper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
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 String _parameters_Call_Value = "1"; |
||||
|
public String _manual_Mode_Call_Value = "未启用"; |
||||
|
public String _automatic_Mode_Call_Value = "未启用"; |
||||
|
|
||||
|
public int WorkDistance = 0; |
||||
|
public int WorkWidth = 0; |
||||
|
|
||||
|
public int leftCompensation = 0; |
||||
|
public int rightCompensation = 0; |
||||
|
|
||||
|
public int leftRightCompensationNeedToSend = 0; |
||||
|
|
||||
|
@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); |
||||
|
|
||||
|
|
||||
|
/* USB串口 控制区域*/ |
||||
|
serialPortHelper = new USBSerialPortHelper(this); |
||||
|
serialPortHelper.intialize(); |
||||
|
serialPortHelper.connect(); |
||||
|
|
||||
|
|
||||
|
|
||||
|
mainBinding.setManualModeBtn.setOnClickListener(new View.OnClickListener() { |
||||
|
@Override |
||||
|
public void onClick(View v) { |
||||
|
|
||||
|
popupHelper.ManualModePopUp(this); |
||||
|
} |
||||
|
}); |
||||
|
mainBinding.setAutomaticModeBtn.setOnClickListener(new View.OnClickListener() { |
||||
|
@Override |
||||
|
public void onClick(View v) { |
||||
|
popupHelper.AutomaticModeSetPopUp(this); |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
mainBinding.mainViewRobotSpeedTxView.addTextChangedListener(new TextWatcher() { |
||||
|
@Override |
||||
|
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void afterTextChanged(Editable s) { |
||||
|
// 文本变化后的回调,在这里进行范围检查
|
||||
|
String input = s.toString(); |
||||
|
if (!input.isEmpty()) { |
||||
|
try { |
||||
|
int value = Integer.parseInt(input); |
||||
|
// 检查输入值是否在 1 到 30 范围内
|
||||
|
if (value < 1 || value > 30) { |
||||
|
showToast("请输入 1 到 30 之间的数字"); |
||||
|
// 可以选择清除输入或限制在范围内
|
||||
|
mainBinding.mainViewRobotSpeedTxView.setText(""); |
||||
|
} else { |
||||
|
showToast("输入有效: " + value); |
||||
|
} |
||||
|
} catch (NumberFormatException e) { |
||||
|
showToast("请输入有效的数字"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
|
||||
|
mainBinding.mainViewLaneChangeDistanceTxView.addTextChangedListener(new TextWatcher() { |
||||
|
@Override |
||||
|
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void afterTextChanged(Editable s) { |
||||
|
// 文本变化后的回调,在这里进行范围检查
|
||||
|
String input = s.toString(); |
||||
|
if (!input.isEmpty()) { |
||||
|
try { |
||||
|
int value = Integer.parseInt(input); |
||||
|
// 检查输入值是否在 -50 到 100 范围内
|
||||
|
if (value < 1 || value > 100) { |
||||
|
showToast("请输入 1 到 100 之间的数字"); |
||||
|
// 可以选择清除输入或限制在范围内
|
||||
|
mainBinding.mainViewLaneChangeDistanceTxView.setText(""); |
||||
|
} else { |
||||
|
showToast("输入有效: " + value); |
||||
|
} |
||||
|
} catch (NumberFormatException e) { |
||||
|
showToast("请输入有效的数字"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
|
||||
|
mainBinding.mainViewVerticalCalibrationTxView.addTextChangedListener(new TextWatcher() { |
||||
|
@Override |
||||
|
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void afterTextChanged(Editable s) { |
||||
|
String input = s.toString().trim(); |
||||
|
|
||||
|
// 1. 允许空输入(用户正在删除)
|
||||
|
if (TextUtils.isEmpty(input)) { |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
// 2. 允许合法的中间状态(如"-10.")
|
||||
|
if (input.matches("^-?\\d*(\\.\\d*)?$")) { |
||||
|
// 合法格式:整数、负数、小数、小数点开头
|
||||
|
try { |
||||
|
|
||||
|
double value = Double.parseDouble(input); |
||||
|
// 检查输入值是否在 -50 到 100 范围内
|
||||
|
if (value < -10 || value > 10) { |
||||
|
showToast("请输入 -10 到 10 之间的数字"); |
||||
|
// 可以选择清除输入或限制在范围内
|
||||
|
mainBinding.mainViewVerticalCalibrationTxView.setText(""); |
||||
|
} else { |
||||
|
showToast("输入有效: " + value); |
||||
|
} |
||||
|
// 尝试转换为double(处理小数)
|
||||
|
//lastValidValue = Double.parseDouble(input);
|
||||
|
} catch (NumberFormatException e) { |
||||
|
// 中间状态,忽略
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
mainBinding.callParametersBtn.setOnClickListener(new View.OnClickListener() { |
||||
|
@Override |
||||
|
public void onClick(View v) { |
||||
|
popupHelper.ParametersCallPopUp(this); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
mainBinding. mainViewErrMessageBtn.setOnClickListener(new View.OnClickListener() { |
||||
|
@Override |
||||
|
public void onClick(View v) { |
||||
|
popupHelper.RobotErrorListPopUp(this); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
myDataHelper.IntializeDataBase(); |
||||
|
|
||||
|
|
||||
|
//程序初始化,读取数据库,进行界面显示
|
||||
|
String parame = mainBinding.mainViewParametersTxView.getText().toString(); |
||||
|
|
||||
|
//读取数据
|
||||
|
int paraIndex = parseInt(parame); |
||||
|
List<DisplayPV> pvList = myDataHelper.getDisplayData(paraIndex); |
||||
|
|
||||
|
mainBinding.mainViewManualModeTxView.setText(_manual_Mode_Call_Value); |
||||
|
mainBinding.mainViewAutomaticModeTxView.setText(_automatic_Mode_Call_Value); |
||||
|
|
||||
|
mainBinding.mainViewLaneChangeDistanceTxView.setText(String.valueOf(pvList.get(0).getLaneChangeDistance())); |
||||
|
|
||||
|
|
||||
|
WorkDistance = pvList.get(0).getWorkDistanceMeters(); |
||||
|
WorkWidth = pvList.get(0).getWorkWidthMeters(); |
||||
|
|
||||
|
mainBinding.mainViewVerticalCalibrationTxView.setText(String.valueOf(pvList.get(0).getVerticalCalibration())); |
||||
|
|
||||
|
|
||||
|
leftCompensation = pvList.get(0).getLeftCompSelect(); |
||||
|
rightCompensation = pvList.get(0).getRightCompSelect(); |
||||
|
|
||||
|
timer.schedule(new TimerTask() { |
||||
|
@Override |
||||
|
public void run() { |
||||
|
// 使用 Handler 或 runOnUiThread 更新 UI
|
||||
|
runOnUiThread(new Runnable() { |
||||
|
@Override |
||||
|
public void run() { |
||||
|
|
||||
|
//调试 报错处理功能
|
||||
|
//String Value = ErrorDeocdeHelper.ErrorDeocde(0b11000000);
|
||||
|
|
||||
|
// 更新 UI 的代码
|
||||
|
_toSendPV = BspPV.PV_struct_define.newBuilder(). |
||||
|
build(); |
||||
|
|
||||
|
try { |
||||
|
if(mainBinding.mainViewRobotSpeedTxView.getText().toString().isEmpty() ) |
||||
|
{ |
||||
|
mainBinding.mainViewRobotSpeedFrameLayout.setBackgroundResource(R.drawable.orange_rounded_rectangle); |
||||
|
} |
||||
|
else { |
||||
|
mainBinding.mainViewRobotSpeedFrameLayout.setBackgroundResource(R.drawable.blue_rounded_rectangle); |
||||
|
_toSendPV = _toSendPV.toBuilder().setRobotSpeed( |
||||
|
Integer.parseInt(String.valueOf(mainBinding.mainViewRobotSpeedTxView.getText())) |
||||
|
).build(); |
||||
|
|
||||
|
} |
||||
|
} catch (Exception e) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
//移动速度
|
||||
|
try { |
||||
|
|
||||
|
//换道距离
|
||||
|
if(mainBinding.mainViewLaneChangeDistanceTxView.getText().toString().isEmpty() ) |
||||
|
{ |
||||
|
mainBinding.mainViewLaneChangeDistanceFrameLayout.setBackgroundResource(R.drawable.orange_rounded_rectangle); |
||||
|
} |
||||
|
else { |
||||
|
|
||||
|
mainBinding.mainViewLaneChangeDistanceFrameLayout.setBackgroundResource(R.drawable.blue_rounded_rectangle); |
||||
|
_toSendPV = _toSendPV.toBuilder().setLaneChangeDistance( |
||||
|
Integer.parseInt(String.valueOf(mainBinding.mainViewLaneChangeDistanceTxView.getText())) |
||||
|
).build(); |
||||
|
} |
||||
|
|
||||
|
} catch (Exception e) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
//竖直微调--小数 *10
|
||||
|
try { |
||||
|
|
||||
|
if(mainBinding.mainViewVerticalCalibrationTxView.getText().toString().isEmpty() ) |
||||
|
{ |
||||
|
mainBinding.mainViewVerticalCalibrationFrameLayout.setBackgroundResource(R.drawable.orange_rounded_rectangle); |
||||
|
} |
||||
|
else { |
||||
|
mainBinding.mainViewVerticalCalibrationFrameLayout.setBackgroundResource(R.drawable.blue_rounded_rectangle); |
||||
|
_toSendPV = _toSendPV.toBuilder().setVerticalCalibration( |
||||
|
Double.parseDouble(String.valueOf(mainBinding.mainViewVerticalCalibrationTxView.getText())) |
||||
|
).build(); |
||||
|
} |
||||
|
|
||||
|
} catch (Exception e) { |
||||
|
// showToast(e+"等你输完我再发送吧哥们");
|
||||
|
} |
||||
|
|
||||
|
_toSendPV = _toSendPV.toBuilder() |
||||
|
.setWorkDistanceMeters(WorkDistance) |
||||
|
.setWorkWidthMeters(WorkWidth) |
||||
|
.build(); |
||||
|
|
||||
|
|
||||
|
if(leftRightCompensationNeedToSend > 0) { |
||||
|
_toSendPV = _toSendPV.toBuilder() |
||||
|
.setLeftCompensation(leftCompensation) |
||||
|
.setRightCompensation(rightCompensation) |
||||
|
.build(); |
||||
|
leftRightCompensationNeedToSend --; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
String manualModeDAta = mainBinding.mainViewManualModeTxView.getText().toString(); |
||||
|
switch (manualModeDAta) { |
||||
|
case "无": |
||||
|
_toSendPV = _toSendPV.toBuilder().setRunMode(1).build(); |
||||
|
break; |
||||
|
case "水平": |
||||
|
_toSendPV = _toSendPV.toBuilder().setRunMode(2).build(); |
||||
|
break; |
||||
|
case "竖直向左": |
||||
|
_toSendPV = _toSendPV.toBuilder().setRunMode(3).build(); |
||||
|
break; |
||||
|
case "竖直向右": |
||||
|
_toSendPV = _toSendPV.toBuilder().setRunMode(4).build(); |
||||
|
break; |
||||
|
} |
||||
|
String automaticModeDAta = mainBinding.mainViewAutomaticModeTxView.getText().toString(); |
||||
|
switch (automaticModeDAta) { |
||||
|
// case "无":
|
||||
|
// _toSendPV = _toSendPV.toBuilder().setRunMode(0).build();
|
||||
|
// break;
|
||||
|
case "水平": |
||||
|
_toSendPV = _toSendPV.toBuilder().setRunMode(5).build(); |
||||
|
break; |
||||
|
case "竖直向左": |
||||
|
_toSendPV = _toSendPV.toBuilder().setRunMode(6).build(); |
||||
|
break; |
||||
|
case "竖直向右": |
||||
|
_toSendPV = _toSendPV.toBuilder().setRunMode(7).build(); |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
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, 250); // 延迟 0 毫秒,每隔 1000 毫秒执行一次
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
private void showToast(String message) |
||||
|
{ |
||||
|
Toast.makeText(this, message, Toast.LENGTH_SHORT).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(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,795 @@ |
|||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
// NO CHECKED-IN PROTOBUF GENCODE
|
||||
|
// source: bsp_Error.proto
|
||||
|
// Protobuf Java Version: 4.27.2
|
||||
|
|
||||
|
package com.example.paintingapp.models; |
||||
|
|
||||
|
public final class BspError { |
||||
|
private BspError() {} |
||||
|
static { |
||||
|
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( |
||||
|
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, |
||||
|
/* major= */ 4, |
||||
|
/* minor= */ 27, |
||||
|
/* patch= */ 2, |
||||
|
/* suffix= */ "", |
||||
|
BspError.class.getName()); |
||||
|
} |
||||
|
public static void registerAllExtensions( |
||||
|
com.google.protobuf.ExtensionRegistryLite registry) { |
||||
|
} |
||||
|
|
||||
|
public static void registerAllExtensions( |
||||
|
com.google.protobuf.ExtensionRegistry registry) { |
||||
|
registerAllExtensions( |
||||
|
(com.google.protobuf.ExtensionRegistryLite) registry); |
||||
|
} |
||||
|
/** |
||||
|
* Protobuf enum {@code ComError} |
||||
|
*/ |
||||
|
public enum ComError |
||||
|
implements com.google.protobuf.ProtocolMessageEnum { |
||||
|
/** |
||||
|
* <code>MK32_SBus = 0;</code> |
||||
|
*/ |
||||
|
MK32_SBus(0), |
||||
|
/** |
||||
|
* <code>MK32_Serial = 1;</code> |
||||
|
*/ |
||||
|
MK32_Serial(1), |
||||
|
/** |
||||
|
* <code>MK32_InitialState = 2;</code> |
||||
|
*/ |
||||
|
MK32_InitialState(2), |
||||
|
/** |
||||
|
* <code>TL720D = 3;</code> |
||||
|
*/ |
||||
|
TL720D(3), |
||||
|
/** |
||||
|
* <code>LS_LeftMotor = 4;</code> |
||||
|
*/ |
||||
|
LS_LeftMotor(4), |
||||
|
/** |
||||
|
* <code>LS_RightMotor = 5;</code> |
||||
|
*/ |
||||
|
LS_RightMotor(5), |
||||
|
UNRECOGNIZED(-1), |
||||
|
; |
||||
|
|
||||
|
static { |
||||
|
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( |
||||
|
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, |
||||
|
/* major= */ 4, |
||||
|
/* minor= */ 27, |
||||
|
/* patch= */ 2, |
||||
|
/* suffix= */ "", |
||||
|
ComError.class.getName()); |
||||
|
} |
||||
|
/** |
||||
|
* <code>MK32_SBus = 0;</code> |
||||
|
*/ |
||||
|
public static final int MK32_SBus_VALUE = 0; |
||||
|
/** |
||||
|
* <code>MK32_Serial = 1;</code> |
||||
|
*/ |
||||
|
public static final int MK32_Serial_VALUE = 1; |
||||
|
/** |
||||
|
* <code>MK32_InitialState = 2;</code> |
||||
|
*/ |
||||
|
public static final int MK32_InitialState_VALUE = 2; |
||||
|
/** |
||||
|
* <code>TL720D = 3;</code> |
||||
|
*/ |
||||
|
public static final int TL720D_VALUE = 3; |
||||
|
/** |
||||
|
* <code>LS_LeftMotor = 4;</code> |
||||
|
*/ |
||||
|
public static final int LS_LeftMotor_VALUE = 4; |
||||
|
/** |
||||
|
* <code>LS_RightMotor = 5;</code> |
||||
|
*/ |
||||
|
public static final int LS_RightMotor_VALUE = 5; |
||||
|
|
||||
|
|
||||
|
public final int getNumber() { |
||||
|
if (this == UNRECOGNIZED) { |
||||
|
throw new java.lang.IllegalArgumentException( |
||||
|
"Can't get the number of an unknown enum value."); |
||||
|
} |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param value The numeric wire value of the corresponding enum entry. |
||||
|
* @return The enum associated with the given numeric wire value. |
||||
|
* @deprecated Use {@link #forNumber(int)} instead. |
||||
|
*/ |
||||
|
@java.lang.Deprecated |
||||
|
public static ComError valueOf(int value) { |
||||
|
return forNumber(value); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param value The numeric wire value of the corresponding enum entry. |
||||
|
* @return The enum associated with the given numeric wire value. |
||||
|
*/ |
||||
|
public static ComError forNumber(int value) { |
||||
|
switch (value) { |
||||
|
case 0: return MK32_SBus; |
||||
|
case 1: return MK32_Serial; |
||||
|
case 2: return MK32_InitialState; |
||||
|
case 3: return TL720D; |
||||
|
case 4: return LS_LeftMotor; |
||||
|
case 5: return LS_RightMotor; |
||||
|
default: return null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static com.google.protobuf.Internal.EnumLiteMap<ComError> |
||||
|
internalGetValueMap() { |
||||
|
return internalValueMap; |
||||
|
} |
||||
|
private static final com.google.protobuf.Internal.EnumLiteMap< |
||||
|
ComError> internalValueMap = |
||||
|
new com.google.protobuf.Internal.EnumLiteMap<ComError>() { |
||||
|
public ComError findValueByNumber(int number) { |
||||
|
return ComError.forNumber(number); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
public final com.google.protobuf.Descriptors.EnumValueDescriptor |
||||
|
getValueDescriptor() { |
||||
|
if (this == UNRECOGNIZED) { |
||||
|
throw new java.lang.IllegalStateException( |
||||
|
"Can't get the descriptor of an unrecognized enum value."); |
||||
|
} |
||||
|
return getDescriptor().getValues().get(ordinal()); |
||||
|
} |
||||
|
public final com.google.protobuf.Descriptors.EnumDescriptor |
||||
|
getDescriptorForType() { |
||||
|
return getDescriptor(); |
||||
|
} |
||||
|
public static final com.google.protobuf.Descriptors.EnumDescriptor |
||||
|
getDescriptor() { |
||||
|
return com.example.paintingapp.models.BspError.getDescriptor().getEnumTypes().get(0); |
||||
|
} |
||||
|
|
||||
|
private static final ComError[] VALUES = values(); |
||||
|
|
||||
|
public static ComError valueOf( |
||||
|
com.google.protobuf.Descriptors.EnumValueDescriptor desc) { |
||||
|
if (desc.getType() != getDescriptor()) { |
||||
|
throw new java.lang.IllegalArgumentException( |
||||
|
"EnumValueDescriptor is not for this type."); |
||||
|
} |
||||
|
if (desc.getIndex() == -1) { |
||||
|
return UNRECOGNIZED; |
||||
|
} |
||||
|
return VALUES[desc.getIndex()]; |
||||
|
} |
||||
|
|
||||
|
private final int value; |
||||
|
|
||||
|
private ComError(int value) { |
||||
|
this.value = value; |
||||
|
} |
||||
|
|
||||
|
// @@protoc_insertion_point(enum_scope:ComError)
|
||||
|
} |
||||
|
|
||||
|
public interface ErrorDataOrBuilder extends |
||||
|
// @@protoc_insertion_point(interface_extends:ErrorData)
|
||||
|
com.google.protobuf.MessageOrBuilder { |
||||
|
|
||||
|
/** |
||||
|
* <code>int32 Com_Error_Code = 1;</code> |
||||
|
* @return The comErrorCode. |
||||
|
*/ |
||||
|
int getComErrorCode(); |
||||
|
|
||||
|
/** |
||||
|
* <code>int32 Left_Motor_Error_Code = 2;</code> |
||||
|
* @return The leftMotorErrorCode. |
||||
|
*/ |
||||
|
int getLeftMotorErrorCode(); |
||||
|
|
||||
|
/** |
||||
|
* <code>int32 Right_Motor_Error_Code = 3;</code> |
||||
|
* @return The rightMotorErrorCode. |
||||
|
*/ |
||||
|
int getRightMotorErrorCode(); |
||||
|
} |
||||
|
/** |
||||
|
* Protobuf type {@code ErrorData} |
||||
|
*/ |
||||
|
public static final class ErrorData extends |
||||
|
com.google.protobuf.GeneratedMessage implements |
||||
|
// @@protoc_insertion_point(message_implements:ErrorData)
|
||||
|
ErrorDataOrBuilder { |
||||
|
private static final long serialVersionUID = 0L; |
||||
|
static { |
||||
|
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( |
||||
|
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, |
||||
|
/* major= */ 4, |
||||
|
/* minor= */ 27, |
||||
|
/* patch= */ 2, |
||||
|
/* suffix= */ "", |
||||
|
ErrorData.class.getName()); |
||||
|
} |
||||
|
// Use ErrorData.newBuilder() to construct.
|
||||
|
private ErrorData(com.google.protobuf.GeneratedMessage.Builder<?> builder) { |
||||
|
super(builder); |
||||
|
} |
||||
|
private ErrorData() { |
||||
|
} |
||||
|
|
||||
|
public static final com.google.protobuf.Descriptors.Descriptor |
||||
|
getDescriptor() { |
||||
|
return com.example.paintingapp.models.BspError.internal_static_ErrorData_descriptor; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
||||
|
internalGetFieldAccessorTable() { |
||||
|
return com.example.paintingapp.models.BspError.internal_static_ErrorData_fieldAccessorTable |
||||
|
.ensureFieldAccessorsInitialized( |
||||
|
com.example.paintingapp.models.BspError.ErrorData.class, com.example.paintingapp.models.BspError.ErrorData.Builder.class); |
||||
|
} |
||||
|
|
||||
|
public static final int COM_ERROR_CODE_FIELD_NUMBER = 1; |
||||
|
private int comErrorCode_ = 0; |
||||
|
/** |
||||
|
* <code>int32 Com_Error_Code = 1;</code> |
||||
|
* @return The comErrorCode. |
||||
|
*/ |
||||
|
@java.lang.Override |
||||
|
public int getComErrorCode() { |
||||
|
return comErrorCode_; |
||||
|
} |
||||
|
|
||||
|
public static final int LEFT_MOTOR_ERROR_CODE_FIELD_NUMBER = 2; |
||||
|
private int leftMotorErrorCode_ = 0; |
||||
|
/** |
||||
|
* <code>int32 Left_Motor_Error_Code = 2;</code> |
||||
|
* @return The leftMotorErrorCode. |
||||
|
*/ |
||||
|
@java.lang.Override |
||||
|
public int getLeftMotorErrorCode() { |
||||
|
return leftMotorErrorCode_; |
||||
|
} |
||||
|
|
||||
|
public static final int RIGHT_MOTOR_ERROR_CODE_FIELD_NUMBER = 3; |
||||
|
private int rightMotorErrorCode_ = 0; |
||||
|
/** |
||||
|
* <code>int32 Right_Motor_Error_Code = 3;</code> |
||||
|
* @return The rightMotorErrorCode. |
||||
|
*/ |
||||
|
@java.lang.Override |
||||
|
public int getRightMotorErrorCode() { |
||||
|
return rightMotorErrorCode_; |
||||
|
} |
||||
|
|
||||
|
private byte memoizedIsInitialized = -1; |
||||
|
@java.lang.Override |
||||
|
public final boolean isInitialized() { |
||||
|
byte isInitialized = memoizedIsInitialized; |
||||
|
if (isInitialized == 1) return true; |
||||
|
if (isInitialized == 0) return false; |
||||
|
|
||||
|
memoizedIsInitialized = 1; |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public void writeTo(com.google.protobuf.CodedOutputStream output) |
||||
|
throws java.io.IOException { |
||||
|
if (comErrorCode_ != 0) { |
||||
|
output.writeInt32(1, comErrorCode_); |
||||
|
} |
||||
|
if (leftMotorErrorCode_ != 0) { |
||||
|
output.writeInt32(2, leftMotorErrorCode_); |
||||
|
} |
||||
|
if (rightMotorErrorCode_ != 0) { |
||||
|
output.writeInt32(3, rightMotorErrorCode_); |
||||
|
} |
||||
|
getUnknownFields().writeTo(output); |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public int getSerializedSize() { |
||||
|
int size = memoizedSize; |
||||
|
if (size != -1) return size; |
||||
|
|
||||
|
size = 0; |
||||
|
if (comErrorCode_ != 0) { |
||||
|
size += com.google.protobuf.CodedOutputStream |
||||
|
.computeInt32Size(1, comErrorCode_); |
||||
|
} |
||||
|
if (leftMotorErrorCode_ != 0) { |
||||
|
size += com.google.protobuf.CodedOutputStream |
||||
|
.computeInt32Size(2, leftMotorErrorCode_); |
||||
|
} |
||||
|
if (rightMotorErrorCode_ != 0) { |
||||
|
size += com.google.protobuf.CodedOutputStream |
||||
|
.computeInt32Size(3, rightMotorErrorCode_); |
||||
|
} |
||||
|
size += getUnknownFields().getSerializedSize(); |
||||
|
memoizedSize = size; |
||||
|
return size; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public boolean equals(final java.lang.Object obj) { |
||||
|
if (obj == this) { |
||||
|
return true; |
||||
|
} |
||||
|
if (!(obj instanceof com.example.paintingapp.models.BspError.ErrorData)) { |
||||
|
return super.equals(obj); |
||||
|
} |
||||
|
com.example.paintingapp.models.BspError.ErrorData other = (com.example.paintingapp.models.BspError.ErrorData) obj; |
||||
|
|
||||
|
if (getComErrorCode() |
||||
|
!= other.getComErrorCode()) return false; |
||||
|
if (getLeftMotorErrorCode() |
||||
|
!= other.getLeftMotorErrorCode()) return false; |
||||
|
if (getRightMotorErrorCode() |
||||
|
!= other.getRightMotorErrorCode()) return false; |
||||
|
if (!getUnknownFields().equals(other.getUnknownFields())) return false; |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public int hashCode() { |
||||
|
if (memoizedHashCode != 0) { |
||||
|
return memoizedHashCode; |
||||
|
} |
||||
|
int hash = 41; |
||||
|
hash = (19 * hash) + getDescriptor().hashCode(); |
||||
|
hash = (37 * hash) + COM_ERROR_CODE_FIELD_NUMBER; |
||||
|
hash = (53 * hash) + getComErrorCode(); |
||||
|
hash = (37 * hash) + LEFT_MOTOR_ERROR_CODE_FIELD_NUMBER; |
||||
|
hash = (53 * hash) + getLeftMotorErrorCode(); |
||||
|
hash = (37 * hash) + RIGHT_MOTOR_ERROR_CODE_FIELD_NUMBER; |
||||
|
hash = (53 * hash) + getRightMotorErrorCode(); |
||||
|
hash = (29 * hash) + getUnknownFields().hashCode(); |
||||
|
memoizedHashCode = hash; |
||||
|
return hash; |
||||
|
} |
||||
|
|
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseFrom( |
||||
|
java.nio.ByteBuffer data) |
||||
|
throws com.google.protobuf.InvalidProtocolBufferException { |
||||
|
return PARSER.parseFrom(data); |
||||
|
} |
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseFrom( |
||||
|
java.nio.ByteBuffer data, |
||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
||||
|
throws com.google.protobuf.InvalidProtocolBufferException { |
||||
|
return PARSER.parseFrom(data, extensionRegistry); |
||||
|
} |
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseFrom( |
||||
|
com.google.protobuf.ByteString data) |
||||
|
throws com.google.protobuf.InvalidProtocolBufferException { |
||||
|
return PARSER.parseFrom(data); |
||||
|
} |
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseFrom( |
||||
|
com.google.protobuf.ByteString data, |
||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
||||
|
throws com.google.protobuf.InvalidProtocolBufferException { |
||||
|
return PARSER.parseFrom(data, extensionRegistry); |
||||
|
} |
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseFrom(byte[] data) |
||||
|
throws com.google.protobuf.InvalidProtocolBufferException { |
||||
|
return PARSER.parseFrom(data); |
||||
|
} |
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseFrom( |
||||
|
byte[] data, |
||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
||||
|
throws com.google.protobuf.InvalidProtocolBufferException { |
||||
|
return PARSER.parseFrom(data, extensionRegistry); |
||||
|
} |
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseFrom(java.io.InputStream input) |
||||
|
throws java.io.IOException { |
||||
|
return com.google.protobuf.GeneratedMessage |
||||
|
.parseWithIOException(PARSER, input); |
||||
|
} |
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseFrom( |
||||
|
java.io.InputStream input, |
||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
||||
|
throws java.io.IOException { |
||||
|
return com.google.protobuf.GeneratedMessage |
||||
|
.parseWithIOException(PARSER, input, extensionRegistry); |
||||
|
} |
||||
|
|
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseDelimitedFrom(java.io.InputStream input) |
||||
|
throws java.io.IOException { |
||||
|
return com.google.protobuf.GeneratedMessage |
||||
|
.parseDelimitedWithIOException(PARSER, input); |
||||
|
} |
||||
|
|
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseDelimitedFrom( |
||||
|
java.io.InputStream input, |
||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
||||
|
throws java.io.IOException { |
||||
|
return com.google.protobuf.GeneratedMessage |
||||
|
.parseDelimitedWithIOException(PARSER, input, extensionRegistry); |
||||
|
} |
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseFrom( |
||||
|
com.google.protobuf.CodedInputStream input) |
||||
|
throws java.io.IOException { |
||||
|
return com.google.protobuf.GeneratedMessage |
||||
|
.parseWithIOException(PARSER, input); |
||||
|
} |
||||
|
public static com.example.paintingapp.models.BspError.ErrorData parseFrom( |
||||
|
com.google.protobuf.CodedInputStream input, |
||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
||||
|
throws java.io.IOException { |
||||
|
return com.google.protobuf.GeneratedMessage |
||||
|
.parseWithIOException(PARSER, input, extensionRegistry); |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public Builder newBuilderForType() { return newBuilder(); } |
||||
|
public static Builder newBuilder() { |
||||
|
return DEFAULT_INSTANCE.toBuilder(); |
||||
|
} |
||||
|
public static Builder newBuilder(com.example.paintingapp.models.BspError.ErrorData prototype) { |
||||
|
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); |
||||
|
} |
||||
|
@java.lang.Override |
||||
|
public Builder toBuilder() { |
||||
|
return this == DEFAULT_INSTANCE |
||||
|
? new Builder() : new Builder().mergeFrom(this); |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
protected Builder newBuilderForType( |
||||
|
com.google.protobuf.GeneratedMessage.BuilderParent parent) { |
||||
|
Builder builder = new Builder(parent); |
||||
|
return builder; |
||||
|
} |
||||
|
/** |
||||
|
* Protobuf type {@code ErrorData} |
||||
|
*/ |
||||
|
public static final class Builder extends |
||||
|
com.google.protobuf.GeneratedMessage.Builder<Builder> implements |
||||
|
// @@protoc_insertion_point(builder_implements:ErrorData)
|
||||
|
com.example.paintingapp.models.BspError.ErrorDataOrBuilder { |
||||
|
public static final com.google.protobuf.Descriptors.Descriptor |
||||
|
getDescriptor() { |
||||
|
return com.example.paintingapp.models.BspError.internal_static_ErrorData_descriptor; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
||||
|
internalGetFieldAccessorTable() { |
||||
|
return com.example.paintingapp.models.BspError.internal_static_ErrorData_fieldAccessorTable |
||||
|
.ensureFieldAccessorsInitialized( |
||||
|
com.example.paintingapp.models.BspError.ErrorData.class, com.example.paintingapp.models.BspError.ErrorData.Builder.class); |
||||
|
} |
||||
|
|
||||
|
// Construct using com.example.paintingapp.models.BspError.ErrorData.newBuilder()
|
||||
|
private Builder() { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private Builder( |
||||
|
com.google.protobuf.GeneratedMessage.BuilderParent parent) { |
||||
|
super(parent); |
||||
|
|
||||
|
} |
||||
|
@java.lang.Override |
||||
|
public Builder clear() { |
||||
|
super.clear(); |
||||
|
bitField0_ = 0; |
||||
|
comErrorCode_ = 0; |
||||
|
leftMotorErrorCode_ = 0; |
||||
|
rightMotorErrorCode_ = 0; |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public com.google.protobuf.Descriptors.Descriptor |
||||
|
getDescriptorForType() { |
||||
|
return com.example.paintingapp.models.BspError.internal_static_ErrorData_descriptor; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public com.example.paintingapp.models.BspError.ErrorData getDefaultInstanceForType() { |
||||
|
return com.example.paintingapp.models.BspError.ErrorData.getDefaultInstance(); |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public com.example.paintingapp.models.BspError.ErrorData build() { |
||||
|
com.example.paintingapp.models.BspError.ErrorData result = buildPartial(); |
||||
|
if (!result.isInitialized()) { |
||||
|
throw newUninitializedMessageException(result); |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public com.example.paintingapp.models.BspError.ErrorData buildPartial() { |
||||
|
com.example.paintingapp.models.BspError.ErrorData result = new com.example.paintingapp.models.BspError.ErrorData(this); |
||||
|
if (bitField0_ != 0) { buildPartial0(result); } |
||||
|
onBuilt(); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
private void buildPartial0(com.example.paintingapp.models.BspError.ErrorData result) { |
||||
|
int from_bitField0_ = bitField0_; |
||||
|
if (((from_bitField0_ & 0x00000001) != 0)) { |
||||
|
result.comErrorCode_ = comErrorCode_; |
||||
|
} |
||||
|
if (((from_bitField0_ & 0x00000002) != 0)) { |
||||
|
result.leftMotorErrorCode_ = leftMotorErrorCode_; |
||||
|
} |
||||
|
if (((from_bitField0_ & 0x00000004) != 0)) { |
||||
|
result.rightMotorErrorCode_ = rightMotorErrorCode_; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public Builder mergeFrom(com.google.protobuf.Message other) { |
||||
|
if (other instanceof com.example.paintingapp.models.BspError.ErrorData) { |
||||
|
return mergeFrom((com.example.paintingapp.models.BspError.ErrorData)other); |
||||
|
} else { |
||||
|
super.mergeFrom(other); |
||||
|
return this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public Builder mergeFrom(com.example.paintingapp.models.BspError.ErrorData other) { |
||||
|
if (other == com.example.paintingapp.models.BspError.ErrorData.getDefaultInstance()) return this; |
||||
|
if (other.getComErrorCode() != 0) { |
||||
|
setComErrorCode(other.getComErrorCode()); |
||||
|
} |
||||
|
if (other.getLeftMotorErrorCode() != 0) { |
||||
|
setLeftMotorErrorCode(other.getLeftMotorErrorCode()); |
||||
|
} |
||||
|
if (other.getRightMotorErrorCode() != 0) { |
||||
|
setRightMotorErrorCode(other.getRightMotorErrorCode()); |
||||
|
} |
||||
|
this.mergeUnknownFields(other.getUnknownFields()); |
||||
|
onChanged(); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public final boolean isInitialized() { |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public Builder mergeFrom( |
||||
|
com.google.protobuf.CodedInputStream input, |
||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
||||
|
throws java.io.IOException { |
||||
|
if (extensionRegistry == null) { |
||||
|
throw new java.lang.NullPointerException(); |
||||
|
} |
||||
|
try { |
||||
|
boolean done = false; |
||||
|
while (!done) { |
||||
|
int tag = input.readTag(); |
||||
|
switch (tag) { |
||||
|
case 0: |
||||
|
done = true; |
||||
|
break; |
||||
|
case 8: { |
||||
|
comErrorCode_ = input.readInt32(); |
||||
|
bitField0_ |= 0x00000001; |
||||
|
break; |
||||
|
} // case 8
|
||||
|
case 16: { |
||||
|
leftMotorErrorCode_ = input.readInt32(); |
||||
|
bitField0_ |= 0x00000002; |
||||
|
break; |
||||
|
} // case 16
|
||||
|
case 24: { |
||||
|
rightMotorErrorCode_ = input.readInt32(); |
||||
|
bitField0_ |= 0x00000004; |
||||
|
break; |
||||
|
} // case 24
|
||||
|
default: { |
||||
|
if (!super.parseUnknownField(input, extensionRegistry, tag)) { |
||||
|
done = true; // was an endgroup tag
|
||||
|
} |
||||
|
break; |
||||
|
} // default:
|
||||
|
} // switch (tag)
|
||||
|
} // while (!done)
|
||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) { |
||||
|
throw e.unwrapIOException(); |
||||
|
} finally { |
||||
|
onChanged(); |
||||
|
} // finally
|
||||
|
return this; |
||||
|
} |
||||
|
private int bitField0_; |
||||
|
|
||||
|
private int comErrorCode_ ; |
||||
|
/** |
||||
|
* <code>int32 Com_Error_Code = 1;</code> |
||||
|
* @return The comErrorCode. |
||||
|
*/ |
||||
|
@java.lang.Override |
||||
|
public int getComErrorCode() { |
||||
|
return comErrorCode_; |
||||
|
} |
||||
|
/** |
||||
|
* <code>int32 Com_Error_Code = 1;</code> |
||||
|
* @param value The comErrorCode to set. |
||||
|
* @return This builder for chaining. |
||||
|
*/ |
||||
|
public Builder setComErrorCode(int value) { |
||||
|
|
||||
|
comErrorCode_ = value; |
||||
|
bitField0_ |= 0x00000001; |
||||
|
onChanged(); |
||||
|
return this; |
||||
|
} |
||||
|
/** |
||||
|
* <code>int32 Com_Error_Code = 1;</code> |
||||
|
* @return This builder for chaining. |
||||
|
*/ |
||||
|
public Builder clearComErrorCode() { |
||||
|
bitField0_ = (bitField0_ & ~0x00000001); |
||||
|
comErrorCode_ = 0; |
||||
|
onChanged(); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
private int leftMotorErrorCode_ ; |
||||
|
/** |
||||
|
* <code>int32 Left_Motor_Error_Code = 2;</code> |
||||
|
* @return The leftMotorErrorCode. |
||||
|
*/ |
||||
|
@java.lang.Override |
||||
|
public int getLeftMotorErrorCode() { |
||||
|
return leftMotorErrorCode_; |
||||
|
} |
||||
|
/** |
||||
|
* <code>int32 Left_Motor_Error_Code = 2;</code> |
||||
|
* @param value The leftMotorErrorCode to set. |
||||
|
* @return This builder for chaining. |
||||
|
*/ |
||||
|
public Builder setLeftMotorErrorCode(int value) { |
||||
|
|
||||
|
leftMotorErrorCode_ = value; |
||||
|
bitField0_ |= 0x00000002; |
||||
|
onChanged(); |
||||
|
return this; |
||||
|
} |
||||
|
/** |
||||
|
* <code>int32 Left_Motor_Error_Code = 2;</code> |
||||
|
* @return This builder for chaining. |
||||
|
*/ |
||||
|
public Builder clearLeftMotorErrorCode() { |
||||
|
bitField0_ = (bitField0_ & ~0x00000002); |
||||
|
leftMotorErrorCode_ = 0; |
||||
|
onChanged(); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
private int rightMotorErrorCode_ ; |
||||
|
/** |
||||
|
* <code>int32 Right_Motor_Error_Code = 3;</code> |
||||
|
* @return The rightMotorErrorCode. |
||||
|
*/ |
||||
|
@java.lang.Override |
||||
|
public int getRightMotorErrorCode() { |
||||
|
return rightMotorErrorCode_; |
||||
|
} |
||||
|
/** |
||||
|
* <code>int32 Right_Motor_Error_Code = 3;</code> |
||||
|
* @param value The rightMotorErrorCode to set. |
||||
|
* @return This builder for chaining. |
||||
|
*/ |
||||
|
public Builder setRightMotorErrorCode(int value) { |
||||
|
|
||||
|
rightMotorErrorCode_ = value; |
||||
|
bitField0_ |= 0x00000004; |
||||
|
onChanged(); |
||||
|
return this; |
||||
|
} |
||||
|
/** |
||||
|
* <code>int32 Right_Motor_Error_Code = 3;</code> |
||||
|
* @return This builder for chaining. |
||||
|
*/ |
||||
|
public Builder clearRightMotorErrorCode() { |
||||
|
bitField0_ = (bitField0_ & ~0x00000004); |
||||
|
rightMotorErrorCode_ = 0; |
||||
|
onChanged(); |
||||
|
return this; |
||||
|
} |
||||
|
|
||||
|
// @@protoc_insertion_point(builder_scope:ErrorData)
|
||||
|
} |
||||
|
|
||||
|
// @@protoc_insertion_point(class_scope:ErrorData)
|
||||
|
private static final com.example.paintingapp.models.BspError.ErrorData DEFAULT_INSTANCE; |
||||
|
static { |
||||
|
DEFAULT_INSTANCE = new com.example.paintingapp.models.BspError.ErrorData(); |
||||
|
} |
||||
|
|
||||
|
public static com.example.paintingapp.models.BspError.ErrorData getDefaultInstance() { |
||||
|
return DEFAULT_INSTANCE; |
||||
|
} |
||||
|
|
||||
|
private static final com.google.protobuf.Parser<ErrorData> |
||||
|
PARSER = new com.google.protobuf.AbstractParser<ErrorData>() { |
||||
|
@java.lang.Override |
||||
|
public ErrorData parsePartialFrom( |
||||
|
com.google.protobuf.CodedInputStream input, |
||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
||||
|
throws com.google.protobuf.InvalidProtocolBufferException { |
||||
|
Builder builder = newBuilder(); |
||||
|
try { |
||||
|
builder.mergeFrom(input, extensionRegistry); |
||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) { |
||||
|
throw e.setUnfinishedMessage(builder.buildPartial()); |
||||
|
} catch (com.google.protobuf.UninitializedMessageException e) { |
||||
|
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); |
||||
|
} catch (java.io.IOException e) { |
||||
|
throw new com.google.protobuf.InvalidProtocolBufferException(e) |
||||
|
.setUnfinishedMessage(builder.buildPartial()); |
||||
|
} |
||||
|
return builder.buildPartial(); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
public static com.google.protobuf.Parser<ErrorData> parser() { |
||||
|
return PARSER; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public com.google.protobuf.Parser<ErrorData> getParserForType() { |
||||
|
return PARSER; |
||||
|
} |
||||
|
|
||||
|
@java.lang.Override |
||||
|
public com.example.paintingapp.models.BspError.ErrorData getDefaultInstanceForType() { |
||||
|
return DEFAULT_INSTANCE; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private static final com.google.protobuf.Descriptors.Descriptor |
||||
|
internal_static_ErrorData_descriptor; |
||||
|
private static final |
||||
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable |
||||
|
internal_static_ErrorData_fieldAccessorTable; |
||||
|
|
||||
|
public static com.google.protobuf.Descriptors.FileDescriptor |
||||
|
getDescriptor() { |
||||
|
return descriptor; |
||||
|
} |
||||
|
private static com.google.protobuf.Descriptors.FileDescriptor |
||||
|
descriptor; |
||||
|
static { |
||||
|
java.lang.String[] descriptorData = { |
||||
|
"\n\017bsp_Error.proto\"b\n\tErrorData\022\026\n\016Com_Er" + |
||||
|
"ror_Code\030\001 \001(\005\022\035\n\025Left_Motor_Error_Code\030" + |
||||
|
"\002 \001(\005\022\036\n\026Right_Motor_Error_Code\030\003 \001(\005*r\n" + |
||||
|
"\010ComError\022\r\n\tMK32_SBus\020\000\022\017\n\013MK32_Serial\020" + |
||||
|
"\001\022\025\n\021MK32_InitialState\020\002\022\n\n\006TL720D\020\003\022\020\n\014" + |
||||
|
"LS_LeftMotor\020\004\022\021\n\rLS_RightMotor\020\005B\"\n\036com" + |
||||
|
".example.paintingapp.modelsP\000b\006proto3" |
||||
|
}; |
||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor |
||||
|
.internalBuildGeneratedFileFrom(descriptorData, |
||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] { |
||||
|
}); |
||||
|
internal_static_ErrorData_descriptor = |
||||
|
getDescriptor().getMessageTypes().get(0); |
||||
|
internal_static_ErrorData_fieldAccessorTable = new |
||||
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable( |
||||
|
internal_static_ErrorData_descriptor, |
||||
|
new java.lang.String[] { "ComErrorCode", "LeftMotorErrorCode", "RightMotorErrorCode", }); |
||||
|
descriptor.resolveAllFeaturesImmutable(); |
||||
|
} |
||||
|
|
||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
package com.example.paintingapp.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; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,107 @@ |
|||||
|
package com.example.paintingapp.models; |
||||
|
|
||||
|
import androidx.databinding.BaseObservable; |
||||
|
|
||||
|
public class DisplayPV extends BaseObservable { |
||||
|
|
||||
|
|
||||
|
|
||||
|
private int leftCompSelect; |
||||
|
public int getLeftCompSelect() { |
||||
|
return leftCompSelect; |
||||
|
} |
||||
|
|
||||
|
public void setLeftCompSelect(int leftCompSelect) { |
||||
|
this.leftCompSelect = leftCompSelect; |
||||
|
} |
||||
|
|
||||
|
private int rightCompSelect; |
||||
|
public int getRightCompSelect() { |
||||
|
return rightCompSelect; |
||||
|
} |
||||
|
public void setRightCompSelect(int rightCompSelect) { |
||||
|
this.rightCompSelect = rightCompSelect; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
private int id; |
||||
|
public int getId() { |
||||
|
return id; |
||||
|
} |
||||
|
public void setId(int id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
private int RobotSpeedValue; |
||||
|
public int getRobotSpeedValue() { |
||||
|
return RobotSpeedValue; |
||||
|
} |
||||
|
public void setRobotSpeedValue(int speedSelect) { |
||||
|
this.RobotSpeedValue = speedSelect; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
private int laneChangeDistance; |
||||
|
public int getLaneChangeDistance() { |
||||
|
return laneChangeDistance; |
||||
|
} |
||||
|
public void setLaneChangeDistance(int laneChangeDistance) { |
||||
|
this.laneChangeDistance = laneChangeDistance; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
private int workDistanceMeters; |
||||
|
public int getWorkDistanceMeters() { |
||||
|
return workDistanceMeters; |
||||
|
} |
||||
|
public void setWorkDistanceMeters(int workDistanceMeters) { |
||||
|
this.workDistanceMeters = workDistanceMeters; |
||||
|
} |
||||
|
|
||||
|
private int workWidthMeters; |
||||
|
public int getWorkWidthMeters() { |
||||
|
return workWidthMeters; |
||||
|
} |
||||
|
public void setWorkWidthMeters(int workWidthMeters) { |
||||
|
this.workWidthMeters = workWidthMeters; |
||||
|
} |
||||
|
|
||||
|
private double verticalCalibration; |
||||
|
public double getVerticalCalibration() { |
||||
|
return verticalCalibration; |
||||
|
} |
||||
|
public void setVerticalCalibration(double verticalCalibration) { |
||||
|
this.verticalCalibration = verticalCalibration; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public DisplayPV(int id,int RobotSpeedValue, int laneChangeDistance, int workDistance, int workWidth, |
||||
|
double verticalCalibration) |
||||
|
{ |
||||
|
this.id = id; |
||||
|
this.RobotSpeedValue = RobotSpeedValue; |
||||
|
this.laneChangeDistance = laneChangeDistance; |
||||
|
this.workDistanceMeters = workDistance; |
||||
|
this.workWidthMeters = workWidth; |
||||
|
this.verticalCalibration = verticalCalibration; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public DisplayPV(int id,int RobotSpeedValue, int laneChangeDistance, int workDistance, int workWidth, |
||||
|
int leftCompSelect,int rightCompSelect,double verticalCalibration) |
||||
|
{ |
||||
|
this.id = id; |
||||
|
this.RobotSpeedValue = RobotSpeedValue; |
||||
|
this.laneChangeDistance = laneChangeDistance; |
||||
|
this.workDistanceMeters = workDistance; |
||||
|
|
||||
|
this.workWidthMeters = workWidth; |
||||
|
this.leftCompSelect = leftCompSelect; |
||||
|
this.rightCompSelect = rightCompSelect; |
||||
|
this.verticalCalibration = verticalCalibration; |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.example.paintingapp.models; |
||||
|
|
||||
|
public class ErrorModel { |
||||
|
|
||||
|
public ErrorModel(long timeID, String errorInfo) { |
||||
|
this.timeID = timeID; |
||||
|
this.errorInfo = errorInfo; |
||||
|
} |
||||
|
private long timeID; |
||||
|
|
||||
|
|
||||
|
public void setDateTimeBJ(String dateTimeUTC) { |
||||
|
this.dateTimeBJ = dateTimeUTC; |
||||
|
} |
||||
|
|
||||
|
private String errorInfo; |
||||
|
|
||||
|
public String getDateTimeBJ() { |
||||
|
return dateTimeBJ; |
||||
|
} |
||||
|
|
||||
|
private String dateTimeBJ; |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return String.valueOf(dateTimeBJ + errorInfo); |
||||
|
} |
||||
|
public void setTimeID(long timeID) { |
||||
|
this.timeID = timeID; |
||||
|
} |
||||
|
|
||||
|
public void setErrorInfo(String errorInfo) { |
||||
|
this.errorInfo = errorInfo; |
||||
|
} |
||||
|
|
||||
|
public long getTimeID() { |
||||
|
return timeID; |
||||
|
} |
||||
|
|
||||
|
public String getErrorInfo() { |
||||
|
return errorInfo; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
package com.example.paintingapp.models; |
||||
|
|
||||
|
import android.content.Context; |
||||
|
import android.util.AttributeSet; |
||||
|
import android.view.View; |
||||
|
import android.widget.ScrollView; |
||||
|
|
||||
|
public class ScrollBottomScrollView extends ScrollView { |
||||
|
|
||||
|
private OnScrollBottomListener listener; |
||||
|
private int calCount; |
||||
|
|
||||
|
public interface OnScrollBottomListener { |
||||
|
void scrollToBottom(); |
||||
|
} |
||||
|
|
||||
|
public void onScrollViewScrollToBottom(OnScrollBottomListener l) { |
||||
|
listener = l; |
||||
|
} |
||||
|
|
||||
|
public void unRegisterOnScrollViewScrollToBottom() { |
||||
|
listener = null; |
||||
|
} |
||||
|
|
||||
|
public ScrollBottomScrollView(Context context, AttributeSet attrs) { |
||||
|
super(context, attrs); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
protected void onScrollChanged(int l, int t, int oldl, int oldt) { |
||||
|
View view = this.getChildAt(0); |
||||
|
if (this.getHeight() + this.getScrollY() == view.getHeight()) { |
||||
|
calCount++; |
||||
|
if (calCount == 1) { |
||||
|
if (listener != null) { |
||||
|
listener.scrollToBottom(); |
||||
|
} |
||||
|
} |
||||
|
} else { |
||||
|
calCount = 0; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.example.paintingapp.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(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.example.paintingapp.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); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,58 @@ |
|||||
|
package com.example.paintingapp.services; |
||||
|
import com.example.paintingapp.models.BspError; |
||||
|
|
||||
|
public class ErrorDeocdeHelper { |
||||
|
|
||||
|
//private static Map<String, Integer> flagMap = new HashMap<>();
|
||||
|
|
||||
|
// public static void AddMap(String errorName, Integer bitPosition)
|
||||
|
// {
|
||||
|
// flagMap.put(errorName,bitPosition);
|
||||
|
// }
|
||||
|
private static String ErrorResult; |
||||
|
private static String addErrorResult; |
||||
|
public static String ErrorDeocde(int data) |
||||
|
{ |
||||
|
ErrorResult=""; |
||||
|
|
||||
|
// 循环遍历 Map
|
||||
|
for (BspError.ComError err : BspError.ComError.values()) { |
||||
|
|
||||
|
int bitPosiiton = err.ordinal(); |
||||
|
// if (err.toString().equals("UNRECOGNIZED")) continue;
|
||||
|
// if (err.toString().equals("TL720D"))
|
||||
|
// addErrorResult = " 作业模式已切换至手动";
|
||||
|
// else
|
||||
|
// addErrorResult = " ";
|
||||
|
//
|
||||
|
// if (err.toString().equals("MK32_InitialState"))
|
||||
|
// addErrorResult = " 遥控器按键未复位";
|
||||
|
// else
|
||||
|
// addErrorResult = " ";
|
||||
|
|
||||
|
|
||||
|
// 使用左移操作生成要检查的标志位
|
||||
|
int bitToCheck = 1 << bitPosiiton; |
||||
|
|
||||
|
// 判断该位置是否有对应的标志位
|
||||
|
if ((data & bitToCheck) != 0) |
||||
|
{ |
||||
|
|
||||
|
// ErrorResult += String.valueOf(bitPosiiton);
|
||||
|
|
||||
|
if (err.toString().equals("MK32_InitialState")) |
||||
|
{ |
||||
|
ErrorResult = "未复位" ; |
||||
|
} |
||||
|
// else
|
||||
|
// {
|
||||
|
// ErrorResult += err.toString()+addErrorResult+"\t";
|
||||
|
// }
|
||||
|
} |
||||
|
} |
||||
|
return ErrorResult; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
package com.example.paintingapp.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); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,72 @@ |
|||||
|
package com.example.paintingapp.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; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,223 @@ |
|||||
|
package com.example.paintingapp.services; |
||||
|
|
||||
|
import android.annotation.SuppressLint; |
||||
|
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.paintingapp.models.DisplayPV; |
||||
|
import com.example.paintingapp.models.ErrorModel; |
||||
|
|
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.TimeZone; |
||||
|
|
||||
|
public class MyDataHelper extends SQLiteOpenHelper { |
||||
|
public static final String COLUMN_ID = "id"; |
||||
|
public static final String TABLE_NAME = "information"; |
||||
|
public static final String COLUMN_LEFT_COMPENSATION = "leftCompensation"; |
||||
|
public static final String COLUMN_RIGHT_COMPENSATION = "rightCompensation"; |
||||
|
public static final String COLUMN_LANCE_CHANGE_DISTANCE = "lanceChangeDistance"; |
||||
|
|
||||
|
public static final String COLUMN_SPEED = "speed"; |
||||
|
public static final String COLUMN_WORK_WIDTH = "workDistance"; |
||||
|
public static final String COLUMN_WORK_DISTANCE = "workWidth"; |
||||
|
public static final String COLUMN_VERTICAL_CALIBRATION = "verticalCalibration"; |
||||
|
|
||||
|
|
||||
|
|
||||
|
public static final String Error_TABLE_NAME = "error"; |
||||
|
public static final String Error_COLUMN_Iime_ID = "timeID"; |
||||
|
public static final String Error_COLUMN_ERROR_INFO = "errorInfo"; |
||||
|
|
||||
|
List<ErrorModel> robotErrorList = new ArrayList<>() ; |
||||
|
|
||||
|
public MyDataHelper(@Nullable Context context) { |
||||
|
super(context, "bingRobot.db", null, 1); |
||||
|
} |
||||
|
|
||||
|
@SuppressLint("SQLiteString") |
||||
|
@Override |
||||
|
public void onCreate(SQLiteDatabase db) { |
||||
|
|
||||
|
String sql = "CREATE TABLE " + TABLE_NAME + "(" + COLUMN_ID + " INTEGER PRIMARY KEY ," + |
||||
|
COLUMN_SPEED + " INTEGER," + |
||||
|
COLUMN_LANCE_CHANGE_DISTANCE + " INTEGER," + |
||||
|
COLUMN_WORK_WIDTH + " INTEGER," + |
||||
|
COLUMN_WORK_DISTANCE + " INTEGER," + |
||||
|
COLUMN_LEFT_COMPENSATION + " DOUBLE," + |
||||
|
COLUMN_RIGHT_COMPENSATION + " DOUBLE," + |
||||
|
COLUMN_VERTICAL_CALIBRATION + " DOUBLE" + |
||||
|
")"; |
||||
|
db.execSQL(sql); |
||||
|
|
||||
|
// (int id, int leftCompSelect, int rightCompSelect, int speedSelect, int laneChangeSelect, int endForceValue)
|
||||
|
|
||||
|
sql = "CREATE TABLE " + Error_TABLE_NAME + "(" + Error_COLUMN_Iime_ID + " INTEGER PRIMARY KEY ," + |
||||
|
Error_COLUMN_ERROR_INFO + " STRING " + ")"; |
||||
|
db.execSQL(sql); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { |
||||
|
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); |
||||
|
db.execSQL("DROP TABLE IF EXISTS " + Error_TABLE_NAME); |
||||
|
onCreate(db); |
||||
|
} |
||||
|
|
||||
|
//增 删 改 查
|
||||
|
public String addOrUpdateDisplayData(DisplayPV pv) { |
||||
|
ContentValues cv = new ContentValues(); |
||||
|
cv.put(COLUMN_ID, pv.getId()); |
||||
|
cv.put(COLUMN_SPEED, pv.getRobotSpeedValue()); |
||||
|
cv.put(COLUMN_LANCE_CHANGE_DISTANCE, pv.getLaneChangeDistance()); |
||||
|
cv.put(COLUMN_WORK_DISTANCE, pv.getWorkDistanceMeters()); |
||||
|
cv.put(COLUMN_WORK_WIDTH, pv.getWorkWidthMeters()); |
||||
|
cv.put(COLUMN_LEFT_COMPENSATION, pv.getLeftCompSelect()); |
||||
|
cv.put(COLUMN_RIGHT_COMPENSATION, pv.getRightCompSelect()); |
||||
|
cv.put(COLUMN_VERTICAL_CALIBRATION, pv.getVerticalCalibration()); |
||||
|
|
||||
|
|
||||
|
SQLiteDatabase sqliteDatabase = this.getWritableDatabase(); |
||||
|
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.isEmpty()) { |
||||
|
DisplayPV pv = new DisplayPV(i, 1, 40, 1, 1, 0,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); |
||||
|
|
||||
|
int idIndex = cursor.getColumnIndex(COLUMN_ID); |
||||
|
|
||||
|
|
||||
|
|
||||
|
int _laneChangeDistanceIndex = cursor.getColumnIndex(COLUMN_LANCE_CHANGE_DISTANCE); |
||||
|
int _speedIndex = cursor.getColumnIndex(COLUMN_SPEED); |
||||
|
int _workdWidth = cursor.getColumnIndex(COLUMN_WORK_WIDTH); |
||||
|
int _workdDistance = cursor.getColumnIndex(COLUMN_WORK_DISTANCE); |
||||
|
int _leftCompSelect = cursor.getColumnIndex(COLUMN_LEFT_COMPENSATION); |
||||
|
int _rightCompSelect = cursor.getColumnIndex(COLUMN_RIGHT_COMPENSATION); |
||||
|
int _vertical_calibraton = cursor.getColumnIndex(COLUMN_VERTICAL_CALIBRATION); |
||||
|
|
||||
|
while (cursor.moveToNext()) { |
||||
|
|
||||
|
DisplayPV pv = new DisplayPV(cursor.getInt(idIndex), |
||||
|
cursor.getInt(_speedIndex), cursor.getInt(_laneChangeDistanceIndex), |
||||
|
cursor.getInt(_workdDistance), cursor.getInt(_workdWidth), |
||||
|
cursor.getInt(_leftCompSelect),cursor.getInt(_rightCompSelect), |
||||
|
cursor.getDouble(_vertical_calibraton) |
||||
|
); |
||||
|
|
||||
|
// (int id, int leftCompSelect, int rightCompSelect, int speedSelect, int laneChangeSelect, int endForceValue)
|
||||
|
|
||||
|
list.add(pv); |
||||
|
} |
||||
|
cursor.close(); |
||||
|
sqLiteDatabase.close(); |
||||
|
return list; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public String AddOrUpdateErrorModel(ErrorModel em) { |
||||
|
ContentValues cv = new ContentValues(); |
||||
|
cv.put(Error_COLUMN_Iime_ID, em.getTimeID()); |
||||
|
cv.put(Error_COLUMN_ERROR_INFO, em.getErrorInfo()); |
||||
|
|
||||
|
SQLiteDatabase sqliteDatabase = this.getWritableDatabase(); |
||||
|
long insert = sqliteDatabase.insertWithOnConflict(Error_TABLE_NAME, null, cv, SQLiteDatabase.CONFLICT_REPLACE); |
||||
|
sqliteDatabase.close(); |
||||
|
if (insert == -1) { |
||||
|
return "failed"; |
||||
|
} |
||||
|
return "success"; |
||||
|
} |
||||
|
|
||||
|
public String DeleteAllErrorModels() { |
||||
|
SQLiteDatabase sqLiteDatabase = this.getWritableDatabase(); |
||||
|
int delete = sqLiteDatabase.delete(Error_TABLE_NAME, null, |
||||
|
null); |
||||
|
|
||||
|
sqLiteDatabase.close(); |
||||
|
if (delete == 0) { |
||||
|
return "failed"; |
||||
|
} |
||||
|
return "success"; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public List<ErrorModel> GetAllErrorModels() { |
||||
|
List<ErrorModel> list = new ArrayList<>(); |
||||
|
|
||||
|
String sql = "SELECT * FROM " + Error_TABLE_NAME; |
||||
|
SQLiteDatabase sqLiteDatabase = this.getWritableDatabase(); |
||||
|
Cursor cursor = sqLiteDatabase.rawQuery(sql, null); |
||||
|
|
||||
|
|
||||
|
|
||||
|
int _time_id_Index = cursor.getColumnIndex(Error_COLUMN_Iime_ID); |
||||
|
int _error_Index = cursor.getColumnIndex(Error_COLUMN_ERROR_INFO); |
||||
|
|
||||
|
while (cursor.moveToNext()) { |
||||
|
|
||||
|
ErrorModel em = new ErrorModel(cursor.getLong(_time_id_Index),cursor.getString(_error_Index)); |
||||
|
|
||||
|
Date date = new Date(em.getTimeID()); // 将时间戳转换为Date对象
|
||||
|
// 创建SimpleDateFormat实例,并设置时区为UTC
|
||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
||||
|
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); // 设置为UTC时区
|
||||
|
// 格式化日期
|
||||
|
String utcTime = sdf.format(date); |
||||
|
// System.out.println("UTC时间: " + utcTime);
|
||||
|
em.setDateTimeBJ(utcTime); |
||||
|
|
||||
|
list.add(em); |
||||
|
} |
||||
|
cursor.close(); |
||||
|
sqLiteDatabase.close(); |
||||
|
return list; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,653 @@ |
|||||
|
package com.example.paintingapp.services; |
||||
|
|
||||
|
import android.app.Dialog; |
||||
|
import android.text.method.ScrollingMovementMethod; |
||||
|
import android.view.View; |
||||
|
import android.widget.Button; |
||||
|
import android.widget.EditText; |
||||
|
import android.widget.RadioButton; |
||||
|
import android.widget.RadioGroup; |
||||
|
import android.widget.ScrollView; |
||||
|
import android.widget.TextView; |
||||
|
import android.widget.Toast; |
||||
|
|
||||
|
import com.example.paintingapp.MainActivity; |
||||
|
import com.example.paintingapp.R; |
||||
|
import com.example.paintingapp.models.DisplayPV; |
||||
|
import com.example.paintingapp.models.ErrorModel; |
||||
|
import com.example.paintingapp.models.ScrollBottomScrollView; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Objects; |
||||
|
|
||||
|
public class PopupHelper { |
||||
|
String manual_Mode_Call_Value = "无"; |
||||
|
String automatic_Mode_Call_Value = "无"; |
||||
|
int tool_Rotation_Direction_Value = 0; |
||||
|
|
||||
|
private final MainActivity mainActivity; |
||||
|
|
||||
|
public PopupHelper(MainActivity mainActivity) |
||||
|
{ |
||||
|
this.mainActivity = mainActivity; |
||||
|
} |
||||
|
|
||||
|
public void ManualModePopUp(View.OnClickListener context) { |
||||
|
Dialog dialog = new Dialog(mainActivity); |
||||
|
|
||||
|
dialog.setContentView(R.layout.manualmodepopup); // 设置自定义布局
|
||||
|
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
|
||||
|
|
||||
|
// 获取布局中的视图
|
||||
|
Button cancelButton = dialog.findViewById(R.id.manualModeCancel); |
||||
|
Button confirmButton = dialog.findViewById(R.id.manualModeModeApply); |
||||
|
//EditText landeChangeDistanceEditText = dialog.findViewById(R.id.);
|
||||
|
|
||||
|
// 设置取消按钮点击事件
|
||||
|
cancelButton.setOnClickListener(v -> { |
||||
|
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
// 设置单选按钮点击事件
|
||||
|
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.manualModeSelectorGroup); |
||||
|
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
||||
|
@Override |
||||
|
public void onCheckedChanged(RadioGroup group, int checkedId) { |
||||
|
RadioButton radioButton = (RadioButton) group.findViewById(checkedId); |
||||
|
manual_Mode_Call_Value = radioButton.getText().toString(); |
||||
|
} |
||||
|
}); |
||||
|
String ii = (mainActivity._manual_Mode_Call_Value); |
||||
|
switch (ii) |
||||
|
{ |
||||
|
case "无": { |
||||
|
radioGroup.check(R.id.rb_one); |
||||
|
break; |
||||
|
} |
||||
|
case "水平": { |
||||
|
radioGroup.check(R.id.rb_two); |
||||
|
break; |
||||
|
} |
||||
|
case "竖直向左": { |
||||
|
radioGroup.check(R.id.rb_three); |
||||
|
break; |
||||
|
} |
||||
|
case "竖直向右": { |
||||
|
radioGroup.check(R.id.rb_four); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
// 设置确定按钮点击事件
|
||||
|
confirmButton.setOnClickListener(v -> { |
||||
|
|
||||
|
mainActivity._manual_Mode_Call_Value = manual_Mode_Call_Value; |
||||
|
if(!Objects.equals(mainActivity._manual_Mode_Call_Value, "")){ |
||||
|
mainActivity._automatic_Mode_Call_Value="未启用"; |
||||
|
mainActivity.mainBinding.mainViewAutomaticModeTxView.setText("未启用"); |
||||
|
} |
||||
|
mainActivity.mainBinding.mainViewManualModeTxView.setText(mainActivity._manual_Mode_Call_Value); |
||||
|
|
||||
|
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show(); |
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
dialog.show(); // 显示弹窗
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void AutomaticModeSetPopUp(View.OnClickListener context) { |
||||
|
|
||||
|
|
||||
|
|
||||
|
Dialog dialog = new Dialog(mainActivity); |
||||
|
|
||||
|
dialog.setContentView(R.layout.automodepopup); // 设置自定义布局
|
||||
|
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
|
||||
|
|
||||
|
// 获取布局中的视图
|
||||
|
|
||||
|
Button confirmButton = dialog.findViewById(R.id.automaticModeModeApply); |
||||
|
Button cancelButton = dialog.findViewById(R.id.automaticModeCancel); |
||||
|
|
||||
|
EditText workDistanceEditText = dialog.findViewById(R.id.popupViewWorkDistanceEdTxView); |
||||
|
EditText workWidthEditText = dialog.findViewById(R.id.popupViewWorkWidthEdTxView); |
||||
|
|
||||
|
if (mainActivity.WorkDistance>0) |
||||
|
{ |
||||
|
workDistanceEditText.setText(String.valueOf(mainActivity.WorkDistance)); |
||||
|
} |
||||
|
if(mainActivity.WorkWidth>0) |
||||
|
{ |
||||
|
workWidthEditText.setText(String.valueOf(mainActivity.WorkWidth)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 设置取消按钮点击事件
|
||||
|
cancelButton.setOnClickListener(v -> { |
||||
|
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
// 设置单选按钮点击事件
|
||||
|
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.autoModeSelectorGroup); |
||||
|
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
||||
|
@Override |
||||
|
public void onCheckedChanged(RadioGroup group, int checkedId) { |
||||
|
RadioButton radioButton = (RadioButton) group.findViewById(checkedId); |
||||
|
automatic_Mode_Call_Value = radioButton.getText().toString(); |
||||
|
} |
||||
|
}); |
||||
|
String ii = (mainActivity._automatic_Mode_Call_Value); |
||||
|
switch (ii) |
||||
|
{ |
||||
|
// case "无": {
|
||||
|
// radioGroup.check(R.id.rb_one);
|
||||
|
// break;
|
||||
|
// }
|
||||
|
case "水平": { |
||||
|
radioGroup.check(R.id.rb_two); |
||||
|
break; |
||||
|
} |
||||
|
case "竖直向左": { |
||||
|
radioGroup.check(R.id.rb_three); |
||||
|
break; |
||||
|
} |
||||
|
case "竖直向右": { |
||||
|
radioGroup.check(R.id.rb_four); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
// 设置确定按钮点击事件
|
||||
|
confirmButton.setOnClickListener(v -> { |
||||
|
String inputWorkDistanceValueStr = workDistanceEditText.getText().toString(); |
||||
|
if(inputWorkDistanceValueStr.isEmpty() ||inputWorkDistanceValueStr.length()>10) |
||||
|
{ |
||||
|
Toast.makeText(mainActivity, "请正确设定作业长度", Toast.LENGTH_SHORT).show(); |
||||
|
//workDistanceEditText.requestFocus();
|
||||
|
return; |
||||
|
} |
||||
|
int workDistance_tempValue = Integer.parseInt(inputWorkDistanceValueStr); |
||||
|
if (workDistance_tempValue <= 200 && workDistance_tempValue >= 0) |
||||
|
{ |
||||
|
mainActivity.WorkDistance = workDistance_tempValue; |
||||
|
//Toast.makeText(mainActivity, "作业长度设置成功", Toast.LENGTH_SHORT).show();
|
||||
|
} else { |
||||
|
Toast.makeText(mainActivity, "作业长度不应大于200或者小于0", Toast.LENGTH_SHORT).show(); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
String inputWorkWidthValueStr = workWidthEditText.getText().toString(); |
||||
|
if(inputWorkWidthValueStr.isEmpty() ||inputWorkWidthValueStr.length()>10) |
||||
|
{ |
||||
|
Toast.makeText(mainActivity, "请正确设定作业宽度", Toast.LENGTH_SHORT).show(); |
||||
|
//workWidthEditText.requestFocus();
|
||||
|
return; |
||||
|
} |
||||
|
int workWidth_tempValue = Integer.parseInt(inputWorkWidthValueStr); |
||||
|
if (workWidth_tempValue <= 200 && workWidth_tempValue >= 0) |
||||
|
{ |
||||
|
mainActivity.WorkWidth = workWidth_tempValue; |
||||
|
//Toast.makeText(mainActivity, "作业宽度设置成功", Toast.LENGTH_SHORT).show();
|
||||
|
} else { |
||||
|
Toast.makeText(mainActivity, "作业宽度不应大于200或者小于0", Toast.LENGTH_SHORT).show(); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
mainActivity._automatic_Mode_Call_Value = automatic_Mode_Call_Value; |
||||
|
if(!Objects.equals(mainActivity._automatic_Mode_Call_Value, "")){ |
||||
|
mainActivity._manual_Mode_Call_Value ="未启用"; |
||||
|
mainActivity.mainBinding.mainViewManualModeTxView.setText("未启用"); |
||||
|
} |
||||
|
mainActivity.mainBinding.mainViewAutomaticModeTxView.setText(mainActivity._automatic_Mode_Call_Value); |
||||
|
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
dialog.show(); // 显示弹窗
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void RobotSpeedPopUp(View.OnClickListener context) { |
||||
|
|
||||
|
|
||||
|
Dialog dialog = new Dialog(mainActivity); |
||||
|
|
||||
|
dialog.setContentView(R.layout.robotspeedpopup); // 设置自定义布局
|
||||
|
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
|
||||
|
|
||||
|
// 获取布局中的视图
|
||||
|
Button cancelButton = dialog.findViewById(R.id.Cancel); |
||||
|
Button confirmButton = dialog.findViewById(R.id.Apply); |
||||
|
EditText robotSppedEditText = dialog.findViewById(R.id.robotSpeed_input); |
||||
|
robotSppedEditText.setText(mainActivity.mainBinding.mainViewRobotSpeedTxView.getText()); |
||||
|
// 设置取消按钮点击事件
|
||||
|
cancelButton.setOnClickListener(v -> { |
||||
|
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
|
||||
|
// 设置确定按钮点击事件
|
||||
|
confirmButton.setOnClickListener(v -> { |
||||
|
|
||||
|
String robotSpped = robotSppedEditText.getText().toString(); |
||||
|
if(robotSpped.isEmpty() ||robotSpped.length()>10) |
||||
|
{ |
||||
|
Toast.makeText(mainActivity, "数据输入错误或输入长度过长", Toast.LENGTH_SHORT).show(); |
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
return; |
||||
|
} |
||||
|
Integer _tempValue = Integer.parseInt(robotSpped); |
||||
|
if (_tempValue >= 0 && _tempValue <= 20) |
||||
|
{ |
||||
|
mainActivity.mainBinding.mainViewRobotSpeedTxView.setText(String.valueOf(_tempValue)); |
||||
|
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show(); |
||||
|
} else { |
||||
|
Toast.makeText(mainActivity, "输入数据不应大于20或者小于0", Toast.LENGTH_SHORT).show(); |
||||
|
} |
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
dialog.show(); // 显示弹窗
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void LaneChangeSelectionPopUp(View.OnClickListener context) { |
||||
|
|
||||
|
|
||||
|
Dialog dialog = new Dialog(mainActivity); |
||||
|
|
||||
|
dialog.setContentView(R.layout.lanechangepopup); // 设置自定义布局
|
||||
|
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
|
||||
|
|
||||
|
// 获取布局中的视图
|
||||
|
Button cancelButton = dialog.findViewById(R.id.lanechangeCancel); |
||||
|
Button confirmButton = dialog.findViewById(R.id.lanechangeApply); |
||||
|
EditText landeChangeDistanceEditText = dialog.findViewById(R.id.lanechange_input); |
||||
|
landeChangeDistanceEditText.setText(mainActivity.mainBinding.mainViewLaneChangeDistanceTxView.getText()); |
||||
|
// 设置取消按钮点击事件
|
||||
|
cancelButton.setOnClickListener(v -> { |
||||
|
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
|
||||
|
// 设置确定按钮点击事件
|
||||
|
confirmButton.setOnClickListener(v -> { |
||||
|
|
||||
|
String laneChangeDistance = landeChangeDistanceEditText.getText().toString(); |
||||
|
if(laneChangeDistance.isEmpty() ||laneChangeDistance.length()>10) |
||||
|
{ |
||||
|
Toast.makeText(mainActivity, "数据输入错误或输入长度过长", Toast.LENGTH_SHORT).show(); |
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
return; |
||||
|
} |
||||
|
Integer _tempValue = Integer.parseInt(laneChangeDistance); |
||||
|
if (_tempValue <= 100 && _tempValue >= 1) |
||||
|
{ |
||||
|
mainActivity.mainBinding.mainViewLaneChangeDistanceTxView.setText(String.valueOf(_tempValue)); |
||||
|
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show(); |
||||
|
} else { |
||||
|
Toast.makeText(mainActivity, "输入数据不应大于100或者小于1", Toast.LENGTH_SHORT).show(); |
||||
|
} |
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
dialog.show(); // 显示弹窗
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public void VerticalCalibrationPopUp(View.OnClickListener context) { |
||||
|
Dialog dialog = new Dialog(mainActivity); |
||||
|
|
||||
|
dialog.setContentView(R.layout.verticalcalibrationpopup); // 设置自定义布局
|
||||
|
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
|
||||
|
|
||||
|
// 获取布局中的视图
|
||||
|
Button cancelButton = dialog.findViewById(R.id.vertical_calibration_Cancel); |
||||
|
Button confirmButton = dialog.findViewById(R.id.vertical_calibration_Apply); |
||||
|
EditText inputEditText = dialog.findViewById(R.id.vertical_calibration_input); |
||||
|
|
||||
|
inputEditText.setText(mainActivity.mainBinding.mainViewVerticalCalibrationTxView.getText()); |
||||
|
|
||||
|
// 设置取消按钮点击事件
|
||||
|
cancelButton.setOnClickListener(v -> { |
||||
|
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
// 设置确定按钮点击事件
|
||||
|
confirmButton.setOnClickListener(v -> { |
||||
|
|
||||
|
String inputValueStr = inputEditText.getText().toString(); |
||||
|
try { |
||||
|
if(inputValueStr.isEmpty() ||inputValueStr.length()>10) |
||||
|
{ |
||||
|
Toast.makeText(mainActivity, "数据输入错误或输入数据过长", Toast.LENGTH_SHORT).show(); |
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
return; |
||||
|
} |
||||
|
double _tempValue = Double.parseDouble(inputValueStr); |
||||
|
if (_tempValue <= 10 && _tempValue >= -10) |
||||
|
{ |
||||
|
mainActivity.mainBinding.mainViewVerticalCalibrationTxView.setText(String.valueOf(_tempValue)); |
||||
|
Toast.makeText(mainActivity, "设置成功", Toast.LENGTH_SHORT).show(); |
||||
|
} else { |
||||
|
Toast.makeText(mainActivity, "输入数据应当在±10度内", Toast.LENGTH_SHORT).show(); |
||||
|
} |
||||
|
|
||||
|
// 可能会发生异常的语句
|
||||
|
} catch (Throwable e) { |
||||
|
// 处理异常 e
|
||||
|
Toast.makeText(mainActivity, "数据输入错误或输入数据过长", Toast.LENGTH_SHORT).show(); |
||||
|
} finally { |
||||
|
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 saveButton = dialog.findViewById(R.id.saveParametersBtn); |
||||
|
Button clearButton = dialog.findViewById(R.id.clearParametersBtn); |
||||
|
|
||||
|
Button cancelButton = dialog.findViewById(R.id.parametersCancel); |
||||
|
Button confirmButton = dialog.findViewById(R.id.parametersApply); |
||||
|
|
||||
|
// 设置保存按钮点击事件
|
||||
|
saveButton.setOnClickListener(v -> { |
||||
|
int paraIndex = Integer.parseInt(mainActivity._parameters_Call_Value); |
||||
|
//int paraIndex = Integer.parseInt(mainActivity.mainBinding.mainViewParametersTxView.getText().toString());
|
||||
|
|
||||
|
int lanceChangeValue = Integer.parseInt(mainActivity.mainBinding.mainViewLaneChangeDistanceTxView.getText().toString()); |
||||
|
int workDistanceMeters = mainActivity.WorkDistance; |
||||
|
int workWidthMeters = mainActivity.WorkWidth; |
||||
|
int robotSpped = Integer.parseInt(mainActivity.mainBinding.mainViewRobotSpeedTxView.getText().toString()); |
||||
|
|
||||
|
int leftCompSelect = 0; |
||||
|
int rightCompSelect = 0; |
||||
|
if(!mainActivity.mainBinding.rxLeftCompensation.getText().toString().equals("")){ |
||||
|
leftCompSelect = (int)(Double.parseDouble(mainActivity.mainBinding.rxLeftCompensation.getText().toString()) * 100); |
||||
|
} |
||||
|
if(!mainActivity.mainBinding.rxLeftCompensation.getText().toString().equals("")){ |
||||
|
rightCompSelect = (int)(Double.parseDouble(mainActivity.mainBinding.rxRightCompensation.getText().toString()) * 100); |
||||
|
} |
||||
|
double vertical_Calibration = Double.parseDouble(mainActivity.mainBinding.mainViewVerticalCalibrationTxView.getText().toString()); |
||||
|
|
||||
|
int toolRotationDirection = tool_Rotation_Direction_Value; |
||||
|
|
||||
|
DisplayPV displayPV = new DisplayPV(paraIndex, robotSpped, lanceChangeValue, workDistanceMeters, workWidthMeters, |
||||
|
leftCompSelect, rightCompSelect, vertical_Calibration); |
||||
|
|
||||
|
|
||||
|
mainActivity.myDataHelper.addOrUpdateDisplayData(displayPV); |
||||
|
|
||||
|
Toast.makeText(mainActivity, "保存成功", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
// 设置清除按钮点击事件
|
||||
|
clearButton.setOnClickListener(v -> { |
||||
|
int paraIndex = Integer.parseInt(mainActivity._parameters_Call_Value); |
||||
|
//int paraIndex = Integer.parseInt(mainActivity.mainBinding.mainViewParametersTxView.getText().toString());
|
||||
|
DisplayPV displayPV = new DisplayPV(paraIndex, 0, 0, 0, 0, |
||||
|
0,0,0); |
||||
|
mainActivity.myDataHelper.addOrUpdateDisplayData(displayPV); |
||||
|
Toast.makeText(mainActivity, "清除成功", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
|
||||
|
// 设置退出按钮点击事件
|
||||
|
cancelButton.setOnClickListener(v -> { |
||||
|
Toast.makeText(mainActivity, "点击了退出", Toast.LENGTH_SHORT).show(); |
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
|
||||
|
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.parameters_call_group); |
||||
|
|
||||
|
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
||||
|
@Override |
||||
|
public void onCheckedChanged(RadioGroup group, int checkedId) { |
||||
|
RadioButton radioButton = (RadioButton) group.findViewById(checkedId); |
||||
|
mainActivity._parameters_Call_Value = radioButton.getText().toString(); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
int ii= ConvertHelper.convertEditTextToInt(mainActivity.mainBinding.mainViewParametersTxView); |
||||
|
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; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 设置读取按钮点击事件
|
||||
|
confirmButton.setOnClickListener(v -> { |
||||
|
|
||||
|
mainActivity.mainBinding.mainViewParametersTxView.setText(mainActivity._parameters_Call_Value); |
||||
|
|
||||
|
//读取数据
|
||||
|
int paraIndex = Integer.parseInt(mainActivity._parameters_Call_Value); |
||||
|
List<DisplayPV> pvList = mainActivity.myDataHelper.getDisplayData(paraIndex); |
||||
|
|
||||
|
mainActivity.mainBinding.mainViewRobotSpeedTxView.setText(String.valueOf(pvList.get(0).getRobotSpeedValue())); |
||||
|
mainActivity.mainBinding.mainViewLaneChangeDistanceTxView.setText(String.valueOf(pvList.get(0).getLaneChangeDistance())); |
||||
|
|
||||
|
|
||||
|
mainActivity.WorkWidth = pvList.get(0).getWorkWidthMeters(); |
||||
|
mainActivity.WorkDistance = pvList.get(0).getWorkDistanceMeters(); |
||||
|
|
||||
|
mainActivity.mainBinding.mainViewVerticalCalibrationTxView.setText(String.valueOf(pvList.get(0).getVerticalCalibration())); |
||||
|
|
||||
|
|
||||
|
|
||||
|
mainActivity.leftCompensation = pvList.get(0).getLeftCompSelect(); |
||||
|
mainActivity.rightCompensation = pvList.get(0).getRightCompSelect(); |
||||
|
mainActivity.leftRightCompensationNeedToSend = 3; |
||||
|
|
||||
|
|
||||
|
|
||||
|
//读取数据库,并对其他控件进行赋值
|
||||
|
Toast.makeText(mainActivity, "调用成功", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
|
||||
|
}); |
||||
|
dialog.show(); // 显示弹窗
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
public void RobotErrorListPopUp(View.OnClickListener context) |
||||
|
{ |
||||
|
Dialog dialog = new Dialog(mainActivity); |
||||
|
|
||||
|
dialog.setContentView(R.layout.log_item); // 设置自定义布局
|
||||
|
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
|
||||
|
|
||||
|
TextView LogText = dialog.findViewById(R.id.popUpErrorLogTextView); |
||||
|
ScrollBottomScrollView LogScrollView = dialog.findViewById(R.id.popUpErrorLogScrollview); |
||||
|
List<ErrorModel> list = mainActivity.myDataHelper.GetAllErrorModels(); |
||||
|
LogText.setMovementMethod(ScrollingMovementMethod.getInstance()); |
||||
|
|
||||
|
final int[] firstDisplay = {1}; |
||||
|
final int[] display = {2}; |
||||
|
final int[] displayOver = {0}; |
||||
|
int displayNum = 25; |
||||
|
LogScrollView.post(new Runnable() { |
||||
|
@Override |
||||
|
public void run() { |
||||
|
if(firstDisplay[0] == 1){ |
||||
|
//滑动顶部
|
||||
|
LogScrollView.fullScroll(ScrollView.FOCUS_UP); |
||||
|
firstDisplay[0] = 0; |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
LogScrollView.onScrollViewScrollToBottom(new ScrollBottomScrollView.OnScrollBottomListener() { |
||||
|
@Override |
||||
|
public void scrollToBottom() { |
||||
|
//请求数据
|
||||
|
if (!list.isEmpty()) { |
||||
|
if(list.size() > displayNum * display[0]) { |
||||
|
for(int i = list.size() - displayNum * (display[0]-1); i-- > list.size() - displayNum * display[0];){ |
||||
|
ErrorModel item = list.get(i); |
||||
|
String RobotErrorLog = item.getDateTimeBJ() + item.getErrorInfo() +"\n"; |
||||
|
LogText.append(RobotErrorLog); |
||||
|
} |
||||
|
display[0] ++; |
||||
|
} |
||||
|
else{ |
||||
|
if(displayOver[0]==0){ |
||||
|
for(int i = list.size() - displayNum * (display[0]-1); i-- > 0;){ |
||||
|
ErrorModel item = list.get(i); |
||||
|
String RobotErrorLog = item.getDateTimeBJ() + item.getErrorInfo() +"\n"; |
||||
|
LogText.append(RobotErrorLog); |
||||
|
displayOver[0]=1; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}}); |
||||
|
|
||||
|
if (!list.isEmpty()) { |
||||
|
|
||||
|
if(list.size() > displayNum) { |
||||
|
|
||||
|
for(int i = list.size(); i-- > list.size() - displayNum;){ |
||||
|
ErrorModel item = list.get(i); |
||||
|
String RobotErrorLog = item.getDateTimeBJ() + item.getErrorInfo() +"\n"; |
||||
|
LogText.append(RobotErrorLog); |
||||
|
} |
||||
|
} |
||||
|
else{ |
||||
|
for(int i = list.size(); i-- > 0;){ |
||||
|
ErrorModel item = list.get(i); |
||||
|
String RobotErrorLog = item.getDateTimeBJ() + item.getErrorInfo() +"\n"; |
||||
|
LogText.append(RobotErrorLog); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
// String list3 = mainActivity.myDataHelper.DeleteAllErrorModels();
|
||||
|
|
||||
|
dialog.show(); // 显示弹窗
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
public void WorkWidthSetPopUp(Dialog mainDialog) { |
||||
|
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.mainViewWorkWidthTxView.getText());
|
||||
|
|
||||
|
// 设置取消按钮点击事件
|
||||
|
cancelButton.setOnClickListener(v -> { |
||||
|
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
// 设置确定按钮点击事件
|
||||
|
confirmButton.setOnClickListener(v -> { |
||||
|
|
||||
|
String inputValueStr = inputEditText.getText().toString(); |
||||
|
if(inputValueStr.isEmpty() ||inputValueStr.length()>10) |
||||
|
{ |
||||
|
Toast.makeText(mainActivity, "数据输入错误或输入数据过长", Toast.LENGTH_SHORT).show(); |
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
return; |
||||
|
} |
||||
|
int _tempValue = Integer.parseInt(inputValueStr); |
||||
|
if (_tempValue <= 200 && _tempValue >= 0) |
||||
|
{ |
||||
|
mainActivity.WorkWidth = _tempValue; |
||||
|
|
||||
|
//mainActivity.mainBinding.mainViewWorkWidthTxView.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 WorkDistanceSetPopUp(Dialog mainDialog) { |
||||
|
Dialog dialog = new Dialog(mainActivity); |
||||
|
|
||||
|
dialog.setContentView(R.layout.workdistancepopup); // 设置自定义布局
|
||||
|
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
|
||||
|
|
||||
|
// 获取布局中的视图
|
||||
|
Button cancelButton = dialog.findViewById(R.id.workDistanceCancel); |
||||
|
Button confirmButton = dialog.findViewById(R.id.workDistanceApply); |
||||
|
EditText inputEditText = dialog.findViewById(R.id.workDistance_input); |
||||
|
|
||||
|
//inputEditText.setText(mainActivity.mainBinding.popupViewWorkDistanceTxView.getText());
|
||||
|
|
||||
|
// 设置取消按钮点击事件
|
||||
|
cancelButton.setOnClickListener(v -> { |
||||
|
Toast.makeText(mainActivity, "点击了取消", Toast.LENGTH_SHORT).show(); |
||||
|
|
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
}); |
||||
|
// 设置确定按钮点击事件
|
||||
|
confirmButton.setOnClickListener(v -> { |
||||
|
|
||||
|
String inputValueStr = inputEditText.getText().toString(); |
||||
|
if(inputValueStr.isEmpty() ||inputValueStr.length()>10) |
||||
|
{ |
||||
|
Toast.makeText(mainActivity, "数据输入错误或输入数据过长", Toast.LENGTH_SHORT).show(); |
||||
|
dialog.dismiss(); // 关闭弹窗
|
||||
|
return; |
||||
|
} |
||||
|
int _tempValue = Integer.parseInt(inputValueStr); |
||||
|
if (_tempValue <= 200 && _tempValue >= 0) |
||||
|
{ |
||||
|
mainActivity.WorkDistance =_tempValue; |
||||
|
//mainActivity.mainBinding.mainViewWorkDistanceTxView.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(); // 显示弹窗
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,64 @@ |
|||||
|
package com.example.paintingapp.services; |
||||
|
|
||||
|
|
||||
|
import com.example.paintingapp.models.BspIV; |
||||
|
import com.example.paintingapp.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); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,519 @@ |
|||||
|
package com.example.paintingapp.services; |
||||
|
|
||||
|
|
||||
|
import static com.example.paintingapp.services.ErrorDeocdeHelper.ErrorDeocde; |
||||
|
|
||||
|
import android.annotation.SuppressLint; |
||||
|
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.paintingapp.BuildConfig; |
||||
|
import com.example.paintingapp.MainActivity; |
||||
|
import com.example.paintingapp.R; |
||||
|
import com.example.paintingapp.models.BspIV; |
||||
|
import com.example.paintingapp.models.ErrorModel; |
||||
|
import com.hoho.android.usbserial.driver.UsbSerialDriver; |
||||
|
import com.hoho.android.usbserial.driver.UsbSerialPort; |
||||
|
import com.hoho.android.usbserial.driver.UsbSerialProber; |
||||
|
import com.hoho.android.usbserial.util.SerialInputOutputManager; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Iterator; |
||||
|
import java.util.List; |
||||
|
import java.util.Objects; |
||||
|
|
||||
|
public class USBSerialPortHelper implements SerialInputOutputManager.Listener { |
||||
|
|
||||
|
|
||||
|
public USBSerialPortHelper(MainActivity mainActivity) |
||||
|
{ |
||||
|
this.MainActivity=mainActivity; |
||||
|
} |
||||
|
|
||||
|
private final 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 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; |
||||
|
String errorLast = ""; |
||||
|
public void intialize() { |
||||
|
|
||||
|
broadcastReceiver = new BroadcastReceiver() { |
||||
|
@Override |
||||
|
public void onReceive(Context context, Intent intent) { |
||||
|
if (INTENT_ACTION_GRANT_USB.equals(intent.getAction())) { |
||||
|
usbPermission = intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false) ? UsbPermission.Granted : UsbPermission.Denied; |
||||
|
connect(); |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
mainLooper = new Handler(Looper.getMainLooper()); |
||||
|
_receiveBufferlist = new ArrayList<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)//从收到第一个数据开始计时
|
||||
|
{ |
||||
|
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) { |
||||
|
// SpannableStringBuilder spn = new SpannableStringBuilder(str+'\r'+'\n');
|
||||
|
//
|
||||
|
// // spn.append(getTime());
|
||||
|
//
|
||||
|
// spn.setSpan(new ForegroundColorSpan(MainActivity.getResources().getColor(R.color.colorAccent)), 0, spn.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
// receiveText.append(spn);
|
||||
|
// mainBinding.roll.fullScroll(ScrollView.FOCUS_DOWN);
|
||||
|
|
||||
|
|
||||
|
// MainActivity.mainBinding.message.setText(str);
|
||||
|
} |
||||
|
/* |
||||
|
逐位检查并构建二进制字符串 |
||||
|
*/ |
||||
|
String unsignedIntToBinary(int value) { |
||||
|
StringBuilder sb = new StringBuilder(32); |
||||
|
for (int i = 7; i >= 0; i--) { |
||||
|
sb.append((value & (1 << i)) == 0 ? '0' : '1'); |
||||
|
} |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
/* |
||||
|
逐位检查并构建二进制字符串 每4位添加一个分隔符 |
||||
|
*/ |
||||
|
String unsignedIntToBinaryWithSeparator(int value) { |
||||
|
StringBuilder sb = new StringBuilder(35); |
||||
|
for (int i = 7; i >= 0; i--) { |
||||
|
sb.append((value & (1 << i)) == 0 ? '0' : '1'); |
||||
|
if (i % 4 == 0 && i != 0) { |
||||
|
sb.append(' '); // 每4位添加一个分隔符
|
||||
|
} |
||||
|
} |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
String toHex4Digits(int value) { |
||||
|
char[] hexChars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; |
||||
|
int low16Bits = value & 0xFFFF; |
||||
|
|
||||
|
char[] result = new char[4]; |
||||
|
result[0] = hexChars[(low16Bits >> 12) & 0xF]; |
||||
|
result[1] = hexChars[(low16Bits >> 8) & 0xF]; |
||||
|
result[2] = hexChars[(low16Bits >> 4) & 0xF]; |
||||
|
result[3] = hexChars[low16Bits & 0xF]; |
||||
|
|
||||
|
return new String(result); |
||||
|
} |
||||
|
@SuppressLint("SetTextI18n") |
||||
|
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.rxRobotSpeed.setText(String.valueOf(_toReceiveIV.getRobotMoveSpeed())); |
||||
|
MainActivity.mainBinding.rxRobotAngle.setText(String.valueOf((double)_toReceiveIV.getCurrentAngle()/100)); |
||||
|
|
||||
|
|
||||
|
// MainActivity.mainBinding.rxTemp.setText(String.valueOf(((double) _toReceiveIV.getTempature()/100)));
|
||||
|
|
||||
|
// MainActivity.mainBinding.rxRunMode.setText(String.valueOf(_toReceiveIV.getRunMode()));
|
||||
|
|
||||
|
|
||||
|
//#define IV_Run_Mode_Automation 1
|
||||
|
//#define IV_Run_Mode_Maunal 0
|
||||
|
//#define IV_Run_Mode_EmergencyStop 2
|
||||
|
//#define IV_Run_Mode_Vertical_LaneChange 3
|
||||
|
//#define IV_Run_Mode_Horizontal_LaneChange 4
|
||||
|
//#define IV_Run_Mode_Forward 5
|
||||
|
//#define IV_Run_Mode_BackWard 6
|
||||
|
//#define IV_Run_Mode_TurnLeft 7
|
||||
|
//#define IV_Run_Mode_TurnRight 8
|
||||
|
//#define IV_Run_Mode_HALT 9
|
||||
|
switch (_toReceiveIV.getRunMode()) |
||||
|
{ |
||||
|
case 0: |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setText("手动模式"); |
||||
|
break; |
||||
|
} |
||||
|
case 1: |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setText("自动运行"); |
||||
|
break; |
||||
|
} |
||||
|
case 2: |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setText("急停"); |
||||
|
break; |
||||
|
} |
||||
|
case 3: |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setText("竖直换道"); |
||||
|
break; |
||||
|
} |
||||
|
case 4: |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setText("水平换道"); |
||||
|
break; |
||||
|
} |
||||
|
case 5: |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setText("前进"); |
||||
|
break; |
||||
|
} |
||||
|
case 6: |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setText("后退"); |
||||
|
break; |
||||
|
} |
||||
|
case 7: |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setText("左转"); |
||||
|
break; |
||||
|
} |
||||
|
case 8: |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setText("右转"); |
||||
|
break; |
||||
|
} |
||||
|
case 9: |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setText("停止"); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
if(MainActivity.mainBinding.rxRunMode.getText().toString().equals("急停")) |
||||
|
{ |
||||
|
MainActivity.mainBinding.rxRunMode.setTextColor(ContextCompat.getColor(MainActivity,R.color.red)); |
||||
|
|
||||
|
} |
||||
|
else{ |
||||
|
MainActivity.mainBinding.rxRunMode.setTextColor(ContextCompat.getColor(MainActivity,R.color.midnightblue)); |
||||
|
} |
||||
|
MainActivity.mainBinding.rxLeftCompensation.setText(String.valueOf((double) _toReceiveIV.getLeftCompensation()/100)); |
||||
|
MainActivity.mainBinding.rxRightCompensation.setText(String.valueOf((double)_toReceiveIV.getRightCompensation()/100)); |
||||
|
|
||||
|
int errorInt = _toReceiveIV.getSystemError(); |
||||
|
String errorString2 = ErrorDeocde(errorInt); |
||||
|
String errorString = " # " + unsignedIntToBinaryWithSeparator(errorInt); |
||||
|
errorString += " " + toHex4Digits(_toReceiveIV.getLeftMotorErr()); |
||||
|
errorString += " " + toHex4Digits(_toReceiveIV.getRightMotorErr()); |
||||
|
|
||||
|
if(errorInt !=0 || _toReceiveIV.getLeftMotorErr()!=0 ||_toReceiveIV.getRightMotorErr()!=0) |
||||
|
{ |
||||
|
if(!Objects.equals(errorLast, errorString)){ |
||||
|
ErrorModel em = new ErrorModel(System.currentTimeMillis(), errorString); |
||||
|
MainActivity.myDataHelper.AddOrUpdateErrorModel(em); |
||||
|
|
||||
|
if(Objects.equals(errorString2, "未复位")) |
||||
|
{ |
||||
|
MainActivity.mainBinding.mainViewErrMessageTxView.setText(String.valueOf(errorString2)); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
MainActivity.mainBinding.mainViewErrMessageTxView.setText("有"); |
||||
|
MainActivity.mainBinding.mainViewErrMessageTxView.setTextColor(ContextCompat.getColor(MainActivity,R.color.red)); |
||||
|
} |
||||
|
|
||||
|
errorLast = errorString; |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
MainActivity.mainBinding.mainViewErrMessageTxView.setText("无"); |
||||
|
MainActivity.mainBinding.mainViewErrMessageTxView.setTextColor(ContextCompat.getColor(MainActivity, R.color.midnightblue)); |
||||
|
} |
||||
|
}else |
||||
|
{ |
||||
|
status("null"); |
||||
|
} |
||||
|
|
||||
|
}else |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}else |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} 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 { |
||||
|
int WRITE_WAIT_MILLIS = 500; |
||||
|
usbSerialPort.write(data, WRITE_WAIT_MILLIS); |
||||
|
} catch (IOException e) |
||||
|
{ |
||||
|
status("Send Failed"); |
||||
|
connected = false; |
||||
|
} |
||||
|
} else { |
||||
|
status("usb serialport disconnected"); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,27 @@ |
|||||
|
package com.example.paintingapp.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(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,11 @@ |
|||||
|
package com.example.paintingapp.viewmodels; |
||||
|
|
||||
|
import androidx.lifecycle.ViewModel; |
||||
|
|
||||
|
public class MainViewModel extends ViewModel { |
||||
|
|
||||
|
public MainViewModel() { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
protoc --java_out . *.proto |
||||
@ -0,0 +1,25 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
|
|
||||
|
<!-- 设置透明背景色 --> |
||||
|
<!-- <solid android:color="@color/gainsboro" />--> |
||||
|
<solid android:color="#f2f3f4" /> |
||||
|
<!-- 设置一个黑色边框 --> |
||||
|
<!-- <stroke--> |
||||
|
<!-- android:width="4px"--> |
||||
|
<!-- android:color="@color/deepskyblue" />--> |
||||
|
<!-- 设置四个圆角的半径 --> |
||||
|
<corners |
||||
|
android:bottomLeftRadius="8dp" |
||||
|
android:bottomRightRadius="8dp" |
||||
|
android:topLeftRadius="8dp" |
||||
|
android:topRightRadius="8dp" /> |
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
<!-- <padding--> |
||||
|
<!-- android:bottom="5dp"--> |
||||
|
<!-- android:left="5dp"--> |
||||
|
<!-- android:right="5dp"--> |
||||
|
<!-- android:top="5dp" />--> |
||||
|
|
||||
|
</shape> |
||||
|
|
||||
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 162 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,25 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
|
|
||||
|
<!-- 设置透明背景色 --> |
||||
|
<!-- <solid android:color="@color/white" />--> |
||||
|
<solid android:color="#d6eaf8" /> |
||||
|
<!-- 设置一个黑色边框 --> |
||||
|
<!-- <stroke--> |
||||
|
<!-- android:width="4px"--> |
||||
|
<!-- android:color="@color/deepskyblue" />--> |
||||
|
<!-- 设置四个圆角的半径 --> |
||||
|
<corners |
||||
|
android:bottomLeftRadius="8dp" |
||||
|
android:bottomRightRadius="8dp" |
||||
|
android:topLeftRadius="8dp" |
||||
|
android:topRightRadius="8dp" /> |
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
<!-- <padding--> |
||||
|
<!-- android:bottom="5dp"--> |
||||
|
<!-- android:left="5dp"--> |
||||
|
<!-- android:right="5dp"--> |
||||
|
<!-- android:top="5dp" />--> |
||||
|
|
||||
|
</shape> |
||||
|
|
||||
@ -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> |
||||
@ -0,0 +1,31 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
|
|
||||
|
<!-- 设置透明背景色 --> |
||||
|
<!-- <solid android:color="##deebf7" />--> |
||||
|
<solid android:color="#d6eaf8" /> |
||||
|
<!-- 设置一个黑色边框 --> |
||||
|
|
||||
|
<!-- <stroke--> |
||||
|
<!-- android:width="4px"--> |
||||
|
<!-- android:color="@color/deepskyblue" />--> |
||||
|
<!-- 设置四个圆角的半径 --> |
||||
|
<corners |
||||
|
android:bottomLeftRadius="5dp" |
||||
|
android:bottomRightRadius="5dp" |
||||
|
android:topLeftRadius="5dp" |
||||
|
android:topRightRadius="5dp" /> |
||||
|
|
||||
|
<!-- <corners--> |
||||
|
<!-- android:bottomLeftRadius="10px"--> |
||||
|
<!-- android:bottomRightRadius="10px"--> |
||||
|
<!-- android:topLeftRadius="10px"--> |
||||
|
<!-- android:topRightRadius="10px" />--> |
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
<!-- <padding--> |
||||
|
<!-- android:bottom="5dp"--> |
||||
|
<!-- android:left="5dp"--> |
||||
|
<!-- android:right="5dp"--> |
||||
|
<!-- android:top="5dp" />--> |
||||
|
|
||||
|
</shape> |
||||
@ -0,0 +1,34 @@ |
|||||
|
<?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/green" />--> |
||||
|
<!-- <!– 设置四个圆角的半径 –>--> |
||||
|
<!-- <corners--> |
||||
|
<!-- android:bottomLeftRadius="5dp"--> |
||||
|
<!-- android:bottomRightRadius="5dp"--> |
||||
|
<!-- android:topLeftRadius="5dp"--> |
||||
|
<!-- android:topRightRadius="5dp" />--> |
||||
|
<!-- 设置一个黑色边框 --> |
||||
|
<stroke |
||||
|
android:width="4px" |
||||
|
android:color="#6efe00" /> |
||||
|
<!-- 设置四个圆角的半径 --> |
||||
|
<corners |
||||
|
android:bottomLeftRadius="10px" |
||||
|
android:bottomRightRadius="10px" |
||||
|
android:topLeftRadius="10px" |
||||
|
android:topRightRadius="10px" /> |
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
<!-- <padding--> |
||||
|
<!-- android:bottom="5dp"--> |
||||
|
<!-- android:left="5dp"--> |
||||
|
<!-- android:right="5dp"--> |
||||
|
<!-- android:top="5dp" />--> |
||||
|
|
||||
|
</shape> |
||||
@ -0,0 +1,31 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
|
|
||||
|
<!-- 设置透明背景色 --> |
||||
|
<!-- <solid android:color="##deebf7" />--> |
||||
|
<solid android:color="@color/white" /> |
||||
|
<!-- 设置一个黑色边框 --> |
||||
|
|
||||
|
<stroke |
||||
|
android:width="4px" |
||||
|
android:color="@color/grey" /> |
||||
|
<!-- 设置四个圆角的半径 --> |
||||
|
<corners |
||||
|
android:bottomLeftRadius="5dp" |
||||
|
android:bottomRightRadius="5dp" |
||||
|
android:topLeftRadius="5dp" |
||||
|
android:topRightRadius="5dp" /> |
||||
|
|
||||
|
<!-- <corners--> |
||||
|
<!-- android:bottomLeftRadius="10px"--> |
||||
|
<!-- android:bottomRightRadius="10px"--> |
||||
|
<!-- android:topLeftRadius="10px"--> |
||||
|
<!-- android:topRightRadius="10px" />--> |
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
<!-- <padding--> |
||||
|
<!-- android:bottom="5dp"--> |
||||
|
<!-- android:left="5dp"--> |
||||
|
<!-- android:right="5dp"--> |
||||
|
<!-- android:top="5dp" />--> |
||||
|
|
||||
|
</shape> |
||||
@ -0,0 +1,24 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
|
|
||||
|
<!-- 设置透明背景色 --> |
||||
|
<solid android:color="#f6ddcc" /> |
||||
|
|
||||
|
<!-- 设置一个黑色边框 --> |
||||
|
<!-- <stroke--> |
||||
|
<!-- android:width="4px"--> |
||||
|
<!-- android:color="#ed7041" />--> |
||||
|
<!-- 设置四个圆角的半径 --> |
||||
|
<corners |
||||
|
android:bottomLeftRadius="5dp" |
||||
|
android:bottomRightRadius="5dp" |
||||
|
android:topLeftRadius="5dp" |
||||
|
android:topRightRadius="5dp" /> |
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
<!-- <padding--> |
||||
|
<!-- android:bottom="5dp"--> |
||||
|
<!-- android:left="5dp"--> |
||||
|
<!-- android:right="5dp"--> |
||||
|
<!-- android:top="5dp" />--> |
||||
|
|
||||
|
</shape> |
||||
@ -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/green" /> |
||||
|
<!-- 设置四个圆角的半径 --> |
||||
|
<corners |
||||
|
android:bottomLeftRadius="5dp" |
||||
|
android:bottomRightRadius="5dp" |
||||
|
android:topLeftRadius="5dp" |
||||
|
android:topRightRadius="5dp" /> |
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
<!-- <padding--> |
||||
|
<!-- android:bottom="5dp"--> |
||||
|
<!-- android:left="5dp"--> |
||||
|
<!-- android:right="5dp"--> |
||||
|
<!-- android:top="5dp" />--> |
||||
|
|
||||
|
</shape> |
||||
@ -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> |
||||
@ -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> |
||||
@ -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> |
||||
@ -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> |
||||
@ -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> |
||||
@ -0,0 +1,24 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
|
|
||||
|
<!-- 设置透明背景色 --> |
||||
|
<solid android:color="#f6ddcc" /> |
||||
|
<!-- 设置一个黑色边框 --> |
||||
|
<!-- <stroke--> |
||||
|
<!-- android:width="4px"--> |
||||
|
<!-- android:color="@color/" />--> |
||||
|
<!-- 设置四个圆角的半径 --> |
||||
|
<corners |
||||
|
android:bottomLeftRadius="15dp" |
||||
|
android:bottomRightRadius="15dp" |
||||
|
android:topLeftRadius="15dp" |
||||
|
android:topRightRadius="15dp" /> |
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
<!-- <padding--> |
||||
|
<!-- android:bottom="5dp"--> |
||||
|
<!-- android:left="5dp"--> |
||||
|
<!-- android:right="5dp"--> |
||||
|
<!-- android:top="5dp" />--> |
||||
|
|
||||
|
</shape> |
||||
|
|
||||
@ -0,0 +1,26 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
|
|
||||
|
<!-- 设置透明背景色 --> |
||||
|
<!-- <solid android:color="@color/white" />--> |
||||
|
<!-- <solid android:color="#c5e1a5" />--> |
||||
|
<solid android:color="#ef9a9a " /> |
||||
|
<!-- 设置一个黑色边框 --> |
||||
|
<!-- <stroke--> |
||||
|
<!-- android:width="4px"--> |
||||
|
<!-- android:color="@color/deepskyblue" />--> |
||||
|
<!-- 设置四个圆角的半径 --> |
||||
|
<corners |
||||
|
android:bottomLeftRadius="8dp" |
||||
|
android:bottomRightRadius="8dp" |
||||
|
android:topLeftRadius="8dp" |
||||
|
android:topRightRadius="8dp" /> |
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
<!-- <padding--> |
||||
|
<!-- android:bottom="5dp"--> |
||||
|
<!-- android:left="5dp"--> |
||||
|
<!-- android:right="5dp"--> |
||||
|
<!-- android:top="5dp" />--> |
||||
|
|
||||
|
</shape> |
||||
|
|
||||
@ -0,0 +1,12 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> |
||||
|
|
||||
|
<solid android:color="#d6eaf8" /> |
||||
|
<!-- 设置一个黑色边框 --> |
||||
|
<!-- <stroke android:width="4px" android:color="@color/deepskyblue"/>--> |
||||
|
<corners android:radius="5dp" /> |
||||
|
<!-- 渐变 --> |
||||
|
|
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
|
||||
|
</shape> |
||||
@ -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/deepskyblue" |
||||
|
android:state_checked="true" /> |
||||
|
</selector> |
||||
@ -0,0 +1,11 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
android:shape="rectangle"> |
||||
|
<!-- 填充 --> |
||||
|
<!-- <solid android:color="@color/gainsboro" />--> |
||||
|
<solid android:color="#eaeded" /> |
||||
|
|
||||
|
<!-- <stroke android:width="4px" android:color="@color/grey"/>--> |
||||
|
<!-- 圆角 --> |
||||
|
<corners android:radius="5dp" /> |
||||
|
</shape> |
||||
@ -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> |
||||
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 75 KiB |
@ -0,0 +1,24 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
|
|
||||
|
<!-- 设置透明背景色 --> |
||||
|
<solid android:color="@color/white" /> |
||||
|
<!-- <solid android:color="#d6eaf8" />--> |
||||
|
<!-- 设置一个黑色边框 --> |
||||
|
<stroke |
||||
|
android:width="2px" |
||||
|
android:color="@color/deepskyblue" /> |
||||
|
<!-- 设置四个圆角的半径 --> |
||||
|
<corners |
||||
|
android:bottomLeftRadius="2dp" |
||||
|
android:bottomRightRadius="2dp" |
||||
|
android:topLeftRadius="2dp" |
||||
|
android:topRightRadius="2dp" /> |
||||
|
<!-- 设置一下边距,让空间大一点 --> |
||||
|
<!-- <padding--> |
||||
|
<!-- android:bottom="5dp"--> |
||||
|
<!-- android:left="5dp"--> |
||||
|
<!-- android:right="5dp"--> |
||||
|
<!-- android:top="5dp" />--> |
||||
|
|
||||
|
</shape> |
||||
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,964 @@ |
|||||
|
<layout |
||||
|
|
||||
|
xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
xmlns:tools="http://schemas.android.com/tools" |
||||
|
tools:context=".MainActivity"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:background="@drawable/background" |
||||
|
android:orientation="vertical"> |
||||
|
|
||||
|
<!--medium view--> |
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="0dp" |
||||
|
android:layout_weight="1" |
||||
|
android:orientation="horizontal"> |
||||
|
<!--左侧信息区域--> |
||||
|
<LinearLayout |
||||
|
android:layout_width="148dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_marginVertical="16dp" |
||||
|
android:layout_marginStart="8dp" |
||||
|
android:background="@drawable/message_rounded_rectangle" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
|
||||
|
<GridLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center" |
||||
|
android:columnCount="1" |
||||
|
android:orientation="vertical" |
||||
|
android:rowCount="7"> |
||||
|
|
||||
|
<!--机器人温度--> |
||||
|
<!-- <LinearLayout--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_rowWeight="0"--> |
||||
|
<!-- android:visibility="gone"--> |
||||
|
<!-- android:gravity="center"--> |
||||
|
<!-- android:orientation="horizontal">--> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:layout_width="wrap_content"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_margin="5dp"--> |
||||
|
<!-- android:width="80dp"--> |
||||
|
<!-- android:text="温度:"--> |
||||
|
<!-- android:textColor="@color/midnightblue"--> |
||||
|
<!-- android:textSize="14sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:id="@+id/rx_temp"--> |
||||
|
<!-- android:layout_width="wrap_content"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_margin="5dp"--> |
||||
|
<!-- android:layout_weight="1"--> |
||||
|
<!-- android:gravity="left"--> |
||||
|
<!-- android:text="XXX"--> |
||||
|
<!-- android:textColor="@color/midnightblue"--> |
||||
|
<!-- android:textSize="14sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:layout_width="10dp"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_margin="5dp"--> |
||||
|
<!-- android:layout_weight="1"--> |
||||
|
<!-- android:gravity="left"--> |
||||
|
<!-- android:text="°c"--> |
||||
|
<!-- android:textColor="@color/midnightblue"--> |
||||
|
<!-- android:textSize="14sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
<!-- </LinearLayout>--> |
||||
|
<!--机器人作业状态--> |
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="0dp" |
||||
|
android:layout_rowWeight="1" |
||||
|
android:gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="45dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginHorizontal="5dp" |
||||
|
android:text="状 态" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/rxRunMode" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="center" |
||||
|
android:text="手动模式" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
|
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="left|center_horizontal" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
|
||||
|
android:textStyle="bold" /> |
||||
|
</LinearLayout> |
||||
|
<!--机器人移动速度--> |
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="0dp" |
||||
|
android:layout_rowWeight="1" |
||||
|
android:gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="45dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginHorizontal="5dp" |
||||
|
android:text="速 度" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/rxRobotSpeed" |
||||
|
android:layout_width="20dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginStart="15dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="center" |
||||
|
android:text="XX" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="10dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="left" |
||||
|
android:text="m/min" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="10sp" |
||||
|
android:textStyle="bold" /> |
||||
|
</LinearLayout> |
||||
|
<!--机器人当前角度--> |
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="0dp" |
||||
|
android:layout_rowWeight="1" |
||||
|
android:gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="45dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginHorizontal="5dp" |
||||
|
android:text="角 度" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/rxRobotAngle" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="right" |
||||
|
android:text="XXX" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" |
||||
|
tools:ignore="RtlHardcoded" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="10dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="left|center_horizontal" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:text="°" |
||||
|
android:textStyle="bold" /> |
||||
|
</LinearLayout> |
||||
|
<!-- <!–机器人压力常数–>--> |
||||
|
<!-- <LinearLayout--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="0dp"--> |
||||
|
<!-- android:layout_rowWeight="1"--> |
||||
|
<!-- android:gravity="center"--> |
||||
|
<!-- android:orientation="horizontal">--> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:layout_width="45dp"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_marginHorizontal="5dp"--> |
||||
|
<!-- android:text="压 力"--> |
||||
|
<!-- android:textColor="@color/midnightblue"--> |
||||
|
<!-- android:textSize="14sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:id="@+id/rxEndPrssure"--> |
||||
|
<!-- android:layout_width="wrap_content"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_margin="1dp"--> |
||||
|
<!-- android:layout_weight="1"--> |
||||
|
<!-- android:gravity="right"--> |
||||
|
<!-- android:text="XXX"--> |
||||
|
<!-- android:textColor="@color/midnightblue"--> |
||||
|
<!-- android:textSize="14sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:layout_width="10dp"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_margin="1dp"--> |
||||
|
<!-- android:layout_weight="1"--> |
||||
|
<!-- android:gravity="left|center_horizontal"--> |
||||
|
<!-- android:text=""--> |
||||
|
<!-- android:textColor="@color/midnightblue"--> |
||||
|
<!-- android:textSize="14sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
<!-- </LinearLayout>--> |
||||
|
<!--机器人左补偿--> |
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="0dp" |
||||
|
android:layout_rowWeight="1" |
||||
|
android:gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="45dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginHorizontal="5dp" |
||||
|
android:text="左补偿" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/rxLeftCompensation" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="right" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold"/> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="10dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="left|center_horizontal" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:text="°" |
||||
|
android:textStyle="bold" /> |
||||
|
</LinearLayout> |
||||
|
<!--机器人右补偿--> |
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="0dp" |
||||
|
android:layout_rowWeight="1" |
||||
|
android:gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="45dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginHorizontal="5dp" |
||||
|
android:text="右补偿" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/rxRightCompensation" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="right" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="10dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="start|center_horizontal" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:text="°" |
||||
|
android:textStyle="bold" /> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
|
||||
|
<!--机器人错误信息--> |
||||
|
|
||||
|
<FrameLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="0dp" |
||||
|
android:layout_rowWeight="1"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="45dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginHorizontal="5dp" |
||||
|
android:text="报 错" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/mainViewErrMessageTxView" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="right" |
||||
|
android:text="XXX" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" /> |
||||
|
<TextView |
||||
|
android:layout_width="10dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="1dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="left|center_horizontal" |
||||
|
android:text="" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="14sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
</LinearLayout> |
||||
|
<Button |
||||
|
android:id="@+id/mainViewErrMessageBtn" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_marginStart="0dp" |
||||
|
android:background="@color/trasnparent" |
||||
|
android:textAlignment="center" /> |
||||
|
</FrameLayout> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</GridLayout> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<!--参数设定区域--> |
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_marginVertical="8dp" |
||||
|
android:layout_marginHorizontal="4dp" |
||||
|
android:orientation="vertical" |
||||
|
tools:ignore="Suspicious0dp"> |
||||
|
<!-- 第一行--> |
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="0dp" |
||||
|
android:layout_gravity="fill" |
||||
|
android:layout_weight="1"> |
||||
|
<!--手动模式--> |
||||
|
<FrameLayout |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginVertical="8dp" |
||||
|
android:layout_marginHorizontal="4dp" |
||||
|
android:layout_weight="1" |
||||
|
android:background="@drawable/blue_rounded_rectangle" |
||||
|
tools:ignore="NestedWeights"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="fill" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="40dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginHorizontal="8dp" |
||||
|
android:text="手动模式" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="18sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/mainViewManualModeTxView" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="match_parent" |
||||
|
android:gravity="center" |
||||
|
android:layout_marginHorizontal="5dp" |
||||
|
android:text="" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="35sp" |
||||
|
android:textStyle="bold" /> |
||||
|
</LinearLayout> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/setManualModeBtn" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_margin="8dp" |
||||
|
android:background="@color/trasnparent" |
||||
|
android:textAlignment="center" /> |
||||
|
</FrameLayout> |
||||
|
<!--自动模式--> |
||||
|
<FrameLayout |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginVertical="8dp" |
||||
|
android:layout_marginHorizontal="4dp" |
||||
|
android:layout_weight="1" |
||||
|
android:background="@drawable/blue_rounded_rectangle"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="fill" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="40dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginHorizontal="8dp" |
||||
|
android:text="自动模式" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="18sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:id="@+id/mainViewAutomaticModeTxView" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_marginHorizontal="5dp" |
||||
|
android:gravity="center" |
||||
|
android:text="" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="35sp" |
||||
|
android:textStyle="bold" /> |
||||
|
</LinearLayout> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/setAutomaticModeBtn" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_margin="8dp" |
||||
|
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:id="@+id/mainViewRobotSpeedFrameLayout" |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginVertical="8dp" |
||||
|
android:layout_marginHorizontal="4dp" |
||||
|
android:layout_weight="1" |
||||
|
android:background="@drawable/blue_rounded_rectangle"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="fill" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="40dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginHorizontal="8dp" |
||||
|
android:text="移动速度" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="18sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:orientation="horizontal" |
||||
|
> |
||||
|
<EditText |
||||
|
android:id="@+id/mainViewRobotSpeedTxView" |
||||
|
android:layout_width="120dp" |
||||
|
android:layout_height="80dp" |
||||
|
android:layout_marginStart="-10dp" |
||||
|
android:background="@null" |
||||
|
android:imeOptions="actionDone" |
||||
|
android:inputType="number" |
||||
|
android:gravity="center" |
||||
|
android:text="10" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="35sp" |
||||
|
android:textStyle="bold" /> |
||||
|
<TextView |
||||
|
|
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_weight="1" |
||||
|
android:layout_marginStart="-25dp" |
||||
|
android:gravity="center" |
||||
|
android:text="m/min" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="15sp" /> |
||||
|
|
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
<!-- <Button--> |
||||
|
<!-- android:id="@+id/setRobotSpeedBtn"--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_margin="5dp"--> |
||||
|
<!-- android:background="@color/trasnparent"--> |
||||
|
<!-- android:textAlignment="center" />--> |
||||
|
</FrameLayout> |
||||
|
<!--换道距离--> |
||||
|
<FrameLayout |
||||
|
android:id="@+id/mainViewLaneChangeDistanceFrameLayout" |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginVertical="8dp" |
||||
|
android:layout_marginHorizontal="4dp" |
||||
|
android:layout_weight="1" |
||||
|
android:background="@drawable/blue_rounded_rectangle"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="fill" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="40dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginHorizontal="8dp" |
||||
|
android:text="换道距离" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="18sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<EditText |
||||
|
android:id="@+id/mainViewLaneChangeDistanceTxView" |
||||
|
android:layout_width="120dp" |
||||
|
android:layout_height="80dp" |
||||
|
android:layout_marginStart="-10dp" |
||||
|
android:background="@null" |
||||
|
android:imeOptions="actionDone" |
||||
|
android:inputType="number" |
||||
|
android:gravity="center" |
||||
|
android:text="40" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="35sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
|
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="match_parent" |
||||
|
android:gravity="center" |
||||
|
android:layout_marginStart="-25dp" |
||||
|
android:text="cm" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="15sp" /> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
<!-- <Button--> |
||||
|
<!-- android:id="@+id/setLaneChangeDistanceBtn"--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_margin="5dp"--> |
||||
|
<!-- 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:id="@+id/mainViewVerticalCalibrationFrameLayout" |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginVertical="8dp" |
||||
|
android:layout_marginHorizontal="4dp" |
||||
|
android:layout_weight="1" |
||||
|
android:background="@drawable/blue_rounded_rectangle"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="fill" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="40dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginHorizontal="8dp" |
||||
|
android:text="竖直微调" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="18sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<EditText |
||||
|
android:id="@+id/mainViewVerticalCalibrationTxView" |
||||
|
android:layout_width="110dp" |
||||
|
android:layout_height="80dp" |
||||
|
android:background="@null" |
||||
|
android:imeOptions="actionDone" |
||||
|
android:inputType="numberSigned|numberDecimal" |
||||
|
|
||||
|
android:gravity="center" |
||||
|
android:text="0.0" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="35sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<TextView |
||||
|
|
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="match_parent" |
||||
|
android:gravity="center" |
||||
|
android:text="°" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="15sp" /> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
<!-- <Button--> |
||||
|
<!-- android:id="@+id/setVerticalCalibrationBtn"--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_margin="5dp"--> |
||||
|
<!-- android:background="@color/trasnparent"--> |
||||
|
<!-- android:textAlignment="center" />--> |
||||
|
|
||||
|
|
||||
|
</FrameLayout> |
||||
|
<!--参数预设--> |
||||
|
<FrameLayout |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginVertical="8dp" |
||||
|
android:layout_marginHorizontal="4dp" |
||||
|
android:layout_weight="1" |
||||
|
android:background="@drawable/blue_rounded_rectangle"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="fill" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="40dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginHorizontal="8dp" |
||||
|
android:text="参数设置" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="18sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
<TextView |
||||
|
android:id="@+id/mainViewParametersTxView" |
||||
|
android:layout_width="100dp" |
||||
|
android:layout_height="80dp" |
||||
|
android:layout_marginStart="10dp" |
||||
|
android:gravity="center" |
||||
|
android:text="1" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="35sp" |
||||
|
android:textStyle="bold" /> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/callParametersBtn" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_margin="8dp" |
||||
|
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="8dp"--> |
||||
|
<!-- android:layout_weight="1"--> |
||||
|
<!-- android:background="@drawable/blue_rounded_rectangle">--> |
||||
|
|
||||
|
<!-- <LinearLayout--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_gravity="fill"--> |
||||
|
<!-- android:orientation="horizontal">--> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:layout_width="40dp"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_gravity="center"--> |
||||
|
<!-- android:layout_marginHorizontal="8dp"--> |
||||
|
<!-- android:text="转动方向"--> |
||||
|
<!-- android:textColor="@color/midnightblue"--> |
||||
|
<!-- android:textSize="18sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
|
||||
|
<!-- <LinearLayout--> |
||||
|
<!-- android:layout_width="wrap_content"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_gravity="center"--> |
||||
|
<!-- android:orientation="horizontal">--> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:id="@+id/mainViewToolRotationDirectionTxView"--> |
||||
|
<!-- android:layout_width="wrap_content"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_marginHorizontal="20dp"--> |
||||
|
<!-- android:gravity="center|right"--> |
||||
|
<!-- android:text="正向"--> |
||||
|
<!-- android:textColor="@color/deepskyblue"--> |
||||
|
<!-- android:textSize="35sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
|
||||
|
<!--<!– <TextView–>--> |
||||
|
|
||||
|
<!--<!– android:layout_width="wrap_content"–>--> |
||||
|
<!--<!– android:layout_height="match_parent"–>--> |
||||
|
<!--<!– android:layout_weight="1"–>--> |
||||
|
<!--<!– android:gravity="bottom|left"–>--> |
||||
|
<!--<!– android:text="m"–>--> |
||||
|
<!--<!– android:textColor="@color/deepskyblue"–>--> |
||||
|
<!--<!– android:textSize="18sp" />–>--> |
||||
|
<!-- </LinearLayout>--> |
||||
|
|
||||
|
<!-- </LinearLayout>--> |
||||
|
|
||||
|
<!-- <Button--> |
||||
|
<!-- android:id="@+id/setToolRotationDirectionBtn"--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_margin="8dp"--> |
||||
|
<!-- android:background="@color/trasnparent"--> |
||||
|
<!-- android:textAlignment="center" />--> |
||||
|
<!-- </FrameLayout>--> |
||||
|
<!-- <!–压力设定–>--> |
||||
|
<!-- <FrameLayout--> |
||||
|
<!-- android:id="@+id/mainViewEndPressureFrameLayout"--> |
||||
|
<!-- android:layout_width="0dp"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_gravity="center"--> |
||||
|
<!-- android:layout_margin="8dp"--> |
||||
|
<!-- android:layout_weight="1"--> |
||||
|
<!-- android:background="@drawable/blue_rounded_rectangle">--> |
||||
|
|
||||
|
<!-- <LinearLayout--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_gravity="fill"--> |
||||
|
<!-- android:orientation="horizontal">--> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:layout_width="40dp"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_gravity="center"--> |
||||
|
<!-- android:layout_marginHorizontal="8dp"--> |
||||
|
<!-- android:text="压力设定"--> |
||||
|
<!-- android:textColor="@color/midnightblue"--> |
||||
|
<!-- android:textSize="18sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
|
||||
|
<!-- <LinearLayout--> |
||||
|
<!-- android:layout_width="wrap_content"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_gravity="center"--> |
||||
|
<!-- android:orientation="horizontal">--> |
||||
|
|
||||
|
<!-- <EditText--> |
||||
|
<!-- android:id="@+id/mainViewEndPressureTxView"--> |
||||
|
<!-- android:layout_width="110dp"--> |
||||
|
<!-- android:layout_height="80dp"--> |
||||
|
|
||||
|
<!-- android:background="@null"--> |
||||
|
<!-- android:imeOptions="actionDone"--> |
||||
|
<!-- android:inputType="number"--> |
||||
|
|
||||
|
<!-- android:gravity="center"--> |
||||
|
<!-- android:text="1500"--> |
||||
|
<!-- android:textColor="@color/deepskyblue"--> |
||||
|
<!-- android:textSize="35sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
|
||||
|
<!-- <!– <TextView–>--> |
||||
|
<!-- <!– android:layout_width="wrap_content"–>--> |
||||
|
<!-- <!– android:layout_height="match_parent"–>--> |
||||
|
<!-- <!– android:layout_weight="1"–>--> |
||||
|
<!-- <!– android:gravity="bottom|left"–>--> |
||||
|
<!-- <!– android:text="N"–>--> |
||||
|
<!-- <!– android:textColor="@color/deepskyblue"–>--> |
||||
|
<!-- <!– android:textSize="18sp" />–>--> |
||||
|
<!-- </LinearLayout>--> |
||||
|
|
||||
|
<!-- </LinearLayout>--> |
||||
|
|
||||
|
<!-- <!– <Button–>--> |
||||
|
<!-- <!– android:id="@+id/setEndPressureBtn"–>--> |
||||
|
<!-- <!– android:layout_width="match_parent"–>--> |
||||
|
<!-- <!– android:layout_height="match_parent"–>--> |
||||
|
<!-- <!– android:layout_margin="5dp"–>--> |
||||
|
<!-- <!– 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="match_parent"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_gravity="center"--> |
||||
|
<!-- android:layout_margin="5dp"--> |
||||
|
<!-- android:background="@drawable/white_rounded_rectangle">--> |
||||
|
<!-- <LinearLayout--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_gravity="fill"--> |
||||
|
<!-- android:orientation="horizontal">--> |
||||
|
<!-- <TextView--> |
||||
|
<!-- android:layout_width="40dp"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_gravity="center"--> |
||||
|
<!-- android:layout_marginHorizontal="8dp"--> |
||||
|
<!-- android:text="报错信息"--> |
||||
|
<!-- android:textColor="@color/midnightblue"--> |
||||
|
<!-- android:textSize="18sp"--> |
||||
|
<!-- android:textStyle="bold">--> |
||||
|
<!-- </TextView>--> |
||||
|
<!-- <TextView--> |
||||
|
<!-- android:id="@+id/mainViewErrMessageTxView"--> |
||||
|
<!-- android:layout_width="wrap_content"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:layout_marginHorizontal="5dp"--> |
||||
|
<!-- android:layout_gravity="center"--> |
||||
|
<!-- android:text=""--> |
||||
|
<!-- android:textColor="@color/midnightblue"--> |
||||
|
<!-- android:textStyle="bold">--> |
||||
|
|
||||
|
<!-- </TextView>--> |
||||
|
<!-- </LinearLayout>--> |
||||
|
<!-- </FrameLayout>--> |
||||
|
<!-- </LinearLayout>--> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
</LinearLayout> |
||||
|
</LinearLayout> |
||||
|
</layout> |
||||
@ -0,0 +1,292 @@ |
|||||
|
<?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="@drawable/submenupng" |
||||
|
android:orientation="vertical" |
||||
|
tools:ignore="MissingDefaultResource"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_margin="30dp" |
||||
|
android:letterSpacing="0.5" |
||||
|
android:text="自动模式" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
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/autoModeSelectorGroup" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:gravity="center" |
||||
|
android:orientation="horizontal" |
||||
|
tools:ignore="UselessParent"> |
||||
|
|
||||
|
<!-- <RadioButton--> |
||||
|
<!-- android:id="@+id/rb_one"--> |
||||
|
<!-- android:layout_width="160dp"--> |
||||
|
<!-- android:layout_height="160dp"--> |
||||
|
<!-- android:background="@drawable/radiobutton_background"--> |
||||
|
<!-- android:button="@null"--> |
||||
|
<!-- android:checked="true"--> |
||||
|
<!-- android:gravity="center"--> |
||||
|
<!-- android:padding="10dp"--> |
||||
|
<!-- android:text="无"--> |
||||
|
<!-- android:textColor="@drawable/radio_button_textcolor"--> |
||||
|
<!-- android:textSize="50sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
|
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_two" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:background="@drawable/radiobutton_background" |
||||
|
android:button="@null" |
||||
|
android:gravity="center" |
||||
|
android:padding="10dp" |
||||
|
android:text="水平" |
||||
|
android:textColor="@drawable/radio_button_textcolor" |
||||
|
android:textSize="40sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_three" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginStart="10dp" |
||||
|
android:background="@drawable/radiobutton_background" |
||||
|
android:button="@null" |
||||
|
android:gravity="center" |
||||
|
android:padding="10dp" |
||||
|
android:text="竖直向左" |
||||
|
android:textColor="@drawable/radio_button_textcolor" |
||||
|
android:textSize="40sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_four" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_marginStart="10dp" |
||||
|
android:background="@drawable/radiobutton_background" |
||||
|
android:button="@null" |
||||
|
android:gravity="center" |
||||
|
android:padding="10dp" |
||||
|
android:text="竖直向右" |
||||
|
android:textColor="@drawable/radio_button_textcolor" |
||||
|
android:textSize="40sp" |
||||
|
android:textStyle="bold" /> |
||||
|
</RadioGroup> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="95dp" |
||||
|
android:layout_gravity="center"> |
||||
|
|
||||
|
|
||||
|
<FrameLayout |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_margin="10dp" |
||||
|
android:layout_weight="1" |
||||
|
android:background="@drawable/borderblue"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="fill" |
||||
|
android:layout_marginHorizontal="10dp" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="50dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:gravity="center" |
||||
|
android:text="纵向距离" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="20sp" |
||||
|
android:textStyle="bold" /> |
||||
|
<EditText |
||||
|
android:id="@+id/popupViewWorkWidthEdTxView" |
||||
|
android:inputType="number" |
||||
|
android:layout_width="100dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:layout_marginStart="8dp" |
||||
|
android:background="@null" |
||||
|
android:layout_gravity="center" |
||||
|
android:textSize="40sp" |
||||
|
android:textStyle="bold" |
||||
|
tools:ignore="RtlHardcoded"> |
||||
|
</EditText> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:id="@+id/popupViewWorkWidthTxView"--> |
||||
|
<!-- android:layout_width="100dp"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_weight="2"--> |
||||
|
<!-- android:gravity="center|right"--> |
||||
|
<!-- android:text="0"--> |
||||
|
<!-- android:textColor="@color/deepskyblue"--> |
||||
|
<!-- android:textSize="40sp"--> |
||||
|
<!-- android:textStyle="bold" />--> |
||||
|
|
||||
|
<TextView |
||||
|
|
||||
|
android:layout_width="20dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:gravity="center" |
||||
|
android:text="m" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="20sp" |
||||
|
tools:ignore="RtlHardcoded" /> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<!-- <Button--> |
||||
|
<!-- android:id="@+id/setWorkWidthBtn"--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_margin="8dp"--> |
||||
|
<!-- 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="10dp" |
||||
|
android:layout_weight="1" |
||||
|
android:background="@drawable/borderblue"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="fill" |
||||
|
android:layout_marginHorizontal="10dp" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="50dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:gravity="center" |
||||
|
android:text="横向距离" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
android:textSize="20sp" |
||||
|
android:textStyle="bold" /> |
||||
|
<EditText |
||||
|
android:id="@+id/popupViewWorkDistanceEdTxView" |
||||
|
android:inputType="number" |
||||
|
android:layout_width="100dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:background="@null" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginStart="8dp" |
||||
|
android:textSize="40sp" |
||||
|
android:textStyle="bold" |
||||
|
tools:ignore="RtlHardcoded"> |
||||
|
</EditText> |
||||
|
|
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:id="@+id/popupViewWorkDistanceTxView"--> |
||||
|
<!-- android:layout_width="100dp"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:gravity="center|right"--> |
||||
|
<!-- android:text="0"--> |
||||
|
<!-- android:textColor="@color/deepskyblue"--> |
||||
|
<!-- android:textSize="40sp"--> |
||||
|
<!-- android:textStyle="bold"--> |
||||
|
<!-- tools:ignore="RtlHardcoded" />--> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="20dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:gravity="center" |
||||
|
android:text="m" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="20sp" |
||||
|
tools:ignore="RtlHardcoded" /> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<!-- <Button--> |
||||
|
<!-- android:id="@+id/setWorkDistanceBtn"--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="match_parent"--> |
||||
|
<!-- android:layout_margin="8dp"--> |
||||
|
<!-- android:background="@color/trasnparent"--> |
||||
|
<!-- android:textAlignment="center" />--> |
||||
|
</FrameLayout> |
||||
|
|
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_marginVertical="5dp" |
||||
|
android:gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_marginHorizontal="12dp" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:padding="4dp" |
||||
|
android:background="@drawable/borderblue"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/automaticModeModeApply" |
||||
|
android:layout_width="200dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:background="@color/trasnparent" |
||||
|
android:text="确定" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="25sp" |
||||
|
android:textStyle="bold"> |
||||
|
</Button> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_marginHorizontal= "12dp" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:padding="4dp" |
||||
|
android:background="@drawable/borderorange"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/automaticModeCancel" |
||||
|
android:layout_width="200dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:background="@color/trasnparent" |
||||
|
android:text="取消" |
||||
|
android:padding="4dp" |
||||
|
android:textColor="#ed7041" |
||||
|
android:textSize="25sp" |
||||
|
android:textStyle="bold"> |
||||
|
</Button> |
||||
|
</LinearLayout> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
</LinearLayout> |
||||
@ -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="@drawable/submenupng" |
||||
|
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/midnightblue" |
||||
|
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/pressure_input" |
||||
|
android:inputType="number" |
||||
|
android:background="@drawable/bordergreen" |
||||
|
android:layout_width="200dp" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
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/deepskyblue" |
||||
|
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/borderblue"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/pressureApply" |
||||
|
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/deepskyblue" |
||||
|
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/pressureCancel" |
||||
|
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> |
||||
@ -0,0 +1,108 @@ |
|||||
|
<?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="@drawable/submenupng" |
||||
|
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/midnightblue" |
||||
|
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/lanechange_input" |
||||
|
android:inputType="number" |
||||
|
android:background="@drawable/bordergreen" |
||||
|
android:layout_width="200dp" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
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/deepskyblue" |
||||
|
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/borderblue"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/lanechangeApply" |
||||
|
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/deepskyblue" |
||||
|
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/lanechangeCancel" |
||||
|
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> |
||||
@ -0,0 +1,43 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
|
android:layout_width="450dp" |
||||
|
android:layout_height="350dp" |
||||
|
android:layout_gravity="center" |
||||
|
android:background="@drawable/submenu" |
||||
|
android:orientation="vertical"> |
||||
|
|
||||
|
<!-- <TextView--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="wrap_content"--> |
||||
|
<!-- android:text="历史记录"--> |
||||
|
<!-- android:layout_marginTop="20dp"--> |
||||
|
<!-- android:gravity="center"--> |
||||
|
<!-- android:textSize="20sp"--> |
||||
|
<!-- android:textColor="@color/midnightblue" />--> |
||||
|
|
||||
|
<com.example.paintingapp.models.ScrollBottomScrollView |
||||
|
android:id="@+id/popUpErrorLogScrollview" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_margin="8dp" |
||||
|
android:background="@drawable/borderlog"> |
||||
|
|
||||
|
<!-- <androidx.recyclerview.widget.RecyclerView--> |
||||
|
<!-- android:layout_width="match_parent"--> |
||||
|
<!-- android:layout_height="wrap_content">--> |
||||
|
|
||||
|
<!-- </androidx.recyclerview.widget.RecyclerView>--> |
||||
|
<TextView |
||||
|
android:id="@+id/popUpErrorLogTextView" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_margin="8dp" |
||||
|
android:scrollbars="vertical" |
||||
|
android:scrollbarStyle="insideInset" |
||||
|
android:textSize="12sp" |
||||
|
android:textColor="@color/midnightblue" /> |
||||
|
</com.example.paintingapp.models.ScrollBottomScrollView> |
||||
|
|
||||
|
|
||||
|
</LinearLayout> |
||||
|
|
||||
@ -0,0 +1,147 @@ |
|||||
|
<?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="@drawable/submenupng" |
||||
|
android:orientation="vertical" |
||||
|
tools:ignore="MissingDefaultResource"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_margin="30dp" |
||||
|
android:letterSpacing="0.5" |
||||
|
android:text="手动模式" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
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/manualModeSelectorGroup" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:gravity="center" |
||||
|
android:orientation="horizontal" |
||||
|
tools:ignore="UselessParent"> |
||||
|
|
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_one" |
||||
|
android:layout_width="130dp" |
||||
|
android:layout_height="130dp" |
||||
|
android:background="@drawable/radiobutton_background" |
||||
|
android:button="@null" |
||||
|
android:gravity="center" |
||||
|
android:padding="10dp" |
||||
|
android:text="无" |
||||
|
android:textColor="@drawable/radio_button_textcolor" |
||||
|
android:textSize="40sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_two" |
||||
|
android:layout_width="130dp" |
||||
|
android:layout_height="130dp" |
||||
|
android:layout_marginStart="10dp" |
||||
|
android:background="@drawable/radiobutton_background" |
||||
|
android:button="@null" |
||||
|
android:gravity="center" |
||||
|
android:padding="10dp" |
||||
|
android:text="水平" |
||||
|
android:textColor="@drawable/radio_button_textcolor" |
||||
|
android:textSize="40sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_three" |
||||
|
android:layout_width="130dp" |
||||
|
android:layout_height="130dp" |
||||
|
android:layout_marginStart="10dp" |
||||
|
android:background="@drawable/radiobutton_background" |
||||
|
android:button="@null" |
||||
|
android:gravity="center" |
||||
|
android:padding="10dp" |
||||
|
android:text="竖直向左" |
||||
|
android:textColor="@drawable/radio_button_textcolor" |
||||
|
android:textSize="40sp" |
||||
|
android:textStyle="bold" /> |
||||
|
|
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_four" |
||||
|
android:layout_width="130dp" |
||||
|
android:layout_height="130dp" |
||||
|
android:layout_marginStart="10dp" |
||||
|
android:background="@drawable/radiobutton_background" |
||||
|
android:button="@null" |
||||
|
android:gravity="center" |
||||
|
android:padding="10dp" |
||||
|
android:text="竖直向右" |
||||
|
android:textColor="@drawable/radio_button_textcolor" |
||||
|
android:textSize="40sp" |
||||
|
android:textStyle="bold" /> |
||||
|
</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_margin="10dp" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:padding="4dp" |
||||
|
android:background="@drawable/borderblue"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/manualModeModeApply" |
||||
|
android:layout_width="200dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:background="@color/trasnparent" |
||||
|
android:text="确定" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="25sp" |
||||
|
android:textStyle="bold"> |
||||
|
</Button> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_margin="10dp" |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:padding="4dp" |
||||
|
android:background="@drawable/borderorange"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/manualModeCancel" |
||||
|
android:layout_width="200dp" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:background="@color/trasnparent" |
||||
|
android:text="取消" |
||||
|
android:padding="4dp" |
||||
|
android:textColor="#ed7041" |
||||
|
android:textSize="25sp" |
||||
|
android:textStyle="bold"> |
||||
|
</Button> |
||||
|
</LinearLayout> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
</LinearLayout> |
||||
@ -0,0 +1,163 @@ |
|||||
|
<?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="@drawable/smallbackground" |
||||
|
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/white" |
||||
|
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/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="wrap_content" |
||||
|
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="无" /> |
||||
|
|
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_two" |
||||
|
android:layout_width="wrap_content" |
||||
|
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="水平" /> |
||||
|
<!-- <RadioButton--> |
||||
|
<!-- android:id="@+id/rb_three"--> |
||||
|
<!-- android:layout_width="wrap_content"--> |
||||
|
<!-- 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="水平右" />--> |
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_four" |
||||
|
android:layout_width="wrap_content" |
||||
|
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="垂直" /> |
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_five" |
||||
|
android:layout_width="wrap_content" |
||||
|
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="自动" /> |
||||
|
</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/bordergreen"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/operationModeApply" |
||||
|
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/bgrgreen" |
||||
|
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/operationModeCancel" |
||||
|
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> |
||||
@ -0,0 +1,210 @@ |
|||||
|
<?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="@drawable/submenupng" |
||||
|
android:orientation="vertical" |
||||
|
tools:ignore="MissingDefaultResource"> |
||||
|
|
||||
|
<TextView |
||||
|
android:layout_width="wrap_content" |
||||
|
android:layout_height="wrap_content" |
||||
|
android:layout_gravity="center" |
||||
|
android:layout_margin="30dp" |
||||
|
android:letterSpacing="0.5" |
||||
|
android:text="参数设置" |
||||
|
android:textColor="@color/midnightblue" |
||||
|
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="30dp" |
||||
|
android:layout_marginHorizontal="30dp" |
||||
|
android:gravity="center" |
||||
|
android:orientation="horizontal"> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_margin="4dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="center" |
||||
|
android:background="@drawable/borderblue"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/saveParametersBtn" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center" |
||||
|
android:background="@color/trasnparent" |
||||
|
android:text="保存" |
||||
|
android:textAlignment="center" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="18dp" |
||||
|
android:textStyle="bold"> |
||||
|
</Button> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_margin="4dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="center" |
||||
|
android:background="@drawable/borderorange"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/clearParametersBtn" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_gravity="center" |
||||
|
android:background="@color/trasnparent" |
||||
|
android:text="清除" |
||||
|
android:textAlignment="center" |
||||
|
android:textColor="#ed7041" |
||||
|
android:textSize="18dp" |
||||
|
android:textStyle="bold"> |
||||
|
</Button> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_margin="4dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="center" |
||||
|
android:background="@drawable/borderblue"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/parametersApply" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:background="@color/trasnparent" |
||||
|
android:text="使用" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
android:textSize="20sp" |
||||
|
android:textStyle="bold"> |
||||
|
</Button> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
<LinearLayout |
||||
|
android:layout_width="0dp" |
||||
|
android:layout_height="match_parent" |
||||
|
android:layout_margin="4dp" |
||||
|
android:layout_weight="1" |
||||
|
android:gravity="center" |
||||
|
android:background="@drawable/borderorange"> |
||||
|
<Button |
||||
|
android:id="@+id/parametersCancel" |
||||
|
android:layout_width="match_parent" |
||||
|
android:layout_height="match_parent" |
||||
|
android:background="@color/trasnparent" |
||||
|
android:text="退出" |
||||
|
android:padding="4dp" |
||||
|
android:textColor="#ed7041" |
||||
|
android:textSize="20sp" |
||||
|
android:textStyle="bold"> |
||||
|
|
||||
|
</Button> |
||||
|
</LinearLayout> |
||||
|
</LinearLayout> |
||||
|
|
||||
|
</LinearLayout> |
||||
@ -0,0 +1,22 @@ |
|||||
|
<?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="@drawable/submenupng" |
||||
|
android:orientation="vertical" |
||||
|
tools:ignore="MissingDefaultResource"> |
||||
|
|
||||
|
<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"/> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</LinearLayout> |
||||
@ -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="@drawable/submenupng" |
||||
|
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/midnightblue" |
||||
|
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/robotSpeed_input" |
||||
|
android:inputType="number" |
||||
|
android:background="@drawable/bordergreen" |
||||
|
android:layout_width="200dp" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
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/min" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
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/borderblue"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/Apply" |
||||
|
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/deepskyblue" |
||||
|
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/Cancel" |
||||
|
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> |
||||
@ -0,0 +1,135 @@ |
|||||
|
<?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="@drawable/submenupng" |
||||
|
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/midnightblue" |
||||
|
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/toolRotationDirectionSelectorGroup" |
||||
|
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="wrap_content" |
||||
|
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="关闭" /> |
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_two" |
||||
|
android:layout_width="wrap_content" |
||||
|
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="正向" /> |
||||
|
<RadioButton |
||||
|
android:id="@+id/rb_three" |
||||
|
android:layout_width="wrap_content" |
||||
|
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="反向" /> |
||||
|
</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/borderblue"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/Apply" |
||||
|
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/deepskyblue" |
||||
|
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/Cancel" |
||||
|
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> |
||||
@ -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="@drawable/submenupng" |
||||
|
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/midnightblue" |
||||
|
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/vertical_calibration_input" |
||||
|
android:inputType="numberSigned|numberDecimal" |
||||
|
android:background="@drawable/bordergreen" |
||||
|
android:layout_width="200dp" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
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/deepskyblue" |
||||
|
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/borderblue"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/vertical_calibration_Apply" |
||||
|
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/deepskyblue" |
||||
|
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/vertical_calibration_Cancel" |
||||
|
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> |
||||
@ -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="@drawable/submenupng" |
||||
|
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/midnightblue" |
||||
|
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/workDistance_input" |
||||
|
android:inputType="number" |
||||
|
android:background="@drawable/bordergreen" |
||||
|
android:layout_width="200dp" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
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/deepskyblue" |
||||
|
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/borderblue"> |
||||
|
|
||||
|
<Button |
||||
|
android:id="@+id/workDistanceApply" |
||||
|
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/deepskyblue" |
||||
|
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/workDistanceCancel" |
||||
|
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> |
||||
@ -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="@drawable/submenupng" |
||||
|
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/midnightblue" |
||||
|
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/bordergreen" |
||||
|
android:layout_width="200dp" |
||||
|
android:textColor="@color/deepskyblue" |
||||
|
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/deepskyblue" |
||||
|
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/borderblue"> |
||||
|
|
||||
|
<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/deepskyblue" |
||||
|
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> |
||||
@ -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> |
||||
@ -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> |
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 982 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
@ -0,0 +1,16 @@ |
|||||
|
<resources> |
||||
|
<!-- 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> |
||||
@ -0,0 +1,154 @@ |
|||||
|
<?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="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> |
||||
@ -0,0 +1,35 @@ |
|||||
|
<resources> |
||||
|
<string name="app_name">喷漆</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> |
||||
@ -0,0 +1,17 @@ |
|||||
|
<resources> |
||||
|
<!-- 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> |
||||