@ -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 @@ |
|||
guohuawindpowerapp |
|||
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="AndroidProjectSystem"> |
|||
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" /> |
|||
</component> |
|||
</project> |
|||
@ -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="2026-01-06T01:28:22.928267700Z"> |
|||
<Target type="DEFAULT_BOOT"> |
|||
<handle> |
|||
<DeviceId pluginId="PhysicalDevice" identifier="serial=f76cda8e" /> |
|||
</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,9 @@ |
|||
<project version="4"> |
|||
<component name="ExternalStorageConfigurationManager" enabled="true" /> |
|||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK"> |
|||
<output url="file://$PROJECT_DIR$/build/classes" /> |
|||
</component> |
|||
<component name="ProjectType"> |
|||
<option name="id" value="Android" /> |
|||
</component> |
|||
</project> |
|||
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="RenderSettings"> |
|||
<option name="showDecorations" value="true" /> |
|||
</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,58 @@ |
|||
plugins { |
|||
id 'com.android.application' |
|||
} |
|||
|
|||
android { |
|||
namespace 'com.example.guohuawindpowerapp' |
|||
compileSdk 35 |
|||
viewBinding |
|||
{ |
|||
enabled true |
|||
} |
|||
// //add this feature |
|||
dataBinding |
|||
{ |
|||
enabled true |
|||
} |
|||
defaultConfig { |
|||
applicationId "com.example.guohuawindpowerapp" |
|||
minSdk 24 |
|||
targetSdk 35 |
|||
versionCode 1 |
|||
versionName "1.0" |
|||
|
|||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
|||
} |
|||
|
|||
buildTypes { |
|||
release { |
|||
minifyEnabled false |
|||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
|||
} |
|||
} |
|||
buildFeatures{ |
|||
buildConfig true |
|||
} |
|||
compileOptions { |
|||
sourceCompatibility JavaVersion.VERSION_1_8 |
|||
targetCompatibility JavaVersion.VERSION_1_8 |
|||
} |
|||
} |
|||
|
|||
dependencies { |
|||
|
|||
implementation 'androidx.appcompat:appcompat:1.6.1' |
|||
implementation 'com.google.android.material:material:1.9.0' |
|||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' |
|||
testImplementation 'junit:junit:4.13.2' |
|||
androidTestImplementation 'androidx.test.ext:junit:1.1.5' |
|||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' |
|||
implementation 'com.github.mik3y:usb-serial-for-android:3.7.0' |
|||
implementation 'com.google.protobuf:protobuf-java:4.27.2' |
|||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20") |
|||
implementation 'com.github.nodemedia:nodemediaclient-android:2.9.20' |
|||
implementation 'io.github.xmaihh:serialport:2.1.1' |
|||
|
|||
|
|||
|
|||
} |
|||
@ -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": "app-release.apk" |
|||
} |
|||
], |
|||
"elementType": "File" |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.example.guohuawindpowerapp; |
|||
|
|||
import android.content.Context; |
|||
|
|||
import androidx.test.platform.app.InstrumentationRegistry; |
|||
import androidx.test.ext.junit.runners.AndroidJUnit4; |
|||
|
|||
import org.junit.Test; |
|||
import org.junit.runner.RunWith; |
|||
|
|||
import static org.junit.Assert.*; |
|||
|
|||
/** |
|||
* Instrumented test, which will execute on an Android device. |
|||
* |
|||
* @see <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,71 @@ |
|||
<?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.READ_EXTERNAL_STORAGE" /> |
|||
<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:label="@string/app_name" |
|||
android:icon="@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> |
|||
|
|||
<!-- 辅助Activity 1:喷漆界面 --> |
|||
<activity android:name=".PaintActivity" |
|||
android:launchMode="singleTop" /> |
|||
|
|||
<!-- 辅助Activity 2:拉毛界面 --> |
|||
<activity android:name=".CleanActivity" |
|||
android:launchMode="singleTop"/> |
|||
|
|||
<!-- 辅助Activity 3:打磨界面 --> |
|||
<activity android:name=".PolishActivity" |
|||
android:launchMode="singleTop"/> |
|||
|
|||
<!-- 辅助Activity 4:测厚界面 --> |
|||
<activity android:name=".MeasureActivity" |
|||
android:launchMode="singleTop"/> |
|||
|
|||
</application> |
|||
|
|||
</manifest> |
|||
@ -0,0 +1,27 @@ |
|||
syntax = "proto3"; |
|||
|
|||
option java_multiple_files = false; |
|||
option java_package = "com.example.guohuawindpowerapp.models"; |
|||
|
|||
message IV_struct_define |
|||
{ |
|||
int32 TempatureE_2C=1;//0.01Celsius 0.01摄氏度 |
|||
int32 RunMode=2;//系统运行状态 |
|||
int32 LeftCompensationE_2D= 3; //左补偿值 0.01° E_2D= 0.01Degree |
|||
int32 RightCompensationE_2D= 4;//右补偿值 0.01° |
|||
int32 CurrentAngleE_2D= 5; //当前值 0.01° |
|||
int32 RobotMoveSpeedE_2MPMin= 6; //0.01m/min |
|||
int32 EndPressure=7; |
|||
int32 SystemError=8; |
|||
int32 Left_Motor_Err=9; |
|||
int32 Right_Motor_Err=10; |
|||
int32 Remote_Status = 11; |
|||
int32 Slide_Table_Position = 12; |
|||
int32 Slide_Table_Speed = 13; |
|||
int32 Spray_Paint_Motor = 14; |
|||
int32 Push_Rod = 15; |
|||
int32 Roll_Brush = 16; |
|||
int32 Water_Pump = 17; |
|||
int32 Thickness_Value = 18; |
|||
|
|||
}; |
|||
@ -0,0 +1,28 @@ |
|||
syntax = "proto3"; |
|||
option java_multiple_files = false; |
|||
option java_package = "com.example.guohuawindpowerapp.models"; |
|||
message PV_struct_define{ |
|||
|
|||
// 喷漆项目 |
|||
int32 RunMode = 1; // 1 平面作业 2 竖直作业 3 自动作业 4 水平作业 |
|||
int32 RobotSpeed=2;//0-30m/min |
|||
|
|||
int32 SlidingDistance_cm = 3; //cm |
|||
int32 RobotBackwardDistance_cm = 4; //cm |
|||
int32 PumpFrequency = 5; |
|||
int32 PressureTargetValue = 6; |
|||
int32 VerticalCompensation = 7; |
|||
int32 RobotWorkingMode = 8; // 1 清洗 2 打磨 3 喷漆 4 测厚 |
|||
int32 SlidingTableSpeed = 9; |
|||
int32 HorizontalCompensationControl = 10; |
|||
int32 RobotSpeed_Clean_Mode = 11; |
|||
int32 RobotSpeed_Derust_Mode = 12; |
|||
int32 RobotSpeed_Spray_Paint_Mode = 13; |
|||
int32 RobotSpeed_Thickness_Measure_Mode = 14; |
|||
int32 PressureTargetValue_Derust = 15; |
|||
|
|||
int32 PumpStopFrequency = 16; |
|||
|
|||
int32 changeLaneBackwarkDistance = 17; |
|||
|
|||
}; |
|||
@ -0,0 +1,465 @@ |
|||
package com.example.guohuawindpowerapp; |
|||
|
|||
import android.app.AlertDialog; |
|||
import android.content.DialogInterface; |
|||
import android.os.Bundle; |
|||
import android.text.Editable; |
|||
import android.text.InputFilter; |
|||
import android.text.TextUtils; |
|||
import android.text.TextWatcher; |
|||
import android.view.View; |
|||
import android.view.WindowManager; |
|||
import android.widget.Toast; |
|||
|
|||
import androidx.appcompat.app.AppCompatActivity; |
|||
import androidx.databinding.DataBindingUtil; |
|||
|
|||
import com.example.guohuawindpowerapp.databinding.ActivityCleanBinding; |
|||
import com.example.guohuawindpowerapp.models.BspPV; |
|||
import com.example.guohuawindpowerapp.models.DisplayPV; |
|||
import com.example.guohuawindpowerapp.services.DecimalDigitsInputFilter; |
|||
import com.example.guohuawindpowerapp.services.ModbusCRC; |
|||
import com.example.guohuawindpowerapp.services.MyDataHelper; |
|||
import com.example.guohuawindpowerapp.services.PopupHelper; |
|||
import com.example.guohuawindpowerapp.services.USBSerialPortHelper; |
|||
import com.example.guohuawindpowerapp.services.VideoPlayerHelper; |
|||
|
|||
import java.util.HashSet; |
|||
import java.util.LinkedList; |
|||
import java.util.List; |
|||
import java.util.Set; |
|||
import java.util.Timer; |
|||
import java.util.TimerTask; |
|||
|
|||
import cn.nodemedia.NodePlayer; |
|||
|
|||
public class CleanActivity extends AppCompatActivity { |
|||
public ActivityCleanBinding mainBinding; |
|||
|
|||
public USBSerialPortHelper serialPortHelper;//串口接收类
|
|||
private BspPV.PV_struct_define _toSendPV; |
|||
|
|||
Timer timer = new Timer(); |
|||
public MyDataHelper myDataHelper = new MyDataHelper(this);//数据库类
|
|||
public PopupHelper popupHelper = new PopupHelper(this);//对话框类,把主界面实例传过去
|
|||
public String _Operate_Mode_Call_Value = "手动作业"; // 默认为手动作业
|
|||
/*报错相关*/ |
|||
private List<String> errorHistory = new LinkedList<>(); |
|||
private Set<String> uniqueErrors = new HashSet<>(); |
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
//设置全屏显示
|
|||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); |
|||
mainBinding= DataBindingUtil.setContentView(this,R.layout.activity_clean); |
|||
|
|||
mainBinding.MaintvVerticalAdjustTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter()}); //editext 一位小数限制
|
|||
mainBinding.MaintvMoveSpeedTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter() }); |
|||
showError("无"); |
|||
|
|||
|
|||
/* USB串口 控制区域*/ |
|||
serialPortHelper = new USBSerialPortHelper(null,this,null,null,null); |
|||
serialPortHelper.intialize(); |
|||
serialPortHelper.connect(); |
|||
|
|||
/* NodePlayer 播放视频区域*/ |
|||
|
|||
NodePlayer nodePlayer0=new NodePlayer(this); |
|||
// String address0 = "rtsp://192.168.1.168:8554/0";
|
|||
// String address1 = "rtsp://192.168.1.169:8554/0";
|
|||
String address0 = "rtsp://192.168.144.3:8554/main.264"; |
|||
VideoPlayerHelper.startVedio(mainBinding.nodePlayerView0,nodePlayer0,address0); |
|||
|
|||
// NodePlayer nodePlayer1=new NodePlayer(this);
|
|||
// // String address0 = "rtsp://192.168.1.168:8554/0";
|
|||
// // String address1 = "rtsp://192.168.1.169:8554/0";
|
|||
// String address1 = "rtsp://192.168.144.60:8554/main.264";
|
|||
// VideoPlayerHelper.startVedio(mainBinding.nodePlayerView5,nodePlayer1,address1);
|
|||
|
|||
myDataHelper.IntializeDataBaseClean(); |
|||
//读取数据
|
|||
List<DisplayPV> pvList = myDataHelper.getDisplayDataClean(1); //按id查询数据赋值给界面
|
|||
mainBinding.MaintvVerticalAdjustTo32.setText(String.valueOf(pvList.get(0).getVerticalCompensation())); |
|||
mainBinding.MaintvMoveSpeedTo32.setText(String.valueOf(pvList.get(0).getmoveSpeedClean())); |
|||
mainBinding.MaintvPumpFrequencyTo32.setText(String.valueOf(pvList.get(0).getpumpFrequency())); |
|||
mainBinding.MaintvPressLimitTo32.setText(String.valueOf(pvList.get(0).getPressSetClean())); |
|||
mainBinding.MaintvPumpStopFrequencyTo32.setText(String.valueOf(pvList.get(0).getpumpStopFrequency())); |
|||
|
|||
|
|||
|
|||
/*发往32*/ |
|||
timer.schedule(new TimerTask() { |
|||
@Override |
|||
public void run() { |
|||
// 使用 Handler 或 runOnUiThread 更新 UI
|
|||
runOnUiThread(new Runnable() { |
|||
@Override |
|||
public void run() { |
|||
|
|||
|
|||
// 更新 UI 的代码
|
|||
//必须有
|
|||
_toSendPV = BspPV.PV_struct_define.newBuilder() |
|||
.setRunMode(1) |
|||
.setRobotSpeed(0) |
|||
.setSlidingDistanceCm(0) |
|||
.setRobotBackwardDistanceCm(0) |
|||
.setPumpFrequency(0) |
|||
.setPressureTargetValue(0) |
|||
.setVerticalCompensation(0) |
|||
.setRobotWorkingMode(2) |
|||
.setSlidingTableSpeed(0) |
|||
.setHorizontalCompensationControl(0) |
|||
.setRobotSpeedCleanMode(0) |
|||
.setRobotSpeedDerustMode(0) |
|||
.setRobotSpeedSprayPaintMode(0) |
|||
.setRobotSpeedThicknessMeasureMode(0) |
|||
.setPumpStopFrequency(0) |
|||
.build(); |
|||
|
|||
String VeticalAdjustStr = mainBinding.MaintvVerticalAdjustTo32.getText().toString(); |
|||
String MoveSpeedStr = mainBinding.MaintvMoveSpeedTo32.getText().toString(); |
|||
String PumpFrequencyStr = mainBinding.MaintvPumpFrequencyTo32.getText().toString(); |
|||
String PumpStopFrequencyStr = mainBinding.MaintvPumpStopFrequencyTo32.getText().toString(); |
|||
String PressLimitStr = mainBinding.MaintvPressLimitTo32.getText().toString(); |
|||
//竖直微调--小数 *10
|
|||
try { |
|||
|
|||
if( VeticalAdjustStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setVerticalCompensation(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setVerticalCompensation( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvVerticalAdjustTo32.getText()))*10 )) .build(); |
|||
|
|||
} |
|||
|
|||
} catch (Exception e) { |
|||
|
|||
} |
|||
//移动速度*10
|
|||
try { |
|||
if( MoveSpeedStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setRobotSpeedCleanMode(1).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setRobotSpeedCleanMode( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvMoveSpeedTo32.getText()))*10 )).build(); |
|||
} |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
|
|||
} |
|||
|
|||
//水泵频率
|
|||
if(PumpFrequencyStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setPumpFrequency(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setPumpFrequency((Integer.parseInt(String.valueOf(mainBinding.MaintvPumpFrequencyTo32.getText())))).build();} |
|||
|
|||
//水泵停止频率
|
|||
if(PumpStopFrequencyStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setPumpStopFrequency(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setPumpStopFrequency((Integer.parseInt(String.valueOf(mainBinding.MaintvPumpStopFrequencyTo32.getText())))).build();} |
|||
|
|||
//压力上限
|
|||
if(PressLimitStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setPressureTargetValue(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setPressureTargetValue((Integer.parseInt(String.valueOf(mainBinding.MaintvPressLimitTo32.getText())))).build();} |
|||
|
|||
//工作模式
|
|||
_toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(1).build(); //1 清洗
|
|||
|
|||
if(_Operate_Mode_Call_Value.equals("手动作业")) |
|||
{ |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(1).build(); |
|||
} |
|||
if(_Operate_Mode_Call_Value.equals("竖直作业")) |
|||
{ |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(2).build(); |
|||
} |
|||
if(_Operate_Mode_Call_Value.equals("自动作业")) |
|||
{ |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(3).build(); |
|||
} |
|||
|
|||
byte[] byteArray = _toSendPV.toByteArray(); |
|||
byte[] sendbyteArray = new byte[byteArray.length + 4]; |
|||
byte[] sendbyteArray3 = new byte[byteArray.length + 6]; |
|||
if (byteArray.length != 0) { |
|||
System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); |
|||
} |
|||
sendbyteArray[0] = (byte) 0x55; |
|||
sendbyteArray[1] = (byte) 0x55; |
|||
sendbyteArray[2] = (byte) 0x01; |
|||
sendbyteArray[3] = (byte) 0x01; |
|||
|
|||
byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); |
|||
|
|||
System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); |
|||
|
|||
System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); |
|||
|
|||
serialPortHelper.SendData(sendbyteArray3); |
|||
} |
|||
}); |
|||
} |
|||
}, 0, 1000); // 延迟 0 毫秒,每隔 1000 毫秒执行一次
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
mainBinding.operateModeDisplay.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
popupHelper.OperateModeCleanPopup(this); |
|||
} |
|||
}); |
|||
//竖直补偿
|
|||
mainBinding.MaintvVerticalAdjustTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
String input = s.toString().trim(); |
|||
|
|||
// 1. 允许空输入(用户正在删除)
|
|||
if (TextUtils.isEmpty(input)) { |
|||
return; |
|||
} |
|||
|
|||
// 2. 允许合法的中间状态(如"-10.")
|
|||
if (input.matches("^-?\\d*(\\.\\d*)?$")) { |
|||
// 合法格式:整数、负数、小数、小数点开头
|
|||
try { |
|||
|
|||
int value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value < -10 || value > 10) { |
|||
showToast("请输入 -10 到 10 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvVerticalAdjustTo32.setText(""); |
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
} |
|||
// 尝试转换为double(处理小数)
|
|||
//lastValidValue = Double.parseDouble(input);
|
|||
} catch (NumberFormatException e) { |
|||
// 中间状态,忽略
|
|||
} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
//车体移动速度事件
|
|||
mainBinding.MaintvMoveSpeedTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
double value=0.0; |
|||
|
|||
if (!input.isEmpty()) { |
|||
try { |
|||
value = Double.parseDouble(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value < 0 || value > 30) { |
|||
showToast("请输入 0 到 30 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvMoveSpeedTo32.setText(""); |
|||
|
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
|
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
}); |
|||
//水泵启停频率
|
|||
mainBinding.MaintvPumpFrequencyTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
if (!input.isEmpty()) { |
|||
try { |
|||
int value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value <= 0 || value > 10) { |
|||
showToast("请输入 0 到 10 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvPumpFrequencyTo32.setText(""); |
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
//水泵停止频率
|
|||
mainBinding.MaintvPumpStopFrequencyTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
if (!input.isEmpty()) { |
|||
try { |
|||
int value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value <= 0 || value > 10) { |
|||
showToast("请输入 0 到 10 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvPumpStopFrequencyTo32.setText(""); |
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
|
|||
//压力上限
|
|||
mainBinding.MaintvPressLimitTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
if (!input.isEmpty()) { |
|||
try { |
|||
int value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value <= 0 || value > 3000) { |
|||
showToast("请输入 0 到 3000 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvPressLimitTo32.setText(""); |
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
//错误显示
|
|||
mainBinding.errorTextView.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
showErrorHistoryDialog(); |
|||
} |
|||
}); |
|||
//保存
|
|||
mainBinding.btnSave.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
//获取界面参数以写进数据库
|
|||
int paraIndex = 1; |
|||
double verticalAdjust = Double.parseDouble(mainBinding.MaintvVerticalAdjustTo32.getText().toString()); |
|||
double moveSpeedClean = Double.parseDouble(mainBinding.MaintvMoveSpeedTo32.getText().toString()); |
|||
|
|||
int pumpFrequency = Integer.parseInt(mainBinding.MaintvPumpFrequencyTo32.getText().toString()); |
|||
int pumpStopFrequency = Integer.parseInt(mainBinding.MaintvPumpStopFrequencyTo32.getText().toString()); |
|||
int pressSetClean = Integer.parseInt(mainBinding.MaintvPressLimitTo32.getText().toString()); |
|||
|
|||
//把界面中的值放进PV类的变量中
|
|||
DisplayPV displayPV = new DisplayPV(paraIndex, verticalAdjust,0,0, 0,0,moveSpeedClean, pumpFrequency, pressSetClean,0,0,0 ,0,pumpStopFrequency,0,0); |
|||
myDataHelper.addOrUpdateDisplayDataClean(displayPV); //创建数据库的实例在这里 PV传进去保存到数据库
|
|||
Toast.makeText(CleanActivity.this, "保存成功", Toast.LENGTH_SHORT).show(); |
|||
} |
|||
}); |
|||
|
|||
} |
|||
|
|||
private void showToast(String message) |
|||
{ |
|||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); |
|||
} |
|||
public void showError(String errorMessage) { |
|||
if (uniqueErrors.add(errorMessage)) { |
|||
errorHistory.add(errorMessage); |
|||
mainBinding.errorTextView.setText(errorMessage); |
|||
} |
|||
} |
|||
public void showErrorHistoryDialog() { |
|||
if (errorHistory.isEmpty()) { |
|||
return; |
|||
} |
|||
|
|||
StringBuilder historyText = new StringBuilder(); |
|||
for (String error : errorHistory) { |
|||
historyText.append(error).append("\n"); |
|||
} |
|||
|
|||
AlertDialog.Builder builder = new AlertDialog.Builder(this); |
|||
builder.setTitle("历史报错信息") |
|||
.setMessage(historyText.toString()) |
|||
.setPositiveButton("关闭", new DialogInterface.OnClickListener() { |
|||
@Override |
|||
public void onClick(DialogInterface dialog, int which) { |
|||
dialog.dismiss(); |
|||
} |
|||
}); |
|||
|
|||
AlertDialog dialog = builder.create(); |
|||
dialog.show(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,189 @@ |
|||
package com.example.guohuawindpowerapp; |
|||
|
|||
import android.content.Intent; |
|||
import android.os.Bundle; |
|||
import android.view.WindowManager; |
|||
|
|||
import androidx.appcompat.app.AppCompatActivity; |
|||
import androidx.databinding.DataBindingUtil; |
|||
|
|||
import com.example.guohuawindpowerapp.databinding.ActivityMainBinding; |
|||
import com.example.guohuawindpowerapp.models.BspPV; |
|||
import com.example.guohuawindpowerapp.services.ModbusCRC; |
|||
import com.example.guohuawindpowerapp.services.USBSerialPortHelper; |
|||
|
|||
import java.util.Timer; |
|||
import java.util.TimerTask; |
|||
|
|||
public class MainActivity extends AppCompatActivity { |
|||
public ActivityMainBinding mainBinding; |
|||
private BspPV.PV_struct_define _toSendPV; |
|||
public USBSerialPortHelper serialPortHelper;//串口接收类
|
|||
Timer timer = new Timer(); |
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
//设置全屏显示
|
|||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); |
|||
mainBinding= DataBindingUtil.setContentView(this,R.layout.activity_main); |
|||
// 必须在 AndroidManifest.xml 中注册,否则会报错
|
|||
mainBinding.btnPaint.setOnClickListener(v -> startActivity(new Intent(this, PaintActivity.class))); |
|||
mainBinding.btnClean.setOnClickListener(v -> startActivity(new Intent(this, CleanActivity.class))); |
|||
mainBinding.btnPolish.setOnClickListener(v -> startActivity(new Intent(this, PolishActivity.class))); |
|||
mainBinding.btnMeasure.setOnClickListener(v -> startActivity(new Intent(this, MeasureActivity.class))); |
|||
/* USB串口 控制区域*/ |
|||
serialPortHelper = new USBSerialPortHelper(null,null,null,null,this); |
|||
serialPortHelper.intialize(); |
|||
serialPortHelper.connect(); |
|||
/*发往32*/ |
|||
timer.schedule(new TimerTask() { |
|||
@Override |
|||
public void run() { |
|||
// 使用 Handler 或 runOnUiThread 更新 UI
|
|||
runOnUiThread(new Runnable() { |
|||
@Override |
|||
public void run() { |
|||
|
|||
|
|||
// 更新 UI 的代码
|
|||
//必须有
|
|||
_toSendPV = BspPV.PV_struct_define.newBuilder() |
|||
.setRunMode(0) |
|||
.setRobotSpeed(0) |
|||
.setSlidingDistanceCm(0) |
|||
.setRobotBackwardDistanceCm(0) |
|||
.setPumpFrequency(0) |
|||
.setPressureTargetValue(0) |
|||
.setVerticalCompensation(0) |
|||
.setRobotWorkingMode(0) |
|||
.setSlidingTableSpeed(0) |
|||
.setHorizontalCompensationControl(0) |
|||
.setPumpStopFrequency(0) |
|||
.build(); |
|||
|
|||
|
|||
_toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(0).build(); |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(0).build(); |
|||
|
|||
byte[] byteArray = _toSendPV.toByteArray(); |
|||
byte[] sendbyteArray = new byte[byteArray.length + 4]; |
|||
byte[] sendbyteArray3 = new byte[byteArray.length + 6]; |
|||
if (byteArray.length != 0) { |
|||
System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); |
|||
} |
|||
sendbyteArray[0] = (byte) 0x55; |
|||
sendbyteArray[1] = (byte) 0x55; |
|||
sendbyteArray[2] = (byte) 0x01; |
|||
sendbyteArray[3] = (byte) 0x01; |
|||
|
|||
byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); |
|||
|
|||
System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); |
|||
|
|||
System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); |
|||
|
|||
serialPortHelper.SendData(sendbyteArray3); |
|||
} |
|||
}); |
|||
} |
|||
}, 0, 1000); // 延迟 0 毫秒,每隔 1000 毫秒执行一次
|
|||
} |
|||
// 新增:当界面可见时调用(如从辅助界面返回时)
|
|||
@Override |
|||
protected void onResume() { |
|||
super.onResume(); |
|||
// 启动串口连接
|
|||
|
|||
/* USB串口 控制区域*/ |
|||
serialPortHelper = new USBSerialPortHelper(null,null,null,null,this); |
|||
serialPortHelper.intialize(); |
|||
serialPortHelper.connect(); |
|||
|
|||
// 启动定时器(确保每次界面可见时都运行)
|
|||
startTimer(); |
|||
} |
|||
// 新增:当界面不可见时调用(如跳转到辅助界面时)
|
|||
@Override |
|||
protected void onPause() { |
|||
super.onPause(); |
|||
// 停止定时器(避免在后台浪费资源)
|
|||
stopTimer(); |
|||
} |
|||
|
|||
// 新增:启动定时器的方法
|
|||
private void startTimer() { |
|||
// 先停止已有定时器,避免重复创建
|
|||
if (timer != null) { |
|||
timer.cancel(); |
|||
} |
|||
timer = new Timer(); |
|||
timer.schedule(new TimerTask() { |
|||
@Override |
|||
public void run() { |
|||
// 使用 Handler 或 runOnUiThread 更新 UI
|
|||
runOnUiThread(new Runnable() { |
|||
@Override |
|||
public void run() { |
|||
|
|||
|
|||
// 更新 UI 的代码
|
|||
//必须有
|
|||
_toSendPV = BspPV.PV_struct_define.newBuilder() |
|||
.setRunMode(0) |
|||
.setRobotSpeed(0) |
|||
.setSlidingDistanceCm(0) |
|||
.setRobotBackwardDistanceCm(0) |
|||
.setPumpFrequency(0) |
|||
.setPressureTargetValue(0) |
|||
.setVerticalCompensation(0) |
|||
.setRobotWorkingMode(0) |
|||
.setSlidingTableSpeed(0) |
|||
.setHorizontalCompensationControl(0) |
|||
.build(); |
|||
|
|||
|
|||
_toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(0).build(); |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(0).build(); |
|||
|
|||
byte[] byteArray = _toSendPV.toByteArray(); |
|||
byte[] sendbyteArray = new byte[byteArray.length + 4]; |
|||
byte[] sendbyteArray3 = new byte[byteArray.length + 6]; |
|||
if (byteArray.length != 0) { |
|||
System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); |
|||
} |
|||
sendbyteArray[0] = (byte) 0x55; |
|||
sendbyteArray[1] = (byte) 0x55; |
|||
sendbyteArray[2] = (byte) 0x01; |
|||
sendbyteArray[3] = (byte) 0x01; |
|||
|
|||
byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); |
|||
|
|||
System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); |
|||
|
|||
System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); |
|||
|
|||
serialPortHelper.SendData(sendbyteArray3); |
|||
} |
|||
}); |
|||
} |
|||
}, 0, 1000); // 延迟 0 毫秒,每隔 1000 毫秒执行一次
|
|||
} |
|||
// 新增:停止定时器的方法
|
|||
private void stopTimer() { |
|||
if (timer != null) { |
|||
timer.cancel(); |
|||
timer = null; // 置空,释放资源
|
|||
} |
|||
} |
|||
// 界面销毁时彻底释放资源
|
|||
@Override |
|||
protected void onDestroy() { |
|||
super.onDestroy(); |
|||
stopTimer(); |
|||
if (serialPortHelper != null) { |
|||
serialPortHelper.disconnect(); |
|||
serialPortHelper = null; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,259 @@ |
|||
package com.example.guohuawindpowerapp; |
|||
|
|||
import android.app.AlertDialog; |
|||
import android.content.DialogInterface; |
|||
import android.os.Bundle; |
|||
import android.text.Editable; |
|||
import android.text.InputFilter; |
|||
import android.text.TextWatcher; |
|||
import android.view.View; |
|||
import android.view.WindowManager; |
|||
import android.widget.Toast; |
|||
|
|||
import androidx.appcompat.app.AppCompatActivity; |
|||
import androidx.databinding.DataBindingUtil; |
|||
import androidx.databinding.ViewDataBinding; |
|||
|
|||
import com.example.guohuawindpowerapp.databinding.ActivityMeasureBinding; |
|||
import com.example.guohuawindpowerapp.models.BspPV; |
|||
import com.example.guohuawindpowerapp.models.DisplayPV; |
|||
import com.example.guohuawindpowerapp.services.DecimalDigitsInputFilter; |
|||
import com.example.guohuawindpowerapp.services.ModbusCRC; |
|||
import com.example.guohuawindpowerapp.services.MyDataHelper; |
|||
import com.example.guohuawindpowerapp.services.PopupHelper; |
|||
import com.example.guohuawindpowerapp.services.USBSerialPortHelper; |
|||
import com.example.guohuawindpowerapp.services.VideoPlayerHelper; |
|||
|
|||
import java.util.HashSet; |
|||
import java.util.LinkedList; |
|||
import java.util.List; |
|||
import java.util.Set; |
|||
import java.util.Timer; |
|||
import java.util.TimerTask; |
|||
|
|||
import cn.nodemedia.NodePlayer; |
|||
|
|||
public class MeasureActivity extends AppCompatActivity { |
|||
|
|||
public ActivityMeasureBinding mainBinding; |
|||
public USBSerialPortHelper serialPortHelper;//串口接收类
|
|||
private BspPV.PV_struct_define _toSendPV; |
|||
|
|||
Timer timer = new Timer(); |
|||
|
|||
public MyDataHelper myDataHelper = new MyDataHelper(this);//数据库类
|
|||
public PopupHelper popupHelper = new PopupHelper(this);//对话框类,把主界面实例传过去
|
|||
|
|||
/*报错相关*/ |
|||
private List<String> errorHistory = new LinkedList<>(); |
|||
private Set<String> uniqueErrors = new HashSet<>(); |
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
//设置全屏显示
|
|||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); |
|||
mainBinding= DataBindingUtil.setContentView(this,R.layout.activity_measure); |
|||
mainBinding.MaintvMoveSpeedTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter() }); |
|||
showError("无"); |
|||
|
|||
|
|||
/* USB串口 控制区域*/ |
|||
serialPortHelper = new USBSerialPortHelper(null,null,null,this,null); |
|||
serialPortHelper.intialize(); |
|||
serialPortHelper.connect(); |
|||
|
|||
|
|||
|
|||
/* NodePlayer 播放视频区域*/ |
|||
|
|||
NodePlayer nodePlayer0=new NodePlayer(this); |
|||
// String address0 = "rtsp://192.168.1.168:8554/0";
|
|||
// String address1 = "rtsp://192.168.1.169:8554/0";
|
|||
String address0 = "rtsp://192.168.144.3:8554/main.264"; |
|||
VideoPlayerHelper.startVedio(mainBinding.nodePlayerView1,nodePlayer0,address0); |
|||
|
|||
// NodePlayer nodePlayer2=new NodePlayer(this);
|
|||
// // String address0 = "rtsp://192.168.1.168:8554/0";
|
|||
// // String address1 = "rtsp://192.168.1.169:8554/0";
|
|||
// String address2 = "rtsp://192.168.144.60:8554/main.264";
|
|||
// VideoPlayerHelper.startVedio(mainBinding.nodePlayerView6,nodePlayer2,address2);
|
|||
|
|||
myDataHelper.IntializeDataBaseMeasure(); |
|||
//读取数据
|
|||
List<DisplayPV> pvList = myDataHelper.getDisplayDataMeasure(1); //按id查询数据赋值给界面
|
|||
|
|||
mainBinding.MaintvMoveSpeedTo32.setText(String.valueOf(pvList.get(0).getmoveSpeedMeasure())); |
|||
|
|||
|
|||
|
|||
/*发往32*/ |
|||
timer.schedule(new TimerTask() { |
|||
@Override |
|||
public void run() { |
|||
// 使用 Handler 或 runOnUiThread 更新 UI
|
|||
runOnUiThread(new Runnable() { |
|||
@Override |
|||
public void run() { |
|||
|
|||
|
|||
// 更新 UI 的代码
|
|||
//必须有
|
|||
_toSendPV = BspPV.PV_struct_define.newBuilder() |
|||
.setRunMode(1) |
|||
.setRobotSpeed(0) |
|||
.setSlidingDistanceCm(0) |
|||
.setRobotBackwardDistanceCm(0) |
|||
.setPumpFrequency(0) |
|||
.setPressureTargetValue(0) |
|||
.setVerticalCompensation(0) |
|||
.setRobotWorkingMode(0) |
|||
.setSlidingTableSpeed(0) |
|||
.setHorizontalCompensationControl(0) |
|||
.setRobotSpeedCleanMode(0) |
|||
.setRobotSpeedDerustMode(0) |
|||
.setRobotSpeedSprayPaintMode(0) |
|||
.setRobotSpeedThicknessMeasureMode(0) |
|||
.setPumpStopFrequency(0) |
|||
.build(); |
|||
|
|||
|
|||
String MoveSpeedStr = mainBinding.MaintvMoveSpeedTo32.getText().toString(); |
|||
|
|||
|
|||
//移动速度
|
|||
try { |
|||
if( MoveSpeedStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setRobotSpeedThicknessMeasureMode(1).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setRobotSpeedThicknessMeasureMode( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvMoveSpeedTo32.getText()))*10 )).build(); |
|||
} |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
|
|||
} |
|||
|
|||
_toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(4).build(); |
|||
|
|||
|
|||
|
|||
byte[] byteArray = _toSendPV.toByteArray(); |
|||
byte[] sendbyteArray = new byte[byteArray.length + 4]; |
|||
byte[] sendbyteArray3 = new byte[byteArray.length + 6]; |
|||
if (byteArray.length != 0) { |
|||
System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); |
|||
} |
|||
sendbyteArray[0] = (byte) 0x55; |
|||
sendbyteArray[1] = (byte) 0x55; |
|||
sendbyteArray[2] = (byte) 0x01; |
|||
sendbyteArray[3] = (byte) 0x01; |
|||
|
|||
byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); |
|||
|
|||
System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); |
|||
|
|||
System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); |
|||
|
|||
serialPortHelper.SendData(sendbyteArray3); |
|||
} |
|||
}); |
|||
} |
|||
}, 0, 1000); // 延迟 0 毫秒,每隔 1000 毫秒执行一次
|
|||
|
|||
//车体移动速度事件
|
|||
mainBinding.MaintvMoveSpeedTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
double value=0.0; |
|||
if (!input.isEmpty()) { |
|||
try { |
|||
value = Double.parseDouble(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value < 0 || value > 30) { |
|||
showToast("请输入 0 到 30 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvMoveSpeedTo32.setText(""); |
|||
|
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
|
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
}); |
|||
//错误显示
|
|||
mainBinding.errorTextView.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
showErrorHistoryDialog(); |
|||
} |
|||
}); |
|||
|
|||
mainBinding.btnSave.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
//获取界面参数以写进数据库
|
|||
int paraIndex = 1; |
|||
double moveSpeedMeasure = Double.parseDouble(mainBinding.MaintvMoveSpeedTo32.getText().toString()); |
|||
|
|||
|
|||
|
|||
//把界面中的值放进PV类的变量中
|
|||
DisplayPV displayPV = new DisplayPV(paraIndex, 0,0,0, 0,0,0, 0, 0,0,0,0,moveSpeedMeasure ,0,0,0); |
|||
myDataHelper.addOrUpdateDisplayDataMeasure(displayPV); //创建数据库的实例在这里 PV传进去保存到数据库
|
|||
Toast.makeText(MeasureActivity.this, "保存成功", Toast.LENGTH_SHORT).show(); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
private void showToast(String message) |
|||
{ |
|||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); |
|||
} |
|||
|
|||
public void showError(String errorMessage) { |
|||
if (uniqueErrors.add(errorMessage)) { |
|||
errorHistory.add(errorMessage); |
|||
mainBinding.errorTextView.setText(errorMessage); |
|||
} |
|||
} |
|||
public void showErrorHistoryDialog() { |
|||
if (errorHistory.isEmpty()) { |
|||
return; |
|||
} |
|||
|
|||
StringBuilder historyText = new StringBuilder(); |
|||
for (String error : errorHistory) { |
|||
historyText.append(error).append("\n"); |
|||
} |
|||
|
|||
AlertDialog.Builder builder = new AlertDialog.Builder(this); |
|||
builder.setTitle("历史报错信息") |
|||
.setMessage(historyText.toString()) |
|||
.setPositiveButton("关闭", new DialogInterface.OnClickListener() { |
|||
@Override |
|||
public void onClick(DialogInterface dialog, int which) { |
|||
dialog.dismiss(); |
|||
} |
|||
}); |
|||
|
|||
AlertDialog dialog = builder.create(); |
|||
dialog.show(); |
|||
} |
|||
} |
|||
@ -0,0 +1,543 @@ |
|||
package com.example.guohuawindpowerapp; |
|||
|
|||
import androidx.appcompat.app.AppCompatActivity; |
|||
import androidx.databinding.DataBindingUtil; |
|||
|
|||
import android.app.AlertDialog; |
|||
import android.content.DialogInterface; |
|||
import android.os.Bundle; |
|||
import android.text.Editable; |
|||
import android.text.InputFilter; |
|||
import android.text.TextUtils; |
|||
import android.text.TextWatcher; |
|||
import android.view.View; |
|||
import android.view.WindowManager; |
|||
import android.widget.Toast; |
|||
|
|||
import com.example.guohuawindpowerapp.databinding.ActivityPaintBinding; |
|||
import com.example.guohuawindpowerapp.models.BspPV; |
|||
import com.example.guohuawindpowerapp.models.DisplayPV; |
|||
import com.example.guohuawindpowerapp.services.DecimalDigitsInputFilter; |
|||
import com.example.guohuawindpowerapp.services.ModbusCRC; |
|||
import com.example.guohuawindpowerapp.services.MyDataHelper; |
|||
import com.example.guohuawindpowerapp.services.PopupHelper; |
|||
import com.example.guohuawindpowerapp.services.USBSerialPortHelper; |
|||
import com.example.guohuawindpowerapp.services.VideoPlayerHelper; |
|||
|
|||
import java.util.HashSet; |
|||
import java.util.LinkedList; |
|||
import java.util.List; |
|||
import java.util.Set; |
|||
import java.util.Timer; |
|||
import java.util.TimerTask; |
|||
|
|||
import cn.nodemedia.NodePlayer; |
|||
|
|||
public class PaintActivity extends AppCompatActivity { |
|||
|
|||
public ActivityPaintBinding mainBinding;//通过Binding可以获取界面数据
|
|||
//USB 串口服务
|
|||
public USBSerialPortHelper serialPortHelper;//串口接收类
|
|||
private BspPV.PV_struct_define _toSendPV; |
|||
|
|||
Timer timer = new Timer(); |
|||
|
|||
public MyDataHelper myDataHelper = new MyDataHelper(this);//数据库类
|
|||
public PopupHelper popupHelper = new PopupHelper(this);//对话框类,把主界面实例传过去
|
|||
|
|||
public static byte[] stopgetAllChData = new byte[]{0x55, 0x66, 0x01, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, (byte) (0xf7 & 0xff), (byte) (0xe0 & 0xff)}; |
|||
public static int sendStopDataCount = 0; |
|||
|
|||
public String _Operate_Mode_Call_Value = "手动作业"; // 默认为手动作业
|
|||
/*报错相关*/ |
|||
private List<String> errorHistory = new LinkedList<>(); |
|||
private Set<String> uniqueErrors = new HashSet<>(); |
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
//设置全屏显示
|
|||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); |
|||
mainBinding = DataBindingUtil.setContentView(this, R.layout.activity_paint); |
|||
showError("无"); |
|||
mainBinding.MaintvVerticalAdjustTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter()}); //editext 一位小数限制
|
|||
mainBinding.MaintvMoveSpeedTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter() }); |
|||
mainBinding.MaintvSlideSpeedTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter()}); |
|||
|
|||
/* USB串口 控制区域*/ |
|||
serialPortHelper = new USBSerialPortHelper(this,null,null,null,null); |
|||
serialPortHelper.intialize(); |
|||
serialPortHelper.connect(); |
|||
|
|||
|
|||
/* NodePlayer 播放视频区域*/ |
|||
|
|||
NodePlayer nodePlayer0=new NodePlayer(this); |
|||
// String address0 = "rtsp://192.168.1.168:8554/0";
|
|||
// String address1 = "rtsp://192.168.1.169:8554/0";
|
|||
String address0 = "rtsp://192.168.144.3:8554/main.264"; |
|||
VideoPlayerHelper.startVedio(mainBinding.nodePlayerView2,nodePlayer0,address0); |
|||
|
|||
/* NodePlayer 播放视频区域*/ |
|||
|
|||
// NodePlayer nodePlayer3=new NodePlayer(this);
|
|||
// // String address0 = "rtsp://192.168.1.168:8554/0";
|
|||
// // String address1 = "rtsp://192.168.1.169:8554/0";
|
|||
// String address3 = "rtsp://192.168.144.60:8554/main.264";
|
|||
// VideoPlayerHelper.startVedio(mainBinding.nodePlayerView4,nodePlayer3,address3);
|
|||
|
|||
|
|||
myDataHelper.IntializeDataBasePaint(); |
|||
//读取数据
|
|||
List<DisplayPV> pvList = myDataHelper.getDisplayDataPaint(1); //按id查询数据赋值给界面
|
|||
mainBinding.MaintvVerticalAdjustTo32.setText(String.valueOf(pvList.get(0).getVerticalCompensation())); |
|||
mainBinding.MaintvMoveSpeedTo32.setText(String.valueOf(pvList.get(0).getMoveSpeedPaint())); |
|||
mainBinding.MaintvBackDistanceTo32.setText(String.valueOf(pvList.get(0).getbackDistance())); |
|||
mainBinding.MaintvSlideSpeedTo32.setText(String.valueOf(pvList.get(0).getslideSpeed())); |
|||
mainBinding.MaintvSlideMoveDistanceTo32.setText(String.valueOf(pvList.get(0).getslideDistance())); |
|||
mainBinding.MaintvChangeLaneBackDistanceTo32.setText(String.valueOf(pvList.get(0).getChangeLaneDisPaint())); |
|||
|
|||
/*发往32*/ |
|||
timer.schedule(new TimerTask() { |
|||
@Override |
|||
public void run() { |
|||
// 使用 Handler 或 runOnUiThread 更新 UI
|
|||
runOnUiThread(new Runnable() { |
|||
@Override |
|||
public void run() { |
|||
|
|||
|
|||
// 更新 UI 的代码
|
|||
//必须有
|
|||
_toSendPV = BspPV.PV_struct_define.newBuilder() |
|||
.setRunMode(1) |
|||
.setRobotSpeed(0) |
|||
.setSlidingDistanceCm(0) |
|||
.setRobotBackwardDistanceCm(0) |
|||
.setPumpFrequency(0) |
|||
.setPressureTargetValue(0) |
|||
.setVerticalCompensation(0) |
|||
.setRobotWorkingMode(0) |
|||
.setSlidingTableSpeed(0) |
|||
.setHorizontalCompensationControl(0) |
|||
.setRobotSpeedCleanMode(0) |
|||
.setRobotSpeedDerustMode(0) |
|||
.setRobotSpeedSprayPaintMode(0) |
|||
.setRobotSpeedThicknessMeasureMode(0) |
|||
.setPumpStopFrequency(0) |
|||
.setChangeLaneBackwarkDistance(0) |
|||
.build(); |
|||
|
|||
String VeticalAdjustStr = mainBinding.MaintvVerticalAdjustTo32.getText().toString(); |
|||
String MoveSpeedStr = mainBinding.MaintvMoveSpeedTo32.getText().toString(); |
|||
String BackDistanceStr = mainBinding.MaintvBackDistanceTo32.getText().toString(); |
|||
String SlideSpeedStr = mainBinding.MaintvSlideSpeedTo32.getText().toString(); |
|||
String SlideMoveDistanceStr = mainBinding.MaintvSlideMoveDistanceTo32.getText().toString(); |
|||
String ChangeLaneDiatancev = mainBinding.MaintvChangeLaneBackDistanceTo32.getText().toString(); |
|||
|
|||
//竖直微调--小数 *10
|
|||
try { |
|||
|
|||
if( VeticalAdjustStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setVerticalCompensation(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setVerticalCompensation( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvVerticalAdjustTo32.getText()))*10 )) .build(); |
|||
|
|||
} |
|||
|
|||
} catch (Exception e) { |
|||
|
|||
} |
|||
//移动速度
|
|||
try { |
|||
if( MoveSpeedStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setRobotSpeedSprayPaintMode(1).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setRobotSpeedSprayPaintMode( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvMoveSpeedTo32.getText()))*10 )).build(); |
|||
} |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
|
|||
} |
|||
//后退距离
|
|||
try { |
|||
if( BackDistanceStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setRobotBackwardDistanceCm(1).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setRobotBackwardDistanceCm( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvBackDistanceTo32.getText())) )).build(); |
|||
} |
|||
} catch (Exception e) { |
|||
|
|||
} |
|||
//滑台速度
|
|||
try { |
|||
if(SlideSpeedStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setSlidingTableSpeed(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setSlidingTableSpeed((Integer.parseInt(String.valueOf(mainBinding.MaintvSlideSpeedTo32.getText()))*10)).build();} |
|||
|
|||
} catch (Exception e) { |
|||
|
|||
} |
|||
|
|||
// 换道距离
|
|||
try { |
|||
if(ChangeLaneDiatancev.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setChangeLaneBackwarkDistance(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setChangeLaneBackwarkDistance((Integer.parseInt(String.valueOf(mainBinding.MaintvChangeLaneBackDistanceTo32.getText())))).build();} |
|||
|
|||
} catch (Exception e) { |
|||
|
|||
} |
|||
|
|||
//滑台移动距离
|
|||
if(SlideMoveDistanceStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setSlidingDistanceCm(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setSlidingDistanceCm((Integer.parseInt(String.valueOf(mainBinding.MaintvSlideMoveDistanceTo32.getText())))).build();} |
|||
|
|||
_toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(3).build(); |
|||
|
|||
if(_Operate_Mode_Call_Value.equals("手动作业")) |
|||
{ |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(1).build(); |
|||
} |
|||
if(_Operate_Mode_Call_Value.equals("竖直作业")) |
|||
{ |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(2).build(); |
|||
} |
|||
if(_Operate_Mode_Call_Value.equals("竖直自动")) |
|||
{ |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(3).build(); |
|||
} |
|||
if(_Operate_Mode_Call_Value.equals("水平自动")) |
|||
{ |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(5).build(); |
|||
} |
|||
|
|||
byte[] byteArray = _toSendPV.toByteArray(); |
|||
byte[] sendbyteArray = new byte[byteArray.length + 4]; |
|||
byte[] sendbyteArray3 = new byte[byteArray.length + 6]; |
|||
if (byteArray.length != 0) { |
|||
System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); |
|||
} |
|||
sendbyteArray[0] = (byte) 0x55; |
|||
sendbyteArray[1] = (byte) 0x55; |
|||
sendbyteArray[2] = (byte) 0x01; |
|||
sendbyteArray[3] = (byte) 0x01; |
|||
|
|||
byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); |
|||
|
|||
System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); |
|||
|
|||
System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); |
|||
|
|||
serialPortHelper.SendData(sendbyteArray3); |
|||
} |
|||
}); |
|||
} |
|||
}, 0, 1000); // 延迟 0 毫秒,每隔 1000 毫秒执行一次
|
|||
|
|||
mainBinding.operateModeDisplay.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
popupHelper.OperateModePaintPopup(this); |
|||
} |
|||
}); |
|||
|
|||
|
|||
|
|||
|
|||
mainBinding.MaintvVerticalAdjustTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
String input = s.toString().trim(); |
|||
|
|||
// 1. 允许空输入(用户正在删除)
|
|||
if (TextUtils.isEmpty(input)) { |
|||
return; |
|||
} |
|||
|
|||
// 2. 允许合法的中间状态(如"-10.")
|
|||
if (input.matches("^-?\\d*(\\.\\d*)?$")) { |
|||
// 合法格式:整数、负数、小数、小数点开头
|
|||
try { |
|||
|
|||
int value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value < -10 || value > 10) { |
|||
showToast("请输入 -10 到 10 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvVerticalAdjustTo32.setText(""); |
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
} |
|||
// 尝试转换为double(处理小数)
|
|||
//lastValidValue = Double.parseDouble(input);
|
|||
} catch (NumberFormatException e) { |
|||
// 中间状态,忽略
|
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
}); |
|||
|
|||
//车体移动速度事件
|
|||
mainBinding.MaintvMoveSpeedTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
double value=0.0; |
|||
|
|||
if (!input.isEmpty()) { |
|||
try { |
|||
value = Double.parseDouble(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value < 0 || value > 30) { |
|||
showToast("请输入 0 到 30 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvMoveSpeedTo32.setText(""); |
|||
|
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
|
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
}); |
|||
//后退距离
|
|||
mainBinding.MaintvBackDistanceTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
|
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
if (!input.isEmpty()) { |
|||
try { |
|||
int value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value <= 0 || value > 100) { |
|||
showToast("请输入 0 到 100 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvBackDistanceTo32.setText(""); |
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
}); |
|||
//滑台速度
|
|||
mainBinding.MaintvSlideSpeedTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
|
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
int value=0; |
|||
|
|||
if (!input.isEmpty()) { |
|||
try { |
|||
value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value <= 0 || value > 10) { |
|||
showToast("请输入 0 到 10 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvSlideSpeedTo32.setText(""); |
|||
|
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
|
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
mainBinding.MaintvSlideMoveDistanceTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
if (!input.isEmpty()) { |
|||
try { |
|||
int value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value <= 0 || value > 30) { |
|||
showToast("请输入 0 到 30 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvSlideMoveDistanceTo32.setText(""); |
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
}); |
|||
//错误显示
|
|||
mainBinding.errorTextView.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
showErrorHistoryDialog(); |
|||
} |
|||
}); |
|||
mainBinding.btnSave.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
//获取界面参数以写进数据库
|
|||
int paraIndex = 1; |
|||
double verticalAdjust = Double.parseDouble(mainBinding.MaintvVerticalAdjustTo32.getText().toString()); |
|||
double moveSpeedPaint = Double.parseDouble(mainBinding.MaintvMoveSpeedTo32.getText().toString()); |
|||
int backDistance = Integer.parseInt(mainBinding.MaintvBackDistanceTo32.getText().toString()); |
|||
int slideSpeed = Integer.parseInt(mainBinding.MaintvSlideSpeedTo32.getText().toString()); |
|||
int slideDistance = Integer.parseInt(mainBinding.MaintvSlideMoveDistanceTo32.getText().toString()); |
|||
int changeLaneDis = Integer.parseInt(mainBinding.MaintvChangeLaneBackDistanceTo32.getText().toString()); |
|||
|
|||
|
|||
//把界面中的值放进PV类的变量中
|
|||
DisplayPV displayPV = new DisplayPV(paraIndex, verticalAdjust,moveSpeedPaint,backDistance, slideSpeed,slideDistance,0, 0, 0,0,0,0,0 ,0,0,changeLaneDis); |
|||
myDataHelper.addOrUpdateDisplayDataPaint(displayPV); //创建数据库的实例在这里 PV传进去保存到数据库
|
|||
Toast.makeText(PaintActivity.this, "保存成功", Toast.LENGTH_SHORT).show(); |
|||
} |
|||
}); |
|||
} //oncreate
|
|||
|
|||
|
|||
//函数定义放create外
|
|||
private void showToast(String message) |
|||
{ |
|||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); |
|||
} |
|||
|
|||
public void showError(String errorMessage) { |
|||
if (uniqueErrors.add(errorMessage)) { |
|||
errorHistory.add(errorMessage); |
|||
mainBinding.errorTextView.setText(errorMessage); |
|||
} |
|||
} |
|||
public void showErrorHistoryDialog() { |
|||
if (errorHistory.isEmpty()) { |
|||
return; |
|||
} |
|||
|
|||
StringBuilder historyText = new StringBuilder(); |
|||
for (String error : errorHistory) { |
|||
historyText.append(error).append("\n"); |
|||
} |
|||
|
|||
AlertDialog.Builder builder = new AlertDialog.Builder(this); |
|||
builder.setTitle("历史报错信息") |
|||
.setMessage(historyText.toString()) |
|||
.setPositiveButton("关闭", new DialogInterface.OnClickListener() { |
|||
@Override |
|||
public void onClick(DialogInterface dialog, int which) { |
|||
dialog.dismiss(); |
|||
} |
|||
}); |
|||
|
|||
AlertDialog dialog = builder.create(); |
|||
dialog.show(); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
@Override |
|||
protected void onStart() { |
|||
super.onStart(); |
|||
serialPortHelper.onStart(); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onStop() { |
|||
serialPortHelper.onStop(); |
|||
super.onStop(); |
|||
} |
|||
|
|||
@Override |
|||
public void onResume() { |
|||
super.onResume(); |
|||
serialPortHelper.onResume(); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onPause() { |
|||
serialPortHelper.onPause(); |
|||
super.onPause(); |
|||
} |
|||
|
|||
@Override |
|||
protected void onDestroy() { |
|||
super.onDestroy(); |
|||
if (timer != null) { |
|||
timer.cancel(); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,430 @@ |
|||
package com.example.guohuawindpowerapp; |
|||
|
|||
import android.app.AlertDialog; |
|||
import android.content.DialogInterface; |
|||
import android.os.Bundle; |
|||
import android.text.Editable; |
|||
import android.text.InputFilter; |
|||
import android.text.TextUtils; |
|||
import android.text.TextWatcher; |
|||
import android.view.View; |
|||
import android.view.WindowManager; |
|||
import android.widget.Toast; |
|||
|
|||
import androidx.appcompat.app.AppCompatActivity; |
|||
import androidx.databinding.DataBindingUtil; |
|||
import androidx.databinding.ViewDataBinding; |
|||
|
|||
import com.example.guohuawindpowerapp.databinding.ActivityMainBinding; |
|||
import com.example.guohuawindpowerapp.databinding.ActivityPolishBinding; |
|||
import com.example.guohuawindpowerapp.models.BspPV; |
|||
import com.example.guohuawindpowerapp.models.DisplayPV; |
|||
import com.example.guohuawindpowerapp.services.DecimalDigitsInputFilter; |
|||
import com.example.guohuawindpowerapp.services.ModbusCRC; |
|||
import com.example.guohuawindpowerapp.services.MyDataHelper; |
|||
import com.example.guohuawindpowerapp.services.PopupHelper; |
|||
import com.example.guohuawindpowerapp.services.USBSerialPortHelper; |
|||
import com.example.guohuawindpowerapp.services.VideoPlayerHelper; |
|||
|
|||
import java.util.HashSet; |
|||
import java.util.LinkedList; |
|||
import java.util.List; |
|||
import java.util.Set; |
|||
import java.util.Timer; |
|||
import java.util.TimerTask; |
|||
|
|||
import cn.nodemedia.NodePlayer; |
|||
|
|||
public class PolishActivity extends AppCompatActivity { |
|||
|
|||
public ActivityPolishBinding mainBinding; |
|||
|
|||
public USBSerialPortHelper serialPortHelper;//串口接收类
|
|||
private BspPV.PV_struct_define _toSendPV; |
|||
|
|||
Timer timer = new Timer(); |
|||
public MyDataHelper myDataHelper = new MyDataHelper(this);//数据库类
|
|||
public PopupHelper popupHelper = new PopupHelper(this);//对话框类,把主界面实例传过去
|
|||
public String _Operate_Mode_Call_Value = "手动作业"; // 默认为手动作业
|
|||
/*报错相关*/ |
|||
private List<String> errorHistory = new LinkedList<>(); |
|||
private Set<String> uniqueErrors = new HashSet<>(); |
|||
|
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
//设置全屏显示
|
|||
// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
|||
mainBinding= DataBindingUtil.setContentView(this,R.layout.activity_polish); |
|||
|
|||
mainBinding.MaintvVerticalAdjustTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter()}); //editext 一位小数限制
|
|||
mainBinding.MaintvMoveSpeedTo32.setFilters(new InputFilter[]{new DecimalDigitsInputFilter() }); |
|||
showError("无"); |
|||
|
|||
|
|||
/* USB串口 控制区域*/ |
|||
serialPortHelper = new USBSerialPortHelper(null,null,this,null,null); |
|||
serialPortHelper.intialize(); |
|||
serialPortHelper.connect(); |
|||
|
|||
|
|||
/* NodePlayer 播放视频区域*/ |
|||
|
|||
NodePlayer nodePlayer0=new NodePlayer(this); |
|||
// String address0 = "rtsp://192.168.1.168:8554/0";
|
|||
// String address1 = "rtsp://192.168.1.169:8554/0";
|
|||
String address0 = "rtsp://192.168.144.3:8554/main.264"; |
|||
VideoPlayerHelper.startVedio(mainBinding.nodePlayerView3,nodePlayer0,address0); |
|||
|
|||
// NodePlayer nodePlayer4=new NodePlayer(this);
|
|||
// // String address0 = "rtsp://192.168.1.168:8554/0";
|
|||
// // String address1 = "rtsp://192.168.1.169:8554/0";
|
|||
// String address4 = "rtsp://192.168.144.60:8554/main.264";
|
|||
// VideoPlayerHelper.startVedio(mainBinding.nodePlayerView7,nodePlayer4,address4);
|
|||
|
|||
myDataHelper.IntializeDataBasePolish(); |
|||
//读取并显示数据
|
|||
List<DisplayPV> pvList = myDataHelper.getDisplayDataPolish(1); //按id查询数据赋值给界面
|
|||
mainBinding.MaintvVerticalAdjustTo32.setText(String.valueOf(pvList.get(0).getVerticalCompensation())); |
|||
mainBinding.MaintvMoveSpeedTo32.setText(String.valueOf(pvList.get(0).getmoveSpeedPolish())); |
|||
mainBinding.MaintvHCompensationSwitchTo32.setText(String.valueOf(pvList.get(0).getHCompensationSwitch())); |
|||
mainBinding.MaintvPressLimitTo32.setText(String.valueOf(pvList.get(0).getPressSetPolish())); |
|||
mainBinding.changeLaneDisValue.setText(String.valueOf(pvList.get(0).getChangeLaneDistance())); |
|||
|
|||
|
|||
/*发往32*/ |
|||
timer.schedule(new TimerTask() { |
|||
@Override |
|||
public void run() { |
|||
// 使用 Handler 或 runOnUiThread 更新 UI
|
|||
runOnUiThread(new Runnable() { |
|||
@Override |
|||
public void run() { |
|||
|
|||
|
|||
// 更新 UI 的代码
|
|||
//必须有
|
|||
_toSendPV = BspPV.PV_struct_define.newBuilder() |
|||
.setRunMode(1) |
|||
.setRobotSpeed(0) |
|||
.setSlidingDistanceCm(0) |
|||
.setRobotBackwardDistanceCm(0) |
|||
.setPumpFrequency(0) |
|||
.setPressureTargetValue(0) |
|||
.setVerticalCompensation(0) |
|||
.setRobotWorkingMode(2) |
|||
.setSlidingTableSpeed(0) |
|||
.setHorizontalCompensationControl(0) |
|||
.setRobotSpeedCleanMode(0) |
|||
.setRobotSpeedDerustMode(0) |
|||
.setRobotSpeedSprayPaintMode(0) |
|||
.setRobotSpeedThicknessMeasureMode(0) |
|||
.setPumpStopFrequency(0) |
|||
.setChangeLaneBackwarkDistance(0) |
|||
.build(); |
|||
|
|||
String VeticalAdjustStr = mainBinding.MaintvVerticalAdjustTo32.getText().toString(); |
|||
String MoveSpeedStr = mainBinding.MaintvMoveSpeedTo32.getText().toString(); |
|||
String HCompensationSwitchStr = mainBinding.MaintvHCompensationSwitchTo32.getText().toString(); |
|||
String PressLimitStr = mainBinding.MaintvPressLimitTo32.getText().toString(); |
|||
String ChangeLaneDisValue = mainBinding.changeLaneDisValue.getText().toString(); |
|||
//竖直微调--小数 *10
|
|||
try { |
|||
|
|||
if( VeticalAdjustStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setVerticalCompensation(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setVerticalCompensation( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvVerticalAdjustTo32.getText()))*10 )) .build(); |
|||
|
|||
} |
|||
|
|||
} catch (Exception e) { |
|||
|
|||
} |
|||
//移动速度*10
|
|||
try { |
|||
if( MoveSpeedStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setRobotSpeed(1).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setRobotSpeedDerustMode( (int) (Double.parseDouble(String.valueOf(mainBinding.MaintvMoveSpeedTo32.getText()))*10 )).build(); |
|||
} |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
|
|||
} |
|||
|
|||
//水平补偿开关
|
|||
if(HCompensationSwitchStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setHorizontalCompensationControl(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setHorizontalCompensationControl((Integer.parseInt(String.valueOf(mainBinding.MaintvHCompensationSwitchTo32.getText())))).build();} |
|||
|
|||
//压力上限
|
|||
if(PressLimitStr.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setPressureTargetValueDerust(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setPressureTargetValueDerust((Integer.parseInt(String.valueOf(mainBinding.MaintvPressLimitTo32.getText())))).build();} |
|||
|
|||
// 换道距离
|
|||
if(ChangeLaneDisValue.isEmpty() ) {_toSendPV = _toSendPV.toBuilder().setChangeLaneBackwarkDistance(0).build();} |
|||
else { _toSendPV = _toSendPV.toBuilder() |
|||
.setChangeLaneBackwarkDistance((Integer.parseInt(String.valueOf(mainBinding.changeLaneDisValue.getText())))).build();} |
|||
|
|||
//工作模式
|
|||
_toSendPV = _toSendPV.toBuilder().setRobotWorkingMode(2).build(); //2 打磨
|
|||
|
|||
if(_Operate_Mode_Call_Value.equals("手动作业")) |
|||
{ |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(1).build(); |
|||
} |
|||
if(_Operate_Mode_Call_Value.equals("竖直作业")) |
|||
{ |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(2).build(); |
|||
} |
|||
if(_Operate_Mode_Call_Value.equals("水平作业")) |
|||
{ |
|||
_toSendPV = _toSendPV.toBuilder().setRunMode(4).build(); |
|||
} |
|||
|
|||
byte[] byteArray = _toSendPV.toByteArray(); |
|||
byte[] sendbyteArray = new byte[byteArray.length + 4]; |
|||
byte[] sendbyteArray3 = new byte[byteArray.length + 6]; |
|||
if (byteArray.length != 0) { |
|||
System.arraycopy(byteArray, 0, sendbyteArray, 4, byteArray.length); |
|||
} |
|||
sendbyteArray[0] = (byte) 0x55; |
|||
sendbyteArray[1] = (byte) 0x55; |
|||
sendbyteArray[2] = (byte) 0x01; |
|||
sendbyteArray[3] = (byte) 0x01; |
|||
|
|||
byte[] byteArray2 = ModbusCRC.calculateCRC(sendbyteArray); |
|||
|
|||
System.arraycopy(sendbyteArray, 0, sendbyteArray3, 0, sendbyteArray.length); |
|||
|
|||
System.arraycopy(byteArray2, 0, sendbyteArray3, sendbyteArray3.length - 2, 2); |
|||
|
|||
serialPortHelper.SendData(sendbyteArray3); |
|||
} |
|||
}); |
|||
} |
|||
}, 0, 1000); // 延迟 0 毫秒,每隔 1000 毫秒执行一次
|
|||
|
|||
|
|||
mainBinding.operateModeDisplay.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
popupHelper.OperateModePolishPopup(this); |
|||
} |
|||
}); |
|||
//竖直补偿
|
|||
mainBinding.MaintvVerticalAdjustTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
String input = s.toString().trim(); |
|||
|
|||
// 1. 允许空输入(用户正在删除)
|
|||
if (TextUtils.isEmpty(input)) { |
|||
return; |
|||
} |
|||
|
|||
// 2. 允许合法的中间状态(如"-10.")
|
|||
if (input.matches("^-?\\d*(\\.\\d*)?$")) { |
|||
// 合法格式:整数、负数、小数、小数点开头
|
|||
try { |
|||
|
|||
int value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value < -10 || value > 10) { |
|||
showToast("请输入 -10 到 10 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvVerticalAdjustTo32.setText(""); |
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
} |
|||
// 尝试转换为double(处理小数)
|
|||
//lastValidValue = Double.parseDouble(input);
|
|||
} catch (NumberFormatException e) { |
|||
// 中间状态,忽略
|
|||
} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
//车体移动速度事件
|
|||
mainBinding.MaintvMoveSpeedTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
double value=0.0; |
|||
|
|||
if (!input.isEmpty()) { |
|||
try { |
|||
value = Double.parseDouble(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value < 0 || value > 30) { |
|||
showToast("请输入 0 到 30 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvMoveSpeedTo32.setText(""); |
|||
|
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
|
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
}); |
|||
|
|||
//压力上限
|
|||
mainBinding.MaintvPressLimitTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
if (!input.isEmpty()) { |
|||
try { |
|||
int value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value <= 0 || value > 3000) { |
|||
showToast("请输入 0 到 3000 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvPressLimitTo32.setText(""); |
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
}); |
|||
//水平补偿开关
|
|||
mainBinding.MaintvHCompensationSwitchTo32.addTextChangedListener(new TextWatcher() { |
|||
@Override |
|||
public void beforeTextChanged(CharSequence s, int start, int count, int after) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onTextChanged(CharSequence s, int start, int before, int count) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterTextChanged(Editable s) { |
|||
// 文本变化后的回调,在这里进行范围检查
|
|||
String input = s.toString(); |
|||
if (!input.isEmpty()) { |
|||
try { |
|||
int value = Integer.parseInt(input); |
|||
// 检查输入值是否在 -50 到 100 范围内
|
|||
if (value < 0 || value > 1) { |
|||
showToast("请输入 0 到 1 之间的数字"); |
|||
// 可以选择清除输入或限制在范围内
|
|||
mainBinding.MaintvHCompensationSwitchTo32.setText(""); |
|||
} else { |
|||
showToast("输入有效: " + value); |
|||
} |
|||
} catch (NumberFormatException e) { |
|||
showToast("请输入有效的数字"); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
//错误显示
|
|||
mainBinding.errorTextView.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
showErrorHistoryDialog(); |
|||
} |
|||
}); |
|||
|
|||
|
|||
mainBinding.btnSave.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View v) { |
|||
//获取界面参数以写进数据库
|
|||
int paraIndex = 1; |
|||
double verticalAdjust = Double.parseDouble(mainBinding.MaintvVerticalAdjustTo32.getText().toString()); |
|||
double moveSpeedPolish = Double.parseDouble(mainBinding.MaintvMoveSpeedTo32.getText().toString()); |
|||
int HCompensationSwitch = Integer.parseInt(mainBinding.MaintvHCompensationSwitchTo32.getText().toString()); |
|||
int pressSetPolish = Integer.parseInt(mainBinding.MaintvPressLimitTo32.getText().toString()); |
|||
int changeLaneDis = Integer.parseInt(mainBinding.changeLaneDisValue.getText().toString()); |
|||
|
|||
// 把界面中的值放进PV类的变量中
|
|||
DisplayPV displayPV = new DisplayPV(paraIndex, verticalAdjust,0,0, 0,0,0, 0, 0,pressSetPolish,moveSpeedPolish,HCompensationSwitch ,0,0,changeLaneDis,0); |
|||
myDataHelper.addOrUpdateDisplayDataPolish(displayPV); //创建数据库的实例在这里 PV传进去保存到数据库
|
|||
Toast.makeText(PolishActivity.this, "保存成功", Toast.LENGTH_SHORT).show(); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
private void showToast(String message) |
|||
{ |
|||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); |
|||
} |
|||
public void showError(String errorMessage) { |
|||
if (uniqueErrors.add(errorMessage)) { |
|||
errorHistory.add(errorMessage); |
|||
mainBinding.errorTextView.setText(errorMessage); |
|||
} |
|||
} |
|||
public void showErrorHistoryDialog() { |
|||
if (errorHistory.isEmpty()) { |
|||
return; |
|||
} |
|||
|
|||
StringBuilder historyText = new StringBuilder(); |
|||
for (String error : errorHistory) { |
|||
historyText.append(error).append("\n"); |
|||
} |
|||
|
|||
AlertDialog.Builder builder = new AlertDialog.Builder(this); |
|||
builder.setTitle("历史报错信息") |
|||
.setMessage(historyText.toString()) |
|||
.setPositiveButton("关闭", new DialogInterface.OnClickListener() { |
|||
@Override |
|||
public void onClick(DialogInterface dialog, int which) { |
|||
dialog.dismiss(); |
|||
} |
|||
}); |
|||
|
|||
AlertDialog dialog = builder.create(); |
|||
dialog.show(); |
|||
} |
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
package com.example.guohuawindpowerapp.models; |
|||
|
|||
import androidx.databinding.BaseObservable; |
|||
|
|||
public class DisplayIV extends BaseObservable { |
|||
private double leftCompensation; |
|||
private double rightCompensation; |
|||
private double currentAngle; |
|||
|
|||
public double getLeftCompensation() { |
|||
return leftCompensation; |
|||
} |
|||
|
|||
public void setLeftCompensation(double leftCompensation) { |
|||
this.leftCompensation = leftCompensation; |
|||
} |
|||
|
|||
public double getRightCompensation() { |
|||
return rightCompensation; |
|||
} |
|||
|
|||
public void setRightCompensation(double rightCompensation) { |
|||
this.rightCompensation = rightCompensation; |
|||
} |
|||
|
|||
public double getCurrentAngle() { |
|||
return currentAngle; |
|||
} |
|||
|
|||
public void setCurrentAngle(double currentAngle) { |
|||
this.currentAngle = currentAngle; |
|||
} |
|||
|
|||
public double getRobotMoveSpeed() { |
|||
return robotMoveSpeed; |
|||
} |
|||
|
|||
public void setRobotMoveSpeed(double robotMoveSpeed) { |
|||
this.robotMoveSpeed = robotMoveSpeed; |
|||
} |
|||
|
|||
private double robotMoveSpeed; |
|||
|
|||
public DisplayIV(double leftCompensation, double rightCompensation, double currentAngle, double robotMoveSpeed) { |
|||
this.leftCompensation = leftCompensation; |
|||
this.rightCompensation = rightCompensation; |
|||
this.currentAngle = currentAngle; |
|||
this.robotMoveSpeed = robotMoveSpeed; |
|||
} |
|||
} |
|||
@ -0,0 +1,122 @@ |
|||
package com.example.guohuawindpowerapp.models; |
|||
|
|||
import androidx.databinding.BaseObservable; |
|||
|
|||
public class DisplayPV extends BaseObservable { |
|||
|
|||
private int id; |
|||
private double verticalCompensation; |
|||
private double moveSpeedPaint; |
|||
|
|||
private int backDistance; |
|||
private int slideSpeed; |
|||
private int slideDistance; |
|||
|
|||
private double moveSpeedClean; |
|||
private int pumpFrequency; |
|||
private int pumpStopFrequency; |
|||
|
|||
private int pressSet_Clean; |
|||
private int pressSet_Polish; |
|||
|
|||
private double moveSpeedPolish; |
|||
private int HCompensationSwitch; |
|||
|
|||
private double moveSpeedMeasure; |
|||
|
|||
private int changeLaneDistance; |
|||
|
|||
private int changeLaneDisPaint; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
public DisplayPV(int id, double verticalCompensation, double moveSpeedPaint, int backDistance, int slideSpeed, int slideDistance, |
|||
double moveSpeedClean,int pumpFrequency ,int pressSet_Clean, int pressSet_Polish, double moveSpeedPolish,int HCompensationSwitch,double moveSpeedMeasure,int pumpStopFrequency,int changelanedis,int changelinedisPaint) { |
|||
this.id = id; |
|||
this.verticalCompensation=verticalCompensation; |
|||
this.moveSpeedPaint = moveSpeedPaint; |
|||
this.backDistance = backDistance; |
|||
this.slideSpeed=slideSpeed; |
|||
this.slideDistance=slideDistance; |
|||
|
|||
this.moveSpeedClean=moveSpeedClean; |
|||
this.pumpFrequency=pumpFrequency; |
|||
this.pressSet_Clean=pressSet_Clean; |
|||
this.pumpStopFrequency=pumpStopFrequency; |
|||
this.pressSet_Polish=pressSet_Polish; |
|||
this.moveSpeedPolish=moveSpeedPolish; |
|||
this.HCompensationSwitch=HCompensationSwitch; |
|||
|
|||
this.moveSpeedMeasure=moveSpeedMeasure; |
|||
this.changeLaneDistance = changelanedis; |
|||
this.changeLaneDisPaint = changelinedisPaint; |
|||
|
|||
} |
|||
|
|||
|
|||
public int getId() { return id; } |
|||
public void setId(int id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public int getChangeLaneDistance(){return changeLaneDistance;} |
|||
|
|||
public int getChangeLaneDisPaint(){return changeLaneDisPaint;} |
|||
|
|||
public double getVerticalCompensation() { |
|||
return verticalCompensation; |
|||
} |
|||
public double getMoveSpeedPaint() { |
|||
return moveSpeedPaint; |
|||
} |
|||
public int getbackDistance() { |
|||
return backDistance; |
|||
} |
|||
|
|||
public int getslideSpeed() { |
|||
return slideSpeed; |
|||
} |
|||
public int getslideDistance() { |
|||
return slideDistance; |
|||
} |
|||
|
|||
public double getmoveSpeedClean() { |
|||
return moveSpeedClean; |
|||
} |
|||
public int getpumpFrequency() { |
|||
return pumpFrequency; |
|||
} |
|||
public int getpumpStopFrequency() { |
|||
return pumpStopFrequency; |
|||
} |
|||
public int getPressSetClean() { |
|||
return pressSet_Clean; |
|||
} |
|||
public int getPressSetPolish() { |
|||
return pressSet_Polish; |
|||
} |
|||
public double getmoveSpeedPolish() { |
|||
return moveSpeedPolish; |
|||
} |
|||
|
|||
public int getHCompensationSwitch() { |
|||
return HCompensationSwitch; |
|||
} |
|||
|
|||
public double getmoveSpeedMeasure() { |
|||
return moveSpeedMeasure; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
package com.example.guohuawindpowerapp.models; |
|||
|
|||
public class ErrorModel { |
|||
|
|||
public ErrorModel(long timeID, String errorInfo) { |
|||
this.timeID = timeID; |
|||
this.errorInfo = errorInfo; |
|||
} |
|||
private long timeID; |
|||
|
|||
|
|||
public void setDateTimeBJ(String dateTimeUTC) { |
|||
this.dateTimeBJ = dateTimeUTC; |
|||
} |
|||
|
|||
private String errorInfo; |
|||
|
|||
public String getDateTimeBJ() { |
|||
return dateTimeBJ; |
|||
} |
|||
|
|||
private String dateTimeBJ; |
|||
|
|||
|
|||
@Override |
|||
public String toString() { |
|||
return String.valueOf(dateTimeBJ + errorInfo); |
|||
} |
|||
public void setTimeID(long timeID) { |
|||
this.timeID = timeID; |
|||
} |
|||
|
|||
public void setErrorInfo(String errorInfo) { |
|||
this.errorInfo = errorInfo; |
|||
} |
|||
|
|||
public long getTimeID() { |
|||
return timeID; |
|||
} |
|||
|
|||
public String getErrorInfo() { |
|||
return errorInfo; |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.example.guohuawindpowerapp.services; |
|||
|
|||
import android.widget.EditText; |
|||
import android.widget.TextView; |
|||
|
|||
public class ConvertHelper { |
|||
|
|||
public static int convertEditTextToInt(TextView editText) { |
|||
// 获取 EditText 中的文本
|
|||
String input = editText.getText().toString().trim(); |
|||
try { |
|||
// 尝试将字符串转换为整数
|
|||
return Integer.parseInt(input); |
|||
} catch (NumberFormatException e) { |
|||
// 输入不是有效的整数格式,返回 -1 表示转换失败
|
|||
return -1; |
|||
} |
|||
} |
|||
|
|||
public static boolean isEditTextNullOrEmpty(EditText editText) { |
|||
|
|||
String str = String.valueOf(editText.getText()); |
|||
|
|||
return str == null || str.isEmpty(); |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
package com.example.guohuawindpowerapp.services; |
|||
|
|||
import com.hoho.android.usbserial.driver.FtdiSerialDriver; |
|||
import com.hoho.android.usbserial.driver.ProbeTable; |
|||
import com.hoho.android.usbserial.driver.UsbSerialProber; |
|||
|
|||
/** |
|||
* add devices here, that are not known to DefaultProber |
|||
* |
|||
* if the App should auto start for these devices, also |
|||
* add IDs to app/src/main/res/xml/device_filter.xml |
|||
*/ |
|||
public class CustomProber { |
|||
|
|||
public static UsbSerialProber getCustomProber() { |
|||
ProbeTable customTable = new ProbeTable(); |
|||
customTable.addProduct(0x1234, 0x0001, FtdiSerialDriver.class); // e.g. device with custom VID+PID
|
|||
customTable.addProduct(0x1234, 0x0002, FtdiSerialDriver.class); // e.g. device with custom VID+PID
|
|||
return new UsbSerialProber(customTable); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
package com.example.guohuawindpowerapp.services; |
|||
|
|||
import android.text.InputFilter; |
|||
import android.text.Spanned; |
|||
|
|||
import java.util.regex.Matcher; |
|||
import java.util.regex.Pattern; |
|||
|
|||
/* |
|||
自定义 InputFilter 类,用于限制输入格式 |
|||
支持整数、负数和最多一位小数的输入 |
|||
使用方法:editText.setFilters(new InputFilter[]{new DecimalDigitsInputFilter()}); |
|||
*/ |
|||
public class DecimalDigitsInputFilter implements InputFilter { |
|||
// 最终验证的正则表达式
|
|||
private final Pattern mFinalPattern; |
|||
// 中间状态允许的正则表达式
|
|||
private final Pattern mIntermediatePattern; |
|||
|
|||
public DecimalDigitsInputFilter() { |
|||
// 最终验证:必须是完整的数字格式
|
|||
mFinalPattern = Pattern.compile("^-?(0|[1-9]\\d*)(\\.\\d)?$"); |
|||
|
|||
// 中间状态:允许临时的不完整格式(如 "-"、"0."、"-2.")
|
|||
mIntermediatePattern = Pattern.compile("^-?(0|[1-9]\\d*)?(\\.)?$"); |
|||
} |
|||
|
|||
@Override |
|||
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { |
|||
// 处理删除操作
|
|||
if (end - start == 0) { |
|||
return null; |
|||
} |
|||
|
|||
// 拼接新的输入内容
|
|||
String newText = dest.toString().substring(0, dstart) + |
|||
source.toString().substring(start, end) + |
|||
dest.toString().substring(dend); |
|||
|
|||
// 允许空字符串或单独的负号
|
|||
if (newText.isEmpty() || newText.equals("-")) { |
|||
return null; |
|||
} |
|||
|
|||
// 防止前导零(除非是 0 或 0.x)
|
|||
if (newText.startsWith("0") && newText.length() > 1 && |
|||
!newText.startsWith("0.") && !newText.equals("0")) { |
|||
return ""; |
|||
} |
|||
|
|||
// 防止多个负号
|
|||
if (newText.indexOf('-') > 0) { |
|||
return ""; |
|||
} |
|||
|
|||
// 防止多个小数点
|
|||
if (newText.indexOf('.') != newText.lastIndexOf('.')) { |
|||
return ""; |
|||
} |
|||
|
|||
// 检查是否匹配最终模式或中间模式
|
|||
Matcher finalMatcher = mFinalPattern.matcher(newText); |
|||
Matcher intermediateMatcher = mIntermediatePattern.matcher(newText); |
|||
|
|||
if (finalMatcher.matches() || intermediateMatcher.matches()) { |
|||
return null; // 匹配成功,允许输入
|
|||
} |
|||
|
|||
return ""; // 匹配失败,阻止输入
|
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
package com.example.guohuawindpowerapp.services; |
|||
|
|||
import android.util.Log; |
|||
|
|||
public class LogUtil { |
|||
private String TAG; |
|||
private boolean isRelease = false; |
|||
private boolean isDebug; |
|||
|
|||
public LogUtil(Class c, boolean isDebug) { |
|||
this.TAG = c.getName(); |
|||
this.isDebug = isDebug; |
|||
} |
|||
|
|||
public void d(String msg) { |
|||
if (!isRelease && isDebug) { |
|||
Log.d(TAG, "--------->" + msg); |
|||
} |
|||
} |
|||
|
|||
public void i(String msg) { |
|||
if (!isRelease && isDebug) { |
|||
Log.i(TAG, "--------->" + msg); |
|||
} |
|||
} |
|||
|
|||
public void w(String msg) { |
|||
if (!isRelease && isDebug) { |
|||
Log.w(TAG, "--------->" + msg); |
|||
} |
|||
} |
|||
|
|||
public void e(String msg) { |
|||
if (!isRelease && isDebug) { |
|||
Log.e(TAG, "--------->" + msg); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,72 @@ |
|||
package com.example.guohuawindpowerapp.services; |
|||
|
|||
public class ModbusCRC { |
|||
|
|||
// /**
|
|||
// * 一个字节包含位的数量 8
|
|||
// */
|
|||
// private static final int BITS_OF_BYTE = 8;
|
|||
// /**
|
|||
// * 多项式
|
|||
// */
|
|||
// private static final int POLYNOMIAL = 0xA001;
|
|||
// /**
|
|||
// * 初始值
|
|||
// */
|
|||
// private static final int INITIAL_VALUE = 0xFFFF;
|
|||
//
|
|||
// /**
|
|||
// * CRC16 编码
|
|||
// *
|
|||
// * @param bytes 编码内容
|
|||
// * @return 编码结果
|
|||
// */
|
|||
// public static int crc16(byte[] bytes) {
|
|||
// int res = INITIAL_VALUE;
|
|||
// for (int data : bytes) {
|
|||
// res = res ^ data;
|
|||
// for (int i = 0; i < BITS_OF_BYTE; i++) {
|
|||
// res = (res & 0x0001) == 1 ? (res >> 1) ^ POLYNOMIAL : res >> 1;
|
|||
// }
|
|||
// }
|
|||
// return revert(res);
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 翻转16位的高八位和低八位字节
|
|||
// *
|
|||
// * @param src 翻转数字
|
|||
// * @return 翻转结果
|
|||
// */
|
|||
// private static int revert(int src) {
|
|||
// int lowByte = (src & 0xFF00) >> 8;
|
|||
// int highByte = (src & 0x00FF) << 8;
|
|||
// return lowByte | highByte;
|
|||
// }
|
|||
|
|||
|
|||
/** |
|||
* 计算 Modbus CRC 校验值 |
|||
* @param data 要计算校验值的字节数组 |
|||
* @return CRC 校验值,以 2 字节的数组形式返回 |
|||
*/ |
|||
public static byte[] calculateCRC(byte[] data) { |
|||
int crc = 0xFFFF; |
|||
for (byte b : data) { |
|||
crc ^= (b & 0xFF); |
|||
for (int i = 0; i < 8; i++) { |
|||
if ((crc & 0x0001) != 0) { |
|||
crc >>= 1; |
|||
crc ^= 0xA001; |
|||
} else { |
|||
crc >>= 1; |
|||
} |
|||
} |
|||
} |
|||
// 将 CRC 结果拆分为两个字节
|
|||
byte[] crcBytes = new byte[2]; |
|||
crcBytes[0] = (byte) (crc & 0xFF); |
|||
crcBytes[1] = (byte) ((crc >> 8) & 0xFF); |
|||
return crcBytes; |
|||
} |
|||
} |
|||
@ -0,0 +1,342 @@ |
|||
package com.example.guohuawindpowerapp.services; |
|||
|
|||
import android.content.ContentValues; |
|||
import android.content.Context; |
|||
import android.database.Cursor; |
|||
import android.database.sqlite.SQLiteDatabase;//具体进行数据库、数据表的一个操作
|
|||
import android.database.sqlite.SQLiteOpenHelper;//用来创建数据库和对数据库进行版本管理
|
|||
|
|||
import androidx.annotation.Nullable; |
|||
|
|||
import com.example.guohuawindpowerapp.models.DisplayPV; |
|||
import com.example.guohuawindpowerapp.models.ErrorModel; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.TimeZone; |
|||
|
|||
public class MyDataHelper extends SQLiteOpenHelper { |
|||
//定义字段
|
|||
public static final String TABLE_NAME_PAINT = "paint"; |
|||
public static final String COLUMN_ID= "id";//参数调用
|
|||
|
|||
public static final String COLUMN_VERTICAL_COMPENSATION = "verticalAdjust";//Maintv_VerticalAdjustTo32 竖直补偿
|
|||
public static final String COLUMN_MOVE_SPEED_PAINT = "moveSpeedPaint"; |
|||
public static final String COLUMN_BACK_DISTANCE = "backDistance"; |
|||
public static final String COLUMN_SLIDE_SPEED = "slideSpeed"; |
|||
public static final String COLUMN_SLIDE_DISTANCE = "slideDistance"; |
|||
/*******************************************************************/ |
|||
public static final String TABLE_NAME_CLEAN = "clean"; |
|||
public static final String COLUMN_MOVE_SPEED_CLEAN = "moveSpeedClean"; |
|||
public static final String COLUMN_PUMP_FREQUENCY = "pumpFrequency"; |
|||
public static final String COLUMN_PRESS_SET_CLEAN = "pressSetClean"; |
|||
public static final String COLUMN_PUMP_STOP_FREQUENCY = "pumpStopFrequency"; |
|||
/**************************************************************************************************/ |
|||
public static final String TABLE_NAME_POLISH = "polish"; |
|||
public static final String COLUMN_MOVE_SPEED_POLISH="moveSpeedPolish"; |
|||
public static final String COLUMN_H_COMPENSATIONSWITCH="HCompensationSwitch"; |
|||
public static final String COLUMN_PRESS_SET_POLISH = "pressSetPolish"; |
|||
|
|||
/***********************************************************************************************/ |
|||
public static final String TABLE_NAME_MEASURE = "measure"; |
|||
public static final String COLUMN_MOVE_SPEED_MEASURE="moveSpeedMeasure"; |
|||
|
|||
public static final String COLUMN_CHANGELANEDIS_POLISH = "changeLaneDisPolish"; |
|||
|
|||
public static final String COLUMN_CHANGELANEDIS_PAINT = "changeLaneDisPaint"; |
|||
|
|||
|
|||
public MyDataHelper(@Nullable Context context) { |
|||
super(context, "bingbot.db", null, 5); //数据库名称为 bingbot.db,数据库版本为 1。存放两个表
|
|||
} |
|||
|
|||
@Override |
|||
public void onCreate(SQLiteDatabase db) { |
|||
|
|||
|
|||
//INTEGER前加空格
|
|||
String sql = "CREATE TABLE " + TABLE_NAME_PAINT + " (" + |
|||
COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + |
|||
COLUMN_VERTICAL_COMPENSATION + " DOUBLE, " + |
|||
COLUMN_MOVE_SPEED_PAINT + " DOUBLE, " + |
|||
COLUMN_BACK_DISTANCE + " DOUBLE, " + |
|||
COLUMN_SLIDE_SPEED + " INTEGER, " + |
|||
COLUMN_CHANGELANEDIS_PAINT + " INTEGER, " + |
|||
COLUMN_SLIDE_DISTANCE + " INTEGER);"; |
|||
db.execSQL(sql); //执行sql语句
|
|||
//清洗
|
|||
sql = "CREATE TABLE " + TABLE_NAME_CLEAN + " (" + |
|||
COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + |
|||
COLUMN_VERTICAL_COMPENSATION + " DOUBLE, " + |
|||
COLUMN_MOVE_SPEED_CLEAN + " DOUBLE, " + |
|||
COLUMN_PUMP_FREQUENCY + " INTEGER, " + |
|||
COLUMN_PUMP_STOP_FREQUENCY + " INTEGER, " + |
|||
COLUMN_PRESS_SET_CLEAN + " INTEGER);"; |
|||
db.execSQL(sql); //执行sql语句
|
|||
// 打磨
|
|||
sql = "CREATE TABLE " + TABLE_NAME_POLISH + " (" + |
|||
COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + |
|||
COLUMN_VERTICAL_COMPENSATION + " DOUBLE, " + |
|||
COLUMN_MOVE_SPEED_POLISH + " DOUBLE, " + |
|||
COLUMN_H_COMPENSATIONSWITCH + " INTEGER, " + |
|||
COLUMN_CHANGELANEDIS_POLISH + " INTEGER, " + |
|||
COLUMN_PRESS_SET_POLISH + " INTEGER);"; |
|||
db.execSQL(sql); //执行sql语句
|
|||
|
|||
// 测厚
|
|||
sql = "CREATE TABLE " + TABLE_NAME_MEASURE + " (" + |
|||
COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + |
|||
COLUMN_MOVE_SPEED_MEASURE + " DOUBLE);"; |
|||
db.execSQL(sql); //执行sql语句
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { |
|||
// 1. 删除所有旧表(如果存在)
|
|||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_PAINT); // 喷漆表
|
|||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_CLEAN); // 清洗表
|
|||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_POLISH); // 打磨表
|
|||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME_MEASURE); // 测厚表
|
|||
onCreate(db); |
|||
} |
|||
|
|||
//增 删 改 查
|
|||
public String addOrUpdateDisplayDataPaint(DisplayPV pv) { |
|||
ContentValues cv = new ContentValues(); //键值对的类
|
|||
cv.put(COLUMN_ID, pv.getId()); |
|||
cv.put(COLUMN_VERTICAL_COMPENSATION, pv.getVerticalCompensation()); |
|||
cv.put(COLUMN_MOVE_SPEED_PAINT, pv.getMoveSpeedPaint()); |
|||
cv.put(COLUMN_BACK_DISTANCE, pv.getbackDistance()); |
|||
cv.put(COLUMN_SLIDE_SPEED, pv.getslideSpeed()); |
|||
cv.put(COLUMN_SLIDE_DISTANCE, pv.getslideDistance()); |
|||
cv.put(COLUMN_CHANGELANEDIS_PAINT, pv.getChangeLaneDisPaint()); |
|||
|
|||
SQLiteDatabase sqliteDatabase = this.getWritableDatabase();//获取数据库实例以实现增上查改等,如果没有就新建 并把sqliteDatabase作为参数传给oncreate方法
|
|||
// try {
|
|||
long insert = sqliteDatabase.insertWithOnConflict(TABLE_NAME_PAINT, null, cv, SQLiteDatabase.CONFLICT_REPLACE); |
|||
sqliteDatabase.close(); |
|||
if (insert == -1) { |
|||
return "failed"; |
|||
} |
|||
return "success"; |
|||
// } catch (Exception e) {
|
|||
//
|
|||
// }
|
|||
} |
|||
public String addOrUpdateDisplayDataClean(DisplayPV pv) { |
|||
ContentValues cv = new ContentValues(); //键值对的类
|
|||
cv.put(COLUMN_ID, pv.getId()); |
|||
cv.put(COLUMN_VERTICAL_COMPENSATION, pv.getVerticalCompensation()); |
|||
cv.put(COLUMN_MOVE_SPEED_CLEAN, pv.getmoveSpeedClean()); |
|||
cv.put(COLUMN_PUMP_FREQUENCY, pv.getpumpFrequency()); |
|||
cv.put(COLUMN_PUMP_STOP_FREQUENCY, pv.getpumpStopFrequency()); |
|||
cv.put(COLUMN_PRESS_SET_CLEAN, pv.getPressSetClean()); |
|||
|
|||
SQLiteDatabase sqliteDatabase = this.getWritableDatabase();//获取数据库实例以实现增上查改等,如果没有就新建 并把sqliteDatabase作为参数传给oncreate方法
|
|||
long insert = sqliteDatabase.insertWithOnConflict(TABLE_NAME_CLEAN, null, cv, SQLiteDatabase.CONFLICT_REPLACE); |
|||
sqliteDatabase.close(); |
|||
if (insert == -1) { |
|||
return "failed"; |
|||
} |
|||
return "success"; |
|||
} |
|||
public String addOrUpdateDisplayDataPolish(DisplayPV pv) { |
|||
ContentValues cv = new ContentValues(); //键值对的类
|
|||
cv.put(COLUMN_ID, pv.getId()); |
|||
cv.put(COLUMN_VERTICAL_COMPENSATION, pv.getVerticalCompensation()); |
|||
cv.put(COLUMN_MOVE_SPEED_POLISH, pv.getmoveSpeedPolish()); |
|||
cv.put(COLUMN_H_COMPENSATIONSWITCH, pv.getHCompensationSwitch()); |
|||
cv.put(COLUMN_PRESS_SET_POLISH, pv.getPressSetPolish()); |
|||
cv.put(COLUMN_CHANGELANEDIS_POLISH, pv.getChangeLaneDistance()); |
|||
|
|||
|
|||
|
|||
SQLiteDatabase sqliteDatabase = this.getWritableDatabase();//获取数据库实例以实现增上查改等,如果没有就新建 并把sqliteDatabase作为参数传给oncreate方法
|
|||
long insert = sqliteDatabase.insertWithOnConflict(TABLE_NAME_POLISH, null, cv, SQLiteDatabase.CONFLICT_REPLACE); |
|||
sqliteDatabase.close(); |
|||
if (insert == -1) { |
|||
return "failed"; |
|||
} |
|||
return "success"; |
|||
} |
|||
public String addOrUpdateDisplayDataMeasure(DisplayPV pv) { |
|||
ContentValues cv = new ContentValues(); //键值对的类
|
|||
cv.put(COLUMN_ID, pv.getId()); |
|||
cv.put(COLUMN_MOVE_SPEED_MEASURE, pv.getmoveSpeedMeasure()); |
|||
|
|||
|
|||
SQLiteDatabase sqliteDatabase = this.getWritableDatabase();//获取数据库实例以实现增上查改等,如果没有就新建 并把sqliteDatabase作为参数传给oncreate方法
|
|||
long insert = sqliteDatabase.insertWithOnConflict(TABLE_NAME_MEASURE, null, cv, SQLiteDatabase.CONFLICT_REPLACE); |
|||
sqliteDatabase.close(); |
|||
if (insert == -1) { |
|||
return "failed"; |
|||
} |
|||
return "success"; |
|||
} |
|||
|
|||
// public String deleteAll() {
|
|||
//// SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();
|
|||
//// int delete = sqLiteDatabase.delete(TABLE_NAME, null, null);
|
|||
////
|
|||
//// sqLiteDatabase.close();
|
|||
//// if (delete == 0) {
|
|||
//// return "failed";
|
|||
//// }
|
|||
//// return "success";
|
|||
//
|
|||
// }
|
|||
|
|||
public void IntializeDataBasePaint() { |
|||
|
|||
for (int i = 1; i < 2; i++) { |
|||
List<DisplayPV> list = getDisplayDataPaint(i); //从数据库中读
|
|||
if (list.size() == 0) { |
|||
DisplayPV pv = new DisplayPV(i, 0, 0, 0, 0, 0, 0,0, 0, 0,0,0,0,0,0,0); |
|||
addOrUpdateDisplayDataPaint(pv);//一行一行添加
|
|||
} |
|||
} |
|||
} |
|||
public void IntializeDataBaseClean() { |
|||
|
|||
for (int i = 1; i < 2; i++) { |
|||
List<DisplayPV> list = getDisplayDataClean(i); //从数据库中读
|
|||
if (list.size() == 0) { |
|||
DisplayPV pv = new DisplayPV(i, 0, 0, 0, 0, 0, 0,0, 0, 0,0,0,0,0,0,0); |
|||
addOrUpdateDisplayDataClean(pv);//一行一行添加
|
|||
} |
|||
} |
|||
} |
|||
public void IntializeDataBasePolish() { |
|||
|
|||
for (int i = 1; i < 2; i++) { |
|||
List<DisplayPV> list = getDisplayDataPolish(i); //从数据库中读
|
|||
if (list.size() == 0) { |
|||
DisplayPV pv = new DisplayPV(i, 0, 0, 0, 0, 0, 0,0, 0, 0,0,0,0,0,0,0); |
|||
addOrUpdateDisplayDataPolish(pv);//一行一行添加
|
|||
} |
|||
} |
|||
} |
|||
public void IntializeDataBaseMeasure() { |
|||
|
|||
for (int i = 1; i < 2; i++) { |
|||
List<DisplayPV> list = getDisplayDataMeasure(i); //从数据库中读
|
|||
if (list.size() == 0) { |
|||
DisplayPV pv = new DisplayPV(i, 0, 0, 0, 0, 0, 0,0, 0, 0,0,0,0,0,0,0); |
|||
addOrUpdateDisplayDataMeasure(pv);//一行一行添加
|
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
public List<DisplayPV> getDisplayDataPaint(int id) { //初始化
|
|||
List<DisplayPV> list = new ArrayList<>(); |
|||
String sql = "SELECT * FROM " + TABLE_NAME_PAINT + " WHERE " + COLUMN_ID + " = " + String.valueOf(id); |
|||
SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();//获取可写数据库实例
|
|||
|
|||
|
|||
Cursor cursor = sqLiteDatabase.rawQuery(sql, null); //按id查询
|
|||
|
|||
int idIndex = cursor.getColumnIndex(COLUMN_ID); |
|||
int _verticalAdjustIndex = cursor.getColumnIndex(COLUMN_VERTICAL_COMPENSATION); |
|||
int _moveSpeedPaintIndex = cursor.getColumnIndex(COLUMN_MOVE_SPEED_PAINT); |
|||
int _backDistanceIndex = cursor.getColumnIndex(COLUMN_BACK_DISTANCE); |
|||
int _slideSpeedIndex = cursor.getColumnIndex(COLUMN_SLIDE_SPEED); |
|||
int _slideDistanceIndex = cursor.getColumnIndex(COLUMN_SLIDE_DISTANCE); |
|||
int _changelanedistance = cursor.getColumnIndex(COLUMN_CHANGELANEDIS_PAINT); |
|||
|
|||
while (cursor.moveToNext()) { |
|||
|
|||
DisplayPV pv = new DisplayPV(cursor.getInt(idIndex), cursor.getInt(_verticalAdjustIndex), |
|||
cursor.getInt(_moveSpeedPaintIndex), cursor.getInt(_backDistanceIndex), cursor.getInt(_slideSpeedIndex), cursor.getInt(_slideDistanceIndex), 0, |
|||
0, 0, 0, 0, 0,0,0,0,cursor.getInt(_changelanedistance)); |
|||
|
|||
|
|||
list.add(pv); |
|||
} |
|||
cursor.close(); |
|||
sqLiteDatabase.close(); |
|||
return list; |
|||
} |
|||
|
|||
public List<DisplayPV> getDisplayDataClean(int id) { //初始化
|
|||
List<DisplayPV> list = new ArrayList<>(); |
|||
String sql = "SELECT * FROM " + TABLE_NAME_CLEAN+ " WHERE " + COLUMN_ID + " = " + String.valueOf(id); |
|||
SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();//获取可写数据库实例
|
|||
|
|||
|
|||
Cursor cursor = sqLiteDatabase.rawQuery(sql, null); //按id查询
|
|||
|
|||
int idIndex = cursor.getColumnIndex(COLUMN_ID); |
|||
int _verticalAdjustIndex = cursor.getColumnIndex(COLUMN_VERTICAL_COMPENSATION); |
|||
int _moveSpeedCleanIndex = cursor.getColumnIndex(COLUMN_MOVE_SPEED_CLEAN); |
|||
int _pumpFrequencyIndex = cursor.getColumnIndex(COLUMN_PUMP_FREQUENCY); |
|||
int _pumpStopFrequencyIndex = cursor.getColumnIndex(COLUMN_PUMP_STOP_FREQUENCY); |
|||
int _pressSetIndex = cursor.getColumnIndex(COLUMN_PRESS_SET_CLEAN); |
|||
|
|||
while (cursor.moveToNext()) { |
|||
|
|||
DisplayPV pv = new DisplayPV(cursor.getInt(idIndex), cursor.getInt(_verticalAdjustIndex), |
|||
0, 0, 0, 0, cursor.getInt(_moveSpeedCleanIndex), |
|||
cursor.getInt(_pumpFrequencyIndex), cursor.getInt(_pressSetIndex), 0, 0, 0,0,cursor.getInt(_pumpStopFrequencyIndex),0,0); |
|||
|
|||
list.add(pv); |
|||
} |
|||
cursor.close(); |
|||
sqLiteDatabase.close(); |
|||
return list; |
|||
} |
|||
public List<DisplayPV> getDisplayDataPolish(int id) { //初始化
|
|||
List<DisplayPV> list = new ArrayList<>(); |
|||
String sql = "SELECT * FROM " + TABLE_NAME_POLISH + " WHERE " + COLUMN_ID + " = " + String.valueOf(id); |
|||
SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();//获取可写数据库实例
|
|||
|
|||
|
|||
Cursor cursor = sqLiteDatabase.rawQuery(sql, null); //按id查询
|
|||
|
|||
int idIndex = cursor.getColumnIndex(COLUMN_ID); |
|||
int _verticalAdjustIndex = cursor.getColumnIndex(COLUMN_VERTICAL_COMPENSATION); |
|||
int _pressSetIndex = cursor.getColumnIndex(COLUMN_PRESS_SET_POLISH); |
|||
int _moveSpeedPolishIndex = cursor.getColumnIndex(COLUMN_MOVE_SPEED_POLISH); |
|||
int _HCompensationSwitchIndex = cursor.getColumnIndex(COLUMN_H_COMPENSATIONSWITCH); |
|||
int _changeLaneDistance = cursor.getColumnIndex(COLUMN_CHANGELANEDIS_POLISH); |
|||
|
|||
|
|||
while (cursor.moveToNext()) { |
|||
|
|||
DisplayPV pv = new DisplayPV(cursor.getInt(idIndex), cursor.getInt(_verticalAdjustIndex), |
|||
0, 0, 0, 0, 0, |
|||
0, 0, cursor.getInt(_pressSetIndex), cursor.getInt(_moveSpeedPolishIndex), |
|||
cursor.getInt(_HCompensationSwitchIndex),0,0,cursor.getInt(_changeLaneDistance),0); |
|||
|
|||
list.add(pv); |
|||
} |
|||
cursor.close(); |
|||
sqLiteDatabase.close(); |
|||
return list; |
|||
} |
|||
public List<DisplayPV> getDisplayDataMeasure(int id) { //初始化
|
|||
List<DisplayPV> list = new ArrayList<>(); |
|||
String sql = "SELECT * FROM " + TABLE_NAME_MEASURE + " WHERE " + COLUMN_ID + " = " + String.valueOf(id); |
|||
SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();//获取可写数据库实例
|
|||
|
|||
Cursor cursor = sqLiteDatabase.rawQuery(sql, null); //按id查询
|
|||
|
|||
int idIndex = cursor.getColumnIndex(COLUMN_ID); |
|||
int _moveSpeedMeasureIndex = cursor.getColumnIndex(COLUMN_MOVE_SPEED_MEASURE); |
|||
|
|||
while (cursor.moveToNext()) { |
|||
|
|||
DisplayPV pv = new DisplayPV(cursor.getInt(idIndex), 0, |
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, |
|||
0, cursor.getInt(_moveSpeedMeasureIndex),0,0,0); |
|||
|
|||
list.add(pv); |
|||
} |
|||
cursor.close(); |
|||
sqLiteDatabase.close(); |
|||
return list; |
|||
} |
|||
} |
|||
@ -0,0 +1,259 @@ |
|||
package com.example.guohuawindpowerapp.services; |
|||
|
|||
import android.app.Dialog; |
|||
import android.icu.text.CaseMap; |
|||
import android.view.View; |
|||
import android.widget.Button; |
|||
import android.widget.RadioButton; |
|||
import android.widget.RadioGroup; |
|||
import android.widget.Toast; |
|||
|
|||
import com.example.guohuawindpowerapp.CleanActivity; |
|||
import com.example.guohuawindpowerapp.MeasureActivity; |
|||
import com.example.guohuawindpowerapp.PaintActivity; |
|||
import com.example.guohuawindpowerapp.PolishActivity; |
|||
import com.example.guohuawindpowerapp.R; |
|||
|
|||
public class PopupHelper { |
|||
|
|||
private PaintActivity mainActivitypaint; |
|||
private CleanActivity mainActivityclean; |
|||
private PolishActivity mainActivitypolish; |
|||
private MeasureActivity mainActivitymeasure; |
|||
|
|||
public String operateModeValuePaint="手动作业";//喷漆
|
|||
public String operateModeValueClean="手动作业"; //清洗
|
|||
public String operateModeValuePolish="手动作业"; //打磨
|
|||
|
|||
public PopupHelper(PaintActivity mainActivity) |
|||
{ |
|||
this.mainActivitypaint = mainActivity; |
|||
|
|||
} |
|||
public PopupHelper(CleanActivity mainActivity) |
|||
{ |
|||
this.mainActivityclean = mainActivity; |
|||
} |
|||
public PopupHelper(PolishActivity mainActivity) |
|||
{ |
|||
this.mainActivitypolish = mainActivity; |
|||
} |
|||
public PopupHelper(MeasureActivity mainActivity) |
|||
{ |
|||
this.mainActivitymeasure = mainActivity; |
|||
} |
|||
//喷漆操作模式弹窗
|
|||
public void OperateModePaintPopup(View.OnClickListener context) { //手动模式弹窗
|
|||
Dialog dialog = new Dialog(mainActivitypaint); |
|||
|
|||
dialog.setContentView(R.layout.paintoperatemodepopup); // 设置自定义布局
|
|||
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
|
|||
|
|||
// 获取布局中的视图
|
|||
Button cancelButton = dialog.findViewById(R.id.manualModePaintCancel); |
|||
Button confirmButton = dialog.findViewById(R.id.manualModePaintApply); |
|||
|
|||
//获取按钮组
|
|||
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.operateModePaintSelectorGroup); |
|||
|
|||
//4种模式
|
|||
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
|||
@Override |
|||
public void onCheckedChanged(RadioGroup group, int checkedId) { |
|||
RadioButton radioButton = (RadioButton) group.findViewById(checkedId); |
|||
operateModeValuePaint=radioButton.getText().toString(); |
|||
|
|||
} |
|||
}); |
|||
|
|||
//下次进来保证是选中状态或者未远中
|
|||
String ii= mainActivitypaint.mainBinding.operateModeDisplay.getText().toString(); |
|||
switch (ii) |
|||
{ |
|||
case "手动作业": { radioGroup.check(R.id.rb_paintone); |
|||
break; |
|||
} |
|||
case "竖直作业": { radioGroup.check(R.id.rb_painttwo); |
|||
break; |
|||
} |
|||
case "竖直自动": { radioGroup.check(R.id.rb_paintthree); |
|||
break; |
|||
} |
|||
case "水平自动":{radioGroup.check(R.id.rb_paintfour); |
|||
break; |
|||
} |
|||
default: |
|||
radioGroup.clearCheck(); |
|||
break; |
|||
|
|||
} |
|||
|
|||
|
|||
// 设置确定按钮点击事件
|
|||
confirmButton.setOnClickListener(v -> { //手动模式弹窗确认
|
|||
if (radioGroup.getCheckedRadioButtonId() != -1) { //有按钮选中时按确定 更新值
|
|||
mainActivitypaint.mainBinding.operateModeDisplay.setText(operateModeValuePaint); |
|||
mainActivitypaint._Operate_Mode_Call_Value=operateModeValuePaint; |
|||
Toast.makeText(mainActivitypaint, "设置成功", Toast.LENGTH_SHORT).show(); |
|||
} |
|||
|
|||
dialog.dismiss(); // 关闭弹窗
|
|||
}); |
|||
|
|||
// 设置取消按钮点击事件
|
|||
cancelButton.setOnClickListener(v -> { |
|||
Toast.makeText(mainActivitypaint, "点击了取消", Toast.LENGTH_SHORT).show(); |
|||
|
|||
dialog.dismiss(); // 关闭弹窗
|
|||
}); |
|||
dialog.show(); // 显示弹窗
|
|||
|
|||
} |
|||
|
|||
|
|||
//清洗操作模式弹窗
|
|||
public void OperateModeCleanPopup(View.OnClickListener context) { //手动模式弹窗
|
|||
Dialog dialog = new Dialog(mainActivityclean); |
|||
|
|||
dialog.setContentView(R.layout.cleanoperatemodepopup); // 设置自定义布局
|
|||
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
|
|||
|
|||
// 获取布局中的视图
|
|||
Button cancelButton = dialog.findViewById(R.id.manualModeCleanCancel); |
|||
Button confirmButton = dialog.findViewById(R.id.manualModeCleanApply); |
|||
|
|||
//获取按钮组
|
|||
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.operateModeCleanSelectorGroup); |
|||
|
|||
//4种模式
|
|||
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
|||
@Override |
|||
public void onCheckedChanged(RadioGroup group, int checkedId) { |
|||
RadioButton radioButton = (RadioButton) group.findViewById(checkedId); |
|||
operateModeValueClean=radioButton.getText().toString(); |
|||
} |
|||
}); |
|||
|
|||
//下次进来保证是选中状态或者未远中
|
|||
String ii= mainActivityclean.mainBinding.operateModeDisplay.getText().toString(); |
|||
switch (ii) |
|||
{ |
|||
case "手动作业": { radioGroup.check(R.id.rb_cleanone); |
|||
break; |
|||
} |
|||
case "竖直作业": { radioGroup.check(R.id.rb_cleantwo); |
|||
break; |
|||
} |
|||
case "自动作业": { radioGroup.check(R.id.rb_cleanthree); |
|||
break; |
|||
|
|||
} |
|||
default: |
|||
radioGroup.clearCheck(); |
|||
break; |
|||
|
|||
} |
|||
|
|||
|
|||
// 设置确定按钮点击事件
|
|||
confirmButton.setOnClickListener(v -> { //手动模式弹窗确认
|
|||
if (radioGroup.getCheckedRadioButtonId() != -1) { //有按钮选中时按确定 更新值
|
|||
mainActivityclean.mainBinding.operateModeDisplay.setText(operateModeValueClean); |
|||
mainActivityclean._Operate_Mode_Call_Value=operateModeValueClean; |
|||
Toast.makeText(mainActivityclean, "设置成功", Toast.LENGTH_SHORT).show(); |
|||
} |
|||
|
|||
|
|||
dialog.dismiss(); // 关闭弹窗
|
|||
}); |
|||
|
|||
// 设置取消按钮点击事件
|
|||
cancelButton.setOnClickListener(v -> { |
|||
Toast.makeText(mainActivityclean, "点击了取消", Toast.LENGTH_SHORT).show(); |
|||
|
|||
dialog.dismiss(); // 关闭弹窗
|
|||
}); |
|||
dialog.show(); // 显示弹窗
|
|||
|
|||
} |
|||
|
|||
//打磨操作模式弹窗
|
|||
public void OperateModePolishPopup(View.OnClickListener context) { //手动模式弹窗
|
|||
Dialog dialog = new Dialog(mainActivitypolish); |
|||
|
|||
dialog.setContentView(R.layout.polishoperatemodepopup); // 设置自定义布局
|
|||
dialog.setCancelable(true); // 设置点击外部是否关闭弹窗
|
|||
|
|||
// 获取布局中的视图
|
|||
Button cancelButton = dialog.findViewById(R.id.manualModePolishCancel); |
|||
Button confirmButton = dialog.findViewById(R.id.manualModePolishApply); |
|||
|
|||
//获取按钮组
|
|||
RadioGroup radioGroup = (RadioGroup) dialog.findViewById(R.id.operateModePolishSelectorGroup); |
|||
|
|||
//4种模式
|
|||
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { |
|||
@Override |
|||
public void onCheckedChanged(RadioGroup group, int checkedId) { |
|||
RadioButton radioButton = (RadioButton) group.findViewById(checkedId); |
|||
operateModeValuePolish=radioButton.getText().toString(); |
|||
|
|||
} |
|||
}); |
|||
|
|||
//下次进来保证是选中状态或者未远中
|
|||
String ii= mainActivitypolish.mainBinding.operateModeDisplay.getText().toString(); |
|||
switch (ii) |
|||
{ |
|||
case "手动作业": { radioGroup.check(R.id.rb_polishone); |
|||
break; |
|||
} |
|||
case "竖直作业": { radioGroup.check(R.id.rb_polishtwo); |
|||
break; |
|||
} |
|||
case "水平作业": { radioGroup.check(R.id.rb_polishthree); |
|||
break; |
|||
|
|||
} |
|||
default: |
|||
radioGroup.clearCheck(); |
|||
break; |
|||
|
|||
} |
|||
|
|||
|
|||
// 设置确定按钮点击事件
|
|||
confirmButton.setOnClickListener(v -> { //手动模式弹窗确认
|
|||
if (radioGroup.getCheckedRadioButtonId() != -1) { //有按钮选中时按确定 更新值
|
|||
mainActivitypolish.mainBinding.operateModeDisplay.setText(operateModeValuePolish); |
|||
mainActivitypolish._Operate_Mode_Call_Value=operateModeValuePolish; |
|||
Toast.makeText(mainActivitypolish, "设置成功", Toast.LENGTH_SHORT).show(); |
|||
} |
|||
|
|||
dialog.dismiss(); // 关闭弹窗
|
|||
}); |
|||
|
|||
// 设置取消按钮点击事件
|
|||
cancelButton.setOnClickListener(v -> { |
|||
Toast.makeText(mainActivitypolish, "点击了取消", Toast.LENGTH_SHORT).show(); |
|||
|
|||
dialog.dismiss(); // 关闭弹窗
|
|||
}); |
|||
dialog.show(); // 显示弹窗
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} //根类
|
|||
|
|||
|
|||
@ -0,0 +1,63 @@ |
|||
package com.example.guohuawindpowerapp.services; |
|||
|
|||
import com.example.guohuawindpowerapp.models.BspIV; |
|||
import com.example.guohuawindpowerapp.models.BspPV; |
|||
import com.google.protobuf.InvalidProtocolBufferException; |
|||
|
|||
public class RobotDataHanlder { |
|||
|
|||
|
|||
public static void test() |
|||
{ |
|||
//byte[] data=hexToByteArray("080110830118313A04B1CBBACF");
|
|||
byte[] data=hexToByteArray("100A180A28013A32B1CBBACF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"); |
|||
|
|||
|
|||
|
|||
} |
|||
public static void DeoodeDataFromRobot(byte[] data) |
|||
{ |
|||
try |
|||
{ |
|||
if(data[0]==0x55&&data[1]==0x55) |
|||
{ |
|||
if (data[2]==0x01) |
|||
{ |
|||
BspIV.IV_struct_define iv = BspIV.IV_struct_define.parseFrom(data); |
|||
}else if(data[2]==0x02) |
|||
{ |
|||
BspPV.PV_struct_define pv = BspPV.PV_struct_define.parseFrom(data); |
|||
} |
|||
} |
|||
} catch (InvalidProtocolBufferException e) |
|||
{ |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
public static byte[] hexToByteArray(String inHex){ |
|||
int hexlen = inHex.length(); |
|||
byte[] result; |
|||
if (hexlen % 2 == 1){ |
|||
//奇数
|
|||
hexlen++; |
|||
result = new byte[(hexlen/2)]; |
|||
inHex="0"+inHex; |
|||
}else { |
|||
//偶数
|
|||
result = new byte[(hexlen/2)]; |
|||
} |
|||
int j=0; |
|||
for (int i = 0; i < hexlen; i+=2){ |
|||
result[j]=hexToByte(inHex.substring(i,i+2)); |
|||
j++; |
|||
} |
|||
return result; |
|||
} |
|||
public static byte hexToByte(String inHex){ |
|||
return (byte)Integer.parseInt(inHex,16); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,562 @@ |
|||
package com.example.guohuawindpowerapp.services; |
|||
|
|||
|
|||
import android.app.Activity; |
|||
import android.app.PendingIntent; |
|||
import android.content.BroadcastReceiver; |
|||
import android.content.Context; |
|||
import android.content.Intent; |
|||
import android.content.IntentFilter; |
|||
import android.hardware.usb.UsbDevice; |
|||
import android.hardware.usb.UsbDeviceConnection; |
|||
import android.hardware.usb.UsbManager; |
|||
import android.icu.text.CaseMap; |
|||
import android.os.Build; |
|||
import android.os.CountDownTimer; |
|||
import android.os.Handler; |
|||
import android.os.Looper; |
|||
import android.widget.Toast; |
|||
|
|||
import androidx.core.content.ContextCompat; |
|||
|
|||
import com.example.guohuawindpowerapp.BuildConfig; |
|||
import com.example.guohuawindpowerapp.CleanActivity; |
|||
import com.example.guohuawindpowerapp.MainActivity; |
|||
import com.example.guohuawindpowerapp.MeasureActivity; |
|||
import com.example.guohuawindpowerapp.PaintActivity; |
|||
import com.example.guohuawindpowerapp.PolishActivity; |
|||
import com.example.guohuawindpowerapp.models.BspIV; |
|||
import com.hoho.android.usbserial.driver.UsbSerialDriver; |
|||
import com.hoho.android.usbserial.driver.UsbSerialPort; |
|||
import com.hoho.android.usbserial.driver.UsbSerialProber; |
|||
import com.hoho.android.usbserial.util.SerialInputOutputManager; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.ArrayList; |
|||
import java.util.Iterator; |
|||
import java.util.List; |
|||
|
|||
public class USBSerialPortHelper implements SerialInputOutputManager.Listener { |
|||
|
|||
private Activity mActivity; |
|||
private CleanActivity activityClean; |
|||
private PaintActivity activityPaint; |
|||
private PolishActivity activityPolish; |
|||
private MeasureActivity activityMesaure; |
|||
public USBSerialPortHelper(PaintActivity activityPaint, CleanActivity activityClean, PolishActivity activityPolish, MeasureActivity activityMesaure, MainActivity mainActivity) |
|||
{ |
|||
if(activityPaint!=null) { |
|||
this.mActivity = activityPaint; |
|||
this.activityPaint=activityPaint; |
|||
} |
|||
if(activityClean!=null) { |
|||
this.mActivity = activityClean; |
|||
this.activityClean=activityClean; |
|||
} |
|||
if(activityPolish!=null) { |
|||
this.mActivity = activityPolish; |
|||
this.activityPolish=activityPolish; |
|||
} |
|||
|
|||
if(activityMesaure!=null) { |
|||
this.mActivity = activityMesaure; |
|||
this.activityMesaure=activityMesaure; |
|||
} |
|||
if(mainActivity!=null) { |
|||
this.mActivity = mainActivity; |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
//sserial port part start
|
|||
|
|||
private enum UsbPermission {Unknown, Requested, Granted, Denied} |
|||
|
|||
private final String INTENT_ACTION_GRANT_USB = BuildConfig.APPLICATION_ID + ".GRANT_USB"; |
|||
|
|||
|
|||
// <usb-device vendor-id="4292" product-id="60000" /> <!-- 0xea60: CP2102 and other CP210x single port devices -->
|
|||
// <usb-device vendor-id="4292" product-id="60016" /> <!-- 0xea70: CP2105 -->
|
|||
// <usb-device vendor-id="4292" product-id="60017" /> <!-- 0xea71: CP2108 -->
|
|||
|
|||
|
|||
private int deviceId = 60000; |
|||
private int deviceId_test = 60000; |
|||
private int portNum; |
|||
private final int WRITE_WAIT_MILLIS = 500; |
|||
private final int READ_WAIT_MILLIS = 100; |
|||
private String PortNameContians = "SILICON";/**/ |
|||
// private static String PortNameContians="FTD";
|
|||
private int baudRate = 57600; |
|||
private boolean withIoManager = true; |
|||
|
|||
private BroadcastReceiver broadcastReceiver; |
|||
private Handler mainLooper; |
|||
|
|||
private SerialInputOutputManager usbIoManager; |
|||
private UsbSerialPort usbSerialPort; |
|||
private UsbPermission usbPermission = UsbPermission.Unknown; |
|||
public boolean connected = false; |
|||
BspIV.IV_struct_define _toReceiveIV1; |
|||
String errorLast = ""; |
|||
|
|||
public void intialize() { |
|||
|
|||
broadcastReceiver = new BroadcastReceiver() { |
|||
@Override |
|||
public void onReceive(Context context, Intent intent) { |
|||
if (INTENT_ACTION_GRANT_USB.equals(intent.getAction())) { |
|||
usbPermission = intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false) ? UsbPermission.Granted : UsbPermission.Denied; |
|||
connect(); |
|||
} |
|||
} |
|||
}; |
|||
mainLooper = new Handler(Looper.getMainLooper()); |
|||
_receiveBufferlist = new ArrayList<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) mActivity.getSystemService(Context.USB_SERVICE); |
|||
for (UsbDevice v : usbManager.getDeviceList().values()) { |
|||
// status(v.getManufacturerName().toUpperCase());
|
|||
if (v.getManufacturerName().toUpperCase().contains(PortNameContians)) { |
|||
device = v; |
|||
break; |
|||
} |
|||
} |
|||
|
|||
if (device == null) { |
|||
// _serialPortSwitch.setChecked(false);
|
|||
|
|||
// status("找不到设备");
|
|||
return; |
|||
} |
|||
UsbSerialDriver driver = UsbSerialProber.getDefaultProber().probeDevice(device); |
|||
if (driver == null) { |
|||
driver = CustomProber.getCustomProber().probeDevice(device); |
|||
} |
|||
if (driver == null) { |
|||
// _serialPortSwitch.setChecked(false);
|
|||
// status("无驱动");
|
|||
return; |
|||
} |
|||
if (driver.getPorts().size() < portNum) //就是0 cp2102 或者同一个驱动,第一个
|
|||
{ |
|||
//status("connection failed: not enough ports at device");
|
|||
//status("找不到设备");
|
|||
return; |
|||
} |
|||
usbSerialPort = driver.getPorts().get(portNum); |
|||
|
|||
UsbDeviceConnection usbConnection = usbManager.openDevice(driver.getDevice()); |
|||
if (usbConnection == null && usbPermission == UsbPermission.Unknown && !usbManager.hasPermission(driver.getDevice())) { |
|||
usbPermission = UsbPermission.Requested; |
|||
int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_MUTABLE : 0; |
|||
Intent intent = new Intent(INTENT_ACTION_GRANT_USB); |
|||
intent.setPackage(mActivity.getPackageName()); |
|||
PendingIntent usbPermissionIntent = PendingIntent.getBroadcast(mActivity, 0, intent, flags); |
|||
usbManager.requestPermission(driver.getDevice(), usbPermissionIntent); |
|||
return; |
|||
} |
|||
if (usbConnection == null) { |
|||
if (!usbManager.hasPermission(driver.getDevice())) { |
|||
// status("connection failed: permission denied");
|
|||
} else { |
|||
// status("connection failed: open failed");
|
|||
} |
|||
|
|||
return; |
|||
} |
|||
|
|||
try { |
|||
usbSerialPort.open(usbConnection); |
|||
try { |
|||
usbSerialPort.setParameters(baudRate, 8, 1, UsbSerialPort.PARITY_NONE); |
|||
// status("connected: ");
|
|||
|
|||
} catch (UnsupportedOperationException e) { |
|||
//status("unsupport setparameters");
|
|||
} |
|||
if (withIoManager) { |
|||
usbIoManager = new SerialInputOutputManager(usbSerialPort, this); |
|||
usbIoManager.setReadBufferSize(40960); |
|||
usbIoManager.setReadTimeout(READ_WAIT_MILLIS); |
|||
usbIoManager.start(); |
|||
} |
|||
//status("connected");
|
|||
connected = true; |
|||
// _serialPortSwitch.setChecked(true);
|
|||
//switch set true
|
|||
|
|||
} catch (Exception e) { |
|||
// status("connection failed: " + e.getMessage());
|
|||
disconnect(); |
|||
} |
|||
} |
|||
|
|||
public void disconnect() { |
|||
connected = false; |
|||
|
|||
if (usbIoManager != null) { |
|||
usbIoManager.setListener(null); |
|||
usbIoManager.stop(); |
|||
} |
|||
usbIoManager = null; |
|||
try { |
|||
usbSerialPort.close(); |
|||
} catch (IOException ignored) { |
|||
|
|||
} |
|||
usbSerialPort = null; |
|||
} |
|||
|
|||
List<Byte> _receiveBufferlist; |
|||
|
|||
private static byte[] listTobyte(List<Byte> list) { |
|||
if (list == null || list.size() < 0) return null; |
|||
byte[] bytes = new byte[list.size()]; |
|||
int i = 0; |
|||
Iterator<Byte> iterator = list.iterator(); |
|||
while (iterator.hasNext()) { |
|||
bytes[i] = iterator.next(); |
|||
i++; |
|||
} |
|||
return bytes; |
|||
} |
|||
|
|||
boolean StartCountDown = false; |
|||
|
|||
// byte _receivedData
|
|||
private void receive(byte[] data) { |
|||
|
|||
// status("read data");
|
|||
for (int i = 0; i < data.length; i++) { |
|||
_receiveBufferlist.add(data[i]); |
|||
} |
|||
|
|||
//decodeRceive(data);
|
|||
if (StartCountDown == false)//从收到第一个数据开始计时
|
|||
{ |
|||
StartCountDown = true; |
|||
new CountDownTimer(400, 200) { |
|||
public void onTick(long millisUntilFinished) { |
|||
|
|||
} |
|||
public void onFinish() { |
|||
|
|||
// status("read finished");
|
|||
decodeRceive(listTobyte(_receiveBufferlist)); |
|||
_receiveBufferlist.clear(); |
|||
StartCountDown = false; |
|||
} |
|||
}.start(); |
|||
} |
|||
} |
|||
|
|||
|
|||
/* |
|||
逐位检查并构建二进制字符串 |
|||
*/ |
|||
String unsignedIntToBinary(int value) { |
|||
StringBuilder sb = new StringBuilder(32); |
|||
for (int i = 7; i >= 0; i--) { |
|||
sb.append((value & (1 << i)) == 0 ? '0' : '1'); |
|||
} |
|||
return sb.toString(); |
|||
} |
|||
/* |
|||
逐位检查并构建二进制字符串 每4位添加一个分隔符 |
|||
*/ |
|||
String unsignedIntToBinaryWithSeparator(int value) { |
|||
StringBuilder sb = new StringBuilder(35); |
|||
for (int i = 11; i >= 0; i--) { |
|||
sb.append((value & (1 << i)) == 0 ? '0' : '1'); |
|||
if (i % 4 == 0 && i != 0) { |
|||
sb.append(' '); // 每4位添加一个分隔符
|
|||
} |
|||
} |
|||
return sb.toString(); |
|||
} |
|||
String toHex4Digits(int value) { |
|||
char[] hexChars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; |
|||
int low16Bits = value & 0xFFFF; |
|||
|
|||
char[] result = new char[4]; |
|||
result[0] = hexChars[(low16Bits >> 12) & 0xF]; |
|||
result[1] = hexChars[(low16Bits >> 8) & 0xF]; |
|||
result[2] = hexChars[(low16Bits >> 4) & 0xF]; |
|||
result[3] = hexChars[low16Bits & 0xF]; |
|||
|
|||
return new String(result); |
|||
} |
|||
|
|||
private void decodeRceive(byte[] data) { |
|||
try { |
|||
|
|||
// String dataReceived = bytesToHex(data);
|
|||
//status(dataReceived);
|
|||
// if ((data[0] == 0xFE) && (data[1] == 0xFE))
|
|||
byte[] crcbytes = new byte[data.length - 2]; |
|||
System.arraycopy(data, 0, crcbytes, 0, data.length - 2); |
|||
byte[] crc=ModbusCRC.calculateCRC(crcbytes); |
|||
// status(bytesToHex(data));
|
|||
// status(String.valueOf(crc[0]+" "+ String.valueOf(crc[1])));
|
|||
if(data[data.length-2]==(byte)(crc[1]&0xff) && data[data.length-1]==(byte)(crc[0] & 0xff)) |
|||
{ |
|||
|
|||
if ((data[0] == 0x55) && (data[1] == 0x55) ) |
|||
{ |
|||
|
|||
byte[] bytes = new byte[data.length - 4]; |
|||
System.arraycopy(data, 2, bytes, 0, data.length - 4); |
|||
|
|||
BspIV.IV_struct_define _toReceiveIV=BspIV.IV_struct_define.parseFrom(bytes); |
|||
_toReceiveIV1=_toReceiveIV; |
|||
if (_toReceiveIV!=null) |
|||
{ |
|||
PaintParaShow(); |
|||
CleanParaShow(); |
|||
PolishParaShow(); |
|||
MeasureParaShow(); |
|||
_toReceiveIV.getSystemError(); |
|||
// Toast.makeText(mActivity, String.valueOf(_toReceiveIV.getSystemError()), Toast.LENGTH_SHORT).show();
|
|||
|
|||
activityErrorShow(String.valueOf(_toReceiveIV.getSystemError()), |
|||
String.valueOf(_toReceiveIV.getLeftMotorErr()), String.valueOf(_toReceiveIV.getRightMotorErr()) ); |
|||
|
|||
|
|||
|
|||
}else |
|||
{ |
|||
// status("null");
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
}else |
|||
{ |
|||
|
|||
} |
|||
|
|||
}else |
|||
{ |
|||
//status("crc failed");
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} catch (Exception e) { |
|||
|
|||
} |
|||
} |
|||
public void activityErrorShow(String errmessage,String leftmotorErr,String rightmotorError) |
|||
{ |
|||
if(activityPaint!=null) |
|||
{ |
|||
int errorCode = Integer.parseInt(errmessage); |
|||
if ((errorCode & (1 << 5)) != 0){ |
|||
activityPaint.showError("请将所有遥控器按键回零位"); |
|||
} |
|||
else{ |
|||
activityPaint.showError(errmessage+"#"+leftmotorErr+"#"+rightmotorError); |
|||
} |
|||
} |
|||
if(activityClean!=null) |
|||
{ |
|||
int errorCode = Integer.parseInt(errmessage); |
|||
if ((errorCode & (1 << 5)) != 0){ |
|||
activityClean.showError("请将所有遥控器按键回零位"); |
|||
} |
|||
else{ |
|||
activityClean.showError(errmessage+"#"+leftmotorErr+"#"+rightmotorError); |
|||
} |
|||
} |
|||
if(activityPolish!=null) |
|||
{ |
|||
int errorCode = Integer.parseInt(errmessage); |
|||
if ((errorCode & (1 << 5)) != 0){ |
|||
activityPolish.showError("请将遥控器所有按键回零位"); |
|||
} |
|||
else{ |
|||
activityPolish.showError(errmessage+"#"+leftmotorErr+"#"+rightmotorError); |
|||
} |
|||
} |
|||
if(activityMesaure!=null) |
|||
{ |
|||
int errorCode = Integer.parseInt(errmessage); |
|||
if ((errorCode & (1 << 5)) != 0){ |
|||
activityMesaure.showError("请将遥控器所有按键回零位"); |
|||
} |
|||
else{ |
|||
activityMesaure.showError(errmessage+"#"+leftmotorErr+"#"+rightmotorError); |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
public void PaintParaShow() |
|||
{ |
|||
if(activityPaint!=null) |
|||
{ |
|||
activityPaint.mainBinding.tvSpeedFrom32.setText(String.valueOf((double)_toReceiveIV1.getRobotMoveSpeedE2MPMin()/10)); |
|||
activityPaint.mainBinding.tvBodyAttitudeFrom32.setText(String.valueOf((double)_toReceiveIV1.getCurrentAngleE2D()/100)); |
|||
activityPaint.mainBinding.tvPressFrom32.setText( String.valueOf(_toReceiveIV1.getEndPressure()) ); |
|||
activityPaint.mainBinding.tvSlidePositionFrom32.setText(String.valueOf(_toReceiveIV1.getSlideTablePosition())); |
|||
activityPaint.mainBinding.tvSlideSpeedFrom32.setText(String.valueOf(_toReceiveIV1.getSlideTableSpeed())); |
|||
activityPaint.mainBinding.tvRightCompensationFrom32Paint.setText(String.valueOf((double)_toReceiveIV1.getRightCompensationE2D()/100)); |
|||
activityPaint.mainBinding.tvLeftCompensationFrom32Paint.setText(String.valueOf((double)_toReceiveIV1.getLeftCompensationE2D()/100)); |
|||
if(_toReceiveIV1.getRemoteStatus()==0) |
|||
{ |
|||
activityPaint.mainBinding.tvSignal.setText("断开"); |
|||
} |
|||
else if(_toReceiveIV1.getRemoteStatus()==1) |
|||
{ |
|||
activityPaint.mainBinding.tvSignal.setText("已连接"); |
|||
} |
|||
} |
|||
} |
|||
public void CleanParaShow() |
|||
{ |
|||
if(activityClean!=null) |
|||
{ |
|||
activityClean.mainBinding.tvSpeedFrom32.setText(String.valueOf((double)_toReceiveIV1.getRobotMoveSpeedE2MPMin()/10)); |
|||
activityClean.mainBinding.tvBodyAttitudeFrom32.setText(String.valueOf((double)_toReceiveIV1.getCurrentAngleE2D()/100)); |
|||
activityClean.mainBinding.tvPressFrom32.setText( String.valueOf(_toReceiveIV1.getEndPressure()) ); |
|||
|
|||
if(_toReceiveIV1.getRemoteStatus()==0) |
|||
{ |
|||
activityClean.mainBinding.tvSignal.setText("断开"); |
|||
} |
|||
else if(_toReceiveIV1.getRemoteStatus()==1) |
|||
{ |
|||
activityClean.mainBinding.tvSignal.setText("已连接"); |
|||
} |
|||
} |
|||
} |
|||
public void PolishParaShow() |
|||
{ |
|||
if(activityPolish!=null) |
|||
{ |
|||
activityPolish.mainBinding.tvSpeedFrom32.setText(String.valueOf((double)_toReceiveIV1.getRobotMoveSpeedE2MPMin()/10)); |
|||
activityPolish.mainBinding.tvBodyAttitudeFrom32.setText(String.valueOf((double)_toReceiveIV1.getCurrentAngleE2D()/100)); |
|||
activityPolish.mainBinding.tvPressFrom32.setText( String.valueOf(_toReceiveIV1.getEndPressure()) ); |
|||
activityPolish.mainBinding.tvLeftCompensationFrom32.setText(String.valueOf((double)_toReceiveIV1.getLeftCompensationE2D()/100)); |
|||
activityPolish.mainBinding.tvRightCompensationFrom32.setText(String.valueOf((double)_toReceiveIV1.getRightCompensationE2D()/100)); |
|||
if(_toReceiveIV1.getRemoteStatus()==0) |
|||
{ |
|||
activityPolish.mainBinding.tvSignal.setText("断开"); |
|||
} |
|||
else if(_toReceiveIV1.getRemoteStatus()==1) |
|||
{ |
|||
activityPolish.mainBinding.tvSignal.setText("已连接"); |
|||
} |
|||
} |
|||
} |
|||
public void MeasureParaShow() |
|||
{ |
|||
if(activityMesaure!=null) |
|||
{ |
|||
activityMesaure.mainBinding.tvSpeedFrom32.setText(String.valueOf((double)_toReceiveIV1.getRobotMoveSpeedE2MPMin()/10)); |
|||
activityMesaure.mainBinding.tvBodyAttitudeFrom32.setText(String.valueOf((double)_toReceiveIV1.getCurrentAngleE2D()/100)); |
|||
activityMesaure.mainBinding.tvPressFrom32.setText( String.valueOf(_toReceiveIV1.getEndPressure()) ); |
|||
activityMesaure.mainBinding.tvMeasureFrom32.setText(String.valueOf((double) _toReceiveIV1.getThicknessValue()/100)); |
|||
|
|||
if(_toReceiveIV1.getRemoteStatus()==0) |
|||
{ |
|||
activityMesaure.mainBinding.tvSignal.setText("断开"); |
|||
} |
|||
else if(_toReceiveIV1.getRemoteStatus()==1) |
|||
{ |
|||
activityMesaure.mainBinding.tvSignal.setText("已连接"); |
|||
} |
|||
} |
|||
} |
|||
public static String bytesToHex(byte[] bytes) { |
|||
StringBuilder result = new StringBuilder(); |
|||
for (byte b : bytes) { |
|||
result.append(String.format("%02X ", b & 0xFF)); |
|||
} |
|||
return result.toString(); |
|||
} |
|||
|
|||
public void onStart() { |
|||
|
|||
ContextCompat.registerReceiver(mActivity, broadcastReceiver, new IntentFilter(INTENT_ACTION_GRANT_USB), ContextCompat.RECEIVER_NOT_EXPORTED); |
|||
//status("onStart");
|
|||
|
|||
} |
|||
|
|||
public void onStop() { |
|||
mActivity.unregisterReceiver(broadcastReceiver); |
|||
// status("onStop");
|
|||
} |
|||
|
|||
|
|||
public void onResume() { |
|||
|
|||
if (!connected && (usbPermission == UsbPermission.Unknown || usbPermission == UsbPermission.Granted)) { |
|||
mainLooper.post(this::connect); |
|||
|
|||
} |
|||
} |
|||
|
|||
|
|||
public void onPause() { |
|||
if (connected) { |
|||
// status("串口断开");
|
|||
// _serialPortSwitch.setChecked(false);
|
|||
disconnect(); |
|||
} |
|||
} |
|||
public void SendData(byte[] data) { |
|||
if (connected) { |
|||
try { |
|||
|
|||
usbSerialPort.write(data, WRITE_WAIT_MILLIS); |
|||
} catch (IOException e) |
|||
{ |
|||
// status("Send Failed");
|
|||
connected = false; |
|||
} |
|||
} |
|||
else { |
|||
//status("usb serialport disconnected");
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.example.guohuawindpowerapp.services; |
|||
|
|||
|
|||
import cn.nodemedia.NodePlayer; |
|||
import cn.nodemedia.NodePlayerView; |
|||
|
|||
public class VideoPlayerHelper { |
|||
|
|||
|
|||
|
|||
public static void startVedio(NodePlayerView nodePlayerView, NodePlayer nodePlayer,String address ){ |
|||
|
|||
|
|||
nodePlayerView.setRenderType(NodePlayerView.RenderType.SURFACEVIEW);//设置渲染器类型
|
|||
nodePlayerView.setUIViewContentMode(NodePlayerView.UIViewContentMode.ScaleToFill);//设置视频画面缩放模式
|
|||
//nodePlayer=new NodePlayer(this);
|
|||
nodePlayer.setPlayerView(nodePlayerView);//设置播放视图
|
|||
//设置RTSP流使用的传输协议,支持的模式有:
|
|||
nodePlayer.setRtspTransport(NodePlayer.RTSP_TRANSPORT_TCP);//设置传输
|
|||
nodePlayer.setInputUrl(address); |
|||
nodePlayer.setVideoEnable(true);//设置视频启用
|
|||
nodePlayer.setBufferTime(100);//设置缓冲时间
|
|||
nodePlayer.setMaxBufferTime(200);//设置最大缓冲时间
|
|||
nodePlayer.start(); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,11 @@ |
|||
package com.example.guohuawindpowerapp.viewmodels; |
|||
|
|||
import androidx.lifecycle.ViewModel; |
|||
|
|||
public class MainViewModel extends ViewModel { |
|||
|
|||
public MainViewModel() { |
|||
|
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,2 @@ |
|||
protoc --java_out . *.proto |
|||
pause |
|||
@ -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 |
@ -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,8 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<solid android:color="#e6f7ff" /> |
|||
<stroke |
|||
android:width="2dp" |
|||
android:color="#1890ff" /> |
|||
<corners android:radius="8dp" /> |
|||
</shape> |
|||
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<solid android:color="#f5f5f5" /> |
|||
<stroke |
|||
android:width="1dp" |
|||
android:color="#d9d9d9" /> |
|||
<corners android:radius="8dp" /> |
|||
</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="#d6eaf8" /> |
|||
|
|||
<!-- 设置一个黑色边框 --> |
|||
<stroke |
|||
android:width="4px" |
|||
android:color="#000000" /> |
|||
<!-- 设置四个圆角的半径 --> |
|||
<corners |
|||
android:bottomLeftRadius="10px" |
|||
android:bottomRightRadius="10px" |
|||
android:topLeftRadius="10px" |
|||
android:topRightRadius="10px" /> |
|||
<!-- 设置一下边距,让空间大一点 --> |
|||
<!-- <padding--> |
|||
<!-- android:bottom="5dp"--> |
|||
<!-- android:left="5dp"--> |
|||
<!-- android:right="5dp"--> |
|||
<!-- android:top="5dp" />--> |
|||
|
|||
</shape> |
|||
@ -0,0 +1,24 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
|
|||
<!-- 设置透明背景色 --> |
|||
<solid android:color="#d6eaf8" /> |
|||
|
|||
<!-- 设置一个黑色边框 --> |
|||
<stroke |
|||
android:width="2px" |
|||
android:color="@color/blue_green" /> |
|||
<!-- 设置四个圆角的半径 --> |
|||
<corners |
|||
android:bottomLeftRadius="10px" |
|||
android:bottomRightRadius="10px" |
|||
android:topLeftRadius="10px" |
|||
android:topRightRadius="10px" /> |
|||
<!-- 设置一下边距,让空间大一点 --> |
|||
<!-- <padding--> |
|||
<!-- android:bottom="5dp"--> |
|||
<!-- android:left="5dp"--> |
|||
<!-- android:right="5dp"--> |
|||
<!-- android:top="5dp" />--> |
|||
|
|||
</shape> |
|||
@ -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="2dp" |
|||
android:color="#ed7041" /> |
|||
<!-- 设置四个圆角的半径 --> |
|||
<corners |
|||
android:bottomLeftRadius="10px" |
|||
android:bottomRightRadius="10px" |
|||
android:topLeftRadius="10px" |
|||
android:topRightRadius="10px" /> |
|||
<!-- 设置一下边距,让空间大一点 --> |
|||
<!-- <padding--> |
|||
<!-- android:bottom="5dp"--> |
|||
<!-- android:left="5dp"--> |
|||
<!-- android:right="5dp"--> |
|||
<!-- android:top="5dp" />--> |
|||
|
|||
</shape> |
|||
@ -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,18 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<item android:state_pressed="true"> |
|||
<!-- 当视图被按下(用户点击并按住)时应用的样式 --> |
|||
<shape> |
|||
<solid android:color="@color/red" /> |
|||
<!-- 填充颜色:深蓝色 --> |
|||
<corners android:radius="15dp" /> |
|||
<!-- 圆角半径:4dp --> |
|||
</shape> |
|||
</item> |
|||
<item> |
|||
<shape> |
|||
<solid android:color="@color/black" /> |
|||
<corners android:radius="0dp" /> |
|||
</shape> |
|||
</item> |
|||
</selector> |
|||
@ -0,0 +1,11 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<solid android:color="#f5f5f5" /> |
|||
<!-- 浅灰色填充 --> |
|||
|
|||
<stroke |
|||
android:width="3dp" |
|||
android:color="#FBE5D6" /> |
|||
<!-- 2dp 宽的红色实线边框 --> |
|||
<corners android:radius="10dp" /> |
|||
</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> |
|||
|
After Width: | Height: | Size: 511 KiB |
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<solid android:color="#E8F0FE" /> |
|||
<stroke android:width="2dp" android:color="#3B88FC" /> |
|||
<corners android:radius="8dp" /> |
|||
</shape> |
|||
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<solid android:color="#F5F5F5" /> |
|||
<stroke android:width="1dp" android:color="#CCCCCC" /> |
|||
<corners android:radius="8dp" /> |
|||
</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,9 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!--自定义edittext的光标颜色和粗细--> |
|||
<shape xmlns:tools="http://schemas.android.com/tools" |
|||
xmlns:android="http://schemas.android.com/apk/res/android" |
|||
tools:ignore="ExtraText"> |
|||
android:shape="rectangle"> |
|||
<size android:width="3dp" /> <!-- 调整此值控制光标粗细 --> |
|||
<solid android:color="@color/black" /> <!-- 光标颜色 --> |
|||
</shape> |
|||
@ -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="#FBE5D6" /> |
|||
<!-- 设置一个黑色边框 --> |
|||
<!-- <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: 142 KiB |
|
After Width: | Height: | Size: 179 KiB |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> |
|||
|
|||
<!-- 设置一个黑色边框 --> |
|||
<stroke android:width="4px" |
|||
android:color="#d6eaf8"/> |
|||
<solid android:color="#d6eaf8" /> |
|||
|
|||
<corners android:radius="10dp" /> |
|||
<!-- 渐变 --> |
|||
|
|||
<!-- 设置一下边距,让空间大一点 --> |
|||
|
|||
</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/blue_green" |
|||
android:state_checked="true" /> |
|||
</selector> |
|||
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:shape="rectangle"> |
|||
<!-- 填充 --> |
|||
<solid android:color="#eaeded" /> |
|||
<!-- 圆角 --> |
|||
<corners android:radius="10dp" /> |
|||
</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> |
|||
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<!-- 设置Editext的形状--> |
|||
|
|||
|
|||
<!-- 设置透明背景色 --> |
|||
<!-- <solid android:color="#87CEEB" />--> |
|||
|
|||
<!-- 设置一个自定义颜色边框 --> |
|||
<stroke |
|||
android:width="1px" |
|||
android:color="@color/trasnparent" /> |
|||
<!-- 设置四个圆角的半径 --> |
|||
<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,13 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:shape="rectangle"> |
|||
<!-- 滚动条滑块颜色 --> |
|||
<solid android:color="#FF4081" /> |
|||
<!-- 滚动条滑块圆角(可选) --> |
|||
<corners android:radius="4dp" /> |
|||
<!-- 滚动条宽度(水平滚动条的高度就是其宽度) --> |
|||
<size |
|||
android:width="8dp" |
|||
android:height="8dp" |
|||
/> |
|||
</shape> |
|||
|
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: 186 KiB |
@ -0,0 +1,636 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<layout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools"> |
|||
|
|||
|
|||
|
|||
<!--根布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:background="@drawable/background" |
|||
android:orientation="vertical"> |
|||
<TextView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="30dp" |
|||
android:text="清洗界面" |
|||
android:gravity="center" |
|||
android:textStyle="bold" |
|||
android:textColor="@color/blue_green" |
|||
/> |
|||
|
|||
<HorizontalScrollView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
android:scrollbars="horizontal" |
|||
android:scrollbarThumbHorizontal="@drawable/scrollbar_horizontal_thumb" |
|||
|
|||
> |
|||
|
|||
<!--工作区显示--> |
|||
<LinearLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
<!--左侧显示半框--> |
|||
<LinearLayout |
|||
android:layout_width="200dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginVertical="12dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="vertical" |
|||
android:background="@drawable/orange_rounded_rectangle" |
|||
> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_marginLeft="8dp" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/信号状态" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_signal" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20sp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
> |
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:layout_marginLeft="8dp" |
|||
android:text="@string/moveSpeed" |
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_speedFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="m/min" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_marginLeft="8dp" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/vehicleBodyAttitude" |
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/tvBodyAttitudeFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/realPress" |
|||
android:layout_marginLeft="8dp" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tvPressFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="N" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<!--右侧显示半框--> |
|||
<LinearLayout |
|||
android:layout_width="400dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginVertical="8dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="vertical" |
|||
> |
|||
|
|||
<!-- 第一行,2个帧布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<!-- 第一行,第1个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/OperateMode" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/operateModeDisplay" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="4" |
|||
android:gravity="center" |
|||
android:text="手动作业" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
</LinearLayout> |
|||
|
|||
</FrameLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!-- 第二行,2个帧布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<!-- 第2行,第1个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="车体\n速度" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<EditText |
|||
android:id="@+id/Maintv_MoveSpeedTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:gravity="center" |
|||
android:hint="请输入0到30之间的数字" |
|||
android:imeOptions="actionDone" |
|||
android:inputType="numberDecimal" |
|||
|
|||
android:text="1.0" |
|||
android:textColor="@color/blue_green" |
|||
android:textCursorDrawable="@drawable/my_cursor" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="m/min" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
<!-- 第二行,第2个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="竖直\n补偿" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<!-- android:imeOptions="actionDone" 不会切换下一个文本输入 --> |
|||
<EditText |
|||
android:id="@+id/Maintv_VerticalAdjustTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:imeOptions="actionDone" |
|||
android:hint="请输入-10到10之间的数字" |
|||
android:inputType="numberSigned|numberDecimal" |
|||
android:digits="-0123456789." |
|||
|
|||
|
|||
android:gravity="center" |
|||
android:text="0.0" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!-- 第三行,2个帧布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<!-- 第3行,第1个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="水泵\n频率" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<EditText |
|||
android:id="@+id/Maintv_PumpFrequencyTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:imeOptions="actionDone" |
|||
android:hint="请输入0到10之间的数字" |
|||
android:inputType="numberDecimal" |
|||
|
|||
android:gravity="center" |
|||
android:text="0" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
<!-- 第3行,第2个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="压力\n上限" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<EditText |
|||
android:id="@+id/Maintv_PressLimitTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:imeOptions="actionDone" |
|||
android:hint="请输入0到3000之间的数字" |
|||
android:inputType="number" |
|||
|
|||
android:gravity="center" |
|||
android:text="1" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="N" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
</FrameLayout> |
|||
</LinearLayout> |
|||
|
|||
<!-- 第四行,参数保存--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="0.5" |
|||
android:orientation="horizontal" |
|||
> |
|||
|
|||
|
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_weight="1" |
|||
android:layout_margin="4dp" |
|||
android:layout_height="match_parent" |
|||
android:background="@drawable/blue_rounded_rectangle" |
|||
android:orientation="horizontal"> |
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="停止\n频率" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="12dp" |
|||
android:textStyle="bold" /> |
|||
<EditText |
|||
android:id="@+id/Maintv_PumpStopFrequencyTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:imeOptions="actionDone" |
|||
android:hint="请输入0到10之间的数字" |
|||
android:inputType="number" |
|||
android:gravity="center" |
|||
android:text="0" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_weight="1" |
|||
android:layout_margin="4dp" |
|||
android:background="@drawable/blue_rounded_rectangle" |
|||
android:layout_height="match_parent"> |
|||
<Button |
|||
android:id="@+id/btn_save" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:text="参数保存" |
|||
android:textColor="@color/blue_green" |
|||
android:background="@color/trasnparent" |
|||
android:textStyle="bold"/> |
|||
|
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
|
|||
</LinearLayout> |
|||
<!--摄像头--> |
|||
<LinearLayout |
|||
android:layout_width="400dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_margin="10dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="horizontal" > |
|||
<cn.nodemedia.NodePlayerView |
|||
android:id="@+id/nodePlayerView0" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
</cn.nodemedia.NodePlayerView> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!--摄像头2--> |
|||
<!-- <LinearLayout--> |
|||
<!-- android:layout_width="0dp"--> |
|||
<!-- android:layout_height="match_parent"--> |
|||
<!-- android:layout_weight="2.5"--> |
|||
<!-- android:layout_margin="10dp"--> |
|||
<!-- android:layout_marginHorizontal="4dp"--> |
|||
<!-- android:orientation="horizontal" >--> |
|||
<!-- <cn.nodemedia.NodePlayerView--> |
|||
<!-- android:id="@+id/nodePlayerView5"--> |
|||
<!-- android:layout_width="match_parent"--> |
|||
<!-- android:layout_height="match_parent">--> |
|||
|
|||
<!-- </cn.nodemedia.NodePlayerView>--> |
|||
|
|||
<!-- </LinearLayout>--> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
</HorizontalScrollView> |
|||
|
|||
|
|||
|
|||
<!--报错区显示--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="50dp" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<TextView |
|||
android:layout_width="100dp" |
|||
android:layout_height="40dp" |
|||
android:layout_margin="4dp" |
|||
android:gravity="center" |
|||
android:text="报错信息" |
|||
android:textColor="@color/black" |
|||
android:textStyle="bold"/> |
|||
<TextView |
|||
android:id="@+id/error_text_view" |
|||
android:layout_width="0dp" |
|||
android:layout_height="40dp" |
|||
android:layout_margin="4dp" |
|||
android:gravity="center" |
|||
android:layout_weight="1" |
|||
android:text="无" |
|||
android:textColor="@color/black" |
|||
android:textStyle="bold"/> |
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
</LinearLayout> |
|||
</layout> |
|||
@ -0,0 +1,122 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<layout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools"> |
|||
|
|||
<!--根布局 --> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="vertical" |
|||
> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
android:layout_margin="10dp" |
|||
android:orientation="horizontal" |
|||
> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="1" |
|||
android:layout_marginRight="20dp" |
|||
android:orientation="horizontal" |
|||
android:background="@drawable/paint1_1"> |
|||
<Button |
|||
android:id="@+id/btn_paint" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="1" |
|||
android:background="@color/trasnparent" |
|||
android:textStyle="bold" |
|||
android:gravity="left|top" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15sp" |
|||
android:text="喷漆"/> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="1" |
|||
|
|||
android:orientation="horizontal" |
|||
android:background="@drawable/clean3_1"> |
|||
|
|||
<Button |
|||
android:id="@+id/btn_clean" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="1" |
|||
android:background="@color/trasnparent" |
|||
android:textColor="@color/blue_green" |
|||
android:textStyle="bold" |
|||
android:textSize="15sp" |
|||
android:gravity="left|top" |
|||
android:text="清洗"/> |
|||
|
|||
</LinearLayout> |
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
android:layout_margin="10dp" |
|||
android:orientation="horizontal" |
|||
> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="1" |
|||
android:layout_marginRight="20dp" |
|||
android:orientation="horizontal" |
|||
android:background="@drawable/polish2_1"> |
|||
<Button |
|||
android:id="@+id/btn_polish" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="1" |
|||
android:background="@color/trasnparent" |
|||
android:textStyle="bold" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15sp" |
|||
android:gravity="left|top" |
|||
android:text="打磨"/> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="1" |
|||
|
|||
android:orientation="horizontal" |
|||
android:background="@drawable/thicknessgauge4_1"> |
|||
|
|||
<Button |
|||
android:id="@+id/btn_measure" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="1" |
|||
android:background="@color/trasnparent" |
|||
android:textColor="@color/blue_green" |
|||
android:textStyle="bold" |
|||
android:textSize="15sp" |
|||
android:gravity="left|top" |
|||
android:text="测厚"/> |
|||
|
|||
</LinearLayout> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</LinearLayout> |
|||
</layout> |
|||
@ -0,0 +1,418 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<layout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools"> |
|||
|
|||
<!--根布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:background="@drawable/background" |
|||
android:orientation="vertical"> |
|||
<!-- 第一行,2个帧布局--> |
|||
<TextView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="30dp" |
|||
android:gravity="center" |
|||
android:text="测厚界面" |
|||
android:textColor="@color/blue_green" |
|||
android:textStyle="bold" /> |
|||
|
|||
|
|||
<HorizontalScrollView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
android:scrollbars="horizontal" |
|||
android:fillViewport="true" |
|||
android:scrollbarThumbHorizontal="@drawable/scrollbar_horizontal_thumb" |
|||
> |
|||
|
|||
<!--工作区显示--> |
|||
<LinearLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<!--左侧显示半框--> |
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginVertical="12dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="vertical" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/orange_rounded_rectangle" |
|||
> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
tools:ignore="NestedWeights"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_marginLeft="8dp" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/信号状态" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_signal" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20sp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
> |
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:layout_marginLeft="8dp" |
|||
android:text="@string/moveSpeed" |
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_speedFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="m/min" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_marginLeft="8dp" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/vehicleBodyAttitude" |
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/tvBodyAttitudeFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/realPress" |
|||
android:layout_marginLeft="8dp" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tvPressFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="N" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/Measure" |
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:layout_marginLeft="8dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/tv_MeasureFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="mm" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<!--右侧显示半框--> |
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_weight="2" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginVertical="12dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="vertical" |
|||
> |
|||
|
|||
<!-- 第二行,2个帧布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<!-- 第2行,第1个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="车体\n速度" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<EditText |
|||
android:id="@+id/Maintv_MoveSpeedTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:gravity="center" |
|||
android:hint="请输入0到30之间的数字" |
|||
android:imeOptions="actionDone" |
|||
android:inputType="numberDecimal" |
|||
|
|||
android:text="1.0" |
|||
android:textColor="@color/blue_green" |
|||
android:textCursorDrawable="@drawable/my_cursor" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="m/min" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!-- 第四行,参数保存--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="0.2" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<Button |
|||
android:id="@+id/btn_save" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:text="参数保存" |
|||
android:textColor="@color/blue_green" |
|||
android:background="@color/trasnparent" |
|||
android:textStyle="bold"/> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
<!-- 第五行,2个帧布局--> |
|||
|
|||
|
|||
</LinearLayout> |
|||
<!--摄像头--> |
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2.5" |
|||
android:layout_margin="10dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="horizontal" > |
|||
|
|||
<cn.nodemedia.NodePlayerView |
|||
android:id="@+id/nodePlayerView1" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
</cn.nodemedia.NodePlayerView> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!--摄像头2--> |
|||
<!-- <LinearLayout--> |
|||
<!-- android:layout_width="0dp"--> |
|||
<!-- android:layout_height="match_parent"--> |
|||
<!-- android:layout_weight="2.5"--> |
|||
<!-- android:layout_margin="10dp"--> |
|||
<!-- android:layout_marginHorizontal="4dp"--> |
|||
<!-- android:orientation="horizontal" >--> |
|||
<!-- <cn.nodemedia.NodePlayerView--> |
|||
<!-- android:id="@+id/nodePlayerView6"--> |
|||
<!-- android:layout_width="match_parent"--> |
|||
<!-- android:layout_height="match_parent">--> |
|||
|
|||
<!-- </cn.nodemedia.NodePlayerView>--> |
|||
|
|||
<!-- </LinearLayout>--> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
</HorizontalScrollView> |
|||
|
|||
|
|||
|
|||
|
|||
<!--报错区显示--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="50dp" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<TextView |
|||
android:layout_width="100dp" |
|||
android:layout_height="40dp" |
|||
android:layout_margin="4dp" |
|||
android:gravity="center" |
|||
android:text="报错信息" |
|||
android:textColor="@color/black" |
|||
android:textStyle="bold"/> |
|||
<TextView |
|||
android:id="@+id/error_text_view" |
|||
android:layout_width="0dp" |
|||
android:layout_height="40dp" |
|||
android:layout_margin="4dp" |
|||
android:gravity="center" |
|||
android:layout_weight="1" |
|||
android:text="无" |
|||
android:textColor="@color/black" |
|||
android:textStyle="bold"/> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</LinearLayout> |
|||
</layout> |
|||
@ -0,0 +1,870 @@ |
|||
<layout |
|||
|
|||
xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
tools:context=".PaintActivity"> |
|||
<!--根布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:background="@drawable/background" |
|||
android:orientation="vertical"> |
|||
<!-- 顶部界面标题--> |
|||
|
|||
<TextView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="30dp" |
|||
android:gravity="center" |
|||
android:text="喷漆界面" |
|||
android:textColor="@color/blue_green" |
|||
android:textStyle="bold" /> |
|||
|
|||
<HorizontalScrollView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
android:scrollbars="horizontal" |
|||
android:scrollbarThumbHorizontal="@drawable/scrollbar_horizontal_thumb" |
|||
> |
|||
|
|||
<!--工作区显示--> |
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<!--左侧显示半框--> |
|||
<LinearLayout |
|||
android:layout_width="200dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginVertical="12dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="vertical" |
|||
|
|||
android:background="@drawable/orange_rounded_rectangle" |
|||
> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_marginLeft="8dp" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="状态信息" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="12dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_signal" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
> |
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:layout_marginLeft="8dp" |
|||
android:text="车体速度" |
|||
android:textColor="@color/black" |
|||
android:textSize="12dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_speedFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="m/min" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_marginLeft="8dp" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="车体姿态" |
|||
android:textColor="@color/black" |
|||
android:textSize="12dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/tvBodyAttitudeFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="实时压力" |
|||
android:layout_marginLeft="8dp" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="12dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tvPressFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="N" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="滑台位置" |
|||
android:textColor="@color/black" |
|||
android:textSize="12dp" |
|||
android:layout_marginLeft="8dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/tv_SlidePositionFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="cm" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="滑台速度" |
|||
android:textColor="@color/black" |
|||
android:textSize="12dp" |
|||
android:layout_marginLeft="8dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_SlideSpeedFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="m/min" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="左侧补偿" |
|||
android:layout_marginLeft="8dp" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="12dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_LeftCompensationFrom32Paint" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="右侧补偿" |
|||
android:layout_marginLeft="8dp" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="12dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tvRightCompensationFrom32Paint" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!--右侧显示半框--> |
|||
<LinearLayout |
|||
android:layout_width="400dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginVertical="8dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="vertical" |
|||
|
|||
> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<!-- 第一行,第1个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="79dp" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1.5" |
|||
android:gravity="left|center" |
|||
android:text="@string/OperateMode" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/operateModeDisplay" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="手动作业" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
|
|||
</FrameLayout> |
|||
<!-- 第一行,第2个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1.5" |
|||
android:gravity="left|center" |
|||
android:text="竖直\n补偿" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<!-- android:imeOptions="actionDone" 不会切换下一个文本输入 --> |
|||
<EditText |
|||
android:id="@+id/Maintv_VerticalAdjustTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:imeOptions="actionDone" |
|||
android:hint="请输入-10到10之间的数字" |
|||
android:inputType="numberSigned|numberDecimal" |
|||
android:digits="-0123456789." |
|||
|
|||
|
|||
android:gravity="center" |
|||
android:text="0.0" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
</LinearLayout> |
|||
|
|||
<!-- 第二行,2个帧布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<!-- 第2行,第1个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1.5" |
|||
android:gravity="left|center" |
|||
android:text="车体\n速度" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<EditText |
|||
android:id="@+id/Maintv_MoveSpeedTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:gravity="center" |
|||
android:hint="请输入0到30之间的数字" |
|||
android:imeOptions="actionDone" |
|||
android:inputType="numberDecimal" |
|||
|
|||
android:text="1.0" |
|||
android:textColor="@color/blue_green" |
|||
android:textCursorDrawable="@drawable/my_cursor" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="m/min" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
<!-- 第2行,第2个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<!-- 外层横向 LinearLayout(包裹“后退距离”文本和上下两行输入框) --> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal" |
|||
android:gravity="center_vertical"> |
|||
|
|||
|
|||
<!-- 垂直 LinearLayout:包裹上下两个输入框 --> |
|||
<LinearLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="1" |
|||
android:orientation="vertical" |
|||
android:gravity="center" |
|||
android:layout_gravity="center"> |
|||
|
|||
<!-- 第一行文本框 --> |
|||
<TextView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
android:text="后退距离" |
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" |
|||
android:gravity="left|center" |
|||
android:layout_marginBottom="2dp"/> |
|||
|
|||
<!-- 第二行文本框 --> |
|||
<TextView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
android:text="换道距离" |
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" |
|||
android:gravity="left|center"/> |
|||
|
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="vertical"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<EditText |
|||
android:id="@+id/Maintv_BackDistanceTo32" |
|||
android:layout_width="80dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:gravity="center" |
|||
android:text="5" |
|||
android:hint="请输入0到100之间的数字" |
|||
android:inputType="number" |
|||
android:imeOptions="actionDone" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
</LinearLayout> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<EditText |
|||
android:id="@+id/Maintv_ChangeLaneBackDistanceTo32" |
|||
android:layout_width="80dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:gravity="center" |
|||
android:text="5" |
|||
android:hint="请输入0到100之间的数字" |
|||
android:inputType="number" |
|||
android:imeOptions="actionDone" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
</LinearLayout> |
|||
</LinearLayout> |
|||
<TextView |
|||
android:layout_width="40dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="right|center" |
|||
android:text="cm" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
</FrameLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!-- 第三行,2个帧布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<!-- 第3行,第1个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1.5" |
|||
android:gravity="left|center" |
|||
android:text="滑台\n速度" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<EditText |
|||
android:id="@+id/Maintv_SlideSpeedTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:imeOptions="actionDone" |
|||
android:hint="请输入0到10之间的数字" |
|||
android:inputType="number" |
|||
|
|||
android:gravity="center" |
|||
android:text="1" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="m/min" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
<!-- 第3行,第2个帧布局--> |
|||
<FrameLayout |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="4dp" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1.5" |
|||
android:gravity="left|center" |
|||
android:text="滑台\n距离" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<EditText |
|||
android:id="@+id/Maintv_SlideMoveDistanceTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:imeOptions="actionDone" |
|||
android:hint="请输入0到30之间的数字" |
|||
android:inputType="number" |
|||
|
|||
android:gravity="center" |
|||
android:text="1" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="cm" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
</FrameLayout> |
|||
</LinearLayout> |
|||
|
|||
<!-- 第四行,参数保存--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="0.5" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<Button |
|||
android:id="@+id/btn_save" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:text="参数保存" |
|||
android:textColor="@color/blue_green" |
|||
android:background="@color/trasnparent" |
|||
android:textStyle="bold"/> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<!--摄像头1--> |
|||
<LinearLayout |
|||
android:layout_width="400dp" |
|||
android:layout_height="match_parent" |
|||
|
|||
android:layout_margin="10dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="horizontal" > |
|||
<cn.nodemedia.NodePlayerView |
|||
android:id="@+id/nodePlayerView2" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
</cn.nodemedia.NodePlayerView> |
|||
|
|||
</LinearLayout> |
|||
<!--摄像头2--> |
|||
<!-- <LinearLayout--> |
|||
<!-- android:layout_width="0dp"--> |
|||
<!-- android:layout_height="match_parent"--> |
|||
<!-- android:layout_weight="2.5"--> |
|||
<!-- android:layout_margin="10dp"--> |
|||
<!-- android:layout_marginHorizontal="4dp"--> |
|||
<!-- android:orientation="horizontal" >--> |
|||
<!-- <cn.nodemedia.NodePlayerView--> |
|||
<!-- android:id="@+id/nodePlayerView4"--> |
|||
<!-- android:layout_width="match_parent"--> |
|||
<!-- android:layout_height="match_parent">--> |
|||
|
|||
<!-- </cn.nodemedia.NodePlayerView>--> |
|||
|
|||
<!-- </LinearLayout>--> |
|||
|
|||
|
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</HorizontalScrollView> |
|||
|
|||
|
|||
|
|||
<!--报错区显示--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="50dp" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<TextView |
|||
android:layout_width="100dp" |
|||
android:layout_height="40dp" |
|||
android:layout_margin="4dp" |
|||
android:gravity="center" |
|||
|
|||
android:text="报错信息" |
|||
android:textColor="@color/black" |
|||
android:textStyle="bold"/> |
|||
<TextView |
|||
android:id="@+id/error_text_view" |
|||
android:layout_width="0dp" |
|||
android:layout_height="40dp" |
|||
android:layout_margin="4dp" |
|||
android:gravity="center" |
|||
android:layout_weight="1" |
|||
|
|||
android:text="无" |
|||
android:textColor="@color/black" |
|||
android:textStyle="bold"/> |
|||
|
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
</layout> |
|||
@ -0,0 +1,727 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<layout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools"> |
|||
|
|||
|
|||
|
|||
<!--根布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:background="@drawable/background" |
|||
android:orientation="vertical"> |
|||
<TextView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="30dp" |
|||
android:text="打磨界面" |
|||
android:gravity="center" |
|||
android:textStyle="bold" |
|||
android:textColor="@color/blue_green" |
|||
/> |
|||
|
|||
<HorizontalScrollView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
android:scrollbars="horizontal" |
|||
android:scrollbarThumbHorizontal="@drawable/scrollbar_horizontal_thumb" |
|||
> |
|||
|
|||
<!--工作区显示--> |
|||
<LinearLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
|
|||
android:orientation="horizontal"> |
|||
<!--左侧显示半框--> |
|||
<LinearLayout |
|||
android:layout_width="200dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginVertical="12dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="vertical" |
|||
android:background="@drawable/orange_rounded_rectangle" |
|||
> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_marginLeft="8dp" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/信号状态" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_signal" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20sp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
> |
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:layout_marginLeft="8dp" |
|||
android:text="@string/moveSpeed" |
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_speedFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="m/min" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_marginLeft="8dp" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/vehicleBodyAttitude" |
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/tvBodyAttitudeFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="61dp" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/realPress" |
|||
android:layout_marginLeft="8dp" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tvPressFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="N" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/LeftCompensation" |
|||
android:layout_marginLeft="8dp" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tv_LeftCompensationFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1" |
|||
|
|||
> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/RightCompensation" |
|||
android:layout_marginLeft="8dp" |
|||
|
|||
android:textColor="@color/black" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<TextView |
|||
android:id="@+id/tvRightCompensationFrom32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:gravity="center" |
|||
android:text="xxx" |
|||
android:textColor="@color/navy_blue" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="35dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="10dp" /> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!--右侧显示半框--> |
|||
<LinearLayout |
|||
android:layout_width="400dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginVertical="8dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="vertical" |
|||
> |
|||
|
|||
|
|||
<!-- 第二行,2个帧布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<!-- 第2行,第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_margin="4dp" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="@string/OperateMode" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/operateModeDisplay" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="4" |
|||
android:gravity="center" |
|||
android:text="手动作业" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
<!-- 第二行,第2个帧布局--> |
|||
<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:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:paddingLeft="5dp" |
|||
android:text="@string/ChangeLineDistance" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<EditText |
|||
android:id="@+id/changeLaneDisValue" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:gravity="center" |
|||
android:hint="请输入0到30之间的数字" |
|||
android:imeOptions="actionDone" |
|||
android:inputType="numberDecimal" |
|||
|
|||
android:text="1.0" |
|||
android:textColor="@color/blue_green" |
|||
android:textCursorDrawable="@drawable/my_cursor" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
<EditText |
|||
|
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:gravity="center" |
|||
android:imeOptions="actionDone" |
|||
android:text="cm" |
|||
android:textColor="@color/blue_green" |
|||
android:textCursorDrawable="@drawable/my_cursor" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!-- 第二行,2个帧布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<!-- 第2行,第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_margin="4dp" |
|||
android:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="车体\n速度" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<EditText |
|||
android:id="@+id/Maintv_MoveSpeedTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:gravity="center" |
|||
android:hint="请输入0到30之间的数字" |
|||
android:imeOptions="actionDone" |
|||
android:inputType="numberDecimal" |
|||
|
|||
android:text="1.0" |
|||
android:textColor="@color/blue_green" |
|||
android:textCursorDrawable="@drawable/my_cursor" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="m/min" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
<!-- 第二行,第2个帧布局--> |
|||
<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:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="竖直\n补偿" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<!-- android:imeOptions="actionDone" 不会切换下一个文本输入 --> |
|||
<EditText |
|||
android:id="@+id/Maintv_VerticalAdjustTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:imeOptions="actionDone" |
|||
android:hint="请输入-10到10之间的数字" |
|||
android:inputType="numberSigned|numberDecimal" |
|||
android:digits="-0123456789." |
|||
|
|||
|
|||
android:gravity="center" |
|||
android:text="0.0" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="°" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!-- 第三行,2个帧布局--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="1"> |
|||
<!-- 第3行,第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:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="水平补偿\n开关" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<EditText |
|||
android:id="@+id/Maintv_HCompensationSwitchTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:imeOptions="actionDone" |
|||
android:hint="请输入0到1之间的数字" |
|||
android:inputType="number" |
|||
android:gravity="center" |
|||
android:text="0" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
|
|||
</FrameLayout> |
|||
<!-- 第3行,第2个帧布局--> |
|||
<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:orientation="horizontal"> |
|||
|
|||
<TextView |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="center" |
|||
android:layout_weight="1" |
|||
android:gravity="left|center" |
|||
android:text="压力\n上限" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="15dp" |
|||
android:textStyle="bold" /> |
|||
<EditText |
|||
android:id="@+id/Maintv_PressLimitTo32" |
|||
android:layout_width="0dp" |
|||
android:layout_height="match_parent" |
|||
android:layout_weight="2" |
|||
android:background="@drawable/rounded_edittext" |
|||
android:imeOptions="actionDone" |
|||
android:hint="请输入0到3000之间的数字" |
|||
android:inputType="number" |
|||
|
|||
android:gravity="center" |
|||
android:text="1" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20dp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<TextView |
|||
android:layout_width="50dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:text="N" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="15dp" /> |
|||
|
|||
</LinearLayout> |
|||
|
|||
|
|||
</FrameLayout> |
|||
</LinearLayout> |
|||
|
|||
|
|||
<!-- 第四行,参数保存--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="0.5" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<Button |
|||
android:id="@+id/btn_save" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:text="参数保存" |
|||
android:textColor="@color/blue_green" |
|||
android:background="@color/trasnparent" |
|||
android:textStyle="bold"/> |
|||
</LinearLayout> |
|||
|
|||
<!-- 第五行,2个帧布局--> |
|||
|
|||
|
|||
</LinearLayout> |
|||
|
|||
<!--摄像头--> |
|||
<LinearLayout |
|||
android:layout_width="400dp" |
|||
android:layout_height="match_parent" |
|||
|
|||
android:layout_margin="10dp" |
|||
android:layout_marginHorizontal="4dp" |
|||
android:orientation="horizontal" > |
|||
<cn.nodemedia.NodePlayerView |
|||
android:id="@+id/nodePlayerView3" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
</cn.nodemedia.NodePlayerView> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<!--摄像头2--> |
|||
<!-- <LinearLayout--> |
|||
<!-- android:layout_width="0dp"--> |
|||
<!-- android:layout_height="match_parent"--> |
|||
<!-- android:layout_weight="2.5"--> |
|||
<!-- android:layout_margin="10dp"--> |
|||
<!-- android:layout_marginHorizontal="4dp"--> |
|||
<!-- android:orientation="horizontal" >--> |
|||
<!-- <cn.nodemedia.NodePlayerView--> |
|||
<!-- android:id="@+id/nodePlayerView7"--> |
|||
<!-- android:layout_width="match_parent"--> |
|||
<!-- android:layout_height="match_parent">--> |
|||
|
|||
<!-- </cn.nodemedia.NodePlayerView>--> |
|||
|
|||
<!-- </LinearLayout>--> |
|||
|
|||
</LinearLayout> |
|||
</HorizontalScrollView> |
|||
|
|||
|
|||
|
|||
<!--报错区显示--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="50dp" |
|||
android:background="@drawable/blue_rounded_rectangle"> |
|||
|
|||
<TextView |
|||
android:layout_width="100dp" |
|||
android:layout_height="40dp" |
|||
android:layout_margin="4dp" |
|||
android:gravity="center" |
|||
|
|||
android:text="报错信息" |
|||
android:textColor="@color/black" |
|||
android:textStyle="bold"/> |
|||
<TextView |
|||
android:id="@+id/error_text_view" |
|||
android:layout_width="0dp" |
|||
android:layout_height="40dp" |
|||
android:layout_margin="4dp" |
|||
android:gravity="center" |
|||
android:layout_weight="1" |
|||
|
|||
android:text="无" |
|||
android:textColor="@color/black" |
|||
android:textStyle="bold"/> |
|||
|
|||
</LinearLayout> |
|||
</LinearLayout> |
|||
</layout> |
|||
@ -0,0 +1,141 @@ |
|||
<?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="500dp" |
|||
android:layout_height="360dp" |
|||
android:layout_gravity="center" |
|||
android:background="@color/white" |
|||
android:orientation="vertical" |
|||
tools:ignore="MissingDefaultResource"> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="25dp" |
|||
android:letterSpacing="0.5" |
|||
android:text="操作模式" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="30sp" |
|||
android:textStyle="bold"> |
|||
|
|||
</TextView> |
|||
|
|||
<!--第一行 模式选择--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center|top" |
|||
android:layout_marginTop="10dp" |
|||
android:layout_marginLeft="10dp" |
|||
android:layout_marginRight="10dp" |
|||
android:gravity="center" |
|||
android:orientation="horizontal"> |
|||
<RadioGroup |
|||
android:id="@+id/operateModeCleanSelectorGroup" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="horizontal" > |
|||
|
|||
<RadioButton |
|||
android:id="@+id/rb_cleanone" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:gravity="center" |
|||
android:button="@null" |
|||
android:background="@drawable/radiobutton_background" |
|||
android:textColor="@drawable/radio_button_textcolor" |
|||
android:textStyle="bold" |
|||
android:checked="true" |
|||
android:layout_marginRight="10dp" |
|||
android:padding="10dp" |
|||
android:textSize="30sp" |
|||
android:text="手动作业" /> |
|||
|
|||
<RadioButton |
|||
android:id="@+id/rb_cleantwo" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/radiobutton_background" |
|||
android:button="@null" |
|||
android:gravity="center" |
|||
android:layout_marginRight="10dp" |
|||
android:padding="10dp" |
|||
android:text="竖直作业" |
|||
android:textColor="@drawable/radio_button_textcolor" |
|||
android:textSize="30sp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<RadioButton |
|||
android:id="@+id/rb_cleanthree" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/radiobutton_background" |
|||
android:button="@null" |
|||
|
|||
android:textColor="@drawable/radio_button_textcolor" |
|||
android:gravity="center" |
|||
android:textStyle="bold" |
|||
android:padding="10dp" |
|||
android:textSize="30sp" |
|||
android:text="自动作业" /> |
|||
|
|||
</RadioGroup> |
|||
</LinearLayout> |
|||
|
|||
<!--第二行 确认取消--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="50dp" |
|||
android:layout_gravity="center" |
|||
android:layout_marginTop="80dp" |
|||
android:gravity="center" |
|||
android:orientation="horizontal"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginRight="20dp" |
|||
android:gravity="center" |
|||
android:background="@drawable/borderbluegreen"> |
|||
|
|||
<Button |
|||
android:id="@+id/manualModeCleanApply" |
|||
android:layout_width="200dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:background="@color/trasnparent" |
|||
android:text="确定" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20sp" |
|||
android:textStyle="bold"> |
|||
|
|||
</Button> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:background="@drawable/borderorange"> |
|||
|
|||
<Button |
|||
android:id="@+id/manualModeCleanCancel" |
|||
android:layout_width="200dp" |
|||
android:layout_height="match_parent" |
|||
android:background="@color/trasnparent" |
|||
android:text="取消" |
|||
android:textColor="#ed7041" |
|||
android:textSize="20sp" |
|||
android:textStyle="bold"> |
|||
|
|||
</Button> |
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
|||
@ -0,0 +1,156 @@ |
|||
<?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="500dp" |
|||
android:layout_height="360dp" |
|||
android:layout_gravity="center" |
|||
android:background="@color/white" |
|||
android:orientation="vertical" |
|||
tools:ignore="MissingDefaultResource"> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="25dp" |
|||
android:letterSpacing="0.5" |
|||
android:text="操作模式" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="30sp" |
|||
android:textStyle="bold"> |
|||
|
|||
</TextView> |
|||
|
|||
<!--第一行 模式选择--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center|top" |
|||
android:layout_marginTop="10dp" |
|||
android:layout_marginLeft="10dp" |
|||
android:layout_marginRight="10dp" |
|||
android:gravity="center" |
|||
android:orientation="horizontal"> |
|||
<RadioGroup |
|||
android:id="@+id/operateModePaintSelectorGroup" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="horizontal" > |
|||
|
|||
<RadioButton |
|||
android:id="@+id/rb_paintone" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:gravity="center" |
|||
android:button="@null" |
|||
android:background="@drawable/radiobutton_background" |
|||
android:textColor="@drawable/radio_button_textcolor" |
|||
android:textStyle="bold" |
|||
android:checked="true" |
|||
android:layout_marginRight="10dp" |
|||
android:padding="10dp" |
|||
android:textSize="23sp" |
|||
android:text="手动作业" /> |
|||
|
|||
<RadioButton |
|||
android:id="@+id/rb_painttwo" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/radiobutton_background" |
|||
android:button="@null" |
|||
android:gravity="center" |
|||
android:layout_marginRight="10dp" |
|||
android:padding="10dp" |
|||
android:text="竖直作业" |
|||
android:textColor="@drawable/radio_button_textcolor" |
|||
android:textSize="23sp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<RadioButton |
|||
android:id="@+id/rb_paintthree" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/radiobutton_background" |
|||
android:button="@null" |
|||
|
|||
android:textColor="@drawable/radio_button_textcolor" |
|||
android:gravity="center" |
|||
android:textStyle="bold" |
|||
android:padding="10dp" |
|||
android:textSize="23sp" |
|||
android:text="竖直自动"/> |
|||
|
|||
<RadioButton |
|||
android:id="@+id/rb_paintfour" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/radiobutton_background" |
|||
android:button="@null" |
|||
android:layout_marginLeft="10dp" |
|||
android:textColor="@drawable/radio_button_textcolor" |
|||
android:gravity="center" |
|||
android:textStyle="bold" |
|||
android:padding="10dp" |
|||
android:textSize="23sp" |
|||
android:text="水平自动"/> |
|||
|
|||
</RadioGroup> |
|||
</LinearLayout> |
|||
|
|||
<!--第二行 确认取消--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="50dp" |
|||
android:layout_gravity="center" |
|||
android:layout_marginTop="80dp" |
|||
android:gravity="center" |
|||
android:orientation="horizontal"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginRight="20dp" |
|||
android:gravity="center" |
|||
android:background="@drawable/borderbluegreen"> |
|||
|
|||
<Button |
|||
android:id="@+id/manualModePaintApply" |
|||
android:layout_width="200dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:background="@color/trasnparent" |
|||
android:text="确定" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20sp" |
|||
android:textStyle="bold"> |
|||
|
|||
</Button> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:background="@drawable/borderorange"> |
|||
|
|||
<Button |
|||
android:id="@+id/manualModePaintCancel" |
|||
android:layout_width="200dp" |
|||
android:layout_height="match_parent" |
|||
android:background="@color/trasnparent" |
|||
android:text="取消" |
|||
android:textColor="#ed7041" |
|||
android:textSize="20sp" |
|||
android:textStyle="bold"> |
|||
|
|||
</Button> |
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
|||
|
|||
</LinearLayout> |
|||
@ -0,0 +1,141 @@ |
|||
<?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="500dp" |
|||
android:layout_height="360dp" |
|||
android:layout_gravity="center" |
|||
android:background="@color/white" |
|||
android:orientation="vertical" |
|||
tools:ignore="MissingDefaultResource"> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center" |
|||
android:layout_margin="25dp" |
|||
android:letterSpacing="0.5" |
|||
android:text="操作模式" |
|||
android:textColor="@color/dark_ink_blue" |
|||
android:textSize="30sp" |
|||
android:textStyle="bold"> |
|||
|
|||
</TextView> |
|||
|
|||
<!--第一行 模式选择--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center|top" |
|||
android:layout_marginTop="10dp" |
|||
android:layout_marginLeft="10dp" |
|||
android:layout_marginRight="10dp" |
|||
android:gravity="center" |
|||
android:orientation="horizontal"> |
|||
<RadioGroup |
|||
android:id="@+id/operateModePolishSelectorGroup" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:orientation="horizontal" > |
|||
|
|||
<RadioButton |
|||
android:id="@+id/rb_polishone" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:gravity="center" |
|||
android:button="@null" |
|||
android:background="@drawable/radiobutton_background" |
|||
android:textColor="@drawable/radio_button_textcolor" |
|||
android:textStyle="bold" |
|||
android:checked="true" |
|||
android:layout_marginRight="10dp" |
|||
android:padding="10dp" |
|||
android:textSize="30sp" |
|||
android:text="手动作业" /> |
|||
|
|||
<RadioButton |
|||
android:id="@+id/rb_polishtwo" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/radiobutton_background" |
|||
android:button="@null" |
|||
android:gravity="center" |
|||
android:layout_marginRight="10dp" |
|||
android:padding="10dp" |
|||
android:text="竖直作业" |
|||
android:textColor="@drawable/radio_button_textcolor" |
|||
android:textSize="30sp" |
|||
android:textStyle="bold" /> |
|||
|
|||
<RadioButton |
|||
android:id="@+id/rb_polishthree" |
|||
android:layout_width="0dp" |
|||
android:layout_height="wrap_content" |
|||
android:layout_weight="1" |
|||
android:background="@drawable/radiobutton_background" |
|||
android:button="@null" |
|||
|
|||
android:textColor="@drawable/radio_button_textcolor" |
|||
android:gravity="center" |
|||
android:textStyle="bold" |
|||
android:padding="10dp" |
|||
android:textSize="30sp" |
|||
android:text="水平作业" /> |
|||
|
|||
</RadioGroup> |
|||
</LinearLayout> |
|||
|
|||
<!--第二行 确认取消--> |
|||
<LinearLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="50dp" |
|||
android:layout_gravity="center" |
|||
android:layout_marginTop="80dp" |
|||
android:gravity="center" |
|||
android:orientation="horizontal"> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
android:layout_marginRight="20dp" |
|||
android:gravity="center" |
|||
android:background="@drawable/borderbluegreen"> |
|||
|
|||
<Button |
|||
android:id="@+id/manualModePolishApply" |
|||
android:layout_width="200dp" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:background="@color/trasnparent" |
|||
android:text="确定" |
|||
android:textColor="@color/blue_green" |
|||
android:textSize="20sp" |
|||
android:textStyle="bold"> |
|||
|
|||
</Button> |
|||
|
|||
</LinearLayout> |
|||
|
|||
<LinearLayout |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
android:gravity="center" |
|||
android:background="@drawable/borderorange"> |
|||
|
|||
<Button |
|||
android:id="@+id/manualModePolishCancel" |
|||
android:layout_width="200dp" |
|||
android:layout_height="match_parent" |
|||
android:background="@color/trasnparent" |
|||
android:text="取消" |
|||
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 xmlns:tools="http://schemas.android.com/tools"> |
|||
<!-- Base application theme. --> |
|||
<style name="Theme.RougheningApp" parent="Theme.MaterialComponents.DayNight.NoActionBar"> |
|||
<!-- Primary brand color. --> |
|||
<item name="colorPrimary">@color/blue</item> |
|||
<item name="colorPrimaryVariant">@color/blue</item> |
|||
<item name="colorOnPrimary">@color/white</item> |
|||
<!-- Secondary brand color. --> |
|||
<item name="colorSecondary">@color/aliceblue</item> |
|||
<item name="colorSecondaryVariant">@color/blueviolet</item> |
|||
<item name="colorOnSecondary">@color/black</item> |
|||
<!-- Status bar color. --> |
|||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item> |
|||
<!-- Customize your theme here. --> |
|||
</style> |
|||
</resources> |
|||
@ -0,0 +1,168 @@ |
|||
<?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="gray">#BDBDBD</color> <!-- 灰色 --> |
|||
<color name="colorPrimary">#3F51B5</color><!--首要颜色--> |
|||
<color name="colorPrimaryDark">#303F9F</color><!--首要颜色暗色--> |
|||
<color name="colorAccent">#FF4081</color><!--色彩强调--> |
|||
<!--自定义颜色--> |
|||
<color name="fecal_yellow"> #FBE5D6 </color><!--左侧 屎黄色--> |
|||
<color name="navy_blue">#1F4E79</color> <!--主界面左侧字体 海军蓝 --> |
|||
<color name="sky_blue">#00ACFC</color> <!-- 主界面右侧字体 - 天蓝色 --> |
|||
<color name="very_light_blue">#DEEBF7</color> <!--弹窗确定按钮背景色 浅天蓝色 --> |
|||
<color name="warm_beige">#FBE5D6</color> <!-- 弹窗取消按钮背景色 暖米色 --> |
|||
<color name="orange_red">#FF713D</color> <!-- 取消按钮字体 橙红色 --> |
|||
<color name="deep_blue">#001E54</color> <!-- 弹窗标题颜色- 深暗蓝色 --> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
<color name="dark_ink_blue">#00194d</color><!--摆臂 深蓝黑色--> |
|||
<color name="blue_green">#00ADFC</color> <!--摆臂 蓝绿色--> |
|||
|
|||
<color name="snow">#fffafa</color><!--雪白色 --> |
|||
<color name="floralwhite">#fffaf0</color><!--花白色 --> |
|||
<color name="blanchedalmond">#ffebcd</color><!--杏白色 --> |
|||
<color name="ghostwhite">#f8f8ff</color><!--幽灵白 --> |
|||
<color name="whitesmoke">#f5f5f5</color><!--烟白色 --> |
|||
<color name="antiquewhite">#faebd7</color><!--古董白 --> |
|||
<color name="navajowhite">#ffdead</color><!--纳瓦白 --> |
|||
<color name="grey">#808080</color><!--灰色 --> |
|||
<color name="gainsboro">#dcdcdc</color><!--淡灰色 --> |
|||
<color name="lightgrey">#d3d3d3</color><!--亮灰色 --> |
|||
<color name="darkgrey">#a9a9a9</color><!--暗灰色 --> |
|||
<color name="dimgrey">#696969</color><!--暗灰色 --> |
|||
<color name="slategrey">#708090</color><!--灰石色 --> |
|||
<color name="lightslategrey">#778899</color><!--亮蓝灰 --> |
|||
<color name="darkslategrey">#2f4f4f</color><!--暗瓦灰色 --> |
|||
<color name="silver">#c0c0c0</color><!--银色 --> |
|||
|
|||
<color name="red">#ff0000</color><!--红色 --> |
|||
<color name="darkred">#8b0000</color><!--暗红色 --> |
|||
<color name="crimson">#dc143c</color><!--暗深红色 --> |
|||
<color name="darkmagenta">#8b008b</color><!--暗洋红 --> |
|||
<color name="fuchsia">#ff00ff</color><!--紫红色 --> |
|||
<color name="tomato">#ff6347</color><!--西红柿色 --> |
|||
<color name="lightcoral">#f08080</color><!--亮珊瑚色 --> |
|||
<color name="darksalmon">#e9967a</color><!--暗肉色 --> |
|||
<color name="peachpuff">#ffdab9</color><!--桃色 --> |
|||
<color name="plum">#dda0dd</color><!--洋李色 --> |
|||
<color name="pink">#ffc0cb</color><!--粉红色 --> |
|||
<color name="lightpink">#ffb6c1</color><!--亮粉红色 --> |
|||
<color name="deeppink">#ff1493</color><!--深粉红色 --> |
|||
<color name="hotpink">#ff69b4</color><!--热粉红色 --> |
|||
<color name="lavenderblush">#fff0f5</color><!--淡紫红 --> |
|||
<color name="indianred">#cd5c5c</color><!--印第安红 --> |
|||
<color name="rosybrown">#bc8f8f</color><!--褐玫瑰红 --> |
|||
<color name="firebrick">#b22222</color><!--红砖色 --> |
|||
<color name="maroon">#800000</color><!--粟色 --> |
|||
<color name="honeydew">#f0fff0</color><!--蜜色 --> |
|||
<color name="orangered">#ff4500</color><!--红橙色 --> |
|||
<color name="orange">#ffa500</color><!--橙色 --> |
|||
<color name="limegreen">#32cd32</color><!--橙绿色 --> |
|||
<color name="lime">#00ff00</color><!--酸橙色 --> |
|||
<color name="yellow">#ffff00</color><!--黄色 --> |
|||
<color name="wheat">#f5deb3</color><!--浅黄色 --> |
|||
<color name="khaki">#f0e68c</color><!--黄褐色 --> |
|||
<color name="burlywood">#deb887</color><!--实木色 --> |
|||
<color name="bisque">#ffe4c4</color><!--桔黄色 --> |
|||
<color name="lightyellow">#ffffe0</color><!--亮黄色 --> |
|||
<color name="darkgoldenrod">#b8860b</color><!--暗金黄色 --> |
|||
<color name="darkorange">#ff8c00</color><!--暗桔黄色 --> |
|||
<color name="lightgoldenrodyellow">#fafad2</color><!--亮金黄色 --> |
|||
<color name="lemonchiffon">#fffacd</color><!--柠檬绸色 --> |
|||
<color name="cornsilk">#fff8dc</color><!--米绸色 --> |
|||
<color name="seaShell">#fff5ee</color><!--海贝色 --> |
|||
<color name="papayawhip">#ffefd5</color><!--番木色 --> |
|||
<color name="mistyrose">#ffe4e1</color><!--浅玫瑰色 --> |
|||
<color name="moccasin">#ffe4b5</color><!--鹿皮色 --> |
|||
<color name="ivory">#fffff0</color><!--象牙色 --> |
|||
<color name="gold">#ffd700</color><!--金色 --> |
|||
<color name="goldenrod">#daa520</color><!--金麒麟色 --> |
|||
<color name="lightsalmon">#ffa07a</color><!--亮肉色 --> |
|||
<color name="coral">#ff7f50</color><!--珊瑚色 --> |
|||
<color name="mintcream">#f5fffa</color><!--薄荷色 --> |
|||
<color name="beige">#f5f5dc</color><!--米色 --> |
|||
<color name="sandybrown">#f4a460</color><!--沙褐色 --> |
|||
<color name="oldlace">#fdf5e6</color><!--老花色 --> |
|||
<color name="linen">#faf0e6</color><!--亚麻色 --> |
|||
<color name="salmon">#fa8072</color><!--鲜肉色 --> |
|||
<color name="thistle">#d8bfd8</color><!--蓟色 --> |
|||
<color name="tan">#d2b48c</color><!--茶色 --> |
|||
<color name="chocolate">#d2691e</color><!--巧可力色 --> |
|||
<color name="peru">#cd853f</color><!--秘鲁色 --> |
|||
<color name="darkkhaki">#bdb76b</color><!--暗黄褐色 --> |
|||
<color name="palegoldenrod">#eee8aa</color><!--苍麒麟色 --> |
|||
<color name="brown">#a52a2a</color><!--褐色 --> |
|||
<color name="saddlebrown">#8b4513</color><!--重褐色 --> |
|||
<color name="sienna">#a0522d</color><!--赭色 --> |
|||
<color name="olive">#808000</color><!--橄榄色 --> |
|||
<color name="chartreuse">#7fff00</color><!--黄绿色 --> |
|||
<color name="greenyellow">#adff2f</color><!--黄绿色 --> |
|||
<color name="green">#008000</color><!--绿色 --> |
|||
<color name="darkgreen">#006400</color><!--暗绿色 --> |
|||
<color name="darkolivegreen">#556b2f</color><!--暗橄榄绿 --> |
|||
<color name="olivedrab">#6b8e23</color><!--深绿褐色 --> |
|||
<color name="lawngreen">#7cfc00</color><!--草绿色 --> |
|||
<color name="forestgreen">#228b22</color><!--森林绿 --> |
|||
<color name="aquamarine">#7fffd4</color><!--碧绿色 --> |
|||
<color name="paleturquoise">#afeeee</color><!--苍宝石绿 --> |
|||
<color name="palegreen">#98fb98</color><!--苍绿色 --> |
|||
<color name="mediumturquoise">#48d1cc</color><!--中绿宝石 --> |
|||
<color name="mediumaquamarine">#66cdaa</color><!--中绿色 --> |
|||
<color name="aqua">#00ffff</color><!--浅绿色 --> |
|||
<color name="springgreen">#00ff7f</color><!--春绿色 --> |
|||
<color name="mediumspringgreen">#00fa9a</color><!--中春绿色 --> |
|||
<color name="darkturquoise">#00ced1</color><!--暗宝石绿 --> |
|||
<color name="seagreen">#2e8b57</color><!--海绿色 --> |
|||
<color name="lightgreen">#90ee90</color><!--亮绿色 --> |
|||
<color name="darkseagreen">#8fbc8f</color><!--暗海兰色 --> |
|||
<color name="turquoise">#40e0d0</color><!--青绿色 --> |
|||
<color name="cyan">#00ffff</color><!--青色 --> |
|||
<color name="darkcyan">#008b8b</color><!--暗青色 --> |
|||
<color name="lightcyan">#e0ffff</color><!--亮青色 --> |
|||
<color name="teal">#008080</color><!--水鸭色 --> |
|||
<color name="indigo">#4b0082</color><!--靛青色 --> |
|||
<color name="blue">#0000ff</color><!--蓝色 --> |
|||
<color name="darkblue">#00008b</color><!--暗蓝色 --> |
|||
<color name="mediumblue">#0000cd</color><!--中兰色 --> |
|||
<color name="midnightblue">#191970</color><!--中灰兰色 --> |
|||
<color name="navy">#000080</color><!--海军色 --> |
|||
<color name="royalblue">#4169e1</color><!--皇家蓝 --> |
|||
<color name="azure">#f0ffff</color><!--天蓝色 --> |
|||
<color name="skyblue">#87ceeb</color><!--天蓝色 --> |
|||
<color name="deepskyblue">#00bfff</color><!--深天蓝色 --> |
|||
<color name="lightskyblue">#87cefa</color><!--亮天蓝色 --> |
|||
<color name="lightseagreen">#20b2aa</color><!--亮海蓝色 --> |
|||
<color name="lightblue">#add8e6</color><!--亮蓝色 --> |
|||
<color name="powderblue">#b0e0e6</color><!--粉蓝色 --> |
|||
<color name="aliceblue">#f0f8ff</color><!--艾利斯兰 --> |
|||
<color name="mediumslateblue">#7b68ee</color><!--中暗蓝色 --> |
|||
<color name="slateblue">#6a5acd</color><!--石蓝色 --> |
|||
<color name="darkslateblue">#483d8b</color><!--暗灰蓝色 --> |
|||
<color name="mediumseagreen">#3cb371</color><!--中海蓝 --> |
|||
<color name="steelblue">#4682b4</color><!--钢兰色 --> |
|||
<color name="lightsteelblue">#b0c4de</color><!--亮钢兰色 --> |
|||
<color name="cornflowerblue">#6495ed</color><!--菊兰色 --> |
|||
<color name="dodgerblue">#1e90ff</color><!--闪兰色 --> |
|||
<color name="cadetblue">#5f9ea0</color><!--军兰色 --> |
|||
<color name="blueviolet">#8a2be2</color><!--紫罗兰蓝色 --> |
|||
<color name="purple">#800080</color><!--紫色 --> |
|||
<color name="lavender">#e6e6fa</color><!--淡紫色 --> |
|||
<color name="orchid">#da70d6</color><!--淡紫色 --> |
|||
<color name="mediumpurple">#9370db</color><!--中紫色 --> |
|||
<color name="darkorchid">#9932cc</color><!--暗紫色 --> |
|||
<color name="violet">#ee82ee</color><!--紫罗兰色 --> |
|||
<color name="mediumvioletred">#c71585</color><!--中紫罗兰色 --> |
|||
<color name="palevioletred">#db7093</color><!--苍紫罗兰色 --> |
|||
<color name="darkviolet">#9400d3</color><!--暗紫罗兰色 --> |
|||
<color name="mediumorchid">#ba55d3</color><!--中粉紫色 --> |
|||
<color name="trasnparent">#00000000</color><!--中粉紫色 --> |
|||
|
|||
<color name="bgrgreen">#6efe00</color><!--中粉紫色 --> |
|||
|
|||
|
|||
</resources> |
|||