Browse Source

增加小车002

cjb 2 weeks ago
parent
commit
9a872119ed

+ 12 - 0
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -49,6 +49,18 @@ export default class CommonConstants {
     {
       id: 1,
       robotCode: 'rgv1',
+      robotNo:'RGV-001',
+      storageId: 1,
+      robotType: 2,
+      robotToward: 2,
+      x: 1,
+      y: 1,
+      lastSelfCheck: '2024/02/16 11:11:34'
+    } as RobotInfo,
+    {
+      id: 2,
+      robotCode: 'rgv2',
+      robotNo:'RGV-002',
       storageId: 1,
       robotType: 2,
       robotToward: 2,

+ 8 - 4
entry/src/main/ets/pages/Menu.ets

@@ -149,15 +149,19 @@ struct menu {
     const checkInterval = setInterval(() => {
       if (CommonConstants.AUTH_TOKEN!='') {
         clearInterval(checkInterval);  // 停止轮询
-        setTimeout(() => {
-          this.connectMQTT();
-        }, 1000);
         return
       }
       this.loginWms();
     }, 2000); // 每500毫秒检查一次
+    const checkInterval2 = setInterval(() => {
+      if (this.isConnected) {
+        clearInterval(checkInterval2); // 停止轮询
+        return
+      }
+        this.connectMQTT()
+    }, 1000);
 
-   // this.loginWms();
+    // this.loginWms();
 
     // 查询数据字典放到CommonConstants的DICT_DATA变量中
     // let res: DictInfo[] = await WmsRequest.post('/api/v1/sys/dictData/all',)

+ 2 - 2
entry/src/main/ets/pages/RgvControl.ets

@@ -497,7 +497,7 @@ struct RgvControl {
                   .onClick(()=>{
                     this.settingPositionDialog.open();
                   })
-                Text('设置小车位置')
+                Text(`设置小车位置`)
                   .fontColor($r('app.color.FFFFFF'))
                   .fontSize($r('app.float.fontSize_16'))
               }
@@ -510,7 +510,7 @@ struct RgvControl {
             Column({space:10}){
               InfoRow({
                 label:"编号:",
-                value:"DF441AS114F5555",
+                value:this.robotsList[this.selectRobotIndex].robotNo,
               })
               InfoRow({
                 label:"状态:",

+ 1 - 0
entry/src/main/ets/viewmodel/wms/rgv/RobotsParam.ets

@@ -17,6 +17,7 @@ export  class RobotInfo {
   // 上次自检日期
   lastSelfCheck? : string
   robotId?:number
+  robotNo?:string
   checkName?:string
   checkTime?:string
   checkStatus?:number

BIN
entry/src/main/resources/base/media/rgv_001.png