zhanghaijun лет назад: 2
Родитель
Сommit
5ed847306d

+ 4 - 0
README.md

@@ -5,3 +5,7 @@
 ## 软件架构
 
 软件架构说明
+
+## 仓库地址
+
+- <http://jiecheng2024.tpddns.cn:3000/liyuezong/Mluti-Agent_simulation/src/master/WebModule>

+ 4 - 1
train-server/src/main/java/top/haijunit/train/simulation/train/TrainComputerService.java

@@ -143,6 +143,9 @@ public class TrainComputerService {
         } else if (NumberUtil.isGreaterOrEqual(train.getSpeed(), TrainConstant.SPEED_LIMIT_SBI)) {
             // 速度超过推荐速度 惰性
             train.setAcceleration(TrainConstant.SLOW_DOWN_LIMIT);
+        } else if (NumberUtil.isGreater(train.getSpeed(), new BigDecimal("5.0"))) {
+            // 加速
+            train.setAcceleration(new BigDecimal("0.3"));
         } else {
             // 加速
             train.setAcceleration(TrainConstant.ACCELERATION_LIMIT);
@@ -208,7 +211,7 @@ public class TrainComputerService {
             List<PlatformDoorEntity> doorList = platformDoorRepository.findByStationIdAndDirection(optional.get().getStationId(), train.getDirection());
             for (PlatformDoorEntity entity : doorList) {
                 JSONObject doorData = JSONUtil.createObj();
-                doorData.set(CommandEnum.PLATFORM_DOOR_LOCK.getNameStr(), Convert.toStr(entity.getId(),""));
+                doorData.set(CommandEnum.PLATFORM_DOOR_LOCK.getNameStr(), Convert.toStr(entity.getId(), ""));
                 doorData.set(CommandEnum.PLATFORM_DOOR_LOCK.getStatusStr(), state);
                 TrainWebSocketUtils.sendMessage(CommandEnum.PLATFORM_DOOR_LOCK, doorData);
             }

+ 201 - 91
train-web/src/pages/device/DeviceDoor.vue

@@ -1,118 +1,228 @@
 <template>
   <div class="box">
-    <div class="box-up">
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-    </div>
-    <div class="box-body">
-      <div>
-
+    <template v-for="boxItem in [doorUpList, undefined, stationDown]">
+      <div v-if="!boxItem" class="station-body">
+        <div>
+          <el-table :data="tableData" border style="width: 100%">
+            <el-table-column prop="date" label="状态" />
+            <el-table-column prop="name" label="上行" width="60" />
+            <el-table-column prop="address" label="下行" width="60">
+              <template #default="scope">
+                <el-switch v-model="scope.row.date" />
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div> </div>
+        <div> </div>
       </div>
-      <div>
-
+      <div v-else class="station-box">
+        <div class="station-title">{{ boxItem.name }}</div>
+        <div class="carriage-box" v-for="(carriage, index) in  boxItem.carriage " :key="index">
+          <div class="door-box">
+            <div class="door-item" v-for="(doorItem, doorIndex) in  carriage.doors " :key="doorIndex">
+              <icon-svg :icon-class="doorItem.icon" :color="doorItem.color || '#42BF01'" size="2em" />
+            </div>
+          </div>
+          <div class="carriage-title">{{ carriage.name }}</div>
+        </div>
       </div>
-      <div>
-
-      </div>
-    </div>
-    <div class="box-down">
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="车厢" color="#000" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-      <icon-svg icon-class="屏蔽门" color="#42BF01" size="2em"/>
-    </div>
+    </template>
   </div>
 </template>
+<script setup lang="ts">
+
+interface StationItem {
+  name: string;
+  // 车厢
+  carriage: Array<{
+    name: string;
+    // 屏蔽门
+    doors: Array<{
+      name: string;
+      icon: string;
+      color?: string;
+    }>
+  }>
+}
+const doorUpList = ref<StationItem>({
+  name: "上行",
+  carriage: [
+    {
+      name: '车厢1',
+      doors: [
+        { name: 'XA1-1', icon: '屏蔽门', },
+        { name: 'XA1-2', icon: '屏蔽门', },
+        { name: 'XE01', icon: '车厢', color: "#000" },
+        { name: 'XA1-3', icon: '屏蔽门', },
+        { name: 'XA1-4', icon: '屏蔽门', },
+      ]
+    },
+    {
+      name: '车厢2',
+      doors: [
+        { name: 'XA2-1', icon: '屏蔽门', },
+        { name: 'XA2-2', icon: '屏蔽门', },
+        { name: 'XE02', icon: '车厢', color: "#000" },
+        { name: 'XA2-3', icon: '屏蔽门', },
+        { name: 'XA2-4', icon: '屏蔽门', },
+      ]
+    },
+    {
+      name: '车厢3',
+      doors: [
+        { name: 'XA3-1', icon: '屏蔽门', },
+        { name: 'XA3-2', icon: '屏蔽门', },
+        { name: 'XE03', icon: '车厢', color: "#000" },
+        { name: 'XA3-3', icon: '屏蔽门', },
+        { name: 'XA3-4', icon: '屏蔽门', },
+      ]
+    },
+    {
+      name: '车厢4',
+      doors: [
+        { name: 'XA4-1', icon: '屏蔽门', },
+        { name: 'XA4-2', icon: '屏蔽门', },
+        { name: 'XE04', icon: '车厢', color: "#000" },
+        { name: 'XA4-3', icon: '屏蔽门', },
+        { name: 'XA4-4', icon: '屏蔽门', },
+      ]
+    },
+    {
+      name: '车厢5',
+      doors: [
+        { name: 'XA5-1', icon: '屏蔽门', },
+        { name: 'XA5-2', icon: '屏蔽门', },
+        { name: 'XE05', icon: '车厢', color: "#000" },
+        { name: 'XA5-3', icon: '屏蔽门', },
+        { name: 'XA5-4', icon: '屏蔽门', },
+      ]
+    },
+    {
+      name: '车厢6',
+      doors: [
+        { name: 'XA6-1', icon: '屏蔽门' },
+        { name: 'XA6-2', icon: '屏蔽门', },
+        { name: 'XE06', icon: '车厢', color: "#000" },
+        { name: 'XA6-3', icon: '屏蔽门', },
+        { name: 'XA6-4', icon: '屏蔽门', },
+      ]
+    }
+  ]
+})
+const stationDown = ref<StationItem>({
+  name: "下行",
+  carriage: [
+    {
+      name: '车厢6',
+      doors: [
+        { name: 'SA6-4', icon: '屏蔽门' },
+        { name: 'SA6-3', icon: '屏蔽门' },
+        { name: 'SE06', icon: '车厢', color: "#000" },
+        { name: 'SA6-2', icon: '屏蔽门' },
+        { name: 'SA6-1', icon: '屏蔽门' },
+      ]
+    },
+    {
+      name: '车厢5',
+      doors: [
+        { name: 'SA5-4', icon: '屏蔽门' },
+        { name: 'SA5-3', icon: '屏蔽门' },
+        { name: 'SE05', icon: '车厢', color: "#000" },
+        { name: 'SA5-2', icon: '屏蔽门' },
+        { name: 'SA5-1', icon: '屏蔽门' },
+      ]
+    },
+    {
+      name: '车厢4',
+      doors: [
+        { name: 'SA4-4', icon: '屏蔽门' },
+        { name: 'SA4-3', icon: '屏蔽门' },
+        { name: 'SE04', icon: '车厢', color: "#000" },
+        { name: 'SA4-2', icon: '屏蔽门' },
+        { name: 'SA4-1', icon: '屏蔽门' },
+      ]
+    },
+    {
+      name: '车厢3',
+      doors: [
+        { name: 'SA3-4', icon: '屏蔽门' },
+        { name: 'SA3-3', icon: '屏蔽门' },
+        { name: 'SE03', icon: '车厢', color: "#000" },
+        { name: 'SA3-2', icon: '屏蔽门' },
+        { name: 'SA3-1', icon: '屏蔽门' },
+      ]
+    },
+    {
+      name: '车厢2',
+      doors: [
+        { name: 'SA2-4', icon: '屏蔽门' },
+        { name: 'SA2-3', icon: '屏蔽门' },
+        { name: 'SE02', icon: '车厢', color: "#000" },
+        { name: 'SA2-2', icon: '屏蔽门' },
+        { name: 'SA2-1', icon: '屏蔽门' },
+      ]
+    },
+    {
+      name: '车厢1',
+      doors: [
+        { name: 'SA1-4', icon: '屏蔽门' },
+        { name: 'SA1-3', icon: '屏蔽门' },
+        { name: 'SE01', icon: '车厢', color: "#000" },
+        { name: 'SA1-2', icon: '屏蔽门' },
+        { name: 'SA1-1', icon: '屏蔽门' },
+      ]
+    }
+  ]
+});
+// 表格
+const tableData = []
+
+</script>
 <style scoped lang="scss">
 .box {
   width: 100%;
   height: 80vh;
   background-color: #A7C0DF;
   border: 1px solid rgba(0, 0, 0, 0.98);
+  padding-top: 60px;
 
-  .box-up, .box-down {
+  .station-box {
     display: flex;
+    flex-direction: row;
     justify-content: center;
-  }
+    align-items: center;
+
+    .station-title {
+      padding-right: 10px;
+    }
+
+    .carriage-box {
+      display: flex;
+      flex-direction: column;
 
-  .box-up {
-    margin-top: 10vh;
+      .carriage-title {
+        border: 1px solid #fff;
+        border-radius: 60px;
+        text-align: center;
+        font-size: 13px;
+      }
+
+      .door-box {
+        display: flex;
+        flex-direction: row;
+      }
+    }
   }
 
-  .box-body {
+  .station-body {
     width: 100%;
     height: 35vh;
     margin: 5vh 0;
     display: flex;
     justify-content: space-evenly;
 
-    > div {
+    >div {
       width: 30vh;
       border: 1px solid rgba(0, 0, 0, 0.98);
     }

+ 112 - 8
train-web/src/pages/device/DeviceWater.vue

@@ -1,16 +1,90 @@
 <template>
   <div class="box">
-    <img :src="pump_normal" alt="" width="80" height="110" />
-    <img :src="pump_failed" alt="" width="80" height="110" />
-    <img :src="pool_low" alt="" width="80" height="110" />
-    <img :src="pool_high" alt="" width="80" height="110" />
+    <div class="region-box" v-for="(item, index) in poolList" :key="index">
+      <div class="region-title">{{ item.name }}</div>
+      <div class="region-pool">
+        <div v-for="(poolItem, poolIndex) in item.pools" :key="poolIndex"
+          style="display: flex;flex-direction: column;align-items: center;">
+          <div class="pool-box">
+            <div v-for="(pumpItem, pumpIndex) in poolItem.pumpItem" :key="pumpIndex"
+              style="display: flex;flex-direction: column;align-items: center;">
+              <div>{{ pumpItem.name }}</div>
+              <img :src="pumpItem.img" alt="" width="70" height="90" />
+            </div>
+          </div>
+          <div>{{ poolItem.name }}</div>
+        </div>
+      </div>
+    </div>
   </div>
 </template>
 <script setup lang="ts">
-import pump_normal from '@/assets/images/蒸发式水泵运行.png'
-import pump_failed from '@/assets/images/蒸发式水泵通讯故障.png'
-import pool_low from '@/assets/images/给排水水箱水位低.png'
-import pool_high from '@/assets/images/给排水水箱水位高.png'
+import pump_normal from '@/assets/images/FSB水泵故障.png'
+
+
+interface RegionPumpItem {
+  name: string,
+  pools: Array<{
+    name: string;
+    pumpItem: Array<{ name: string; img: string; }>;
+  }>
+}
+
+const poolList = ref<RegionPumpItem[]>([
+  {
+    name: "A端",
+    pools: [
+      {
+        name: "雨水泵JBP-1,2 1号出入口", pumpItem: [
+          { name: "A泵", img: pump_normal },
+          { name: "B泵", img: pump_normal }
+        ]
+      },
+      {
+        name: "雨水泵JBP-3,4 2号出入口", pumpItem: [
+          { name: "A泵", img: pump_normal },
+          { name: "B泵", img: pump_normal }
+        ]
+      }
+    ]
+  },
+  {
+    name: "A端",
+    pools: [
+      {
+        name: "车站废水泵FSB-1,2 站台层废水泵房", pumpItem: [
+          { name: "A泵", img: pump_normal },
+          { name: "B泵", img: pump_normal }
+        ]
+      },
+      {
+        name: "车站废水泵WSB-1,2 站台层废水泵房", pumpItem: [
+          { name: "A泵", img: pump_normal },
+          { name: "B泵", img: pump_normal }
+        ]
+      },
+      {
+        name: "排水泵JBP-7/8 1号活塞风道", pumpItem: [
+          { name: "A泵", img: pump_normal },
+          { name: "B泵", img: pump_normal }
+        ]
+      },
+      {
+        name: "排水泵JBP-11/12 3号风道新风井", pumpItem: [
+          { name: "A泵", img: pump_normal },
+          { name: "B泵", img: pump_normal }
+        ]
+      },
+      {
+        name: "潜水泵JBP-15/16 3号风道表冷器", pumpItem: [
+          { name: "A泵", img: pump_normal },
+          { name: "B泵", img: pump_normal }
+        ]
+      }
+    ]
+  },
+
+]);
 
 
 
@@ -23,5 +97,35 @@ import pool_high from '@/assets/images/给排水水箱水位高.png'
   background-color: #A7C0DF;
   border: 1px solid rgba(0, 0, 0, 0.98);
   padding: 10px 10px;
+
+  .region-box {
+    display: flex;
+    flex-direction: row;
+    flex-wrap: nowrap;
+
+    .region-title {
+      width: 60px;
+      text-align: right;
+      margin-top: 30px;
+    }
+
+    .region-pool {
+      flex: 1;
+      display: grid;
+      grid-template-columns: 1fr 1fr 1fr 1fr;
+    }
+  }
+}
+
+.pool-box {
+  width: 260px;
+  height: 150px;
+  margin-top: 30px;
+  border-left: 20px solid #D3D5D7;
+  border-right: 20px solid #D3D5D7;
+  border-bottom: 20px solid #D3D5D7;
+  display: flex;
+  justify-content: space-around;
+  background: linear-gradient(to bottom, #A7C0DF 50%, #C3E9EC 50%);
 }
 </style>

+ 1 - 1
train-web/src/pages/train/controller/DrewTrain.ts

@@ -41,7 +41,7 @@ export class DrewTrain {
           this.draw(switchItem.kilometer + x, this.line_down - y, train);
           break;
         case 3:
-          this.draw(switchItem.kilometer - x, this.line_down - y, train);
+          this.draw(switchItem.kilometer - x2, this.line_up - y2, train);
           break;
         case 4:
           this.draw(switchItem.kilometer - x2, this.line_up + y2, train);

+ 0 - 1
train-web/src/types/auto-imports.d.ts

@@ -6,7 +6,6 @@
 export {}
 declare global {
   const EffectScope: typeof import('vue')['EffectScope']
-  const ElNotification: typeof import('element-plus/es')['ElNotification']
   const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
   const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
   const autoResetRef: typeof import('@vueuse/core')['autoResetRef']

+ 1 - 0
train-web/src/types/components.d.ts

@@ -22,6 +22,7 @@ declare module 'vue' {
     ElRadio: typeof import('element-plus/es')['ElRadio']
     ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElSelect: typeof import('element-plus/es')['ElSelect']
+    ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
     ElTabPane: typeof import('element-plus/es')['ElTabPane']