#
Junjie
1 天以前 a0d8732c1d698b25850c0949f7b8967333d67d21
src/main/webapp/components/MapCanvas.js
@@ -77,6 +77,8 @@
      },
      pixiShelfMap: new Map(),
      pixiTrackMap: new Map(),
      pixiCrnTextureMap: new Map(),
      pixiRgvTextureMap: new Map(),
      pixiDevpTextureMap: new Map(),
      pixiCrnColorTextureMap: new Map(),
      pixiDevpTextureMap: new Map(),
@@ -787,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 });
@@ -820,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 });
@@ -853,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 });
@@ -1227,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);
    },
@@ -2799,7 +2820,6 @@
    }
  }
});