|
|
@@ -1,168 +1,303 @@
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
xmlns:tools="http://schemas.android.com/tools"
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="match_parent"
|
|
|
- tools:context=".MainActivity"
|
|
|
- tools:ignore="MissingDefaultResource">
|
|
|
+ android:orientation="vertical"
|
|
|
+ tools:context=".MainActivity">
|
|
|
|
|
|
- <TextView
|
|
|
- android:id="@+id/recvView"
|
|
|
+ <RelativeLayout
|
|
|
android:layout_width="match_parent"
|
|
|
- android:background="@color/colorAccent"
|
|
|
- android:layout_height="300dp"
|
|
|
- android:layout_alignParentStart="true"
|
|
|
- android:layout_alignParentTop="true" />
|
|
|
- <Button
|
|
|
- android:id="@+id/sale"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/sale"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_below="@+id/recvView"
|
|
|
- android:layout_marginStart="50dp"
|
|
|
- android:layout_marginTop="30dp"
|
|
|
- />
|
|
|
-
|
|
|
- <Button
|
|
|
- android:id="@+id/getVersion"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/version"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_below="@+id/recvView"
|
|
|
- android:layout_marginTop="30dp"
|
|
|
- android:layout_toEndOf="@+id/sale"
|
|
|
- android:layout_marginStart="20dp"/>
|
|
|
-
|
|
|
- <Button
|
|
|
- android:id="@+id/getTemp"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/gettemp"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_below="@+id/sale"
|
|
|
- android:layout_marginStart="50dp"
|
|
|
- android:layout_marginTop="30dp"
|
|
|
- />
|
|
|
- <Button
|
|
|
- android:id="@+id/reboot"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/reboot"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_below="@+id/getVersion"
|
|
|
- android:layout_toEndOf="@id/getTemp"
|
|
|
- android:layout_marginStart="20dp"
|
|
|
- android:layout_marginTop="30dp"/>
|
|
|
-
|
|
|
- <Button
|
|
|
- android:id="@+id/setTemp"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/settemp"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_below="@id/getTemp"
|
|
|
- android:layout_marginTop="30dp"
|
|
|
- android:layout_marginStart="50dp" />
|
|
|
-
|
|
|
- <EditText
|
|
|
- android:id="@+id/editTemp"
|
|
|
- android:layout_width="88dp"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_marginStart="20dp"
|
|
|
- android:layout_toEndOf="@id/setTemp"
|
|
|
- android:layout_below="@id/reboot"
|
|
|
- android:layout_marginTop="30dp"
|
|
|
- />
|
|
|
-
|
|
|
- <Button
|
|
|
- android:id="@+id/startDownload"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/startdownload"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_below="@+id/recvView"
|
|
|
- android:layout_marginStart="20dp"
|
|
|
- android:layout_toEndOf="@id/reboot"
|
|
|
- android:layout_marginTop="30dp"/>
|
|
|
-
|
|
|
- <Button
|
|
|
- android:id="@+id/firmwareTransfer"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/content"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_marginTop="30dp"
|
|
|
- android:layout_below="@id/startDownload"
|
|
|
- android:layout_toEndOf="@id/reboot"
|
|
|
- android:layout_marginStart="20dp"/>
|
|
|
-
|
|
|
- <Button
|
|
|
- android:id="@+id/stopDownload"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/stopdownload"
|
|
|
- android:layout_below="@id/firmwareTransfer"
|
|
|
- android:layout_marginTop="30dp"
|
|
|
- android:layout_toEndOf="@id/editTemp"
|
|
|
- android:layout_marginStart="20dp"
|
|
|
- />
|
|
|
-
|
|
|
- <Button
|
|
|
- android:id="@+id/getRealWeight"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/getRealWeight"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_marginStart="50dp"
|
|
|
- android:layout_below="@id/setTemp"
|
|
|
- android:layout_marginTop="30dp" />
|
|
|
-
|
|
|
- <Button
|
|
|
- android:id="@+id/clearStandard"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/clearStandard"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_below="@id/editTemp"
|
|
|
- android:layout_marginStart="20dp"
|
|
|
- android:layout_marginTop="30dp"
|
|
|
- android:layout_toEndOf="@id/getRealWeight"
|
|
|
- />
|
|
|
-
|
|
|
- <Button
|
|
|
- android:id="@+id/setZero"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/setZero"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_below="@id/stopDownload"
|
|
|
- android:layout_centerVertical="true"
|
|
|
- android:layout_marginStart="20dp"
|
|
|
- android:layout_marginTop="30dp"
|
|
|
- android:layout_toEndOf="@id/clearStandard"
|
|
|
- />
|
|
|
-
|
|
|
- <Button
|
|
|
- android:id="@+id/setThreshold"
|
|
|
- android:background="#009688"
|
|
|
- android:text="@string/setThreshold"
|
|
|
- android:layout_width="wrap_content"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_marginStart="50dp"
|
|
|
- android:layout_below="@id/getRealWeight"
|
|
|
- android:layout_marginTop="30dp" />
|
|
|
- <EditText
|
|
|
- android:id="@+id/editThreshold"
|
|
|
- android:layout_width="88dp"
|
|
|
- android:inputType="numberDecimal"
|
|
|
- android:layout_height="wrap_content"
|
|
|
- android:layout_below="@id/getRealWeight"
|
|
|
- android:layout_marginStart="20dp"
|
|
|
- android:layout_marginTop="30dp"
|
|
|
- android:layout_toEndOf="@id/setTemp" />
|
|
|
-
|
|
|
-
|
|
|
-</RelativeLayout>
|
|
|
+ android:layout_height="0dp"
|
|
|
+ android:layout_weight="1.2"
|
|
|
+ android:background="@color/holo_blue_light"
|
|
|
+ >
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:background="@color/white"
|
|
|
+ android:id="@+id/logview"
|
|
|
+ android:layout_marginTop="10dp"
|
|
|
+ android:layout_marginStart="0dp"
|
|
|
+ >
|
|
|
+ <TextView
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:layout_marginStart="10dp"
|
|
|
+ android:layout_marginEnd="10dp"
|
|
|
+ android:layout_marginTop="5dp"
|
|
|
+ android:layout_marginBottom="5dp"
|
|
|
+ android:textColor="@color/black"
|
|
|
+ android:textSize="30sp"
|
|
|
+ android:text="日志">
|
|
|
+ </TextView>
|
|
|
+ </LinearLayout>
|
|
|
+
|
|
|
+ <RelativeLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:layout_marginStart="100dp"
|
|
|
+ android:layout_marginEnd="100dp"
|
|
|
+ android:layout_marginTop="60dp"
|
|
|
+ android:layout_marginBottom="30dp"
|
|
|
+ android:gravity="center"
|
|
|
+ >
|
|
|
+ <RelativeLayout
|
|
|
+ android:id="@+id/logLayout"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:fadeScrollbars="false"
|
|
|
+ android:scrollbars="vertical"
|
|
|
+ android:gravity="center"
|
|
|
+ android:textColor="#000000"
|
|
|
+ android:textSize="80sp"
|
|
|
+ android:background="@drawable/bg_account_shape">
|
|
|
+ <ListView
|
|
|
+ android:id="@+id/listLog"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:stackFromBottom="false"
|
|
|
+ android:transcriptMode="alwaysScroll"
|
|
|
+ android:visibility="invisible"
|
|
|
+ >
|
|
|
+
|
|
|
+ </ListView>
|
|
|
+
|
|
|
+ </RelativeLayout>
|
|
|
+ </RelativeLayout>
|
|
|
+ </RelativeLayout>
|
|
|
+
|
|
|
+ <RelativeLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:background="@color/holo_blue_light"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:layout_height="0dp"
|
|
|
+
|
|
|
+ >
|
|
|
+ <LinearLayout
|
|
|
+ android:id="@+id/controlView"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:background="@color/white"
|
|
|
+ android:layout_marginTop="10dp"
|
|
|
+ android:layout_marginStart="0dp"
|
|
|
+ >
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_marginStart="10dp"
|
|
|
+ android:layout_marginEnd="10dp"
|
|
|
+ android:layout_marginTop="5dp"
|
|
|
+ android:layout_marginBottom="5dp"
|
|
|
+ android:textSize="30sp"
|
|
|
+ android:textColor="@color/black"
|
|
|
+ android:text="控制"
|
|
|
+ >
|
|
|
+ </TextView>
|
|
|
+
|
|
|
+ </LinearLayout>
|
|
|
+
|
|
|
+ <RelativeLayout
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_below="@+id/controlView"
|
|
|
+ android:layout_marginTop="40dp"
|
|
|
+ >
|
|
|
+ <TextView
|
|
|
+ android:id="@+id/tempText"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_marginStart="0dp"
|
|
|
+ android:textColor="@color/black"
|
|
|
+ android:textSize="30sp"
|
|
|
+ android:text="温度:">
|
|
|
+ </TextView>
|
|
|
+ <TextView
|
|
|
+ android:id="@+id/temp"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_toEndOf="@+id/tempText"
|
|
|
+ android:layout_marginStart="10dp"
|
|
|
+ android:textColor="@color/black"
|
|
|
+ android:textSize="30sp"
|
|
|
+ android:text="0.0"/>
|
|
|
+ </RelativeLayout>
|
|
|
+ <RelativeLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:gravity="center"
|
|
|
+ >
|
|
|
+ <RelativeLayout
|
|
|
+ android:id="@+id/operate"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_marginStart="150dp"
|
|
|
+ android:layout_marginEnd="150dp"
|
|
|
+ android:background="@drawable/bg_account_shape"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:gravity="center"
|
|
|
+ android:layout_centerVertical="true">
|
|
|
+ <Spinner
|
|
|
+ android:id="@+id/serial"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_marginTop="0dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ style="@style/Spinner"
|
|
|
+ android:gravity="center"
|
|
|
+ android:background="@drawable/bg_spin_normal"
|
|
|
+ />
|
|
|
+ <Spinner
|
|
|
+ android:id="@+id/baute"
|
|
|
+ android:gravity="center"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:layout_marginTop="0dp"
|
|
|
+ android:layout_toEndOf="@id/serial"
|
|
|
+ android:background="@drawable/bg_spin_normal"
|
|
|
+ style="@style/Spinner"
|
|
|
+ android:layout_marginStart="40dp" />
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/openSerial"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ android:text="@string/openserial"
|
|
|
+ android:layout_marginTop="0dp"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:layout_toEndOf="@id/baute"
|
|
|
+ android:layout_marginStart="40dp"
|
|
|
+ android:textSize="20sp"
|
|
|
+ />
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/closeSerial"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ android:text="@string/closeSerial"
|
|
|
+ android:layout_marginTop="0dp"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:layout_toEndOf="@id/baute"
|
|
|
+ android:layout_marginStart="40dp"
|
|
|
+ android:visibility="invisible"
|
|
|
+ android:textSize="20sp"
|
|
|
+ />
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/clearLog"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ android:text="@string/clearLog"
|
|
|
+ android:layout_marginTop="0dp"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:layout_toEndOf="@id/openSerial"
|
|
|
+ android:layout_marginStart="40dp"
|
|
|
+ android:textSize="20sp"
|
|
|
+ />
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/setAddr"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ android:text="设备配置"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:layout_below="@+id/serial"
|
|
|
+ android:layout_marginTop="40dp"
|
|
|
+ android:textSize="20sp"
|
|
|
+ />
|
|
|
+
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/readAddr"
|
|
|
+ android:text="设备地址"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:layout_below="@id/setAddr"
|
|
|
+ android:textSize="20sp"
|
|
|
+ android:layout_marginTop="40dp"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ />
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/motoTest"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ android:text="电机测试"
|
|
|
+ android:layout_marginTop="40dp"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:layout_toEndOf="@+id/readAddr"
|
|
|
+ android:layout_below="@id/baute"
|
|
|
+ android:textSize="20sp"
|
|
|
+ android:layout_marginStart="40dp"/>
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/motoStart"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ android:text="电机启动"
|
|
|
+ android:layout_marginTop="40dp"
|
|
|
+ android:layout_below="@+id/baute"
|
|
|
+ android:layout_toEndOf="@+id/motoTest"
|
|
|
+ android:layout_marginStart="40dp"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:textSize="20sp"
|
|
|
+ />
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/querySerial"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ android:text="序列号"
|
|
|
+ android:layout_marginTop="40dp"
|
|
|
+ android:layout_below="@+id/baute"
|
|
|
+ android:layout_toEndOf="@+id/motoStart"
|
|
|
+ android:layout_marginStart="40dp"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:textSize="20sp"
|
|
|
+ />
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/queryStatus"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ android:text="执行状态"
|
|
|
+ android:layout_marginTop="40dp"
|
|
|
+ android:layout_below="@+id/setAddr"
|
|
|
+ android:layout_toEndOf="@+id/readAddr"
|
|
|
+ android:layout_marginStart="40dp"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:textSize="20sp"
|
|
|
+ />
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/controlIn"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ android:text="开关量输入"
|
|
|
+ android:layout_marginTop="40dp"
|
|
|
+ android:layout_below="@+id/setAddr"
|
|
|
+ android:layout_toEndOf="@+id/queryStatus"
|
|
|
+ android:layout_marginStart="40dp"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:textSize="20sp"
|
|
|
+ />
|
|
|
+
|
|
|
+ <Button
|
|
|
+ android:id="@+id/controlOut"
|
|
|
+ android:background="@drawable/bg_btn_button"
|
|
|
+ android:text="开关量输出"
|
|
|
+ android:layout_marginTop="40dp"
|
|
|
+ android:layout_below="@+id/setAddr"
|
|
|
+ android:layout_toEndOf="@+id/controlIn"
|
|
|
+ android:layout_marginStart="40dp"
|
|
|
+ android:layout_width="150dp"
|
|
|
+ android:layout_height="70dp"
|
|
|
+ android:textSize="20sp"
|
|
|
+ />
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </RelativeLayout>
|
|
|
+ </RelativeLayout>
|
|
|
+ </RelativeLayout>
|
|
|
+
|
|
|
+
|
|
|
+</LinearLayout>
|