ow-eengine-power 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OW_EEngine_Power.js +2 -2
- package/dist/OW_EEngine_Power.umd.cjs +1 -1
- package/index.d.ts +2 -2
- package/package.json +4 -4
package/dist/OW_EEngine_Power.js
CHANGED
|
@@ -45409,8 +45409,8 @@ function WD(e) {
|
|
|
45409
45409
|
for (let f = 1; f < s.length; f += 3) {
|
|
45410
45410
|
const c = parseFloat(s[f]), h = parseFloat(s[f + 1]), d = parseFloat(s[f + 2]);
|
|
45411
45411
|
if (!isNaN(c) && !isNaN(h) && !isNaN(d)) {
|
|
45412
|
-
const
|
|
45413
|
-
r.push(
|
|
45412
|
+
const m = { timeStep: Math.floor((f - 1) / 3) + 1, x: c, y: h, z: d };
|
|
45413
|
+
r.push(m);
|
|
45414
45414
|
}
|
|
45415
45415
|
}
|
|
45416
45416
|
n.push({
|
|
@@ -6595,4 +6595,4 @@ void main()
|
|
|
6595
6595
|
}
|
|
6596
6596
|
`},translucent:function(){return!0}})}setLineVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=t)}RemoveLineModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.remove(this.dataSource2),this.entityCollection2.show=!1)}}class Fx{constructor(){se(this,"id","");se(this,"name","");se(this,"towerFZinfo","");se(this,"towerDisFile","");se(this,"stressFileContent","");se(this,"TowerMemberColor","#FFFFFF");se(this,"TowerMembersWidth",2);se(this,"Longitude",0);se(this,"Latitude",0);se(this,"Altitude",0);se(this,"RollX",0);se(this,"RollY",90);se(this,"RollZ",0)}}function Mx(e){debugger;const t=e.split(`
|
|
6597
6597
|
`),n=[],i=[],o=/^\s*(\d+)\s+([\d.-]+)\s+([\d.-]+)\s+([\d.-]+)\s+(-?\d+)/,a=/^\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:#|$)/;for(const r of t){const f=r.trim();if(!f)continue;const c=f.match(o);if(c){n.push({id:parseInt(c[1]),x:parseFloat(c[2]),y:parseFloat(c[3]),z:parseFloat(c[4]),flag:parseInt(c[5])});continue}const h=f.match(a);h&&i.push({from:parseInt(h[1]),to:parseInt(h[2]),type:parseInt(h[3])})}return{TowerNodes:n,connections:i}}function Ux(e){const t=e.split(`
|
|
6598
|
-
`),n=[];for(const i of t){if(!i.trim())continue;const o=i.trim().split(/\s+/).filter(f=>f!==""),a=parseInt(o[0]);if(isNaN(a))continue;const r=[];for(let f=1;f<o.length;f+=3){const c=parseFloat(o[f]),h=parseFloat(o[f+1]),d=parseFloat(o[f+2]);if(!isNaN(c)&&!isNaN(h)&&!isNaN(d)){const
|
|
6598
|
+
`),n=[];for(const i of t){if(!i.trim())continue;const o=i.trim().split(/\s+/).filter(f=>f!==""),a=parseInt(o[0]);if(isNaN(a))continue;const r=[];for(let f=1;f<o.length;f+=3){const c=parseFloat(o[f]),h=parseFloat(o[f+1]),d=parseFloat(o[f+2]);if(!isNaN(c)&&!isNaN(h)&&!isNaN(d)){const m={timeStep:Math.floor((f-1)/3)+1,x:c,y:h,z:d};r.push(m)}}n.push({nodeId:a,displacements:r})}return n}function B0(e){const t={};return e.forEach(n=>{n.displacements.forEach(i=>{t[i.timeStep]||(t[i.timeStep]=[]),t[i.timeStep].push({nodeId:n.nodeId,...i})})}),t}class kx{constructor(t,n,i){se(this,"viewer");se(this,"TowerFZS");se(this,"Keym","");se(this,"dataSource2");se(this,"entityCollection2");se(this,"TowerNodes",[]);se(this,"connections",[]);se(this,"displacementData",[]);se(this,"_animationInterval",null);this.Keym=i,this.viewer=t,this.TowerFZS=n,this.dataSource2=new rr(this.TowerFZS.id),this.entityCollection2=this.dataSource2.entities}loadfile(){if(this.Keym!="OW_JPS_EEngin_001")return;const{TowerNodes:t,connections:n}=Mx(this.TowerFZS.towerFZinfo);this.TowerNodes=t,this.connections=n,this.displacementData=Ux(this.TowerFZS.towerDisFile);debugger}loadFZTower(){if(this.Keym!="OW_JPS_EEngin_001")return;let t=new He(S.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const n=u.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(i=>{const o=this.TowerNodes.find(h=>h.id===i.from),a=this.TowerNodes.find(h=>h.id===i.to),r=[],f=new u(o==null?void 0:o.x,o==null?void 0:o.y,o==null?void 0:o.z);r.push(Q(n,f,t)),this.entityCollection2.add(Pa(r[0],(o==null?void 0:o.id)+""));const c=new u(a==null?void 0:a.x,a==null?void 0:a.y,a==null?void 0:a.z);r.push(Q(n,c,t)),this.entityCollection2.add(Pa(r[1],(a==null?void 0:a.id)+"")),this.entityCollection2.add(v(r,i.from+""+i.to,this.TowerFZS.TowerMembersWidth,this.TowerFZS.TowerMemberColor))})}loadFZDISTower(t){if(this.Keym!=="OW_JPS_EEngin_001")return;const i=B0(this.displacementData)[t];debugger;if(!i){console.warn(`未找到时间步 ${t} 的位移数据`);return}const o=new He(S.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ),a=u.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(r=>{const f=this.TowerNodes.find(E=>E.id===r.from),c=this.TowerNodes.find(E=>E.id===r.to);if(!f||!c){console.warn(`找不到连接 ${r.from}->${r.to} 的节点`);return}debugger;const h=i.find(E=>E.nodeId===r.from),d=i.find(E=>E.nodeId===r.to);if(!h||!d){console.warn(`找不到连接 ${r.from}->${r.to} 的位移数据`);return}const p=new u(f.x-h.x,f.y-h.y,f.z-h.z),m=new u(c.x-d.x,c.y-d.y,c.z-d.z),T=Q(a,p,o);this.entityCollection2.add(Pa(T,r.from+""));const y=Q(a,m,o);this.entityCollection2.add(Pa(y,r.to+""));const w=[T,y],A=`${r.from}_${r.to}`;this.entityCollection2.add(v(w,A+t,this.TowerFZS.TowerMembersWidth,"#ffffff"))})}loadFZDISTower1(t){if(this.Keym!="OW_JPS_EEngin_001")return;const n=B0(this.displacementData);let i=new He(S.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const o=u.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(a=>{const r=this.TowerNodes.find(T=>T.id===a.from),f=n[t].find(T=>T.nodeId===a.from),c=this.TowerNodes.find(T=>T.id===a.to),h=n[t].find(T=>T.nodeId===a.to),d=[],p=new u(r.x-f.x,r.y-f.y,r.z-f.z);d.push(Q(o,p,i));const m=new u(c.x-h.x,c.y-h.y,c.z-h.z);d.push(Q(o,m,i));debugger;this.entityCollection2.add(v(d,a.from+""+a.to,this.TowerFZS.TowerMembersWidth,this.TowerFZS.TowerMemberColor))})}loadAllFZDisTower(){if(this.Keym!=="OW_JPS_EEngin_001")return;if(!this.displacementData||this.displacementData.length===0){console.warn("没有可用的位移数据");return}let t=1;const n=this.displacementData.length;this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null);const i=()=>{if(this.viewer.dataSources.contains(this.dataSource2)&&this.viewer.dataSources.remove(this.dataSource2,!0),t>n){t=1;return}this.dataSource2=new rr("fztower"),this.entityCollection2=this.dataSource2.entities;try{this.loadFZDISTower(t),this.loadFZModel(),console.log(`正在显示位移帧: ${t}/${n}`),t++}catch(o){console.error("加载位移帧时出错:",o),this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}};i(),this._animationInterval=setInterval(i,300)}stopDisplacementAnimation(){this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}toggleAnimation(t){t?this.stopDisplacementAnimation():this.loadAllFZDisTower()}loadFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.entities.show)}setFZModelVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=t)}RemoveFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.remove(this.dataSource2),this.entityCollection2.show=!1)}}ot.GUAPoint=Lx,ot.InsulatorInfo=zx,ot.InsulatorType=Ht,ot.LineNum=ar,ot.LineType=P0,ot.OWEEgineFZManager=kx,ot.OWEEgineManager=Nx,ot.PhaseSType=nn,ot.TowerFZInfo=Fx,ot.TowerInfo=Rx,ot.TowerLineInfo=Bx,ot.TowerType=$i,ot.WairnumType=$,ot.drawModel=go,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
export { OWEEgineFZManager } from './lib/OW_EEngine_FZ_Management';
|
|
2
|
+
export { TowerFZInfo } from './lib/OW_EEngine_FZ_Model';
|
|
1
3
|
export { OWEEgineManager } from './lib/OW_EEngine_Management';
|
|
2
4
|
export { drawModel } from './lib/OW_EEngine_DrawModel';
|
|
3
5
|
export { TowerInfo, TowerLineInfo ,InsulatorInfo,GUAPoint,InsulatorType,PhaseSType,TowerType,LineType,LineNum,WairnumType } from './lib/OW_EEngine_Model';
|
|
4
|
-
export { OWEEgineFZManager } from './lib/OW_EEngine_FZ_Management';
|
|
5
|
-
export { TowerFZInfo } from './lib/OW_EEngine_FZ_Model';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ow-eengine-power",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"typescript": "~5.6.3",
|
|
24
24
|
"vite": "^5.4.9",
|
|
25
|
-
"cesium": "^1.111.0"
|
|
26
|
-
|
|
25
|
+
"cesium": "^1.111.0"
|
|
26
|
+
|
|
27
27
|
}
|
|
28
|
-
}
|
|
28
|
+
}
|