Browse Source

[Mod 0000] 修改双巷局扇模型的动画展示逻辑

ruienger 3 weeks ago
parent
commit
919b0cd8b3

+ 15 - 6
src/views/vent/monitorManager/fanLocalMonitor/fanLocalDual.threejs.base.ts

@@ -43,7 +43,9 @@ class ModelContext {
    */
   setModelType(modelType: 'inner' | 'outer' | string, data: any[]) {
     const fanOuter1Run = get<string>(data[0], 'Fan1StartStatus', '0') == '1';
+    const fanOuter2Run = get<string>(data[0], 'Fan2StartStatus', '0') == '1';
     const fanInner1Run = get<string>(data[1], 'Fan1StartStatus', '0') == '1';
+    const fanInner2Run = get<string>(data[1], 'Fan2StartStatus', '0') == '1';
     if (modelType === 'inner') {
       this.execute('fanLeftStrong');
     }
@@ -52,15 +54,22 @@ class ModelContext {
     }
     if (fanOuter1Run && fanInner1Run) {
       this.execute('fan1RightOpen&fan1LeftOpen');
-    }
-    if (fanOuter1Run && !fanInner1Run) {
+    } else if (fanOuter1Run && fanInner2Run) {
       this.execute('fan1RightOpen&fan2LeftOpen');
-    }
-    if (!fanOuter1Run && fanInner1Run) {
+    } else if (fanOuter2Run && fanInner1Run) {
       this.execute('fan2RightOpen&fan1LeftOpen');
-    }
-    if (!fanOuter1Run && !fanInner1Run) {
+    } else if (fanOuter2Run && fanInner2Run) {
       this.execute('fan2RightOpen&fan2LeftOpen');
+    } else if (fanOuter1Run) {
+      this.execute('fan1RightOpen');
+    } else if (fanOuter2Run) {
+      this.execute('fan2RightOpen');
+    } else if (fanInner1Run) {
+      this.execute('fan1LeftOpen');
+    } else if (fanInner2Run) {
+      this.execute('fan2LeftOpen');
+    } else {
+      this.stopAnimation(this.elements);
     }
   }