| | |
| | | import { Legend } from './Legend'; |
| | | |
| | | const _hMap = { |
| | | 19: [0, 1000], //NO |
| | | 1: [0, 1000], //NO2 |
| | | 2: [0, 2000], //CO |
| | | 3: [0, 1000], //H2S |
| | |
| | | this.factorId; |
| | | this.heights = []; //3d地图当前展示坐标点对应的高度数组 |
| | | this.colors = []; // 3d地图当前展示坐标点对应的颜色数组 |
| | | this.bottomColors = []; //最小值对应的图例色数组 |
| | | this.bottomColor; //最小值对应的图例色 |
| | | this.min = -1; // 当前显示的最小值 |
| | | this.max = -1; // 当前显示的最大值 |
| | |
| | | this.factorName = options.factorName; |
| | | this.factorId = options.factorId; |
| | | this.colors = options.colors; |
| | | this.bottomColors = options.bottomColors; |
| | | this.bottomColor = options.bottomColor; |
| | | this.standardMin = options.standardMin; |
| | | this.standardMax = options.standardMax; |
| | |
| | | this.heights = []; |
| | | this.colors = []; |
| | | this.datas.forEach((d) => { |
| | | var h = getFactorHeight(d.factorId, d.factorData, [this.min, this.max]); |
| | | let h = getFactorHeight(d.factorId, d.factorData, [this.min, this.max]); |
| | | if (d.factorData == -1) { |
| | | h = -1; |
| | | } |
| | | this.heights.push(h); |
| | | var c = Legend.getColor( |
| | | const c = Legend.getColor( |
| | | this.factorName, |
| | | this.legendType, |
| | | d.factorData, |
| | |
| | | this.max |
| | | ); |
| | | this.colors.push(c); |
| | | const b = Legend.getPreviousColor(this.factorName, this.legendType, c); |
| | | this.bottomColors.push(b); |
| | | // this.heights.push(d.factorData) |
| | | }); |
| | | this.bottomColor = Legend.getColor( |
| | |
| | | originMax: this.originMax, |
| | | factorName: this.factorName, |
| | | colors: this.colors, |
| | | bottomColors: this.bottomColors, |
| | | bottomColor: this.bottomColor, |
| | | standardMin: this.standardMin, |
| | | standardMax: this.standardMax |
| | |
| | | if (d1 == undefined || d2 == undefined) { |
| | | return; |
| | | } |
| | | let diffValue = d2.factorData - d1.factorData; |
| | | // 对于风向矢量来说,动画的变化应该从两个风向夹角较小的那一侧进行变化 |
| | | if (this.factorName == 'WIND_DIRECTION') { |
| | | // 风向角度差 |
| | | if (diffValue > 180) { |
| | | diffValue -= 360; |
| | | } else if (diffValue < -180) { |
| | | diffValue += 360; |
| | | } |
| | | } |
| | | // 单帧数据值的差值 |
| | | var dValue = { |
| | | factorData: (d2.factorData - d1.factorData) / count, |
| | | physicalQuantity: (d2.physicalQuantity - d2.physicalQuantity) / count |
| | | const dValue = { |
| | | factorData: diffValue / count |
| | | // physicalQuantity: (d2.physicalQuantity - d2.physicalQuantity) / count |
| | | }; |
| | | |
| | | // 风向矢量修正 |
| | | const correct = (v) => { |
| | | if (this.factorName == 'WIND_DIRECTION') { |
| | | if (v < 0) { |
| | | return 360 + v; |
| | | } else if (v > 360) { |
| | | return v - 360; |
| | | } else { |
| | | return v; |
| | | } |
| | | } else { |
| | | return v; |
| | | } |
| | | }; |
| | | for (let i = 0; i < count - 1; i++) { |
| | | var _data = { |
| | | factorData: d1.factorData + dValue.factorData * (i + 1), |
| | | factorData: correct(d1.factorData + dValue.factorData * (i + 1)), |
| | | factorId: d1.factorId, |
| | | factorName: d1.factorName, |
| | | physicalQuantity: |
| | | d1.physicalQuantity + dValue.physicalQuantity * (i + 1), |
| | | // physicalQuantity: |
| | | // d1.physicalQuantity + dValue.physicalQuantity * (i + 1), |
| | | sensorId: d1.sensorId, |
| | | statusList: d1.statusList |
| | | }; |
| | | if (!isDraw) { |
| | | _data.factorData = -1; |
| | | _data.physicalQuantity = -1; |
| | | // _data.physicalQuantity = -1; |
| | | } |
| | | this.datas.push(_data); |
| | | } |