Ver código fonte

author:wcq
update:修改启动时锁加载时会过滤掉false的锁板信息的问题,选择全部上报
首页图片修改

wcq 3 anos atrás
pai
commit
fad8097478

+ 7 - 3
app/src/main/java/com/emato/ich/device/DeviceControl.java

@@ -82,9 +82,9 @@ public class DeviceControl {
      * 参数    :section,  port, CmdCallback
      */
     public static void unlockLocker(int section, int port, CmdCallback cmdCallback) {
-        Log.i(TAG, new Date() + "unlockLocker: 打开柜门开始");
+        Log.i(TAG, new Date() + "unlockLocker: 打开柜门开始!锁板id:" + section + "端口:" + port);
         initedInstance.unlockLocker(section, port, cmdCallback);
-        Log.i(TAG, new Date() + "unlockLocker: 打开柜门结束");
+        Log.i(TAG, new Date() + "unlockLocker: 打开柜门结束!锁板id:" + section + "端口:" + port);
     }
 
     /**
@@ -202,6 +202,7 @@ public class DeviceControl {
     public static Cabinet queryCabinetInfo(CountDownLatch countDownLatch) {
         Cabinet cabinet = new Cabinet();
         List<Cabinet.CabinetPlat> lockPlateInfos = new ArrayList<>();
+
         for (int i = 1; i <= 10; i++) {
             queryLockListInfo(i, lockPlateInfos, countDownLatch);
         }
@@ -219,13 +220,16 @@ public class DeviceControl {
         querySection(finalI, (code, data) -> {
             if (code == 0) {
                 String s = Arrays.asList(data).get(0);
+                Log.e(TAG,"querySection 查询信息:" + s);
                 ObjectMapper objectMapper = JacksonUtils.objectmapper;
 
                 JavaType javaType = objectMapper.getTypeFactory().constructParametricType(List.class, Cabinet.CabinetLocker.class);
 
                 try {
                     List<Cabinet.CabinetLocker> lockInfos = objectMapper.readValue(s, javaType);
-                    lockInfos = lockInfos.stream().filter(lockInfo -> lockInfo.getLocked().equals("false")).collect(Collectors.toList());
+                    // 不再过滤锁信息,直接全部入库 后续再一一对应 有用的锁配置大小柜子 无用的锁设置为无效
+                    //lockInfos = lockInfos.stream().filter(lockInfo -> lockInfo.getLocked().equals("false")).collect(Collectors.toList());
+                    //Log.e(TAG,"过滤锁信息后:" + s);
 //                    if (finalI <= 3) {
 //                        lockInfos = lockInfos.stream().filter(lockInfo -> lockInfo.getLocked().equals("false")).collect(Collectors.toList()).subList(0, 12);
 //                    } else if (finalI > 3) {

BIN
app/src/main/res/drawable/top_image2.jpg


BIN
app/src/main/res/drawable/top_image2_bak.jpg


+ 3 - 4
app/src/main/res/layout/content_main.xml

@@ -9,7 +9,6 @@
     android:focusableInTouchMode="true">
 
 
-
     <fragment
         android:id="@+id/nav_host_fragment_content_main"
         android:name="androidx.navigation.fragment.NavHostFragment"
@@ -17,7 +16,7 @@
         android:layout_height="0dp"
         app:defaultNavHost="true"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintHorizontal_bias="0.0"
+        app:layout_constraintHorizontal_bias="1.0"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintTop_toTopOf="parent"
@@ -26,8 +25,8 @@
 
     <ImageView
         android:id="@+id/imageView"
-        android:layout_width="360dp"
-        android:layout_height="280dp"
+        android:layout_width="344dp"
+        android:layout_height="290dp"
         android:scaleType="fitXY"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintHorizontal_bias="0.0"