#
Junjie
1 天以前 28dfce304e4cacf5a339a61c6fdec56dfa9edabf
src/main/webapp/components/MapCanvas.js
@@ -12,6 +12,7 @@
            圈{{ item.loopNo }} |
            站点: {{ item.stationCount || 0 }} |
            任务: {{ item.taskCount || 0 }} |
            手动: {{ item.manualStationCount || 0 }} |
            承载: {{ formatLoadPercent(item.currentLoad) }}
          </div>
        </div>
@@ -76,6 +77,8 @@
      },
      pixiShelfMap: new Map(),
      pixiTrackMap: new Map(),
      pixiCrnTextureMap: new Map(),
      pixiRgvTextureMap: new Map(),
      pixiDevpTextureMap: new Map(),
      pixiCrnColorTextureMap: new Map(),
      pixiDevpTextureMap: new Map(),
@@ -129,6 +132,8 @@
        loopList: [],
        totalStationCount: 0,
        taskStationCount: 0,
        manualStationCount: 0,
        occupiedStationCount: 0,
        currentLoad: 0
      },
      showMapToolPanel: false,
@@ -784,8 +789,7 @@
      });
      this.crnList.forEach((item) => {
        if (this.graphicsCrn == null) { this.graphicsCrn = this.createCrnTexture(item.width * 0.9, item.height * 0.9); }
        let sprite = new PIXI.Sprite(this.graphicsCrn);
        let sprite = this.createCrnSprite(item.width * 0.9, item.height * 0.9);
        const deviceNo = this.getDeviceNo(item.value);
        const taskNo = this.getTaskNo(item.value);
        const style = new PIXI.TextStyle({ fontFamily: 'Arial', fontSize: 12, fill: '#000000', stroke: '#ffffff', strokeThickness: 1 });
@@ -817,8 +821,7 @@
      });
      
      this.dualCrnList.forEach((item) => {
        if (this.graphicsCrn == null) { this.graphicsCrn = this.createCrnTexture(item.width * 0.9, item.height * 0.9); }
        let sprite = new PIXI.Sprite(this.graphicsCrn);
        let sprite = this.createCrnSprite(item.width * 0.9, item.height * 0.9);
        const deviceNo = this.getDeviceNo(item.value);
        const taskNo = this.getTaskNo(item.value);
        const style = new PIXI.TextStyle({ fontFamily: 'Arial', fontSize: 12, fill: '#000000', stroke: '#ffffff', strokeThickness: 1 });
@@ -850,8 +853,7 @@
      });
      
      this.rgvList.forEach((item) => {
        if (this.graphicsRgv == null) { this.graphicsRgv = this.createRgvTexture(item.width * 0.9, item.height * 0.9); }
        let sprite = new PIXI.Sprite(this.graphicsRgv);
        let sprite = this.createRgvSprite(item.width * 0.9, item.height * 0.9);
        const deviceNo = this.getDeviceNo(item.value);
        const taskNo = this.getTaskNo(item.value);
        const style = new PIXI.TextStyle({ fontFamily: 'Arial', fontSize: 12, fill: '#000000', stroke: '#ffffff', strokeThickness: 1 });
@@ -984,6 +986,8 @@
        loopList: loopList,
        totalStationCount: payload.totalStationCount || 0,
        taskStationCount: payload.taskStationCount || 0,
        manualStationCount: payload.manualStationCount || 0,
        occupiedStationCount: payload.occupiedStationCount || 0,
        currentLoad: typeof payload.currentLoad === 'number' ? payload.currentLoad : parseFloat(payload.currentLoad || 0)
      };
      if (this.hoverLoopNo != null) {
@@ -1222,6 +1226,28 @@
      if (texture == undefined) {
        texture = this.createTrackTexture(width, height, trackMask);
        this.pixiTrackMap.set(idx, texture);
      }
      return new PIXI.Sprite(texture);
    },
    createCrnSprite(width, height) {
      const w = Math.max(1, Math.round(width));
      const h = Math.max(1, Math.round(height));
      const key = w + "-" + h;
      let texture = this.pixiCrnTextureMap.get(key);
      if (texture == undefined) {
        texture = this.createCrnTexture(w, h);
        this.pixiCrnTextureMap.set(key, texture);
      }
      return new PIXI.Sprite(texture);
    },
    createRgvSprite(width, height) {
      const w = Math.max(1, Math.round(width));
      const h = Math.max(1, Math.round(height));
      const key = w + "-" + h;
      let texture = this.pixiRgvTextureMap.get(key);
      if (texture == undefined) {
        texture = this.createRgvTexture(w, h);
        this.pixiRgvTextureMap.set(key, texture);
      }
      return new PIXI.Sprite(texture);
    },
@@ -1854,7 +1880,7 @@
        blockedStationId: this.parseStationTaskNo(trace.blockedStationId),
        passedStationIds: this.normalizeTraceStationIds(trace.passedStationIds),
        pendingStationIds: this.normalizeTraceStationIds(trace.pendingStationIds),
        latestAppendedPath: this.normalizeTraceStationIds(trace.latestAppendedPath)
        latestAppendedPath: this.normalizeTraceStationIds(trace.latestIssuedSegmentPath || trace.latestAppendedPath)
      };
    },
    normalizeTraceStationIds(list) {
@@ -2794,9 +2820,6 @@
    }
  }
});