ow-eengine-power 2.8.2 → 2.8.6

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.
@@ -1,11 +1,9 @@
1
- (function(Z,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("cesium")):typeof define=="function"&&define.amd?define(["exports","cesium"],V):(Z=typeof globalThis<"u"?globalThis:Z||self,V(Z.OW_EEngine_Power={},Z.Cesium))})(this,function(Z,V){"use strict";var Us=Object.defineProperty;var Js=(Z,V,Lt)=>V in Z?Us(Z,V,{enumerable:!0,configurable:!0,writable:!0,value:Lt}):Z[V]=Lt;var w=(Z,V,Lt)=>Js(Z,typeof V!="symbol"?V+"":V,Lt);function Lt(h){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const s in h)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(h,s);Object.defineProperty(e,s,r.get?r:{enumerable:!0,get:()=>h[s]})}}return e.default=h,Object.freeze(e)}const f=Lt(V);function De(h,e,s={}){const{color:r=V.Color.WHITE,width:t=3,clampToGround:a=!1,zIndex:n=0,dashed:W=!1,dashLength:u=10}=s,c=W?new f.PolylineDashMaterialProperty({color:r,dashLength:u}):new f.ColorMaterialProperty(r);return h.entities.add({polyline:{positions:e,width:t,material:c,clampToGround:a,zIndex:n}})}function C(h,e,s=10,r="#ba1919",t,a=!1){const n={show:!0,positions:h,clampToGround:a,width:s,material:f.Color.fromCssColorString(r),arcType:f.ArcType.NONE,shadows:f.ShadowMode.DISABLED,granularity:a?void 0:0};let W;return W=[0,1e5],n.distanceDisplayCondition=new f.DistanceDisplayCondition(W[0],W[1]),{name:e,label:{text:e,font:"18px sans-serif",distanceDisplayCondition:new f.DistanceDisplayCondition(W[0],Math.min(W[1],5e3))},polyline:n}}function $t(h,e,s,r,t=new f.HeadingPitchRoll(0,0,0),a=1,n){const W={show:!0,uri:r,scale:a,transition:{distanceDisplayCondition:!0,scale:!0}};return n&&(Array.isArray(n)?W.distanceDisplayCondition=new f.DistanceDisplayCondition(n[0],n[1]):W.distanceDisplayCondition=n),{id:h,name:s,position:e,orientation:f.Transforms.headingPitchRollQuaternion(e,t),model:W}}function vt(h,e,s,r={}){const{pointColor:t=V.Color.YELLOW,pointSize:a=12,labelColor:n=V.Color.WHITE,fontSize:W=16,pixelOffset:u=[0,-20],heightReference:c=V.HeightReference.NONE}=r;return h.entities.add({position:e,point:{color:t,pixelSize:a,heightReference:c,distanceDisplayCondition:new f.DistanceDisplayCondition(0,100)},label:{text:s,font:`${W}px sans-serif`,fillColor:n,pixelOffset:new f.Cartesian2(...u),style:V.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,outlineColor:V.Color.BLACK,heightReference:c,distanceDisplayCondition:new f.DistanceDisplayCondition(0,100)}})}var x=63710088e-1,ie={centimeters:x*100,centimetres:x*100,degrees:x/111325,feet:x*3.28084,inches:x*39.37,kilometers:x/1e3,kilometres:x/1e3,meters:x,metres:x,miles:x/1609.344,millimeters:x*1e3,millimetres:x*1e3,nauticalmiles:x/1852,radians:1,yards:x*1.0936};function Wt(h,e,s){s===void 0&&(s={});var r={type:"Feature"};return(s.id===0||s.id)&&(r.id=s.id),s.bbox&&(r.bbox=s.bbox),r.properties=e||{},r.geometry=h,r}function st(h,e,s){if(s===void 0&&(s={}),!h)throw new Error("coordinates is required");if(!Array.isArray(h))throw new Error("coordinates must be an Array");if(h.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ne(h[0])||!ne(h[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:h};return Wt(r,e,s)}function Me(h,e,s){s===void 0&&(s={});for(var r=0,t=h;r<t.length;r++){var a=t[r];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var n=0;n<a[a.length-1].length;n++)if(a[a.length-1][n]!==a[0][n])throw new Error("First and last Position are not equivalent.")}var W={type:"Polygon",coordinates:h};return Wt(W,e,s)}function j(h,e,s){if(s===void 0&&(s={}),h.length<2)throw new Error("coordinates must be an array of two or more positions");var r={type:"LineString",coordinates:h};return Wt(r,e,s)}function Ee(h,e){e===void 0&&(e={});var s={type:"FeatureCollection"};return e.id&&(s.id=e.id),e.bbox&&(s.bbox=e.bbox),s.features=h,s}function Re(h,e,s){s===void 0&&(s={});var r={type:"MultiLineString",coordinates:h};return Wt(r,e,s)}function oe(h,e){e===void 0&&(e="kilometers");var s=ie[e];if(!s)throw new Error(e+" units is invalid");return h*s}function Zt(h,e){e===void 0&&(e="kilometers");var s=ie[e];if(!s)throw new Error(e+" units is invalid");return h/s}function Se(h,e){return bt(Zt(h,e))}function bt(h){var e=h%(2*Math.PI);return e*180/Math.PI}function nt(h){var e=h%360;return e*Math.PI/180}function re(h,e,s){if(e===void 0&&(e="kilometers"),s===void 0&&(s="kilometers"),!(h>=0))throw new Error("length must be a positive number");return oe(Zt(h,e),s)}function ne(h){return!isNaN(h)&&h!==null&&!Array.isArray(h)}function he(h){return!!h&&h.constructor===Object}function fe(h,e,s){if(h!==null)for(var r,t,a,n,W,u,c,i=0,l=0,T,p=h.type,o=p==="FeatureCollection",A=p==="Feature",g=o?h.features.length:1,y=0;y<g;y++){c=o?h.features[y].geometry:A?h.geometry:h,T=c?c.type==="GeometryCollection":!1,W=T?c.geometries.length:1;for(var L=0;L<W;L++){var m=0,B=0;if(n=T?c.geometries[L]:c,n!==null){u=n.coordinates;var v=n.type;switch(i=0,v){case null:break;case"Point":if(e(u,l,y,m,B)===!1)return!1;l++,m++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(e(u[r],l,y,m,B)===!1)return!1;l++,v==="MultiPoint"&&m++}v==="LineString"&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(t=0;t<u[r].length-i;t++){if(e(u[r][t],l,y,m,B)===!1)return!1;l++}v==="MultiLineString"&&m++,v==="Polygon"&&B++}v==="Polygon"&&m++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(B=0,t=0;t<u[r].length;t++){for(a=0;a<u[r][t].length-i;a++){if(e(u[r][t][a],l,y,m,B)===!1)return!1;l++}B++}m++}break;case"GeometryCollection":for(r=0;r<n.geometries.length;r++)if(fe(n.geometries[r],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function _e(h,e){if(h.type==="Feature")e(h,0);else if(h.type==="FeatureCollection")for(var s=0;s<h.features.length&&e(h.features[s],s)!==!1;s++);}function ke(h,e){var s,r,t,a,n,W,u,c,i,l,T=0,p=h.type==="FeatureCollection",o=h.type==="Feature",A=p?h.features.length:1;for(s=0;s<A;s++){for(W=p?h.features[s].geometry:o?h.geometry:h,c=p?h.features[s].properties:o?h.properties:{},i=p?h.features[s].bbox:o?h.bbox:void 0,l=p?h.features[s].id:o?h.id:void 0,u=W?W.type==="GeometryCollection":!1,n=u?W.geometries.length:1,t=0;t<n;t++){if(a=u?W.geometries[t]:W,a===null){if(e(null,T,c,i,l)===!1)return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(a,T,c,i,l)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<a.geometries.length;r++)if(e(a.geometries[r],T,c,i,l)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}T++}}function ae(h,e){ke(h,function(s,r,t,a,n){var W=s===null?null:s.type;switch(W){case null:case"Point":case"LineString":case"Polygon":return e(Wt(s,t,{bbox:a,id:n}),r,0)===!1?!1:void 0}var u;switch(W){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var c=0;c<s.coordinates.length;c++){var i=s.coordinates[c],l={type:u,coordinates:i};if(e(Wt(l,t),r,c)===!1)return!1}})}function Fe(h,e){ae(h,function(s,r,t){var a=0;if(s.geometry){var n=s.geometry.type;if(!(n==="Point"||n==="MultiPoint")){var W,u=0,c=0,i=0;if(fe(s,function(l,T,p,o,A){if(W===void 0||r>u||o>c||A>i){W=l,u=r,c=o,i=A,a=0;return}var g=j([W,l],s.properties);if(e(g,r,t,A,a)===!1)return!1;a++,W=l})===!1)return!1}}})}function Ct(h){if(!h)throw new Error("coord is required");if(!Array.isArray(h)){if(h.type==="Feature"&&h.geometry!==null&&h.geometry.type==="Point")return h.geometry.coordinates;if(h.type==="Point")return h.coordinates}if(Array.isArray(h)&&h.length>=2&&!Array.isArray(h[0])&&!Array.isArray(h[1]))return h;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Xt(h){if(Array.isArray(h))return h;if(h.type==="Feature"){if(h.geometry!==null)return h.geometry.coordinates}else if(h.coordinates)return h.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function le(h,e,s){if(!h)throw new Error("No feature passed");if(!s)throw new Error(".featureOf() requires a name");if(!h||h.type!=="Feature"||!h.geometry)throw new Error("Invalid input to "+s+", Feature with geometry required");if(!h.geometry||h.geometry.type!==e)throw new Error("Invalid input to "+s+": must be a "+e+", given "+h.geometry.type)}function $e(h){return h.type==="Feature"?h.geometry:h}function Ze(h,e){return h.type==="FeatureCollection"?"FeatureCollection":h.type==="GeometryCollection"?"GeometryCollection":h.type==="Feature"&&h.geometry!==null?h.geometry.type:h.type}var It=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xe(h,e,s){if(s===void 0&&(s={}),!h)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=Ct(h),t=$e(e),a=t.type,n=e.bbox,W=t.coordinates;if(n&&Ye(r,n)===!1)return!1;a==="Polygon"&&(W=[W]);for(var u=!1,c=0;c<W.length&&!u;c++)if(ce(r,W[c][0],s.ignoreBoundary)){for(var i=!1,l=1;l<W[c].length&&!i;)ce(r,W[c][l],!s.ignoreBoundary)&&(i=!0),l++;i||(u=!0)}return u}function ce(h,e,s){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var t=0,a=e.length-1;t<e.length;a=t++){var n=e[t][0],W=e[t][1],u=e[a][0],c=e[a][1],i=h[1]*(n-u)+W*(u-h[0])+c*(h[0]-n)===0&&(n-h[0])*(u-h[0])<=0&&(W-h[1])*(c-h[1])<=0;if(i)return!s;var l=W>h[1]!=c>h[1]&&h[0]<(u-n)*(h[1]-W)/(c-W)+n;l&&(r=!r)}return r}function Ye(h,e){return e[0]<=h[0]&&e[1]<=h[1]&&e[2]>=h[0]&&e[3]>=h[1]}function lt(h,e,s){s===void 0&&(s={});var r=Ct(h),t=Ct(e),a=nt(t[1]-r[1]),n=nt(t[0]-r[0]),W=nt(r[1]),u=nt(t[1]),c=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(n/2),2)*Math.cos(W)*Math.cos(u);return oe(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),s.units)}function Ve(h){if(!h)throw new Error("geojson is required");switch(h.type){case"Feature":return ue(h);case"FeatureCollection":return He(h);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Yt(h);default:throw new Error("unknown GeoJSON type")}}function ue(h){var e={type:"Feature"};return Object.keys(h).forEach(function(s){switch(s){case"type":case"properties":case"geometry":return;default:e[s]=h[s]}}),e.properties=We(h.properties),e.geometry=Yt(h.geometry),e}function We(h){var e={};return h&&Object.keys(h).forEach(function(s){var r=h[s];typeof r=="object"?r===null?e[s]=null:Array.isArray(r)?e[s]=r.map(function(t){return t}):e[s]=We(r):e[s]=r}),e}function He(h){var e={type:"FeatureCollection"};return Object.keys(h).forEach(function(s){switch(s){case"type":case"features":return;default:e[s]=h[s]}}),e.features=h.features.map(function(s){return ue(s)}),e}function Yt(h){var e={type:h.type};return h.bbox&&(e.bbox=h.bbox),h.type==="GeometryCollection"?(e.geometries=h.geometries.map(function(s){return Yt(s)}),e):(e.coordinates=Ce(h.coordinates),e)}function Ce(h){var e=h;return typeof e[0]!="object"?e.slice():e.map(function(s){return Ce(s)})}function Vt(h,e,s,r){r===void 0&&(r={});var t=Ct(h),a=nt(t[0]),n=nt(t[1]),W=nt(s),u=Zt(e,r.units),c=Math.asin(Math.sin(n)*Math.cos(u)+Math.cos(n)*Math.sin(u)*Math.cos(W)),i=a+Math.atan2(Math.sin(W)*Math.sin(u)*Math.cos(n),Math.cos(u)-Math.sin(n)*Math.sin(c)),l=bt(i),T=bt(c);return st([l,T],r.properties)}function Dt(h,e,s){if(s===void 0&&(s={}),s.final===!0)return Oe(h,e);var r=Ct(h),t=Ct(e),a=nt(r[0]),n=nt(t[0]),W=nt(r[1]),u=nt(t[1]),c=Math.sin(n-a)*Math.cos(u),i=Math.cos(W)*Math.sin(u)-Math.sin(W)*Math.cos(u)*Math.cos(n-a);return bt(Math.atan2(c,i))}function Oe(h,e){var s=Dt(e,h);return s=(s+180)%360,s}function Ne(h,e){var s=lt(h,e),r=Dt(h,e),t=Vt(h,s/2,r);return t}function Ge(h,e){if(!h)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var s,r=1/0,t=0;return _e(e,function(a,n){var W=lt(h,a);W<r&&(t=n,r=W)}),s=Ve(e.features[t]),s.properties.featureIndex=t,s.properties.distanceToPoint=r,s}function ze(h,e,s){s===void 0&&(s={});var r=Ct(h),t=Ct(e);t[0]+=t[0]-r[0]>180?-360:r[0]-t[0]>180?360:0;var a=Ke(r,t),n=re(a,"meters",s.units);return n}function Ke(h,e,s){s=s===void 0?x:Number(s);var r=s,t=h[1]*Math.PI/180,a=e[1]*Math.PI/180,n=a-t,W=Math.abs(e[0]-h[0])*Math.PI/180;W>Math.PI&&(W-=2*Math.PI);var u=Math.log(Math.tan(a/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),c=Math.abs(u)>1e-11?n/u:Math.cos(t),i=Math.sqrt(n*n+c*c*W*W),l=i*r;return l}function gt(h,e,s){if(s===void 0&&(s={}),s.method||(s.method="geodesic"),s.units||(s.units="kilometers"),!h)throw new Error("pt is required");if(Array.isArray(h)?h=st(h):h.type==="Point"?h=Wt(h):le(h,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=j(e):e.type==="LineString"?e=Wt(e):le(e,"LineString","line");var r=1/0,t=h.geometry.coordinates;return Fe(e,function(a){var n=a.geometry.coordinates[0],W=a.geometry.coordinates[1],u=qe(t,n,W,s);u<r&&(r=u)}),re(r,"degrees",s.units)}function qe(h,e,s,r){var t=[s[0]-e[0],s[1]-e[1]],a=[h[0]-e[0],h[1]-e[1]],n=de(a,t);if(n<=0)return Ht(h,e,{method:r.method,units:"degrees"});var W=de(t,t);if(W<=n)return Ht(h,s,{method:r.method,units:"degrees"});var u=n/W,c=[e[0]+u*t[0],e[1]+u*t[1]];return Ht(h,c,{method:r.method,units:"degrees"})}function de(h,e){return h[0]*e[0]+h[1]*e[1]}function Ht(h,e,s){return s.method==="planar"?ze(h,e,s):lt(h,e,s)}function Te(h,e,s,r){if(r=r||{},!he(r))throw new Error("options is invalid");var t,a=[];if(h.type==="Feature")t=h.geometry.coordinates;else if(h.type==="LineString")t=h.coordinates;else throw new Error("input must be a LineString Feature or Geometry");for(var n=t.length,W=0,u,c,i,l=0;l<t.length&&!(e>=W&&l===t.length-1);l++){if(W>e&&a.length===0){if(u=e-W,!u)return a.push(t[l]),j(a);c=Dt(t[l],t[l-1])-180,i=Vt(t[l],u,c,r),a.push(i.geometry.coordinates)}if(W>=s)return u=s-W,u?(c=Dt(t[l],t[l-1])-180,i=Vt(t[l],u,c,r),a.push(i.geometry.coordinates),j(a)):(a.push(t[l]),j(a));if(W>=e&&a.push(t[l]),l===t.length-1)return j(a);W+=lt(t[l],t[l+1],r)}if(W<e&&t.length===n)throw new Error("Start position is beyond line");var T=t[t.length-1];return j([T,T])}function Mt(h){var e=h[0],s=h[1];return[s[0]-e[0],s[1]-e[1]]}function Ot(h,e){return h[0]*e[1]-e[0]*h[1]}function Ue(h,e){return[h[0]+e[0],h[1]+e[1]]}function Je(h,e){return[h[0]-e[0],h[1]-e[1]]}function je(h,e){return[h*e[0],h*e[1]]}function Qe(h,e){var s=h[0],r=Mt(h),t=e[0],a=Mt(e),n=Ot(r,a),W=Je(t,s),u=Ot(W,a),c=u/n,i=Ue(s,je(c,r));return i}function xe(h,e){var s=Mt(h),r=Mt(e);return Ot(s,r)===0}function ts(h,e){return xe(h,e)?!1:Qe(h,e)}function Nt(h,e,s){if(s=s||{},!he(s))throw new Error("options is invalid");var r=s.units;if(!h)throw new Error("geojson is required");if(e==null||isNaN(e))throw new Error("distance is required");var t=Ze(h),a=h.properties;switch(t){case"LineString":return pe(h,e,r);case"MultiLineString":var n=[];return ae(h,function(W){n.push(pe(W,e,r).geometry.coordinates)}),Re(n,a);default:throw new Error("geometry "+t+" is not supported")}}function pe(h,e,s){var r=[],t=Se(e,s),a=Xt(h),n=[];return a.forEach(function(W,u){if(u!==a.length-1){var c=es(W,a[u+1],t);if(r.push(c),u>0){var i=r[u-1],l=ts(c,i);l!==!1&&(i[1]=l,c[0]=l),n.push(i[0]),u===a.length-2&&(n.push(c[0]),n.push(c[1]))}a.length===2&&(n.push(c[0]),n.push(c[1]))}}),j(n,h.properties)}function es(h,e,s){var r=Math.sqrt((h[0]-e[0])*(h[0]-e[0])+(h[1]-e[1])*(h[1]-e[1])),t=h[0]+s*(e[1]-h[1])/r,a=e[0]+s*(e[1]-h[1])/r,n=h[1]+s*(h[0]-e[0])/r,W=e[1]+s*(h[0]-e[0])/r;return[[t,n],[a,W]]}class ss{constructor(){w(this,"LineID","myEntity1");w(this,"Tag","");w(this,"towers",[]);w(this,"ISPhaseSequence",!1);w(this,"Wairnum",0);w(this,"Type",0);w(this,"corridor_features",[]);w(this,"wireAColor","#FFFFFF");w(this,"wireBColor","#FFFFFF");w(this,"wireCColor","#FFFFFF");w(this,"wireTColor","#FFFFFF");w(this,"wireD1Color","#FFFFFF");w(this,"wireD2Color","#FFFFFF");w(this,"wireWidth",1);w(this,"LineDistanceDisplaymin",0);w(this,"LineDistanceDisplaymax",5e3)}}class is{constructor(){w(this,"id","");w(this,"type",0);w(this,"modelid","");w(this,"lon",0);w(this,"lat",0);w(this,"alt",0);w(this,"modelH",0);w(this,"modelurl","");w(this,"modelScale",1);w(this,"modelbox","")}}var U=(h=>(h[h.树木=0]="树木",h[h.房屋=1]="房屋",h[h.高速公路=2]="高速公路",h[h.电力线=3]="电力线",h[h.导线=4]="导线",h[h.地面=5]="地面",h[h.其他地物=6]="其他地物",h))(U||{});class os{constructor(){w(this,"id","");w(this,"name","");w(this,"type",0);w(this,"Longitude",0);w(this,"Latitude",0);w(this,"Altitude",0);w(this,"RollX",0);w(this,"RollY",90);w(this,"RollZ",0);w(this,"towerScale",1);w(this,"towerHeight",0);w(this,"towerModelUri","");w(this,"towerPoint",[]);w(this,"Insulators",[]);w(this,"DistanceDisplaymin",0);w(this,"DistanceDisplaymax",1e3)}}class rs{constructor(){w(this,"treeId",0);w(this,"treeCoordinates",[0,0,0]);w(this,"conductorCoordinates",[0,0,0]);w(this,"horizontalDistance",0);w(this,"verticalDistance",0);w(this,"straightLineDistance",0);w(this,"clearanceDistance",0);w(this,"timestamp",0)}}class ns{constructor(){w(this,"id","");w(this,"name","");w(this,"type",0);w(this,"WairFX","进");w(this,"linenum",1);w(this,"Wairnum",0);w(this,"PhaseSequence",0);w(this,"RollX",0);w(this,"RollY",0);w(this,"RollZ",0);w(this,"InsulatorScale",1);w(this,"InsulatorLength",0);w(this,"InsulatorModelUri","");w(this,"InsulatorPoint",[]);w(this,"DistanceDisplaymin",0);w(this,"DistanceDisplaymax",500)}}class hs{constructor(){w(this,"name","");w(this,"X",-45);w(this,"Y",90);w(this,"Z",0)}}var Q=(h=>(h[h.A相=0]="A相",h[h.B相=1]="B相",h[h.C相=2]="C相",h[h.地线1=3]="地线1",h[h.地线2=4]="地线2",h))(Q||{}),rt=(h=>(h[h.直线塔=0]="直线塔",h[h.耐张塔=1]="耐张塔",h[h.门架塔=2]="门架塔",h[h.换位塔=3]="换位塔",h))(rt||{}),Ae=(h=>(h[h.交流单回路=0]="交流单回路",h[h.交流双回路=1]="交流双回路",h[h.直流单回路=2]="直流单回路",h[h.直流双回路=3]="直流双回路",h[h.交流四回路=4]="交流四回路",h))(Ae||{}),mt=(h=>(h[h.地线=0]="地线",h[h.回路一=1]="回路一",h[h.回路二=2]="回路二",h[h.回路三=3]="回路三",h[h.回路四=4]="回路四",h))(mt||{}),K=(h=>(h[h.悬垂串=0]="悬垂串",h[h.耐张串=1]="耐张串",h[h.跳线串=2]="跳线串",h[h.硬跳串=3]="硬跳串",h[h.V串=4]="V串",h[h.地线串=5]="地线串",h[h.绕跳临时=6]="绕跳临时",h))(K||{}),I=(h=>(h[h.单分裂=0]="单分裂",h[h.双分裂=1]="双分裂",h[h.四分裂=2]="四分裂",h[h.六分裂=3]="六分裂",h[h.八分裂=4]="八分裂",h))(I||{}),q=(h=>(h[h.直线距离=0]="直线距离",h[h.水平距离=1]="水平距离",h[h.垂直距离=2]="垂直距离",h[h.净空距离=3]="净空距离",h[h.安全距离=4]="安全距离",h[h.线间距离测量=5]="线间距离测量",h))(q||{});class we{constructor(){w(this,"horizontalLevels");w(this,"verticalLevels");w(this,"straightLineLevels");w(this,"clearanceLevels");w(this,"wireToWireLevels")}}class Gt{constructor(){w(this,"typeRules",new Map)}}var G=(h=>(h[h.A相=0]="A相",h[h.B相=1]="B相",h[h.C相=2]="C相",h[h.地线1=3]="地线1",h[h.地线2=4]="地线2",h[h.全部=5]="全部",h))(G||{});class zt{constructor(){w(this,"phaseRules",new Map)}getRules(e,s){const r=e<=s?`${e}-${s}`:`${s}-${e}`;return this.phaseRules.get(r)}setRules(e,s,r){const t=e<=s?`${e}-${s}`:`${s}-${e}`;this.phaseRules.set(t,r)}}class fs{constructor(){w(this,"timestamp",0);w(this,"phase1",0);w(this,"wire1Coordinates",[0,0,0]);w(this,"phase2",1);w(this,"wire2Coordinates",[0,0,0]);w(this,"horizontalDistance",0);w(this,"verticalDistance",0);w(this,"straightLineDistance",0);w(this,"status","正常");w(this,"statusColor","#00ff00")}}const it={units:"kilometers"};function Et(h,e,s,r){const t=Kt(h,e),a=Kt(h,s),n=Kt(h,r),W=Math.min(t,a,n);return W===t?e:W===a?s:r}function Kt(h,e){if(!e||e.length===0)return console.log("fastPointToLineDistance: line is empty or null"),1/0;let s=1/0;for(let t=0;t<e.length;t++){const a=e[t],n=h[0]-a[0],W=h[1]-a[1],u=n*n+W*W;u<s&&(s=u)}const r=Math.sqrt(s);return console.log(`fastPointToLineDistance result: ${r}`),r}const Rt=()=>({horizontalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],verticalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],straightLineLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],clearanceLevels:[{name:"critical",minDistance:0,maxDistance:10,color:"#ff0000"},{name:"danger",minDistance:10,maxDistance:15,color:"#ff6600"},{name:"warning",minDistance:15,maxDistance:20,color:"#ffa500"},{name:"safe",minDistance:20,maxDistance:1/0,color:"#00ff00"}]}),Le=(()=>{const h=new Gt;return h.typeRules.set(U.树木,Rt()),h.typeRules.set(U.房屋,Rt()),h.typeRules.set(U.高速公路,Rt()),h.typeRules.set(U.电力线,Rt()),h})(),as=(h,e)=>h.typeRules.get(e)||new we,dt=(h,e,s,r=Le,t,a=U.树木)=>{const W=as(r||Le,a),u=st(h.slice(0,2)),{nearestCoord:c}=ge(h,e),i=e.findIndex(N=>N[0]==c[0]&&N[1]==c[1]);let l=[];if(i==0)l.push(e[0],e[1]);else if(i==e.length-1)l.push(e[e.length-2],e[e.length-1]);else{const N=[e[i],e[i+1]],J=[e[i-1],e[i]];var T=gt(u,j(N),it),p=gt(u,j(J),it);l=T>p?J:N}console.log("附近的点",i,l);const o=j([l[0].slice(0,2),l[1].slice(0,2)]),A=st(l[0].slice(0,2)),g=st(l[1].slice(0,2));var y=gt(u,o,it),L=lt(u,A,it)||0,m=Math.sqrt(L*L-y*y)||0;let B=l[0].slice(0,2);m>0&&(B=Te(o,0,m,it).geometry.coordinates[1]);const v=lt(A,g,it),b=Math.abs(l[0][2]-l[1][2]),M=Math.min(l[0][2],l[1][2]),S=Math.max(l[0][2],l[1][2]),R=l[0][2]>l[1][2]?S-m/v*b:m/v*b+M;console.log("高度差>>>>",b),console.log("最小高度>>>>",M),console.log("最大高度>>>>",S);const E=R-h[2],D=y*1e3,$=Math.sqrt(D*D+E*E);console.log("水平距离>>>>",D),console.log("竖直距离>>>>",E),console.log("直线距离>>>>",$);let k="#eff819",F=f.Color.RED;const X=f.Cartesian3.fromDegrees(h[0],h[1],h[2]),Y=f.Cartesian3.fromDegrees(B[0],B[1],h[2]),H=f.Cartesian3.fromDegrees(B[0],B[1],R);console.log(`坐标详情: 树木=[${h[0]}, ${h[1]}, ${h[2]}], 导线点=[${B[0]}, ${B[1]}, ${R}]`);var O=Ne(st([h[0],h[1]]),st([B[0],B[1]])).geometry.coordinates;const z=f.Cartesian3.fromDegrees(O[0],O[1],h[2]),yt=f.Cartesian3.fromDegrees(O[0],O[1],R-E/2),At=f.Cartesian3.fromDegrees(B[0],B[1],R-E/2);let et;if(t.includes(q.水平距离)&&(W.horizontalLevels&&(et=W.horizontalLevels.find(N=>D>=N.minDistance&&D<=N.maxDistance)),et)){k=et.color,F=f.Color.fromCssColorString(et.color);const N={position:z,name:"水平距离",label:{text:`水平距离${D.toFixed(1)}米`,fillColor:f.Color.fromCssColorString(k),font:"12px sans-serif",pixelOffset:new f.Cartesian2(0,0),scaleByDistance:new f.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},J=[];J.push(X),J.push(Y);var Ft={polyline:{show:!0,positions:J,clampToGround:!1,width:2,material:F,shadows:f.ShadowMode.DISABLED}};s.add(N),s.add(Ft)}if(t.includes(q.垂直距离)&&(W.verticalLevels&&(et=W.verticalLevels.find(N=>E>=N.minDistance&&E<=N.maxDistance)),et)){k=et.color,F=f.Color.fromCssColorString(et.color);const N={position:At,name:"垂直距离",label:{text:`垂直距离${E.toFixed(1)}米`,fillColor:f.Color.fromCssColorString(k),font:"12px sans-serif",pixelOffset:new f.Cartesian2(0,0),scaleByDistance:new f.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},J=[];J.push(Y),J.push(H);var Qt={polyline:{show:!0,positions:J,clampToGround:!1,width:2,material:F,shadows:f.ShadowMode.DISABLED}};s.add(N),s.add(Qt)}if(t.includes(q.直线距离)&&(W.straightLineLevels&&(et=W.straightLineLevels.find(N=>$>=N.minDistance&&$<=N.maxDistance)),et)){k=et.color,F=f.Color.fromCssColorString(et.color);const N={position:yt,name:"直线距离",label:{text:`直线距离${$.toFixed(1)}米`,fillColor:f.Color.fromCssColorString(k),font:"12px sans-serif",pixelOffset:new f.Cartesian2(0,0),scaleByDistance:new f.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},J=[];J.push(X),J.push(H);var Bt={polyline:{show:!0,positions:J,clampToGround:!1,width:2,material:F,shadows:f.ShadowMode.DISABLED}};s.add(N),s.add(Bt)}},St=(h,e,s)=>{const r=st(h.slice(0,2)),{nearestCoord:t}=ge(h,e),a=e.findIndex(E=>E[0]==t[0]&&E[1]==t[1]);let n=[];if(a==0)n.push(e[0],e[1]);else if(a==e.length-1)n.push(e[e.length-2],e[e.length-1]);else{const E=[e[a],e[a+1]],D=[e[a-1],e[a]];var W=gt(r,j(E),it),u=gt(r,j(D),it);n=W>u?D:E}const c=j([n[0].slice(0,2),n[1].slice(0,2)]),i=st(n[0].slice(0,2)),l=st(n[1].slice(0,2));var T=gt(r,c,it),p=lt(r,i,it)||0,o=Math.sqrt(p*p-T*T)||0;let A=n[0].slice(0,2);o>0&&(A=Te(c,0,o,it).geometry.coordinates[1]);const g=lt(i,l,it),y=Math.abs(n[0][2]-n[1][2]),L=Math.min(n[0][2],n[1][2]),m=Math.max(n[0][2],n[1][2]),B=n[0][2]>n[1][2]?m-o/g*y:o/g*y+L,v=B-h[2],b=T*1e3,M=Math.sqrt(b*b+v*v),S=parseFloat(B.toFixed(1));return{treeId:s,treeCoordinates:[h[0],h[1],h[2]],conductorCoordinates:[A[0],A[1],B],horizontalDistance:parseFloat(b.toFixed(1)),verticalDistance:parseFloat(v.toFixed(1)),straightLineDistance:parseFloat(M.toFixed(1)),clearanceDistance:S,timestamp:Date.now()}};function ge(h,e){const s=st(h.slice(0,2)),r=[];e.forEach(W=>{r.push(st([W[0],W[1]]))});const t=Ee(r),a=Ge(s,t),n=lt(s,a,it);return{nearestCoord:a.geometry.coordinates,nearestDistance:n}}function P(h,e,s,r,t){s||(s=new f.HeadingPitchRoll);const a=f.Transforms.headingPitchRollQuaternion(h,s,r,t),n=f.Matrix4.fromRotationTranslation(f.Matrix3.fromQuaternion(a,new f.Matrix3),h,new f.Matrix4);return f.Matrix4.multiplyByPoint(n,e,new f.Cartesian3)}function tt(h,e){var s=h.cartesianToCartographic(e),r=f.Math.toDegrees(s.latitude),t=f.Math.toDegrees(s.longitude),a=s.height;return[t,r,a]}function ct(h,e,s,r){const t=e*Math.PI/180,a=h*Math.PI/180,n=r*Math.PI/180,W=s*Math.PI/180,u=Math.sin(W-a)*Math.cos(n),c=Math.cos(t)*Math.sin(n)-Math.sin(t)*Math.cos(n)*Math.cos(W-a);let i=Math.atan2(u,c)*180/Math.PI;return i=(i+360)%360,i}function d(h,e=6){const s=[];for(var r=0;r<h.length-1;r++)s.push(...ls(h[r],h[r+1],e*-1e3,100));return s}function ls(h,e,s,r){var t=[],a=f.Cartographic.fromCartesian(h),n=f.Cartographic.fromCartesian(e),W=a.longitude*180/Math.PI,u=a.latitude*180/Math.PI,c=n.longitude*180/Math.PI,i=n.latitude*180/Math.PI,l=Math.sqrt((W-c)*(W-c)+(u-i)*(u-i)),T=l*s,p=f.Cartesian3.clone(h),o=f.Cartesian3.clone(e),A=f.Cartesian3.distance(p,f.Cartesian3.ZERO),g=f.Cartesian3.distance(o,f.Cartesian3.ZERO);if(f.Cartesian3.normalize(p,p),f.Cartesian3.normalize(o,o),f.Cartesian3.distance(p,o)==0)return t;var y=f.Cartesian3.angleBetween(p,o);t.push(h);for(var L=1;L<r-1;L++){var m=L*1/(r-1),B=1-m,v=Math.sin(B*y)/Math.sin(y),b=Math.sin(m*y)/Math.sin(y),M=f.Cartesian3.multiplyByScalar(p,v,new f.Cartesian3),S=f.Cartesian3.multiplyByScalar(o,b,new f.Cartesian3),R=f.Cartesian3.add(M,S,new f.Cartesian3),E=m*Math.PI,D=A*B+g*m+Math.sin(E)*T;R=f.Cartesian3.multiplyByScalar(R,D,R),t.push(R)}return t.push(e),t}function cs(h,e,s=30){const r=h.length;if(r<=2||e===0||e===r-1)return!1;const t=ct(h[e-1].Longitude,h[e-1].Latitude,h[e].Longitude,h[e].Latitude);let n=ct(h[e].Longitude,h[e].Latitude,h[e+1].Longitude,h[e+1].Latitude)-t;return n>180&&(n-=360),n<-180&&(n+=360),Math.abs(n)>=s}function qt(h,e,s=2){const r=h.length;if(r<=1)return 0;if(cs(h,e,15))return e<r-1?ct(h[e].Longitude,h[e].Latitude,h[e+1].Longitude,h[e+1].Latitude):ct(h[e-1].Longitude,h[e-1].Latitude,h[e].Longitude,h[e].Latitude);let t=Math.max(0,e-s),a=Math.min(r-1,e+s);if(a-t<1)return e===r-1?ct(h[e-1].Longitude,h[e-1].Latitude,h[e].Longitude,h[e].Latitude):ct(h[e].Longitude,h[e].Latitude,h[e+1].Longitude,h[e+1].Latitude);const n=[];for(let i=t;i<a;i++){const l=ct(h[i].Longitude,h[i].Latitude,h[i+1].Longitude,h[i+1].Latitude);n.push(l)}if(n.length===1)return n[0];let W=0,u=0;for(const i of n){const l=i*Math.PI/180;W+=Math.cos(l),u+=Math.sin(l)}return(Math.atan2(u,W)*180/Math.PI+360)%360}function us(h,e){const s=h*Math.PI/180,r=e*Math.PI/180,t=Math.cos(s),a=Math.sin(s),n=Math.cos(r),W=Math.sin(r),u=t+n,c=a+W;if(Math.abs(u)<1e-10&&Math.abs(c)<1e-10)return(h+90)%360;let i=Math.atan2(c,u)*180/Math.PI;return i=(i+360)%360,i}function Ws(h,e){if(!e||e.length<2)return!1;const s=st(h),r=Me([e]);return Xe(s,r)}function Cs(h,e=[]){if(!h||!e||e.length<2)return console.log("filterTreesInCorridor: invalid input parameters"),[];const s=h.filter(r=>{if(r.lon===void 0||r.lat===void 0)return console.warn("filterTreesInCorridor: tree missing lon/lat properties",r),!1;const t=[r.lon,r.lat],a=Ws(t,e);return h.indexOf(r)<5&&console.log(`Tree ${h.indexOf(r)}: [${t[0]}, ${t[1]}], inCorridor: ${a}`),a});return console.log(`filterTreesInCorridor: found ${s.length} trees in corridor`),s}function ds(h,e=2e3){if(!h||h.length<2)return[];const s=h.map(t=>[t.Longitude,t.Latitude]),r=j(s);try{const t=e/1e3,a=Nt(r,t,{units:"kilometers"}),n=Nt(r,-t,{units:"kilometers"}),W=Xt(a),u=Xt(n);return[...W,...u.reverse(),W[0]]}catch{return[]}}class Ts{constructor(e,s,r){w(this,"viewer");w(this,"LineInfo");w(this,"Keym","");w(this,"dataSource2");w(this,"entityCollection2");w(this,"offsetTowers",[]);w(this,"autoCalculateRollX",!0);w(this,"towerWirePoints",new Map);w(this,"loadedWireSegments",new Set);w(this,"loadedTowerIndices",new Set);w(this,"isDynamicLoadingEnabled",!0);w(this,"isLineModelRemoved",!1);w(this,"cameraMoveHandler",null);w(this,"offsetWires11",[]);w(this,"offsetWires12",[]);w(this,"offsetWires13",[]);w(this,"offsetWires21",[]);w(this,"offsetWires22",[]);w(this,"offsetWires23",[]);w(this,"ToffsetArcWires1A",[]);w(this,"ToffsetArcWires2A",[]);w(this,"ToffsetWires1A1",[]);w(this,"ToffsetWires1A2",[]);w(this,"ToffsetArcWires1B",[]);w(this,"ToffsetArcWires2B",[]);w(this,"ToffsetWires1B1",[]);w(this,"ToffsetWires1B2",[]);w(this,"ToffsetArcWires1C",[]);w(this,"ToffsetArcWires2C",[]);w(this,"ToffsetWires1C1",[]);w(this,"ToffsetWires1C2",[]);w(this,"ToffsetArcWires1A2",[]);w(this,"ToffsetArcWires2A2",[]);w(this,"ToffsetWires2A1",[]);w(this,"ToffsetWires2A2",[]);w(this,"ToffsetArcWires1B2",[]);w(this,"ToffsetArcWires2B2",[]);w(this,"ToffsetWires2B1",[]);w(this,"ToffsetWires2B2",[]);w(this,"ToffsetArcWires1C2",[]);w(this,"ToffsetArcWires2C2",[]);w(this,"ToffsetWires2C1",[]);w(this,"ToffsetWires2C2",[]);w(this,"offsetArcWires1A",[]);w(this,"offsetArcWires1B",[]);w(this,"offsetArcWires1C",[]);w(this,"offsetArcWires2A",[]);w(this,"offsetArcWires2B",[]);w(this,"offsetArcWires2C",[]);w(this,"offsetGrouundWires1",[]);w(this,"offsetGrouundWires2",[]);w(this,"offsetGrouundWires11",[]);w(this,"offsetGrouundWires12",[]);w(this,"arcLine1A1",[]);w(this,"arcLine1B1",[]);w(this,"arcLine1C1",[]);w(this,"LinedataSource2");w(this,"LineentityCollection2");w(this,"modelCache",new Map);this.Keym=r,this.viewer=e,this.LineInfo=s,this.dataSource2=new f.CustomDataSource(this.LineInfo.LineID),this.entityCollection2=this.dataSource2.entities,this.LinedataSource2=new f.CustomDataSource(this.LineInfo.LineID+"daoxian"),this.LineentityCollection2=this.LinedataSource2.entities}createModelCacheKey(e,s,r,t){return`${e}_${s}_${r}_${t}`}getCachedModelConfig(e,s,r,t){const a=Math.max(0,r),n=Math.min(t,5e4),W=this.createModelCacheKey(e,s,a,n);if(!this.modelCache.has(W)){const u={uri:e,scale:s,distanceDisplayCondition:[a,n]};this.modelCache.set(W,u)}return this.modelCache.get(W)}addModelToCollection(e,s,r,t,a,n,W){const u=this.getCachedModelConfig(t,n,W[0],W[1]);this.entityCollection2.add($t(e,s,r,u.uri,a,u.scale,u.distanceDisplayCondition))}setAutoCalculateRollX(e){this.autoCalculateRollX=e}getAutoCalculateRollX(){return this.autoCalculateRollX}setDynamicLoadingEnabled(e){this.isDynamicLoadingEnabled=e}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}setupCameraMoveListener(){this.cameraMoveHandler&&this.cameraMoveHandler(),this.cameraMoveHandler=this.viewer.camera.moveEnd.addEventListener(()=>{this.updateVisibleTowers()})}getVisibleTowerIndices(){var u;if(!this.viewer.camera||this.offsetTowers.length===0)return{start:0,end:0};const e=this.viewer.camera.position,s=((u=this.viewer.camera.positionCartographic)==null?void 0:u.height)||1e3;let r=5;s>5e4?r=2:s>1e4?r=3:s>5e3?r=5:r=10;let t=0,a=Number.MAX_VALUE;for(let c=0;c<this.offsetTowers.length;c++){const i=f.Cartesian3.distance(e,this.offsetTowers[c]);i<a&&(a=i,t=c)}const n=Math.max(0,t-r),W=Math.min(this.offsetTowers.length-1,t+r);return{start:n,end:W}}updateVisibleTowers(){const{start:e,end:s}=this.getVisibleTowerIndices();this.isLineModelRemoved||this.loadTowersInRange(e,s)}initializeLineData(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.towers.forEach(e=>{this.offsetTowers.push(f.Cartesian3.fromDegrees(e.Longitude,e.Latitude,e.Altitude))}),this.autoCalculateRollX&&this.calculateTowerOrientations())}calculateTowerOrientations(){const e=this.LineInfo.towers.length;if(e!==0){if(e===1){this.LineInfo.towers[0].RollX===void 0&&(this.LineInfo.towers[0].RollX=90);return}for(let s=0;s<e;s++){let r=0;if(this.LineInfo.towers[s].type===rt.耐张塔)if(s===0)r=(qt(this.LineInfo.towers,s,3)-90+360)%360;else if(s===e-1)r=(qt(this.LineInfo.towers,s,3)-90+360)%360;else{const t=this.LineInfo.towers[s-1],a=this.LineInfo.towers[s],n=this.LineInfo.towers[s+1],W=ct(t.Longitude,t.Latitude,a.Longitude,a.Latitude),u=ct(a.Longitude,a.Latitude,n.Longitude,n.Latitude);r=(us(W,u)-90+360)%360}else r=(qt(this.LineInfo.towers,s,2)-90+360)%360;this.LineInfo.towers[s].RollX=r}}}loadTowersInRange(e,s){if(e<0||s>=this.LineInfo.towers.length)return;const r=Math.max(0,e-1),t=Math.min(this.LineInfo.towers.length-1,s+1);for(let a=r;a<=t;a++)this.loadedTowerIndices.has(a)||(this.loadTowerAndCollectWirePoints(a),this.loadedTowerIndices.add(a));for(let a=r;a<t;a++){const n=`${a}-${a+1}`;this.loadedWireSegments.has(n)||(this.loadWireSegmentBetweenTowers(a,a+1),this.loadedWireSegments.add(n))}}loadTowerAndCollectWirePoints(e){const s=this.offsetTowers[e],r=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[e].RollX),f.Math.toRadians(this.LineInfo.towers[e].RollY),f.Math.toRadians(this.LineInfo.towers[e].RollZ));this.addModelToCollection(this.LineInfo.towers[e].id,s,this.LineInfo.towers[e].name,this.LineInfo.towers[e].towerModelUri,r,this.LineInfo.towers[e].towerScale,[this.LineInfo.towers[e].DistanceDisplaymin,this.LineInfo.towers[e].DistanceDisplaymax]);const t=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[e].RollX),0,0),a=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[e].RollX),0,0);let n=0;const W=[];this.LineInfo.towers[e].Insulators.forEach(u=>{const c=P(s,new f.Cartesian3(this.LineInfo.towers[e].towerPoint[n].X,this.LineInfo.towers[e].towerPoint[n].Y,this.LineInfo.towers[e].towerPoint[n].Z),this.LineInfo.towers[e].type===rt.耐张塔?a:t);let i,l;if(this.autoCalculateRollX?l=this.LineInfo.towers[e].RollX:l=u.RollX,this.LineInfo.towers[e].type===rt.耐张塔)switch(u.type){case K.耐张串:i=u.WairFX==="进"?new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(-180),f.Math.toRadians(180)):new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(0),f.Math.toRadians(0));break;case K.跳线串:i=new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(u.RollY),f.Math.toRadians(u.RollZ));break;case K.地线串:i=new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(u.RollY),f.Math.toRadians(u.RollZ));break;default:i=new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(u.RollY),f.Math.toRadians(u.RollZ))}else i=new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(u.RollY),f.Math.toRadians(u.RollZ));this.addModelToCollection(u.id,c,u.name,u.InsulatorModelUri,i,u.InsulatorScale,[u.DistanceDisplaymin,u.DistanceDisplaymax]);const T={insulator:u,insulatorIndex:n,position:s,lineroll:t,WairPoint:[]};u.InsulatorPoint.forEach(p=>{p.Y=p.Y+this.LineInfo.towers[e].towerPoint[n].Y,p.Z=p.Z+this.LineInfo.towers[e].towerPoint[n].Z,T.WairPoint.push(P(s,new f.Cartesian3(p.X,p.Y,p.Z),t))}),W.push(T),n++}),this.towerWirePoints.set(e,W)}loadWireSegmentBetweenTowers(e,s){const r=this.towerWirePoints.get(e),t=this.towerWirePoints.get(s);!r||!t||(this.resetWireArraysForTwoTowers(),console.log(`加载导线段: ${e}-${s}`))}resetWireArraysForTwoTowers(){this.offsetWires11=[],this.offsetWires12=[],this.offsetWires13=[],this.offsetWires21=[],this.offsetWires22=[],this.offsetWires23=[],this.ToffsetWires1A1=[],this.ToffsetWires1A2=[]}getLineDataSources(){return[this.dataSource2,this.LinedataSource2]}removeLineModels(){this.isLineModelRemoved=!0,this.entityCollection2.removeAll(),this.LineentityCollection2.removeAll(),this.loadedTowerIndices.clear(),this.loadedWireSegments.clear()}restoreLineModels(){this.isLineModelRemoved=!1,this.isDynamicLoadingEnabled?(this.setupCameraMoveListener(),this.updateVisibleTowers()):this.loadAllTowersAtOnce()}loadAllTowersAtOnce(){let e=0,s=0;this.offsetTowers.forEach((r,t)=>{const a=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[t].RollX),f.Math.toRadians(this.LineInfo.towers[t].RollY),f.Math.toRadians(this.LineInfo.towers[t].RollZ));this.addModelToCollection(this.LineInfo.towers[t].id,r,this.LineInfo.towers[t].name,this.LineInfo.towers[t].towerModelUri,a,this.LineInfo.towers[t].towerScale,[this.LineInfo.towers[t].DistanceDisplaymin,this.LineInfo.towers[t].DistanceDisplaymax]);const n=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[t].RollX),0,0),W=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[t].RollX),0,0);let u=0;if(this.LineInfo.towers[t].Insulators.forEach(i=>{const l=P(r,new f.Cartesian3(this.LineInfo.towers[t].towerPoint[u].X,this.LineInfo.towers[t].towerPoint[u].Y,this.LineInfo.towers[t].towerPoint[u].Z),this.LineInfo.towers[t].type===rt.耐张塔?W:n);let T,p;if(this.autoCalculateRollX?p=this.LineInfo.towers[t].RollX:p=i.RollX,this.LineInfo.towers[t].type===rt.耐张塔)switch(i.type){case K.耐张串:T=i.WairFX==="进"?new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(-180),f.Math.toRadians(180)):new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(0),f.Math.toRadians(0));break;case K.跳线串:T=new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(i.RollY),f.Math.toRadians(i.RollZ));break;case K.地线串:T=new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(i.RollY),f.Math.toRadians(i.RollZ));break;default:T=new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(i.RollY),f.Math.toRadians(i.RollZ))}else T=new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(i.RollY),f.Math.toRadians(i.RollZ));this.addModelToCollection(i.id,l,i.name,i.InsulatorModelUri,T,i.InsulatorScale,[i.DistanceDisplaymin,i.DistanceDisplaymax]);const o=[];switch(i.InsulatorPoint.forEach(A=>{A.Y=A.Y+this.LineInfo.towers[t].towerPoint[u].Y,A.Z=A.Z+this.LineInfo.towers[t].towerPoint[u].Z,o.push(P(r,new f.Cartesian3(A.X,A.Y,A.Z),n))}),i.linenum){case mt.回路一:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[t].type==rt.耐张塔)switch(i.PhaseSequence){case Q.A相:if(i.type==K.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires11.push(o[0]),this.ToffsetWires1A1.push(o[0]);break;case I.双分裂:this.offsetWires11.push(o[0]),this.offsetWires11.push(o[1]),this.ToffsetWires1A1.push(o[2]),this.ToffsetWires1A1.push(o[3]);break;case I.四分裂:this.offsetWires11.push(o[0]),this.offsetWires11.push(o[1]),this.offsetWires11.push(o[2]),this.offsetWires11.push(o[3]),this.ToffsetWires1A1.push(o[4]),this.ToffsetWires1A1.push(o[5]),this.ToffsetWires1A1.push(o[6]),this.ToffsetWires1A1.push(o[7]);break;case I.六分裂:this.offsetWires11.push(o[0]),this.offsetWires11.push(o[1]),this.offsetWires11.push(o[2]),this.offsetWires11.push(o[3]),this.offsetWires11.push(o[4]),this.offsetWires11.push(o[5]),this.ToffsetWires1A1.push(o[6]),this.ToffsetWires1A1.push(o[7]),this.ToffsetWires1A1.push(o[8]),this.ToffsetWires1A1.push(o[9]),this.ToffsetWires1A1.push(o[10]),this.ToffsetWires1A1.push(o[11]);break;case I.八分裂:this.offsetWires11.push(o[0]),this.offsetWires11.push(o[1]),this.offsetWires11.push(o[2]),this.offsetWires11.push(o[3]),this.offsetWires11.push(o[4]),this.offsetWires11.push(o[5]),this.offsetWires11.push(o[6]),this.offsetWires11.push(o[7]),this.ToffsetWires1A1.push(o[8]),this.ToffsetWires1A1.push(o[9]),this.ToffsetWires1A1.push(o[10]),this.ToffsetWires1A1.push(o[11]),this.ToffsetWires1A1.push(o[12]),this.ToffsetWires1A1.push(o[13]),this.ToffsetWires1A1.push(o[14]),this.ToffsetWires1A1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires11.push(A),this.ToffsetWires1A2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires11.push(g),this.offsetWires11.push(y),this.ToffsetWires1A2.push(g),this.ToffsetWires1A2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires11.push(L),this.offsetWires11.push(m),this.offsetWires11.push(B),this.offsetWires11.push(v),this.ToffsetWires1A2.push(L),this.ToffsetWires1A2.push(m),this.ToffsetWires1A2.push(B),this.ToffsetWires1A2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),S=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires11.push(b),this.offsetWires11.push(M),this.offsetWires11.push(S),this.offsetWires11.push(R),this.offsetWires11.push(E),this.offsetWires11.push(D),this.ToffsetWires1A2.push(b),this.ToffsetWires1A2.push(M),this.ToffsetWires1A2.push(S),this.ToffsetWires1A2.push(R),this.ToffsetWires1A2.push(E),this.ToffsetWires1A2.push(D);break;case I.八分裂:const $=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),X=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),Y=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires11.push($),this.offsetWires11.push(k),this.offsetWires11.push(F),this.offsetWires11.push(X),this.offsetWires11.push(Y),this.offsetWires11.push(H),this.offsetWires11.push(O),this.offsetWires11.push(z),this.ToffsetWires1A2.push($),this.ToffsetWires1A2.push(k),this.ToffsetWires1A2.push(F),this.ToffsetWires1A2.push(X),this.ToffsetWires1A2.push(Y),this.ToffsetWires1A2.push(H),this.ToffsetWires1A2.push(O),this.ToffsetWires1A2.push(z);break}else if(i.type==K.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A2.push(o[1]);break;case I.双分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A1.push(o[1]),this.ToffsetWires1A2.push(o[2]),this.ToffsetWires1A2.push(o[3]);break;case I.四分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A1.push(o[1]),this.ToffsetWires1A1.push(o[2]),this.ToffsetWires1A1.push(o[3]),this.ToffsetWires1A2.push(o[4]),this.ToffsetWires1A2.push(o[5]),this.ToffsetWires1A2.push(o[6]),this.ToffsetWires1A2.push(o[7]);break;case I.六分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A1.push(o[1]),this.ToffsetWires1A1.push(o[2]),this.ToffsetWires1A1.push(o[3]),this.ToffsetWires1A1.push(o[4]),this.ToffsetWires1A1.push(o[5]),this.ToffsetWires1A2.push(o[6]),this.ToffsetWires1A2.push(o[7]),this.ToffsetWires1A2.push(o[8]),this.ToffsetWires1A2.push(o[9]),this.ToffsetWires1A2.push(o[10]),this.ToffsetWires1A2.push(o[11]);break;case I.八分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A1.push(o[1]),this.ToffsetWires1A1.push(o[2]),this.ToffsetWires1A1.push(o[3]),this.ToffsetWires1A1.push(o[4]),this.ToffsetWires1A1.push(o[5]),this.ToffsetWires1A1.push(o[6]),this.ToffsetWires1A1.push(o[7]),this.ToffsetWires1A2.push(o[8]),this.ToffsetWires1A2.push(o[9]),this.ToffsetWires1A2.push(o[10]),this.ToffsetWires1A2.push(o[11]),this.ToffsetWires1A2.push(o[12]),this.ToffsetWires1A2.push(o[13]),this.ToffsetWires1A2.push(o[14]),this.ToffsetWires1A2.push(o[15]);break}break;case Q.B相:if(i.type==K.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires12.push(o[0]),this.ToffsetWires1B1.push(o[1]);break;case I.双分裂:this.offsetWires12.push(o[0]),this.offsetWires12.push(o[1]),this.ToffsetWires1B1.push(o[2]),this.ToffsetWires1B1.push(o[3]);break;case I.四分裂:this.offsetWires12.push(o[0]),this.offsetWires12.push(o[1]),this.offsetWires12.push(o[2]),this.offsetWires12.push(o[3]),this.ToffsetWires1B1.push(o[4]),this.ToffsetWires1B1.push(o[5]),this.ToffsetWires1B1.push(o[6]),this.ToffsetWires1B1.push(o[7]);break;case I.六分裂:this.offsetWires12.push(o[0]),this.offsetWires12.push(o[1]),this.offsetWires12.push(o[2]),this.offsetWires12.push(o[3]),this.offsetWires12.push(o[4]),this.offsetWires12.push(o[5]),this.ToffsetWires1B1.push(o[6]),this.ToffsetWires1B1.push(o[7]),this.ToffsetWires1B1.push(o[8]),this.ToffsetWires1B1.push(o[9]),this.ToffsetWires1B1.push(o[10]),this.ToffsetWires1B1.push(o[11]);break;case I.八分裂:this.offsetWires12.push(o[0]),this.offsetWires12.push(o[1]),this.offsetWires12.push(o[2]),this.offsetWires12.push(o[3]),this.offsetWires12.push(o[4]),this.offsetWires12.push(o[5]),this.offsetWires12.push(o[6]),this.offsetWires12.push(o[7]),this.ToffsetWires1B1.push(o[8]),this.ToffsetWires1B1.push(o[9]),this.ToffsetWires1B1.push(o[10]),this.ToffsetWires1B1.push(o[11]),this.ToffsetWires1B1.push(o[12]),this.ToffsetWires1B1.push(o[13]),this.ToffsetWires1B1.push(o[14]),this.ToffsetWires1B1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires12.push(A),this.ToffsetWires1B2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires12.push(g),this.offsetWires12.push(y),this.ToffsetWires1B2.push(g),this.ToffsetWires1B2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires12.push(L),this.offsetWires12.push(m),this.offsetWires12.push(B),this.offsetWires12.push(v),this.ToffsetWires1B2.push(L),this.ToffsetWires1B2.push(m),this.ToffsetWires1B2.push(B),this.ToffsetWires1B2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),S=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires12.push(b),this.offsetWires12.push(M),this.offsetWires12.push(S),this.offsetWires12.push(R),this.offsetWires12.push(E),this.offsetWires12.push(D),this.ToffsetWires1B2.push(b),this.ToffsetWires1B2.push(M),this.ToffsetWires1B2.push(S),this.ToffsetWires1B2.push(R),this.ToffsetWires1B2.push(E),this.ToffsetWires1B2.push(D);break;case I.八分裂:const $=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),X=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),Y=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires12.push($),this.offsetWires12.push(k),this.offsetWires12.push(F),this.offsetWires12.push(X),this.offsetWires12.push(Y),this.offsetWires12.push(H),this.offsetWires12.push(O),this.offsetWires12.push(z),this.ToffsetWires1B2.push($),this.ToffsetWires1B2.push(k),this.ToffsetWires1B2.push(F),this.ToffsetWires1B2.push(X),this.ToffsetWires1B2.push(Y),this.ToffsetWires1B2.push(H),this.ToffsetWires1B2.push(O),this.ToffsetWires1B2.push(z);break}else if(i.type==K.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1B1.push(o[0]),this.ToffsetWires1B2.push(o[0]);break;case I.双分裂:this.ToffsetWires1B1.push(o[0]),this.ToffsetWires1B1.push(o[1]),this.ToffsetWires1B2.push(o[2]),this.ToffsetWires1B2.push(o[3]);break;case I.四分裂:this.ToffsetWires1B1.push(o[0]),this.ToffsetWires1B1.push(o[1]),this.ToffsetWires1B1.push(o[2]),this.ToffsetWires1B1.push(o[3]),this.ToffsetWires1B2.push(o[4]),this.ToffsetWires1B2.push(o[5]),this.ToffsetWires1B2.push(o[6]),this.ToffsetWires1B2.push(o[7]);break;case I.六分裂:this.ToffsetWires1B1.push(o[0]),this.ToffsetWires1B1.push(o[1]),this.ToffsetWires1B1.push(o[2]),this.ToffsetWires1B1.push(o[3]),this.ToffsetWires1B1.push(o[4]),this.ToffsetWires1B1.push(o[5]),this.ToffsetWires1B2.push(o[6]),this.ToffsetWires1B2.push(o[7]),this.ToffsetWires1B2.push(o[8]),this.ToffsetWires1B2.push(o[9]),this.ToffsetWires1B2.push(o[10]),this.ToffsetWires1B2.push(o[11]);break;case I.八分裂:this.ToffsetWires1B1.push(o[0]),this.ToffsetWires1B1.push(o[1]),this.ToffsetWires1B1.push(o[2]),this.ToffsetWires1B1.push(o[3]),this.ToffsetWires1B1.push(o[4]),this.ToffsetWires1B1.push(o[5]),this.ToffsetWires1B1.push(o[6]),this.ToffsetWires1B1.push(o[7]),this.ToffsetWires1B2.push(o[8]),this.ToffsetWires1B2.push(o[9]),this.ToffsetWires1B2.push(o[10]),this.ToffsetWires1B2.push(o[11]),this.ToffsetWires1B2.push(o[12]),this.ToffsetWires1B2.push(o[13]),this.ToffsetWires1B2.push(o[14]),this.ToffsetWires1B2.push(o[15]);break}break;case Q.C相:if(i.type==K.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires13.push(o[0]),this.ToffsetWires1C1.push(o[1]);break;case I.双分裂:this.offsetWires13.push(o[0]),this.offsetWires13.push(o[1]),this.ToffsetWires1C1.push(o[2]),this.ToffsetWires1C1.push(o[3]);break;case I.四分裂:this.offsetWires13.push(o[0]),this.offsetWires13.push(o[1]),this.offsetWires13.push(o[2]),this.offsetWires13.push(o[3]),this.ToffsetWires1C1.push(o[4]),this.ToffsetWires1C1.push(o[5]),this.ToffsetWires1C1.push(o[6]),this.ToffsetWires1C1.push(o[7]);break;case I.六分裂:this.offsetWires13.push(o[0]),this.offsetWires13.push(o[1]),this.offsetWires13.push(o[2]),this.offsetWires13.push(o[3]),this.offsetWires13.push(o[4]),this.offsetWires13.push(o[5]),this.ToffsetWires1C1.push(o[6]),this.ToffsetWires1C1.push(o[7]),this.ToffsetWires1C1.push(o[8]),this.ToffsetWires1C1.push(o[9]),this.ToffsetWires1C1.push(o[10]),this.ToffsetWires1C1.push(o[11]);break;case I.八分裂:this.offsetWires13.push(o[0]),this.offsetWires13.push(o[1]),this.offsetWires13.push(o[2]),this.offsetWires13.push(o[3]),this.offsetWires13.push(o[4]),this.offsetWires13.push(o[5]),this.offsetWires13.push(o[6]),this.offsetWires13.push(o[7]),this.ToffsetWires1C1.push(o[8]),this.ToffsetWires1C1.push(o[9]),this.ToffsetWires1C1.push(o[10]),this.ToffsetWires1C1.push(o[11]),this.ToffsetWires1C1.push(o[12]),this.ToffsetWires1C1.push(o[13]),this.ToffsetWires1C1.push(o[14]),this.ToffsetWires1C1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires13.push(A),this.ToffsetWires1C2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires13.push(g),this.offsetWires13.push(y),this.ToffsetWires1C2.push(g),this.ToffsetWires1C2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires13.push(L),this.offsetWires13.push(m),this.offsetWires13.push(B),this.offsetWires13.push(v),this.ToffsetWires1C2.push(L),this.ToffsetWires1C2.push(m),this.ToffsetWires1C2.push(B),this.ToffsetWires1C2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),S=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires13.push(b),this.offsetWires13.push(M),this.offsetWires13.push(S),this.offsetWires13.push(R),this.offsetWires13.push(E),this.offsetWires13.push(D),this.ToffsetWires1C2.push(b),this.ToffsetWires1C2.push(M),this.ToffsetWires1C2.push(S),this.ToffsetWires1C2.push(R),this.ToffsetWires1C2.push(E),this.ToffsetWires1C2.push(D);break;case I.八分裂:const $=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),X=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),Y=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires13.push($),this.offsetWires13.push(k),this.offsetWires13.push(F),this.offsetWires13.push(X),this.offsetWires13.push(Y),this.offsetWires13.push(H),this.offsetWires13.push(O),this.offsetWires13.push(z),this.ToffsetWires1C2.push($),this.ToffsetWires1C2.push(k),this.ToffsetWires1C2.push(F),this.ToffsetWires1C2.push(X),this.ToffsetWires1C2.push(Y),this.ToffsetWires1C2.push(H),this.ToffsetWires1C2.push(O),this.ToffsetWires1C2.push(z);break}else if(i.type==K.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1C1.push(o[0]),this.ToffsetWires1C2.push(o[0]);break;case I.双分裂:this.ToffsetWires1C1.push(o[0]),this.ToffsetWires1C1.push(o[1]),this.ToffsetWires1C2.push(o[2]),this.ToffsetWires1C2.push(o[3]);break;case I.四分裂:this.ToffsetWires1C1.push(o[0]),this.ToffsetWires1C1.push(o[1]),this.ToffsetWires1C1.push(o[2]),this.ToffsetWires1C1.push(o[3]),this.ToffsetWires1C2.push(o[4]),this.ToffsetWires1C2.push(o[5]),this.ToffsetWires1C2.push(o[6]),this.ToffsetWires1C2.push(o[7]);break;case I.六分裂:this.ToffsetWires1C1.push(o[0]),this.ToffsetWires1C1.push(o[1]),this.ToffsetWires1C1.push(o[2]),this.ToffsetWires1C1.push(o[3]),this.ToffsetWires1C1.push(o[4]),this.ToffsetWires1C1.push(o[5]),this.ToffsetWires1C2.push(o[6]),this.ToffsetWires1C2.push(o[7]),this.ToffsetWires1C2.push(o[8]),this.ToffsetWires1C2.push(o[9]),this.ToffsetWires1C2.push(o[10]),this.ToffsetWires1C2.push(o[11]);break;case I.八分裂:this.ToffsetWires1C1.push(o[0]),this.ToffsetWires1C1.push(o[1]),this.ToffsetWires1C1.push(o[2]),this.ToffsetWires1C1.push(o[3]),this.ToffsetWires1C1.push(o[4]),this.ToffsetWires1C1.push(o[5]),this.ToffsetWires1C1.push(o[6]),this.ToffsetWires1C1.push(o[7]),this.ToffsetWires1C2.push(o[8]),this.ToffsetWires1C2.push(o[9]),this.ToffsetWires1C2.push(o[10]),this.ToffsetWires1C2.push(o[11]),this.ToffsetWires1C2.push(o[12]),this.ToffsetWires1C2.push(o[13]),this.ToffsetWires1C2.push(o[14]),this.ToffsetWires1C2.push(o[15]);break}break}else switch(i.PhaseSequence){case Q.A相:o.forEach(A=>{this.offsetWires11.push(A)});break;case Q.B相:o.forEach(A=>{this.offsetWires12.push(A)});break;case Q.C相:o.forEach(A=>{this.offsetWires13.push(A)});break}else if(this.LineInfo.towers[t].type==rt.耐张塔)switch(u){case 2:switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires11.push(o[0]),this.ToffsetWires1A1.push(o[0]);break;case I.双分裂:this.offsetWires11.push(o[0]),this.offsetWires11.push(o[1]),this.ToffsetWires1A1.push(o[2]),this.ToffsetWires1A1.push(o[3]);break}break;case 3:switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A2.push(o[0]);break;case I.双分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A1.push(o[1]),this.ToffsetWires1A2.push(o[2]),this.ToffsetWires1A2.push(o[3]);break}break;case 4:switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires11.push(A),this.ToffsetWires1A2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires11.push(g),this.offsetWires11.push(y),this.ToffsetWires1A2.push(g),this.ToffsetWires1A2.push(y);break}break;case 5:o.forEach(A=>{this.offsetWires12.push(A),this.ToffsetWires1B1.push(A)});break;case 6:o.forEach(A=>{this.ToffsetWires1B1.push(A),this.ToffsetWires1B2.push(A)});break;case 7:i.InsulatorPoint.forEach(A=>{const g=P(r,new f.Cartesian3(A.X*-1,A.Y,A.Z),n);this.offsetWires12.push(g),this.ToffsetWires1B2.push(g)});break;case 8:o.forEach(A=>{this.offsetWires13.push(A),this.ToffsetWires1C1.push(A)});break;case 9:o.forEach(A=>{this.ToffsetWires1C1.push(A),this.ToffsetWires1C2.push(A)});break;case 10:i.InsulatorPoint.forEach(A=>{const g=P(r,new f.Cartesian3(A.X*-1,A.Y,A.Z),n);this.offsetWires13.push(g),this.ToffsetWires1C2.push(g)});break}else switch(u){case 2:o.forEach(A=>{this.offsetWires11.push(A)});break;case 3:o.forEach(A=>{this.offsetWires12.push(A)});break;case 4:o.forEach(A=>{this.offsetWires13.push(A)});break}break;case mt.回路二:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[t].type==rt.耐张塔)switch(i.PhaseSequence){case Q.A相:if(i.type==K.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires21.push(o[0]),this.ToffsetWires2A1.push(o[0]);break;case I.双分裂:this.offsetWires21.push(o[0]),this.offsetWires21.push(o[1]),this.ToffsetWires2A1.push(o[2]),this.ToffsetWires2A1.push(o[3]);break;case I.四分裂:this.offsetWires21.push(o[0]),this.offsetWires21.push(o[1]),this.offsetWires21.push(o[2]),this.offsetWires21.push(o[3]),this.ToffsetWires2A1.push(o[4]),this.ToffsetWires2A1.push(o[5]),this.ToffsetWires2A1.push(o[6]),this.ToffsetWires2A1.push(o[7]);break;case I.六分裂:this.offsetWires21.push(o[0]),this.offsetWires21.push(o[1]),this.offsetWires21.push(o[2]),this.offsetWires21.push(o[3]),this.offsetWires21.push(o[4]),this.offsetWires21.push(o[5]),this.ToffsetWires2A1.push(o[6]),this.ToffsetWires2A1.push(o[7]),this.ToffsetWires2A1.push(o[8]),this.ToffsetWires2A1.push(o[9]),this.ToffsetWires2A1.push(o[10]),this.ToffsetWires2A1.push(o[11]);break;case I.八分裂:this.offsetWires21.push(o[0]),this.offsetWires21.push(o[1]),this.offsetWires21.push(o[2]),this.offsetWires21.push(o[3]),this.offsetWires21.push(o[4]),this.offsetWires21.push(o[5]),this.offsetWires21.push(o[6]),this.offsetWires21.push(o[7]),this.ToffsetWires2A1.push(o[8]),this.ToffsetWires2A1.push(o[9]),this.ToffsetWires2A1.push(o[10]),this.ToffsetWires2A1.push(o[11]),this.ToffsetWires2A1.push(o[12]),this.ToffsetWires2A1.push(o[13]),this.ToffsetWires2A1.push(o[14]),this.ToffsetWires2A1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires21.push(A),this.ToffsetWires2A2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires21.push(g),this.offsetWires21.push(y),this.ToffsetWires2A2.push(g),this.ToffsetWires2A2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires21.push(L),this.offsetWires21.push(m),this.offsetWires21.push(B),this.offsetWires21.push(v),this.ToffsetWires2A2.push(L),this.ToffsetWires2A2.push(m),this.ToffsetWires2A2.push(B),this.ToffsetWires2A2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),S=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires21.push(b),this.offsetWires21.push(M),this.offsetWires21.push(S),this.offsetWires21.push(R),this.offsetWires21.push(E),this.offsetWires21.push(D),this.ToffsetWires2A2.push(b),this.ToffsetWires2A2.push(M),this.ToffsetWires2A2.push(S),this.ToffsetWires2A2.push(R),this.ToffsetWires2A2.push(E),this.ToffsetWires2A2.push(D);break;case I.八分裂:const $=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),X=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),Y=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires21.push($),this.offsetWires21.push(k),this.offsetWires21.push(F),this.offsetWires21.push(X),this.offsetWires21.push(Y),this.offsetWires21.push(H),this.offsetWires21.push(O),this.offsetWires21.push(z),this.ToffsetWires2A2.push($),this.ToffsetWires2A2.push(k),this.ToffsetWires2A2.push(F),this.ToffsetWires2A2.push(X),this.ToffsetWires2A2.push(Y),this.ToffsetWires2A2.push(H),this.ToffsetWires2A2.push(O),this.ToffsetWires2A2.push(z);break}else if(i.type==K.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A2.push(o[0]);break;case I.双分裂:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A1.push(o[1]),this.ToffsetWires2A2.push(o[2]),this.ToffsetWires2A2.push(o[3]);break;case I.四分裂:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A1.push(o[1]),this.ToffsetWires2A1.push(o[2]),this.ToffsetWires2A1.push(o[3]),this.ToffsetWires2A2.push(o[4]),this.ToffsetWires2A2.push(o[5]),this.ToffsetWires2A2.push(o[6]),this.ToffsetWires2A2.push(o[7]);break;case I.六分裂:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A1.push(o[1]),this.ToffsetWires2A1.push(o[2]),this.ToffsetWires2A1.push(o[3]),this.ToffsetWires2A1.push(o[4]),this.ToffsetWires2A1.push(o[5]),this.ToffsetWires2A2.push(o[6]),this.ToffsetWires2A2.push(o[7]),this.ToffsetWires2A2.push(o[8]),this.ToffsetWires2A2.push(o[9]),this.ToffsetWires2A2.push(o[10]),this.ToffsetWires2A2.push(o[11]);break;case I.八分裂:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A1.push(o[1]),this.ToffsetWires2A1.push(o[2]),this.ToffsetWires2A1.push(o[3]),this.ToffsetWires2A1.push(o[4]),this.ToffsetWires2A1.push(o[5]),this.ToffsetWires2A1.push(o[6]),this.ToffsetWires2A1.push(o[7]),this.ToffsetWires2A2.push(o[8]),this.ToffsetWires2A2.push(o[9]),this.ToffsetWires2A2.push(o[10]),this.ToffsetWires2A2.push(o[11]),this.ToffsetWires2A2.push(o[12]),this.ToffsetWires2A2.push(o[13]),this.ToffsetWires2A2.push(o[14]),this.ToffsetWires2A2.push(o[15]);break}break;case Q.B相:if(i.type==K.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires22.push(o[0]),this.ToffsetWires2B1.push(o[0]);break;case I.双分裂:this.offsetWires22.push(o[0]),this.offsetWires22.push(o[1]),this.ToffsetWires2B1.push(o[2]),this.ToffsetWires2B1.push(o[3]);break;case I.四分裂:this.offsetWires22.push(o[0]),this.offsetWires22.push(o[1]),this.offsetWires22.push(o[2]),this.offsetWires22.push(o[3]),this.ToffsetWires2B1.push(o[4]),this.ToffsetWires2B1.push(o[5]),this.ToffsetWires2B1.push(o[6]),this.ToffsetWires2B1.push(o[7]);break;case I.六分裂:this.offsetWires22.push(o[0]),this.offsetWires22.push(o[1]),this.offsetWires22.push(o[2]),this.offsetWires22.push(o[3]),this.offsetWires22.push(o[4]),this.offsetWires22.push(o[5]),this.ToffsetWires2B1.push(o[6]),this.ToffsetWires2B1.push(o[7]),this.ToffsetWires2B1.push(o[8]),this.ToffsetWires2B1.push(o[9]),this.ToffsetWires2B1.push(o[10]),this.ToffsetWires2B1.push(o[11]);break;case I.八分裂:this.offsetWires22.push(o[0]),this.offsetWires22.push(o[1]),this.offsetWires22.push(o[2]),this.offsetWires22.push(o[3]),this.offsetWires22.push(o[4]),this.offsetWires22.push(o[5]),this.offsetWires22.push(o[6]),this.offsetWires22.push(o[7]),this.ToffsetWires2B1.push(o[8]),this.ToffsetWires2B1.push(o[9]),this.ToffsetWires2B1.push(o[10]),this.ToffsetWires2B1.push(o[11]),this.ToffsetWires2B1.push(o[12]),this.ToffsetWires2B1.push(o[13]),this.ToffsetWires2B1.push(o[14]),this.ToffsetWires2B1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires22.push(A),this.ToffsetWires2B2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires22.push(g),this.offsetWires22.push(y),this.ToffsetWires2B2.push(g),this.ToffsetWires2B2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires22.push(L),this.offsetWires22.push(m),this.offsetWires22.push(B),this.offsetWires22.push(v),this.ToffsetWires2B2.push(L),this.ToffsetWires2B2.push(m),this.ToffsetWires2B2.push(B),this.ToffsetWires2B2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),S=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires22.push(b),this.offsetWires22.push(M),this.offsetWires22.push(S),this.offsetWires22.push(R),this.offsetWires22.push(E),this.offsetWires22.push(D),this.ToffsetWires2B2.push(b),this.ToffsetWires2B2.push(M),this.ToffsetWires2B2.push(S),this.ToffsetWires2B2.push(R),this.ToffsetWires2B2.push(E),this.ToffsetWires2B2.push(D);break;case I.八分裂:const $=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),X=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),Y=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires22.push($),this.offsetWires22.push(k),this.offsetWires22.push(F),this.offsetWires22.push(X),this.offsetWires22.push(Y),this.offsetWires22.push(H),this.offsetWires22.push(O),this.offsetWires22.push(z),this.ToffsetWires2B2.push($),this.ToffsetWires2B2.push(k),this.ToffsetWires2B2.push(F),this.ToffsetWires2B2.push(X),this.ToffsetWires2B2.push(Y),this.ToffsetWires2B2.push(H),this.ToffsetWires2B2.push(O),this.ToffsetWires2B2.push(z);break}else if(i.type==K.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B2.push(o[0]);break;case I.双分裂:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B1.push(o[1]),this.ToffsetWires2B2.push(o[2]),this.ToffsetWires2B2.push(o[3]);break;case I.四分裂:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B1.push(o[1]),this.ToffsetWires2B1.push(o[2]),this.ToffsetWires2B1.push(o[3]),this.ToffsetWires2B2.push(o[4]),this.ToffsetWires2B2.push(o[5]),this.ToffsetWires2B2.push(o[6]),this.ToffsetWires2B2.push(o[7]);break;case I.六分裂:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B1.push(o[1]),this.ToffsetWires2B1.push(o[2]),this.ToffsetWires2B1.push(o[3]),this.ToffsetWires2B1.push(o[4]),this.ToffsetWires2B1.push(o[5]),this.ToffsetWires2B2.push(o[6]),this.ToffsetWires2B2.push(o[7]),this.ToffsetWires2B2.push(o[8]),this.ToffsetWires2B2.push(o[9]),this.ToffsetWires2B2.push(o[10]),this.ToffsetWires2B2.push(o[11]);break;case I.八分裂:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B1.push(o[1]),this.ToffsetWires2B1.push(o[2]),this.ToffsetWires2B1.push(o[3]),this.ToffsetWires2B1.push(o[4]),this.ToffsetWires2B1.push(o[5]),this.ToffsetWires2B1.push(o[6]),this.ToffsetWires2B1.push(o[7]),this.ToffsetWires2B2.push(o[8]),this.ToffsetWires2B2.push(o[9]),this.ToffsetWires2B2.push(o[10]),this.ToffsetWires2B2.push(o[11]),this.ToffsetWires2B2.push(o[12]),this.ToffsetWires2B2.push(o[13]),this.ToffsetWires2B2.push(o[14]),this.ToffsetWires2B2.push(o[15]);break}break;case Q.C相:if(i.type==K.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires23.push(o[0]),this.ToffsetWires2C1.push(o[0]);break;case I.双分裂:this.offsetWires23.push(o[0]),this.offsetWires23.push(o[1]),this.ToffsetWires2C1.push(o[2]),this.ToffsetWires2C1.push(o[3]);break;case I.四分裂:this.offsetWires23.push(o[0]),this.offsetWires23.push(o[1]),this.offsetWires23.push(o[2]),this.offsetWires23.push(o[3]),this.ToffsetWires2C1.push(o[4]),this.ToffsetWires2C1.push(o[5]),this.ToffsetWires2C1.push(o[6]),this.ToffsetWires2C1.push(o[7]);break;case I.六分裂:this.offsetWires23.push(o[0]),this.offsetWires23.push(o[1]),this.offsetWires23.push(o[2]),this.offsetWires23.push(o[3]),this.offsetWires23.push(o[4]),this.offsetWires23.push(o[5]),this.ToffsetWires2C1.push(o[6]),this.ToffsetWires2C1.push(o[7]),this.ToffsetWires2C1.push(o[8]),this.ToffsetWires2C1.push(o[9]),this.ToffsetWires2C1.push(o[10]),this.ToffsetWires2C1.push(o[11]);break;case I.八分裂:this.offsetWires23.push(o[0]),this.offsetWires23.push(o[1]),this.offsetWires23.push(o[2]),this.offsetWires23.push(o[3]),this.offsetWires23.push(o[4]),this.offsetWires23.push(o[5]),this.offsetWires23.push(o[6]),this.offsetWires23.push(o[7]),this.ToffsetWires2C1.push(o[8]),this.ToffsetWires2C1.push(o[9]),this.ToffsetWires2C1.push(o[10]),this.ToffsetWires2C1.push(o[11]),this.ToffsetWires2C1.push(o[12]),this.ToffsetWires2C1.push(o[13]),this.ToffsetWires2C1.push(o[14]),this.ToffsetWires2C1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires23.push(A),this.ToffsetWires2C2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires23.push(g),this.offsetWires23.push(y),this.ToffsetWires2C2.push(g),this.ToffsetWires2C2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires23.push(L),this.offsetWires23.push(m),this.offsetWires23.push(B),this.offsetWires23.push(v),this.ToffsetWires2C2.push(L),this.ToffsetWires2C2.push(m),this.ToffsetWires2C2.push(B),this.ToffsetWires2C2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),S=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires23.push(b),this.offsetWires23.push(M),this.offsetWires23.push(S),this.offsetWires23.push(R),this.offsetWires23.push(E),this.offsetWires23.push(D),this.ToffsetWires2C2.push(b),this.ToffsetWires2C2.push(M),this.ToffsetWires2C2.push(S),this.ToffsetWires2C2.push(R),this.ToffsetWires2C2.push(E),this.ToffsetWires2C2.push(D);break;case I.八分裂:const $=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),X=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),Y=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires23.push($),this.offsetWires23.push(k),this.offsetWires23.push(F),this.offsetWires23.push(X),this.offsetWires23.push(Y),this.offsetWires23.push(H),this.offsetWires23.push(O),this.offsetWires23.push(z),this.ToffsetWires2C2.push($),this.ToffsetWires2C2.push(k),this.ToffsetWires2C2.push(F),this.ToffsetWires2C2.push(X),this.ToffsetWires2C2.push(Y),this.ToffsetWires2C2.push(H),this.ToffsetWires2C2.push(O),this.ToffsetWires2C2.push(z);break}else if(i.type==K.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C2.push(o[0]);break;case I.双分裂:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C1.push(o[1]),this.ToffsetWires2C2.push(o[2]),this.ToffsetWires2C2.push(o[3]);break;case I.四分裂:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C1.push(o[1]),this.ToffsetWires2C1.push(o[2]),this.ToffsetWires2C1.push(o[3]),this.ToffsetWires2C2.push(o[4]),this.ToffsetWires2C2.push(o[5]),this.ToffsetWires2C2.push(o[6]),this.ToffsetWires2C2.push(o[7]);break;case I.六分裂:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C1.push(o[1]),this.ToffsetWires2C1.push(o[2]),this.ToffsetWires2C1.push(o[3]),this.ToffsetWires2C1.push(o[4]),this.ToffsetWires2C1.push(o[5]),this.ToffsetWires2C2.push(o[6]),this.ToffsetWires2C2.push(o[7]),this.ToffsetWires2C2.push(o[8]),this.ToffsetWires2C2.push(o[9]),this.ToffsetWires2C2.push(o[10]),this.ToffsetWires2C2.push(o[11]);break;case I.八分裂:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C1.push(o[1]),this.ToffsetWires2C1.push(o[2]),this.ToffsetWires2C1.push(o[3]),this.ToffsetWires2C1.push(o[4]),this.ToffsetWires2C1.push(o[5]),this.ToffsetWires2C1.push(o[6]),this.ToffsetWires2C1.push(o[7]),this.ToffsetWires2C2.push(o[8]),this.ToffsetWires2C2.push(o[9]),this.ToffsetWires2C2.push(o[10]),this.ToffsetWires2C2.push(o[11]),this.ToffsetWires2C2.push(o[12]),this.ToffsetWires2C2.push(o[13]),this.ToffsetWires2C2.push(o[14]),this.ToffsetWires2C2.push(o[15]);break}break}else switch(i.PhaseSequence){case Q.A相:o.forEach(A=>{this.offsetWires21.push(A)});break;case Q.B相:o.forEach(A=>{this.offsetWires22.push(A)});break;case Q.C相:o.forEach(A=>{this.offsetWires23.push(A)});break}else if(this.LineInfo.towers[t].type==rt.耐张塔)switch(u){case 11:this.offsetWires21.push(o[0]),this.ToffsetWires2A1.push(o[0]);break;case 12:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A2.push(o[0]);break;case 13:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires21.push(A),this.ToffsetWires2A2.push(A);break;case 14:this.offsetWires22.push(o[0]),this.ToffsetWires2B1.push(o[0]);break;case 15:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B2.push(o[0]);break;case 16:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires22.push(g),this.ToffsetWires2B2.push(g);break;case 17:this.offsetWires23.push(o[0]),this.ToffsetWires2C1.push(o[0]);break;case 18:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C2.push(o[0]);break;case 19:const y=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires23.push(y),this.ToffsetWires2C2.push(y);break}else switch(u){case 5:o.forEach(A=>{this.offsetWires21.push(A)});break;case 6:o.forEach(A=>{this.offsetWires22.push(A)});break;case 7:o.forEach(A=>{this.offsetWires23.push(A)});break}break;case mt.地线:if(this.LineInfo.ISPhaseSequence)switch(i.PhaseSequence){case Q.地线1:this.offsetGrouundWires11.push(o[0]);break;case Q.地线2:this.offsetGrouundWires12.push(o[0]);break}else switch(u){case 0:this.offsetGrouundWires11.push(o[0]);break;case 1:this.offsetGrouundWires12.push(o[0]);break}break}u=u+1}),this.offsetWires11.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires11.length>=2&&(i.push(this.offsetWires11[e]),i.push(this.offsetWires11[e-1]),this.offsetArcWires1A=d(i),this.offsetArcWires1A.forEach(L=>{const m=tt(this.viewer.scene.globe.ellipsoid,L);this.arcLine1A1.push(m)}),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case I.双分裂:this.offsetWires11.length>=4&&(i.push(this.offsetWires11[e]),i.push(this.offsetWires11[e-2]),this.offsetArcWires1A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(L=>{this.arcLine1A1.push(tt(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires11[e+1]),l.push(this.offsetWires11[e-1]),this.offsetArcWires1A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case I.四分裂:this.offsetWires11.length>=8&&(i.push(this.offsetWires11[e]),i.push(this.offsetWires11[e-4]),this.offsetArcWires1A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(L=>{this.arcLine1A1.push(tt(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires11[e+1]),l.push(this.offsetWires11[e-3]),this.offsetArcWires1A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires11[e+2]),T.push(this.offsetWires11[e-2]),this.offsetArcWires1A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[e+3]),p.push(this.offsetWires11[e-1]),this.offsetArcWires1A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case I.六分裂:this.offsetWires11.length>=12&&(i.push(this.offsetWires11[e]),i.push(this.offsetWires11[e-6]),this.offsetArcWires1A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(L=>{this.arcLine1A1.push(tt(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires11[e+1]),l.push(this.offsetWires11[e-5]),this.offsetArcWires1A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires11[e+2]),T.push(this.offsetWires11[e-4]),this.offsetArcWires1A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[e+3]),p.push(this.offsetWires11[e-3]),this.offsetArcWires1A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires11[e+4]),o.push(this.offsetWires11[e-2]),this.offsetArcWires1A=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires11[e+5]),A.push(this.offsetWires11[e-1]),this.offsetArcWires1A=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case I.八分裂:this.offsetWires11.length>=16&&(i.push(this.offsetWires11[e]),i.push(this.offsetWires11[e-8]),this.offsetArcWires1A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(L=>{this.arcLine1A1.push(tt(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires11[e+1]),l.push(this.offsetWires11[e-7]),this.offsetArcWires1A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires11[e+2]),T.push(this.offsetWires11[e-6]),this.offsetArcWires1A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[e+3]),p.push(this.offsetWires11[e-5]),this.offsetArcWires1A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires11[e+4]),o.push(this.offsetWires11[e-4]),this.offsetArcWires1A=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires11[e+5]),A.push(this.offsetWires11[e-3]),this.offsetArcWires1A=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires11[e+6]),g.push(this.offsetWires11[e-2]),this.offsetArcWires1A=d(g),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires11[e+7]),y.push(this.offsetWires11[e-1]),this.offsetArcWires1A=d(y),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break}}if(this.offsetWires12.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:i.push(this.offsetWires12[e]),i.push(this.offsetWires12[e-1]),this.offsetArcWires1B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(L=>{this.arcLine1B1.push(tt(this.viewer.scene.globe.ellipsoid,L))});break;case I.双分裂:i.push(this.offsetWires12[e]),i.push(this.offsetWires12[e-2]),this.offsetArcWires1B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(L=>{this.arcLine1B1.push(tt(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires12[e+1]),l.push(this.offsetWires12[e-1]),this.offsetArcWires1B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.四分裂:i.push(this.offsetWires12[e]),i.push(this.offsetWires12[e-4]),this.offsetArcWires1B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(L=>{this.arcLine1B1.push(tt(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires12[e+1]),l.push(this.offsetWires12[e-3]),this.offsetArcWires1B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires12[e+2]),T.push(this.offsetWires12[e-2]),this.offsetArcWires1B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[e+3]),p.push(this.offsetWires12[e-1]),this.offsetArcWires1B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.六分裂:i.push(this.offsetWires12[e]),i.push(this.offsetWires12[e-6]),this.offsetArcWires1B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(L=>{this.arcLine1B1.push(tt(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires12[e+1]),l.push(this.offsetWires12[e-5]),this.offsetArcWires1B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires12[e+2]),T.push(this.offsetWires12[e-4]),this.offsetArcWires1B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[e+3]),p.push(this.offsetWires12[e-3]),this.offsetArcWires1B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires12[e+4]),o.push(this.offsetWires12[e-2]),this.offsetArcWires1B=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires12[e+5]),A.push(this.offsetWires12[e-1]),this.offsetArcWires1B=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.八分裂:i.push(this.offsetWires12[e]),i.push(this.offsetWires12[e-8]),this.offsetArcWires1B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(L=>{this.arcLine1B1.push(tt(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires12[e+1]),l.push(this.offsetWires12[e-7]),this.offsetArcWires1B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires12[e+2]),T.push(this.offsetWires12[e-6]),this.offsetArcWires1B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[e+3]),p.push(this.offsetWires12[e-5]),this.offsetArcWires1B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires12[e+4]),o.push(this.offsetWires12[e-4]),this.offsetArcWires1B=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires12[e+5]),A.push(this.offsetWires12[e-3]),this.offsetArcWires1B=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires12[e+6]),g.push(this.offsetWires12[e-2]),this.offsetArcWires1B=d(g),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires12[e+7]),y.push(this.offsetWires12[e-1]),this.offsetArcWires1B=d(y),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires13.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:i.push(this.offsetWires13[e]),i.push(this.offsetWires13[e-1]),this.offsetArcWires1C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(L=>{this.arcLine1C1.push(tt(this.viewer.scene.globe.ellipsoid,L))});break;case I.双分裂:i.push(this.offsetWires13[e]),i.push(this.offsetWires13[e-2]),this.offsetArcWires1C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires13[e+1]),l.push(this.offsetWires13[e-1]),this.offsetArcWires1C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(L=>{this.arcLine1C1.push(tt(this.viewer.scene.globe.ellipsoid,L))});break;case I.四分裂:i.push(this.offsetWires13[e]),i.push(this.offsetWires13[e-4]),this.offsetArcWires1C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires13[e+1]),l.push(this.offsetWires13[e-3]),this.offsetArcWires1C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires13[e+2]),T.push(this.offsetWires13[e-2]),this.offsetArcWires1C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[e+3]),p.push(this.offsetWires13[e-1]),this.offsetArcWires1C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(L=>{this.arcLine1C1.push(tt(this.viewer.scene.globe.ellipsoid,L))});break;case I.六分裂:i.push(this.offsetWires13[e]),i.push(this.offsetWires13[e-6]),this.offsetArcWires1C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires13[e+1]),l.push(this.offsetWires13[e-5]),this.offsetArcWires1C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires13[e+2]),T.push(this.offsetWires13[e-4]),this.offsetArcWires1C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[e+3]),p.push(this.offsetWires13[e-3]),this.offsetArcWires1C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires13[e+4]),o.push(this.offsetWires13[e-2]),this.offsetArcWires1C=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires13[e+5]),A.push(this.offsetWires13[e-1]),this.offsetArcWires1C=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(L=>{this.arcLine1C1.push(tt(this.viewer.scene.globe.ellipsoid,L))});break;case I.八分裂:i.push(this.offsetWires13[e]),i.push(this.offsetWires13[e-8]),this.offsetArcWires1C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires13[e+1]),l.push(this.offsetWires13[e-7]),this.offsetArcWires1C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires13[e+2]),T.push(this.offsetWires13[e-6]),this.offsetArcWires1C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[e+3]),p.push(this.offsetWires13[e-5]),this.offsetArcWires1C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires13[e+4]),o.push(this.offsetWires13[e-4]),this.offsetArcWires1C=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires13[e+5]),A.push(this.offsetWires13[e-3]),this.offsetArcWires1C=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires13[e+6]),g.push(this.offsetWires13[e-2]),this.offsetArcWires1C=d(g),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires13[e+7]),y.push(this.offsetWires13[e-1]),this.offsetArcWires1C=d(y),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(L=>{this.arcLine1C1.push(tt(this.viewer.scene.globe.ellipsoid,L))});break}}if(this.offsetWires21.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:i.push(this.offsetWires21[e]),i.push(this.offsetWires21[e-1]),this.offsetArcWires2A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.双分裂:i.push(this.offsetWires21[e]),i.push(this.offsetWires21[e-2]),this.offsetArcWires2A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires21[e+1]),l.push(this.offsetWires21[e-1]),this.offsetArcWires2A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.四分裂:i.push(this.offsetWires21[e]),i.push(this.offsetWires21[e-4]),this.offsetArcWires2A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires21[e+1]),l.push(this.offsetWires21[e-3]),this.offsetArcWires2A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires21[e+2]),T.push(this.offsetWires21[e-2]),this.offsetArcWires2A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[e+3]),p.push(this.offsetWires21[e-1]),this.offsetArcWires2A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.六分裂:i.push(this.offsetWires21[e]),i.push(this.offsetWires21[e-6]),this.offsetArcWires2A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires21[e+1]),l.push(this.offsetWires21[e-5]),this.offsetArcWires2A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires21[e+2]),T.push(this.offsetWires21[e-4]),this.offsetArcWires2A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[e+3]),p.push(this.offsetWires21[e-3]),this.offsetArcWires2A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires21[e+4]),o.push(this.offsetWires21[e-2]),this.offsetArcWires2A=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires21[e+5]),A.push(this.offsetWires21[e-1]),this.offsetArcWires2A=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.八分裂:i.push(this.offsetWires21[e]),i.push(this.offsetWires21[e-8]),this.offsetArcWires2A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires21[e+1]),l.push(this.offsetWires21[e-7]),this.offsetArcWires2A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires21[e+2]),T.push(this.offsetWires21[e-6]),this.offsetArcWires2A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[e+3]),p.push(this.offsetWires21[e-5]),this.offsetArcWires2A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires21[e+4]),o.push(this.offsetWires21[e-4]),this.offsetArcWires2A=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires21[e+5]),A.push(this.offsetWires21[e-3]),this.offsetArcWires2A=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires21[e+6]),g.push(this.offsetWires21[e-2]),this.offsetArcWires2A=d(g),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires21[e+7]),y.push(this.offsetWires21[e-1]),this.offsetArcWires2A=d(y),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires22.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:i.push(this.offsetWires22[e]),i.push(this.offsetWires22[e-1]),this.offsetArcWires2B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.双分裂:i.push(this.offsetWires22[e]),i.push(this.offsetWires22[e-2]),this.offsetArcWires2B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires22[e+1]),l.push(this.offsetWires22[e-1]),this.offsetArcWires2B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.四分裂:i.push(this.offsetWires22[e]),i.push(this.offsetWires22[e-4]),this.offsetArcWires2B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires22[e+1]),l.push(this.offsetWires22[e-3]),this.offsetArcWires2B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires22[e+2]),T.push(this.offsetWires22[e-2]),this.offsetArcWires2B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[e+3]),p.push(this.offsetWires22[e-1]),this.offsetArcWires2B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.六分裂:i.push(this.offsetWires22[e]),i.push(this.offsetWires22[e-6]),this.offsetArcWires2B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires22[e+1]),l.push(this.offsetWires22[e-5]),this.offsetArcWires2B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires22[e+2]),T.push(this.offsetWires22[e-4]),this.offsetArcWires2B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[e+3]),p.push(this.offsetWires22[e-3]),this.offsetArcWires2B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires22[e+4]),o.push(this.offsetWires22[e-2]),this.offsetArcWires2B=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires22[e+5]),A.push(this.offsetWires22[e-1]),this.offsetArcWires2B=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.八分裂:i.push(this.offsetWires22[e]),i.push(this.offsetWires22[e-8]),this.offsetArcWires2B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires22[e+1]),l.push(this.offsetWires22[e-7]),this.offsetArcWires2B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires22[e+2]),T.push(this.offsetWires22[e-6]),this.offsetArcWires2B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[e+3]),p.push(this.offsetWires22[e-5]),this.offsetArcWires2B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires22[e+4]),o.push(this.offsetWires22[e-4]),this.offsetArcWires2B=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires22[e+5]),A.push(this.offsetWires22[e-3]),this.offsetArcWires2B=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires22[e+6]),g.push(this.offsetWires22[e-2]),this.offsetArcWires2B=d(g),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires22[e+7]),y.push(this.offsetWires22[e-1]),this.offsetArcWires2B=d(y),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires23.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:i.push(this.offsetWires23[e]),i.push(this.offsetWires23[e-1]),this.offsetArcWires2C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.双分裂:i.push(this.offsetWires23[e]),i.push(this.offsetWires23[e-2]),this.offsetArcWires2C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires23[e+1]),l.push(this.offsetWires23[e-1]),this.offsetArcWires2C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.四分裂:i.push(this.offsetWires23[e]),i.push(this.offsetWires23[e-4]),this.offsetArcWires2C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires23[e+1]),l.push(this.offsetWires23[e-3]),this.offsetArcWires2C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires23[e+2]),T.push(this.offsetWires23[e-2]),this.offsetArcWires2C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[e+3]),p.push(this.offsetWires23[e-1]),this.offsetArcWires2C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.六分裂:i.push(this.offsetWires23[e]),i.push(this.offsetWires23[e-6]),this.offsetArcWires2C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires23[e+1]),l.push(this.offsetWires23[e-5]),this.offsetArcWires2C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires23[e+2]),T.push(this.offsetWires23[e-4]),this.offsetArcWires2C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[e+3]),p.push(this.offsetWires23[e-3]),this.offsetArcWires2C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires23[e+4]),o.push(this.offsetWires23[e-2]),this.offsetArcWires2C=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires23[e+5]),A.push(this.offsetWires23[e-1]),this.offsetArcWires2C=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.八分裂:i.push(this.offsetWires23[e]),i.push(this.offsetWires23[e-8]),this.offsetArcWires2C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires23[e+1]),l.push(this.offsetWires23[e-7]),this.offsetArcWires2C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires23[e+2]),T.push(this.offsetWires23[e-6]),this.offsetArcWires2C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[e+3]),p.push(this.offsetWires23[e-5]),this.offsetArcWires2C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires23[e+4]),o.push(this.offsetWires23[e-4]),this.offsetArcWires2C=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires23[e+5]),A.push(this.offsetWires23[e-3]),this.offsetArcWires2C=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires23[e+6]),g.push(this.offsetWires23[e-2]),this.offsetArcWires2C=d(g),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires23[e+7]),y.push(this.offsetWires23[e-1]),this.offsetArcWires2C=d(y),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetGrouundWires11.length>1){const i=[];i.push(this.offsetGrouundWires11[t]),i.push(this.offsetGrouundWires11[t-1]);const l=[];l.push(this.offsetGrouundWires12[t]),l.push(this.offsetGrouundWires12[t-1]),this.offsetGrouundWires1=d(i,2),this.offsetGrouundWires2=d(l,2),this.LineentityCollection2.add(C(this.offsetGrouundWires1,"地线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireD1Color)),this.LineentityCollection2.add(C(this.offsetGrouundWires2,"地线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireD2Color))}let c=2;if(this.LineInfo.towers[t].type==rt.耐张塔){switch(this.LineInfo.Wairnum){case I.单分裂:e=e+c,s=s+c;break;case I.双分裂:e=e+c*2,s=s+c*2;break;case I.四分裂:e=e+c*4,s=s+c*4;break;case I.六分裂:e=e+c*6,s=s+c*6;break;case I.八分裂:e=e+c*8,s=s+c*8;break}if(this.ToffsetWires1A1.length>1&&this.ToffsetWires1A2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],S=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1A1.length>=2&&(i.push(this.ToffsetWires1A1[s-2]),i.push(this.ToffsetWires1A1[s-1]),this.ToffsetArcWires1A=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=2&&(L.push(this.ToffsetWires1A2[s-2]),L.push(this.ToffsetWires1A2[s-1]),this.ToffsetArcWires2A=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires1A1.length>=4&&(i.push(this.ToffsetWires1A1[s-4]),i.push(this.ToffsetWires1A1[s-2]),this.ToffsetArcWires1A=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1A1[s-3]),l.push(this.ToffsetWires1A1[s-1]),this.ToffsetArcWires1A=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=4&&(L.push(this.ToffsetWires1A2[s-4]),L.push(this.ToffsetWires1A2[s-2]),this.ToffsetArcWires2A=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A2[s-3]),m.push(this.ToffsetWires1A2[s-1]),this.ToffsetArcWires2A=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires1A1.length>=8&&(i.push(this.ToffsetWires1A1[s-8]),i.push(this.ToffsetWires1A1[s-4]),this.ToffsetArcWires1A=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1A1[s-7]),l.push(this.ToffsetWires1A1[s-3]),this.ToffsetArcWires1A=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A1[s-6]),T.push(this.ToffsetWires1A1[s-2]),this.ToffsetArcWires1A=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[s-5]),p.push(this.ToffsetWires1A1[s-1]),this.ToffsetArcWires1A=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=8&&(L.push(this.ToffsetWires1A2[s-8]),L.push(this.ToffsetWires1A2[s-4]),this.ToffsetArcWires2A=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A2[s-7]),m.push(this.ToffsetWires1A2[s-3]),this.ToffsetArcWires2A=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[s-6]),B.push(this.ToffsetWires1A2[s-2]),this.ToffsetArcWires2A=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1A2[s-5]),v.push(this.ToffsetWires1A2[s-1]),this.ToffsetArcWires2A=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires1A1.length>=12&&(i.push(this.ToffsetWires1A1[s-12]),i.push(this.ToffsetWires1A1[s-6]),this.ToffsetArcWires1A=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1A1[s-11]),l.push(this.ToffsetWires1A1[s-5]),this.ToffsetArcWires1A=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A1[s-10]),T.push(this.ToffsetWires1A1[s-4]),this.ToffsetArcWires1A=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[s-9]),p.push(this.ToffsetWires1A1[s-3]),this.ToffsetArcWires1A=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1A1[s-8]),o.push(this.ToffsetWires1A1[s-2]),this.ToffsetArcWires1A=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1A1[s-7]),A.push(this.ToffsetWires1A1[s-1]),this.ToffsetArcWires1A=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=12&&(L.push(this.ToffsetWires1A2[s-12]),L.push(this.ToffsetWires1A2[s-6]),this.ToffsetArcWires2A=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A2[s-11]),m.push(this.ToffsetWires1A2[s-5]),this.ToffsetArcWires2A=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[s-10]),B.push(this.ToffsetWires1A2[s-4]),this.ToffsetArcWires2A=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1A2[s-9]),v.push(this.ToffsetWires1A2[s-3]),this.ToffsetArcWires2A=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[s-8]),b.push(this.ToffsetWires1A2[s-2]),this.ToffsetArcWires2A=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1A2[s-7]),M.push(this.ToffsetWires1A2[s-1]),this.ToffsetArcWires2A=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires1A1.length>=16&&(i.push(this.ToffsetWires1A1[s-16]),i.push(this.ToffsetWires1A1[s-8]),this.ToffsetArcWires1A=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1A1[s-15]),l.push(this.ToffsetWires1A1[s-7]),this.ToffsetArcWires1A=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A1[s-14]),T.push(this.ToffsetWires1A1[s-6]),this.ToffsetArcWires1A=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[s-13]),p.push(this.ToffsetWires1A1[s-5]),this.ToffsetArcWires1A=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1A1[s-12]),o.push(this.ToffsetWires1A1[s-4]),this.ToffsetArcWires1A=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1A1[s-11]),A.push(this.ToffsetWires1A1[s-3]),this.ToffsetArcWires1A=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires1A1[s-10]),g.push(this.ToffsetWires1A1[s-2]),this.ToffsetArcWires1A=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1A1[s-9]),y.push(this.ToffsetWires1A1[s-1]),this.ToffsetArcWires1A=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=16&&(L.push(this.ToffsetWires1A2[s-16]),L.push(this.ToffsetWires1A2[s-8]),this.ToffsetArcWires2A=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A2[s-15]),m.push(this.ToffsetWires1A2[s-7]),this.ToffsetArcWires2A=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[s-14]),B.push(this.ToffsetWires1A2[s-6]),this.ToffsetArcWires2A=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1A2[s-13]),v.push(this.ToffsetWires1A2[s-5]),this.ToffsetArcWires2A=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[s-12]),b.push(this.ToffsetWires1A2[s-4]),this.ToffsetArcWires2A=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1A2[s-11]),M.push(this.ToffsetWires1A2[s-3]),this.ToffsetArcWires2A=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),S.push(this.ToffsetWires1A2[s-10]),S.push(this.ToffsetWires1A2[s-2]),this.ToffsetArcWires2A=d(S,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1A2[s-9]),R.push(this.ToffsetWires1A2[s-1]),this.ToffsetArcWires2A=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1B1.length>1&&this.ToffsetWires1B2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],S=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1B1.length>=2&&(i.push(this.ToffsetWires1B1[s-2]),i.push(this.ToffsetWires1B1[s-1]),this.ToffsetArcWires1B=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=2&&(L.push(this.ToffsetWires1B2[s-2]),L.push(this.ToffsetWires1B2[s-1]),this.ToffsetArcWires2B=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires1B1.length>=4&&(i.push(this.ToffsetWires1B1[s-4]),i.push(this.ToffsetWires1B1[s-2]),this.ToffsetArcWires1B=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1B1[s-3]),l.push(this.ToffsetWires1B1[s-1]),this.ToffsetArcWires1B=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=4&&(L.push(this.ToffsetWires1B2[s-4]),L.push(this.ToffsetWires1B2[s-2]),this.ToffsetArcWires2B=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B2[s-3]),m.push(this.ToffsetWires1B2[s-1]),this.ToffsetArcWires2B=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires1B1.length>=8&&(i.push(this.ToffsetWires1B1[s-8]),i.push(this.ToffsetWires1B1[s-4]),this.ToffsetArcWires1B=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1B1[s-7]),l.push(this.ToffsetWires1B1[s-3]),this.ToffsetArcWires1B=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B1[s-6]),T.push(this.ToffsetWires1B1[s-2]),this.ToffsetArcWires1B=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[s-5]),p.push(this.ToffsetWires1B1[s-1]),this.ToffsetArcWires1B=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=8&&(L.push(this.ToffsetWires1B2[s-8]),L.push(this.ToffsetWires1B2[s-4]),this.ToffsetArcWires2B=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B2[s-7]),m.push(this.ToffsetWires1B2[s-3]),this.ToffsetArcWires2B=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[s-6]),B.push(this.ToffsetWires1B2[s-2]),this.ToffsetArcWires2B=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1B2[s-5]),v.push(this.ToffsetWires1B2[s-1]),this.ToffsetArcWires2B=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires1B1.length>=12&&(i.push(this.ToffsetWires1B1[s-12]),i.push(this.ToffsetWires1B1[s-6]),this.ToffsetArcWires1B=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1B1[s-11]),l.push(this.ToffsetWires1B1[s-5]),this.ToffsetArcWires1B=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B1[s-10]),T.push(this.ToffsetWires1B1[s-4]),this.ToffsetArcWires1B=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[s-9]),p.push(this.ToffsetWires1B1[s-3]),this.ToffsetArcWires1B=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1B1[s-8]),o.push(this.ToffsetWires1B1[s-2]),this.ToffsetArcWires1B=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1B1[s-7]),A.push(this.ToffsetWires1B1[s-1]),this.ToffsetArcWires1B=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=12&&(L.push(this.ToffsetWires1B2[s-12]),L.push(this.ToffsetWires1B2[s-6]),this.ToffsetArcWires2B=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B2[s-11]),m.push(this.ToffsetWires1B2[s-5]),this.ToffsetArcWires2B=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[s-10]),B.push(this.ToffsetWires1B2[s-4]),this.ToffsetArcWires2B=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1B2[s-9]),v.push(this.ToffsetWires1B2[s-3]),this.ToffsetArcWires2B=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[s-8]),b.push(this.ToffsetWires1B2[s-2]),this.ToffsetArcWires2B=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1B2[s-7]),M.push(this.ToffsetWires1B2[s-1]),this.ToffsetArcWires2B=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires1B1.length>=16&&(i.push(this.ToffsetWires1B1[s-16]),i.push(this.ToffsetWires1B1[s-8]),this.ToffsetArcWires1B=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1B1[s-15]),l.push(this.ToffsetWires1B1[s-7]),this.ToffsetArcWires1B=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B1[s-14]),T.push(this.ToffsetWires1B1[s-6]),this.ToffsetArcWires1B=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[s-13]),p.push(this.ToffsetWires1B1[s-5]),this.ToffsetArcWires1B=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1B1[s-12]),o.push(this.ToffsetWires1B1[s-4]),this.ToffsetArcWires1B=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1B1[s-11]),A.push(this.ToffsetWires1B1[s-3]),this.ToffsetArcWires1B=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires1B1[s-10]),g.push(this.ToffsetWires1B1[s-2]),this.ToffsetArcWires1B=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1B1[s-9]),y.push(this.ToffsetWires1B1[s-1]),this.ToffsetArcWires1B=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=16&&(L.push(this.ToffsetWires1B2[s-16]),L.push(this.ToffsetWires1B2[s-8]),this.ToffsetArcWires2B=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B2[s-15]),m.push(this.ToffsetWires1B2[s-7]),this.ToffsetArcWires2B=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[s-14]),B.push(this.ToffsetWires1B2[s-6]),this.ToffsetArcWires2B=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1B2[s-13]),v.push(this.ToffsetWires1B2[s-5]),this.ToffsetArcWires2B=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[s-12]),b.push(this.ToffsetWires1B2[s-4]),this.ToffsetArcWires2B=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1B2[s-11]),M.push(this.ToffsetWires1B2[s-3]),this.ToffsetArcWires2B=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),S.push(this.ToffsetWires1B2[s-10]),S.push(this.ToffsetWires1B2[s-2]),this.ToffsetArcWires2B=d(S,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1B2[s-9]),R.push(this.ToffsetWires1B2[s-1]),this.ToffsetArcWires2B=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1C1.length>1&&this.ToffsetWires1C2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],S=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1C1.length>=2&&(i.push(this.ToffsetWires1C1[s-2]),i.push(this.ToffsetWires1C1[s-1]),this.ToffsetArcWires1C=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=2&&(L.push(this.ToffsetWires1C2[s-2]),L.push(this.ToffsetWires1C2[s-1]),this.ToffsetArcWires2C=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires1C1.length>=4&&(i.push(this.ToffsetWires1C1[s-4]),i.push(this.ToffsetWires1C1[s-2]),this.ToffsetArcWires1C=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1C1[s-3]),l.push(this.ToffsetWires1C1[s-1]),this.ToffsetArcWires1C=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=4&&(L.push(this.ToffsetWires1C2[s-4]),L.push(this.ToffsetWires1C2[s-2]),this.ToffsetArcWires2C=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C2[s-3]),m.push(this.ToffsetWires1C2[s-1]),this.ToffsetArcWires2C=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires1C1.length>=8&&(i.push(this.ToffsetWires1C1[s-8]),i.push(this.ToffsetWires1C1[s-4]),this.ToffsetArcWires1C=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1C1[s-7]),l.push(this.ToffsetWires1C1[s-3]),this.ToffsetArcWires1C=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C1[s-6]),T.push(this.ToffsetWires1C1[s-2]),this.ToffsetArcWires1C=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[s-5]),p.push(this.ToffsetWires1C1[s-1]),this.ToffsetArcWires1C=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=8&&(L.push(this.ToffsetWires1C2[s-8]),L.push(this.ToffsetWires1C2[s-4]),this.ToffsetArcWires2C=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C2[s-7]),m.push(this.ToffsetWires1C2[s-3]),this.ToffsetArcWires2C=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[s-6]),B.push(this.ToffsetWires1C2[s-2]),this.ToffsetArcWires2C=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1C2[s-5]),v.push(this.ToffsetWires1C2[s-1]),this.ToffsetArcWires2C=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires1C1.length>=12&&(i.push(this.ToffsetWires1C1[s-12]),i.push(this.ToffsetWires1C1[s-6]),this.ToffsetArcWires1C=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1C1[s-11]),l.push(this.ToffsetWires1C1[s-5]),this.ToffsetArcWires1C=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C1[s-10]),T.push(this.ToffsetWires1C1[s-4]),this.ToffsetArcWires1C=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[s-9]),p.push(this.ToffsetWires1C1[s-3]),this.ToffsetArcWires1C=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1C1[s-8]),o.push(this.ToffsetWires1C1[s-2]),this.ToffsetArcWires1C=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1C1[s-7]),A.push(this.ToffsetWires1C1[s-1]),this.ToffsetArcWires1C=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=12&&(L.push(this.ToffsetWires1C2[s-12]),L.push(this.ToffsetWires1C2[s-6]),this.ToffsetArcWires2C=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C2[s-11]),m.push(this.ToffsetWires1C2[s-5]),this.ToffsetArcWires2C=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[s-10]),B.push(this.ToffsetWires1C2[s-4]),this.ToffsetArcWires2C=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1C2[s-9]),v.push(this.ToffsetWires1C2[s-3]),this.ToffsetArcWires2C=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[s-8]),b.push(this.ToffsetWires1C2[s-2]),this.ToffsetArcWires2C=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1C2[s-7]),M.push(this.ToffsetWires1C2[s-1]),this.ToffsetArcWires2C=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires1C1.length>=16&&(i.push(this.ToffsetWires1C1[s-16]),i.push(this.ToffsetWires1C1[s-8]),this.ToffsetArcWires1C=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1C1[s-15]),l.push(this.ToffsetWires1C1[s-7]),this.ToffsetArcWires1C=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C1[s-14]),T.push(this.ToffsetWires1C1[s-6]),this.ToffsetArcWires1C=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[s-13]),p.push(this.ToffsetWires1C1[s-5]),this.ToffsetArcWires1C=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1C1[s-12]),o.push(this.ToffsetWires1C1[s-4]),this.ToffsetArcWires1C=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1C1[s-11]),A.push(this.ToffsetWires1C1[s-3]),this.ToffsetArcWires1C=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires1C1[s-10]),g.push(this.ToffsetWires1C1[s-2]),this.ToffsetArcWires1C=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1C1[s-9]),y.push(this.ToffsetWires1C1[s-1]),this.ToffsetArcWires1C=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=16&&(L.push(this.ToffsetWires1C2[s-16]),L.push(this.ToffsetWires1C2[s-8]),this.ToffsetArcWires2C=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C2[s-15]),m.push(this.ToffsetWires1C2[s-7]),this.ToffsetArcWires2C=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[s-14]),B.push(this.ToffsetWires1C2[s-6]),this.ToffsetArcWires2C=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1C2[s-13]),v.push(this.ToffsetWires1C2[s-5]),this.ToffsetArcWires2C=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[s-12]),b.push(this.ToffsetWires1C2[s-4]),this.ToffsetArcWires2C=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1C2[s-11]),M.push(this.ToffsetWires1C2[s-3]),this.ToffsetArcWires2C=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),S.push(this.ToffsetWires1C2[s-10]),S.push(this.ToffsetWires1C2[s-2]),this.ToffsetArcWires2C=d(S,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1C2[s-9]),R.push(this.ToffsetWires1C2[s-1]),this.ToffsetArcWires2C=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2A1.length>1&&this.ToffsetWires2A2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],S=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2A1.length>=2&&(i.push(this.ToffsetWires2A1[s-2]),i.push(this.ToffsetWires2A1[s-1]),this.ToffsetArcWires1A2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=2&&(L.push(this.ToffsetWires2A2[s-2]),L.push(this.ToffsetWires2A2[s-1]),this.ToffsetArcWires2A2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires2A1.length>=4&&(i.push(this.ToffsetWires2A1[s-4]),i.push(this.ToffsetWires2A1[s-2]),this.ToffsetArcWires1A2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2A1[s-3]),l.push(this.ToffsetWires2A1[s-1]),this.ToffsetArcWires1A2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=4&&(L.push(this.ToffsetWires2A2[s-4]),L.push(this.ToffsetWires2A2[s-2]),this.ToffsetArcWires2A2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A2[s-3]),m.push(this.ToffsetWires2A2[s-1]),this.ToffsetArcWires2A2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires2A1.length>=8&&(i.push(this.ToffsetWires2A1[s-8]),i.push(this.ToffsetWires2A1[s-4]),this.ToffsetArcWires1A2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2A1[s-7]),l.push(this.ToffsetWires2A1[s-3]),this.ToffsetArcWires1A2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A1[s-6]),T.push(this.ToffsetWires2A1[s-2]),this.ToffsetArcWires1A2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[s-5]),p.push(this.ToffsetWires2A1[s-1]),this.ToffsetArcWires1A2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=8&&(L.push(this.ToffsetWires2A2[s-8]),L.push(this.ToffsetWires2A2[s-4]),this.ToffsetArcWires2A2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A2[s-7]),m.push(this.ToffsetWires2A2[s-3]),this.ToffsetArcWires2A2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[s-6]),B.push(this.ToffsetWires2A2[s-2]),this.ToffsetArcWires2A2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2A2[s-5]),v.push(this.ToffsetWires2A2[s-1]),this.ToffsetArcWires2A2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires2A1.length>=12&&(i.push(this.ToffsetWires2A1[s-12]),i.push(this.ToffsetWires2A1[s-6]),this.ToffsetArcWires1A2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2A1[s-11]),l.push(this.ToffsetWires2A1[s-5]),this.ToffsetArcWires1A2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A1[s-10]),T.push(this.ToffsetWires2A1[s-4]),this.ToffsetArcWires1A2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[s-9]),p.push(this.ToffsetWires2A1[s-3]),this.ToffsetArcWires1A2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2A1[s-8]),o.push(this.ToffsetWires2A1[s-2]),this.ToffsetArcWires1A2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2A1[s-7]),A.push(this.ToffsetWires2A1[s-1]),this.ToffsetArcWires1A2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=12&&(L.push(this.ToffsetWires2A2[s-12]),L.push(this.ToffsetWires2A2[s-6]),this.ToffsetArcWires2A2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A2[s-11]),m.push(this.ToffsetWires2A2[s-5]),this.ToffsetArcWires2A2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[s-10]),B.push(this.ToffsetWires2A2[s-4]),this.ToffsetArcWires2A2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2A2[s-9]),v.push(this.ToffsetWires2A2[s-3]),this.ToffsetArcWires2A2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[s-8]),b.push(this.ToffsetWires2A2[s-2]),this.ToffsetArcWires2A2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2A2[s-7]),M.push(this.ToffsetWires2A2[s-1]),this.ToffsetArcWires2A2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires2A1.length>=16&&(i.push(this.ToffsetWires2A1[s-16]),i.push(this.ToffsetWires2A1[s-8]),this.ToffsetArcWires1A2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2A1[s-15]),l.push(this.ToffsetWires2A1[s-7]),this.ToffsetArcWires1A2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A1[s-14]),T.push(this.ToffsetWires2A1[s-6]),this.ToffsetArcWires1A2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[s-13]),p.push(this.ToffsetWires2A1[s-5]),this.ToffsetArcWires1A2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2A1[s-12]),o.push(this.ToffsetWires2A1[s-4]),this.ToffsetArcWires1A2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2A1[s-11]),A.push(this.ToffsetWires2A1[s-3]),this.ToffsetArcWires1A2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires2A1[s-10]),g.push(this.ToffsetWires2A1[s-2]),this.ToffsetArcWires1A2=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2A1[s-9]),y.push(this.ToffsetWires2A1[s-1]),this.ToffsetArcWires1A2=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=16&&(L.push(this.ToffsetWires2A2[s-16]),L.push(this.ToffsetWires2A2[s-8]),this.ToffsetArcWires2A2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A2[s-15]),m.push(this.ToffsetWires2A2[s-7]),this.ToffsetArcWires2A2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[s-14]),B.push(this.ToffsetWires2A2[s-6]),this.ToffsetArcWires2A2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2A2[s-13]),v.push(this.ToffsetWires2A2[s-5]),this.ToffsetArcWires2A2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[s-12]),b.push(this.ToffsetWires2A2[s-4]),this.ToffsetArcWires2A2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2A2[s-11]),M.push(this.ToffsetWires2A2[s-3]),this.ToffsetArcWires2A2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),S.push(this.ToffsetWires2A2[s-10]),S.push(this.ToffsetWires2A2[s-2]),this.ToffsetArcWires2A2=d(S,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2A2[s-9]),R.push(this.ToffsetWires2A2[s-1]),this.ToffsetArcWires2A2=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2B1.length>1&&this.ToffsetWires2B2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],S=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2B1.length>=2&&(i.push(this.ToffsetWires2B1[s-2]),i.push(this.ToffsetWires2B1[s-1]),this.ToffsetArcWires1B2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=2&&(L.push(this.ToffsetWires2B2[s-2]),L.push(this.ToffsetWires2B2[s-1]),this.ToffsetArcWires2B2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires2B1.length>=4&&(i.push(this.ToffsetWires2B1[s-4]),i.push(this.ToffsetWires2B1[s-2]),this.ToffsetArcWires1B2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2B1[s-3]),l.push(this.ToffsetWires2B1[s-1]),this.ToffsetArcWires1B2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=4&&(L.push(this.ToffsetWires2B2[s-4]),L.push(this.ToffsetWires2B2[s-2]),this.ToffsetArcWires2B2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B2[s-3]),m.push(this.ToffsetWires2B2[s-1]),this.ToffsetArcWires2B2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires2B1.length>=8&&(i.push(this.ToffsetWires2B1[s-8]),i.push(this.ToffsetWires2B1[s-4]),this.ToffsetArcWires1B2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2B1[s-7]),l.push(this.ToffsetWires2B1[s-3]),this.ToffsetArcWires1B2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B1[s-6]),T.push(this.ToffsetWires2B1[s-2]),this.ToffsetArcWires1B2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[s-5]),p.push(this.ToffsetWires2B1[s-1]),this.ToffsetArcWires1B2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=8&&(L.push(this.ToffsetWires2B2[s-8]),L.push(this.ToffsetWires2B2[s-4]),this.ToffsetArcWires2B2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B2[s-7]),m.push(this.ToffsetWires2B2[s-3]),this.ToffsetArcWires2B2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[s-6]),B.push(this.ToffsetWires2B2[s-2]),this.ToffsetArcWires2B2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2B2[s-5]),v.push(this.ToffsetWires2B2[s-1]),this.ToffsetArcWires2B2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires2B1.length>=12&&(i.push(this.ToffsetWires2B1[s-12]),i.push(this.ToffsetWires2B1[s-6]),this.ToffsetArcWires1B2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2B1[s-11]),l.push(this.ToffsetWires2B1[s-5]),this.ToffsetArcWires1B2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B1[s-10]),T.push(this.ToffsetWires2B1[s-4]),this.ToffsetArcWires1B2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[s-9]),p.push(this.ToffsetWires2B1[s-3]),this.ToffsetArcWires1B2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2B1[s-8]),o.push(this.ToffsetWires2B1[s-2]),this.ToffsetArcWires1B2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2B1[s-7]),A.push(this.ToffsetWires2B1[s-1]),this.ToffsetArcWires1B2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=12&&(L.push(this.ToffsetWires2B2[s-12]),L.push(this.ToffsetWires2B2[s-6]),this.ToffsetArcWires2B2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B2[s-11]),m.push(this.ToffsetWires2B2[s-5]),this.ToffsetArcWires2B2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[s-10]),B.push(this.ToffsetWires2B2[s-4]),this.ToffsetArcWires2B2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2B2[s-9]),v.push(this.ToffsetWires2B2[s-3]),this.ToffsetArcWires2B2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[s-8]),b.push(this.ToffsetWires2B2[s-2]),this.ToffsetArcWires2B2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2B2[s-7]),M.push(this.ToffsetWires2B2[s-1]),this.ToffsetArcWires2B2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires2B1.length>=16&&(i.push(this.ToffsetWires2B1[s-16]),i.push(this.ToffsetWires2B1[s-8]),this.ToffsetArcWires1B2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2B1[s-15]),l.push(this.ToffsetWires2B1[s-7]),this.ToffsetArcWires1B2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B1[s-14]),T.push(this.ToffsetWires2B1[s-6]),this.ToffsetArcWires1B2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[s-13]),p.push(this.ToffsetWires2B1[s-5]),this.ToffsetArcWires1B2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2B1[s-12]),o.push(this.ToffsetWires2B1[s-4]),this.ToffsetArcWires1B2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2B1[s-11]),A.push(this.ToffsetWires2B1[s-3]),this.ToffsetArcWires1B2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires2B1[s-10]),g.push(this.ToffsetWires2B1[s-2]),this.ToffsetArcWires1B2=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2B1[s-9]),y.push(this.ToffsetWires2B1[s-1]),this.ToffsetArcWires1B2=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=16&&(L.push(this.ToffsetWires2B2[s-16]),L.push(this.ToffsetWires2B2[s-8]),this.ToffsetArcWires2B2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B2[s-15]),m.push(this.ToffsetWires2B2[s-7]),this.ToffsetArcWires2B2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[s-14]),B.push(this.ToffsetWires2B2[s-6]),this.ToffsetArcWires2B2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2B2[s-13]),v.push(this.ToffsetWires2B2[s-5]),this.ToffsetArcWires2B2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[s-12]),b.push(this.ToffsetWires2B2[s-4]),this.ToffsetArcWires2B2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2B2[s-11]),M.push(this.ToffsetWires2B2[s-3]),this.ToffsetArcWires2B2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),S.push(this.ToffsetWires2B2[s-10]),S.push(this.ToffsetWires2B2[s-2]),this.ToffsetArcWires2B2=d(S,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2B2[s-9]),R.push(this.ToffsetWires2B2[s-1]),this.ToffsetArcWires2B2=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2C1.length>1&&this.ToffsetWires2C2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],S=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2C1.length>=2&&(i.push(this.ToffsetWires2C1[s-2]),i.push(this.ToffsetWires2C1[s-1]),this.ToffsetArcWires1C2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=2&&(L.push(this.ToffsetWires2C2[s-2]),L.push(this.ToffsetWires2C2[s-1]),this.ToffsetArcWires2C2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires2C1.length>=4&&(i.push(this.ToffsetWires2C1[s-4]),i.push(this.ToffsetWires2C1[s-2]),this.ToffsetArcWires1C2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2C1[s-3]),l.push(this.ToffsetWires2C1[s-1]),this.ToffsetArcWires1C2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=4&&(L.push(this.ToffsetWires2C2[s-4]),L.push(this.ToffsetWires2C2[s-2]),this.ToffsetArcWires2C2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C2[s-3]),m.push(this.ToffsetWires2C2[s-1]),this.ToffsetArcWires2C2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires2C1.length>=8&&(i.push(this.ToffsetWires2C1[s-8]),i.push(this.ToffsetWires2C1[s-4]),this.ToffsetArcWires1C2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2C1[s-7]),l.push(this.ToffsetWires2C1[s-3]),this.ToffsetArcWires1C2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C1[s-6]),T.push(this.ToffsetWires2C1[s-2]),this.ToffsetArcWires1C2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[s-5]),p.push(this.ToffsetWires2C1[s-1]),this.ToffsetArcWires1C2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=8&&(L.push(this.ToffsetWires2C2[s-8]),L.push(this.ToffsetWires2C2[s-4]),this.ToffsetArcWires2C2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C2[s-7]),m.push(this.ToffsetWires2C2[s-3]),this.ToffsetArcWires2C2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[s-6]),B.push(this.ToffsetWires2C2[s-2]),this.ToffsetArcWires2C2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2C2[s-5]),v.push(this.ToffsetWires2C2[s-1]),this.ToffsetArcWires2C2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires2C1.length>=12&&(i.push(this.ToffsetWires2C1[s-12]),i.push(this.ToffsetWires2C1[s-6]),this.ToffsetArcWires1C2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2C1[s-11]),l.push(this.ToffsetWires2C1[s-5]),this.ToffsetArcWires1C2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C1[s-10]),T.push(this.ToffsetWires2C1[s-4]),this.ToffsetArcWires1C2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[s-9]),p.push(this.ToffsetWires2C1[s-3]),this.ToffsetArcWires1C2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2C1[s-8]),o.push(this.ToffsetWires2C1[s-2]),this.ToffsetArcWires1C2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2C1[s-7]),A.push(this.ToffsetWires2C1[s-1]),this.ToffsetArcWires1C2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=12&&(L.push(this.ToffsetWires2C2[s-12]),L.push(this.ToffsetWires2C2[s-6]),this.ToffsetArcWires2C2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C2[s-11]),m.push(this.ToffsetWires2C2[s-5]),this.ToffsetArcWires2C2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[s-10]),B.push(this.ToffsetWires2C2[s-4]),this.ToffsetArcWires2C2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2C2[s-9]),v.push(this.ToffsetWires2C2[s-3]),this.ToffsetArcWires2C2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[s-8]),b.push(this.ToffsetWires2C2[s-2]),this.ToffsetArcWires2C2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2C2[s-7]),M.push(this.ToffsetWires2C2[s-1]),this.ToffsetArcWires2C2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires2C1.length>=16&&(i.push(this.ToffsetWires2C1[s-16]),i.push(this.ToffsetWires2C1[s-8]),this.ToffsetArcWires1C2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2C1[s-15]),l.push(this.ToffsetWires2C1[s-7]),this.ToffsetArcWires1C2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C1[s-14]),T.push(this.ToffsetWires2C1[s-6]),this.ToffsetArcWires1C2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[s-13]),p.push(this.ToffsetWires2C1[s-5]),this.ToffsetArcWires1C2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2C1[s-12]),o.push(this.ToffsetWires2C1[s-4]),this.ToffsetArcWires1C2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2C1[s-11]),A.push(this.ToffsetWires2C1[s-3]),this.ToffsetArcWires1C2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires2C1[s-10]),g.push(this.ToffsetWires2C1[s-2]),this.ToffsetArcWires1C2=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2C1[s-9]),y.push(this.ToffsetWires2C1[s-1]),this.ToffsetArcWires1C2=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=16&&(L.push(this.ToffsetWires2C2[s-16]),L.push(this.ToffsetWires2C2[s-8]),this.ToffsetArcWires2C2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C2[s-15]),m.push(this.ToffsetWires2C2[s-7]),this.ToffsetArcWires2C2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[s-14]),B.push(this.ToffsetWires2C2[s-6]),this.ToffsetArcWires2C2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2C2[s-13]),v.push(this.ToffsetWires2C2[s-5]),this.ToffsetArcWires2C2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[s-12]),b.push(this.ToffsetWires2C2[s-4]),this.ToffsetArcWires2C2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2C2[s-11]),M.push(this.ToffsetWires2C2[s-3]),this.ToffsetArcWires2C2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),S.push(this.ToffsetWires2C2[s-10]),S.push(this.ToffsetWires2C2[s-2]),this.ToffsetArcWires2C2=d(S,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2C2[s-9]),R.push(this.ToffsetWires2C2[s-1]),this.ToffsetArcWires2C2=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}}else switch(this.LineInfo.Wairnum){case I.单分裂:e=e+1;break;case I.双分裂:e=e+2;break;case I.四分裂:e=e+4;break;case I.六分裂:e=e+6;break;case I.八分裂:e=e+8;break}})}getWireDataForChannelCalculation(){return{arcLine1A1:this.arcLine1A1,arcLine1B1:this.arcLine1B1,arcLine1C1:this.arcLine1C1}}getWireDataForChannelCalculationByTowerRange(e,s){if(e<0||s>=this.LineInfo.towers.length||e>s)return console.warn(`无效的杆塔索引范围: ${e} - ${s}`),{arcLine1A1:[],arcLine1B1:[],arcLine1C1:[]};const r=[],t=[],a=[],n=this.LineInfo.towers,W={minLon:Math.min(...n.slice(e,s+1).map(c=>c.Longitude)),maxLon:Math.max(...n.slice(e,s+1).map(c=>c.Longitude)),minLat:Math.min(...n.slice(e,s+1).map(c=>c.Latitude)),maxLat:Math.max(...n.slice(e,s+1).map(c=>c.Latitude))},u=.005;return W.minLon-=u,W.maxLon+=u,W.minLat-=u,W.maxLat+=u,this.arcLine1A1.forEach(c=>{c[0]>=W.minLon&&c[0]<=W.maxLon&&c[1]>=W.minLat&&c[1]<=W.maxLat&&r.push(c)}),this.arcLine1B1.forEach(c=>{c[0]>=W.minLon&&c[0]<=W.maxLon&&c[1]>=W.minLat&&c[1]<=W.maxLat&&t.push(c)}),this.arcLine1C1.forEach(c=>{c[0]>=W.minLon&&c[0]<=W.maxLon&&c[1]>=W.minLat&&c[1]<=W.maxLat&&a.push(c)}),{arcLine1A1:r,arcLine1B1:t,arcLine1C1:a}}parseWireEntityName(e){if(e=="导线1_A111-12")debugger;const s=e.match(/^导线(\d+)_([ABC])\d*(\d+)-(\d+)$/);return s?{circuit:parseInt(s[1]),phase:s[2],startTowerIndex:parseInt(s[3]),endTowerIndex:parseInt(s[4])}:null}getWireSegmentByTowerRange(e,s){const r={arcLine1A1:[],arcLine1B1:[],arcLine1C1:[]};return this.LineentityCollection2.values.forEach(t=>{if(t.name&&t.polyline&&t.polyline.positions){const a=this.parseWireEntityName(t.name);if(a&&a.circuit===1&&a.startTowerIndex===e&&a.endTowerIndex===s){const n=t.polyline.positions.getValue(f.JulianDate.now());if(n&&n.length>0){const W=[];for(let u=0;u<n.length;u++){const c=f.Cartographic.fromCartesian(n[u]);W.push([f.Math.toDegrees(c.longitude),f.Math.toDegrees(c.latitude),c.height])}switch(a.phase){case"A":r.arcLine1A1=W;break;case"B":r.arcLine1B1=W;break;case"C":r.arcLine1C1=W;break}}}}}),r}getAllWireSegments(){const e=[],s=[],r=[],t=[],a=[],n=[],W=new Map;return this.LineInfo&&this.LineInfo.towers&&this.LineInfo.towers.forEach((u,c)=>{W.set(u.id,c),u.name&&W.set(u.name,c)}),this.LineentityCollection2.values.forEach(u=>{if(u.name&&u.polyline&&u.polyline.positions){console.log(u.name);const c=this.parseWireEntityName(u.name);if(c){const i=u.polyline.positions.getValue(f.JulianDate.now());if(i&&i.length>0){const l=[];for(let o=0;o<i.length;o++){const A=f.Cartographic.fromCartesian(i[o]);l.push([f.Math.toDegrees(A.longitude),f.Math.toDegrees(A.latitude),A.height])}const T=c.endTowerIndex,p=W.get(T)??T;if(c.circuit===1)switch(c.phase){case"A":e[p]=l;break;case"B":s[p]=l;break;case"C":r[p]=l;break}else if(c.circuit===2)switch(c.phase){case"A":t[p]=l;break;case"B":a[p]=l;break;case"C":n[p]=l;break}}}}}),console.log(`从LineentityCollection2提取导线数据完成: 回路1-A相${e.length}段, B相${s.length}段, C相${r.length}段; 回路2-A相${t.length}段, B相${a.length}段, C相${n.length}段`),{wireSegments1A1:e,wireSegments1B1:s,wireSegments1C1:r,wireSegments2A1:t,wireSegments2B1:a,wireSegments2C1:n}}getOffsetTowers(){return this.offsetTowers}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}flyToTower(e){if(e<0||e>=this.offsetTowers.length){console.warn(`Invalid tower index: ${e}. Valid range: 0-${this.offsetTowers.length-1}`);return}const s=this.offsetTowers[e];console.log(s),this.viewer.camera.flyTo({destination:s,duration:2,orientation:{heading:f.Math.toRadians(0),pitch:f.Math.toRadians(-60),roll:f.Math.toRadians(0)}})}loadLineTower(){this.initializeLineData(),this.isDynamicLoadingEnabled?(this.loadAllWiresOnly(),this.setupCameraMoveListener(),this.updateVisibleTowers()):this.loadAllTowersAtOnce()}LODloadAllWiresOnly(){this.initializeLineData(),this.loadAllWiresOnly()}loadAllWiresOnly(){const e=new f.EntityCollection,s=this.entityCollection2;this.entityCollection2=e,this.loadAllTowersAtOnce();const r=[];e.values.forEach(t=>{var a;t.name&&(t.name.includes("导线")||t.name.includes("daoxian")||(a=t.id)!=null&&a.toString().includes("daoxian"))&&r.push(t)}),this.entityCollection2=s,r.forEach(t=>{this.entityCollection2.add(t)}),e.removeAll()}setLineVisible(e){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=e,this.LineentityCollection2.show=e)}getArcLine1A1(){return this.arcLine1A1}getArcLine1B1(){return this.arcLine1B1}getArcLine1C1(){return this.arcLine1C1}}const kt=class kt{constructor(e,s,r){w(this,"viewer");w(this,"LineInfo");w(this,"Keym","");w(this,"offsetTrees",[]);w(this,"dataSourcetree");w(this,"entityCollectiontree");w(this,"isDynamicLoadingEnabled",!0);w(this,"loadedTreeIndices",new Set);w(this,"isTreeModelRemoved",!1);w(this,"modelCache",new Map);this.Keym=r,this.viewer=e,this.LineInfo=s,this.dataSourcetree=new f.CustomDataSource(this.LineInfo.LineID+"tree"),this.entityCollectiontree=this.dataSourcetree.entities}createModelCacheKey(e,s,r,t){return`${e}_${s}_${r}_${t}`}getCachedModelConfig(e,s,r,t){const a=Math.max(0,r),n=Math.min(t,5e4),W=this.createModelCacheKey(e,s,a,n);if(!this.modelCache.has(W)){const u={uri:e,scale:s,distanceDisplayCondition:[a,n]};this.modelCache.set(W,u)}return this.modelCache.get(W)}setDynamicLoadingEnabled(e){this.isDynamicLoadingEnabled=e}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}getVisibleTreeIndices(){var a;if(!this.viewer.camera||this.offsetTrees.length===0)return[];const e=this.viewer.camera.position,s=((a=this.viewer.camera.positionCartographic)==null?void 0:a.height)||1e3;let r=Math.max(5e3,s*2);console.log(`相机高度: ${s}, 加载距离: ${r}`),s>5e4&&(r=1e5);const t=[];for(let n=0;n<this.offsetTrees.length;n++){const W=this.offsetTrees[n];f.Cartesian3.distance(e,W)<=r&&t.push(n)}if(t.length===0&&this.offsetTrees.length>0){const n=Math.min(20,this.offsetTrees.length);for(let W=0;W<n;W++)t.push(W)}return t}updateVisibleTrees(){if(this.isTreeModelRemoved)return;const e=this.getVisibleTreeIndices(),s=[];this.loadedTreeIndices.forEach(r=>{e.includes(r)||s.push(r)}),s.forEach(r=>{const t="tree-"+this.LineInfo.corridor_features[r].id;this.entityCollectiontree.removeById(t),this.loadedTreeIndices.delete(r)}),e.forEach(r=>{if(!this.loadedTreeIndices.has(r))if(r>=0&&r<this.offsetTrees.length&&r<this.LineInfo.corridor_features.length){const t=this.offsetTrees[r],a=this.LineInfo.corridor_features[r];t&&a?(this.loadTreeAtIndex(r,t),this.loadedTreeIndices.add(r)):console.warn(`跳过无效的动态加载树木数据,索引: ${r}`)}else console.warn(`动态加载树木索引超出范围: ${r}`)})}loadTree(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.corridor_features.forEach(e=>{this.offsetTrees.push(f.Cartesian3.fromDegrees(e.lon,e.lat,e.alt))}),this.entityCollectiontree.show=!0,this.isDynamicLoadingEnabled?this.updateVisibleTrees():this.loadAllTreesAtOnce())}loadAllTreesAtOnce(){this.LineInfo.corridor_features.length!==this.offsetTrees.length&&console.warn(`树木数据长度 (${this.LineInfo.corridor_features.length}) 与位置数据长度 (${this.offsetTrees.length}) 不匹配`);const e=Math.min(this.LineInfo.corridor_features.length,this.offsetTrees.length);for(let s=0;s<e;s++){const r=this.LineInfo.corridor_features[s],t=this.offsetTrees[s];r&&t?this.loadTreeAtIndex(s,t):console.warn(`跳过无效的树木数据,索引: ${s}`)}}loadTreeAtIndex(e,s){const r=this.LineInfo.corridor_features[e];if(!r.modelurl||r.modelurl.trim()===""){console.warn(`Tree ${e} has invalid model URL: ${r.modelurl}. Skipping...`);return}let t=1;r.modelScale>0&&r.modelH>0?(t=r.modelH/r.modelScale,t<=0&&(t=1)):r.modelH>0&&(t=r.modelH);const a=this.getCachedModelConfig(r.modelurl,t,0,2e4);this.entityCollectiontree.add($t("tree-"+r.id,s,"tree-"+r.id,a.uri,new f.HeadingPitchRoll(0,0,0),a.scale,a.distanceDisplayCondition))}flyToTree(e){if(e<0||e>=this.LineInfo.corridor_features.length){console.warn(`Invalid tree index: ${e}. Valid range: 0-${this.LineInfo.corridor_features.length-1}`);return}const s=this.LineInfo.corridor_features[e],r=f.Cartesian3.fromDegrees(s.lon,s.lat,s.alt+(s.modelH||0));this.viewer.camera.flyTo({destination:r,duration:2,orientation:{heading:f.Math.toRadians(0),pitch:f.Math.toRadians(-60),roll:f.Math.toRadians(0)}})}removeTreeModels(){this.isTreeModelRemoved=!0,this.entityCollectiontree.removeAll(),this.loadedTreeIndices.clear()}restoreTreeModels(){this.isTreeModelRemoved=!1,this.isDynamicLoadingEnabled?this.updateVisibleTrees():this.loadAllTreesAtOnce()}addTreeData(e){this.LineInfo.corridor_features.push(e)}getTreeCoordinates(){return this.LineInfo.corridor_features.map(e=>[e.lon,e.lat,Number(e.alt||0)+Number(e.treeH||0)])}getOffsetTrees(){return this.offsetTrees}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}getTerrainDataSources(){return[this.dataSourcetree]}static getTreeEntityPrefix(){return kt.TREE_ENTITY_PREFIX}setTreeVisible(e){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollectiontree.show=e)}};w(kt,"TREE_ENTITY_PREFIX","tree-");let Ut=kt;class ps{constructor(e){w(this,"viewer");w(this,"dataSourceplotting");w(this,"entityCollectionplotting");w(this,"terrainVerificationCache",new Map);w(this,"terrainVerificationResultCache",new Map);w(this,"maxVisibleResults",200);w(this,"terrainVerificationBatchIndex",0);w(this,"terrainVerificationTotalBatches",0);w(this,"terrainVerificationIsRunning",!1);w(this,"terrainVerificationBatchSize",100);w(this,"cameraMoveHandler",null);w(this,"isDynamicTerrainVerificationEnabled",!1);w(this,"wireClickHandler",null);w(this,"distanceRuleConfig",new Gt);w(this,"wireToWireDistanceRuleConfig",new zt);this.viewer=e,this.dataSourceplotting=new f.CustomDataSource("plotting"),this.entityCollectionplotting=this.dataSourceplotting.entities}ensurePlottingDataSourceAdded(){this.viewer.dataSources.contains(this.dataSourceplotting)||this.viewer.dataSources.add(this.dataSourceplotting),this.entityCollectionplotting.show=!0}calcResultByType(e,s,r,t,a,n=this.distanceRuleConfig,W=U.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const u=`${e[0].toFixed(6)}_${e[1].toFixed(6)}_${e[2].toFixed(2)}`;if(this.terrainVerificationCache.has(u)){const c=this.terrainVerificationCache.get(u);dt(e,c,this.entityCollectionplotting,n,a,W);return}else{const c=Et(e,s,r,t);this.terrainVerificationCache.set(u,c),dt(e,c,this.entityCollectionplotting,n||this.distanceRuleConfig,a,W)}}performTerrainVerification(e,s,r,t,a=null,n,W=[],u=U.树木){const c=`${e[0].toFixed(6)}_${e[1].toFixed(6)}_${e[2].toFixed(2)}`,i=Et(e,s,r,t);return this.terrainVerificationCache.set(c,i),dt(e,i,this.entityCollectionplotting,a||this.distanceRuleConfig,W,u),St(e,i,n??"unknown")}setMaxVisibleTerrainResults(e=200){this.maxVisibleResults=Math.max(10,e)}setDistanceRuleConfig(e){this.distanceRuleConfig=e}getDistanceRuleConfig(){return{...this.distanceRuleConfig}}setDistanceRulesByType(e,s){this.distanceRuleConfig.typeRules.set(e,s)}getDistanceRulesByType(e){return this.distanceRuleConfig.typeRules.get(e)}getDistanceRulesByTypeOrDefault(e){return this.distanceRuleConfig.typeRules.get(e)||new we}hasDistanceRulesForType(e){return this.distanceRuleConfig.typeRules.has(e)}getConfiguredDistanceRuleTypes(){return Array.from(this.distanceRuleConfig.typeRules.keys())}clearDistanceRuleConfig(){this.distanceRuleConfig.typeRules.clear()}getDistanceRuleConfigCount(){return this.distanceRuleConfig.typeRules.size}getHorizontalDistanceLevels(e){var s;return(s=this.distanceRuleConfig.typeRules.get(e))==null?void 0:s.horizontalLevels}getVerticalDistanceLevels(e){var s;return(s=this.distanceRuleConfig.typeRules.get(e))==null?void 0:s.verticalLevels}getStraightLineDistanceLevels(e){var s;return(s=this.distanceRuleConfig.typeRules.get(e))==null?void 0:s.straightLineLevels}getClearanceDistanceLevels(e){var s;return(s=this.distanceRuleConfig.typeRules.get(e))==null?void 0:s.clearanceLevels}createDefaultDistanceRuleConfig(){const e={horizontalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],verticalLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],straightLineLevels:[{name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],clearanceLevels:[{name:"critical",minDistance:0,maxDistance:10,color:"#ff0000"},{name:"danger",minDistance:10,maxDistance:15,color:"#ff6600"},{name:"warning",minDistance:15,maxDistance:20,color:"#ffa500"},{name:"safe",minDistance:20,maxDistance:1/0,color:"#00ff00"}]};this.setDistanceRulesByType(U.树木,{...e}),this.setDistanceRulesByType(U.房屋,{...e}),this.setDistanceRulesByType(U.高速公路,{...e}),this.setDistanceRulesByType(U.电力线,{...e})}drawCorridorPolygon(e,s="corridor-polygon"){if(!e||e.length<3)return;this.ensurePlottingDataSourceAdded();const r=e.map(a=>f.Cartesian3.fromDegrees(a[0],a[1])),t=this.entityCollectionplotting.add({name:s,polygon:{hierarchy:new f.PolygonHierarchy(r),material:f.Color.GREEN.withAlpha(.3),outline:!0,outlineColor:f.Color.GREEN,outlineWidth:2,heightReference:f.HeightReference.CLAMP_TO_GROUND,perPositionHeight:!1}});this.terrainVerificationResultCache.has("corridor-polygon")||this.terrainVerificationResultCache.set("corridor-polygon",[]),this.terrainVerificationResultCache.get("corridor-polygon").push(t)}drawCorridorDistanceMarkers(e,s,r="corridor-markers",t=!0){!e||e.length<2||(this.ensurePlottingDataSourceAdded(),this.addPerpendicularWidthMarkers(e,s,r),t&&this.addParallelIntervalMarkers(e,s,10,r))}addPerpendicularWidthMarkers(e,s,r){const t=e[0],a=e.length>1?e[1]:e[e.length-1],n=f.Cartesian3.fromDegrees(t[0],t[1]),W=f.Cartesian3.fromDegrees(a[0],a[1]),u=f.Cartesian3.subtract(W,n,new f.Cartesian3);f.Cartesian3.normalize(u,u);const c=f.Cartesian3.clone(n);f.Cartesian3.normalize(c,c);const i=f.Cartesian3.cross(c,u,new f.Cartesian3);f.Cartesian3.normalize(i,i);const l=s,T=f.Cartesian3.add(n,f.Cartesian3.multiplyByScalar(i,l,new f.Cartesian3),new f.Cartesian3),p=f.Cartesian3.add(n,f.Cartesian3.multiplyByScalar(i,-l,new f.Cartesian3),new f.Cartesian3),o=f.Cartographic.fromCartesian(T),A=f.Cartographic.fromCartesian(p),g=f.Math.toDegrees(o.longitude),y=f.Math.toDegrees(o.latitude),L=f.Math.toDegrees(A.longitude),m=f.Math.toDegrees(A.latitude),B=this.entityCollectionplotting.add({name:`${r}-left-width-marker`,polyline:{positions:[f.Cartesian3.fromDegrees(t[0],t[1]),f.Cartesian3.fromDegrees(g,y)],width:3,material:new f.PolylineDashMaterialProperty({color:f.Color.RED,dashLength:12}),clampToGround:!0}}),v=this.entityCollectionplotting.add({name:`${r}-right-width-marker`,polyline:{positions:[f.Cartesian3.fromDegrees(t[0],t[1]),f.Cartesian3.fromDegrees(L,m)],width:3,material:new f.PolylineDashMaterialProperty({color:f.Color.RED,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.has("corridor-markers")||this.terrainVerificationResultCache.set("corridor-markers",[]),this.terrainVerificationResultCache.get("corridor-markers").push(B),this.terrainVerificationResultCache.get("corridor-markers").push(v)}addParallelIntervalMarkers(e,s,r,t){if(e.length<2||s<=0||r<=0)return;let a=r,n=1;for(;a<=s;){let W;a<=50?W=f.Color.RED.withAlpha(.7):a<=100?W=f.Color.ORANGE.withAlpha(.7):W=f.Color.GREEN.withAlpha(.7);const u=this.createOffsetLine(e,a,!0);if(u.length>0){const c=this.entityCollectionplotting.add({name:`${t}-parallel-left-${n}`,polyline:{positions:u,width:3,material:new f.PolylineDashMaterialProperty({color:W,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.has("corridor-markers")||this.terrainVerificationResultCache.set("corridor-markers",[]),this.terrainVerificationResultCache.get("corridor-markers").push(c)}a+=r,n++}for(a=r,n=1;a<=s;){let W;a<=50?W=f.Color.RED.withAlpha(.7):a<=100?W=f.Color.ORANGE.withAlpha(.7):W=f.Color.GREEN.withAlpha(.7);const u=this.createOffsetLine(e,a,!1);if(u.length>0){const c=this.entityCollectionplotting.add({name:`${t}-parallel-right-${n}`,polyline:{positions:u,width:3,material:new f.PolylineDashMaterialProperty({color:W,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.get("corridor-markers").push(c)}a+=r,n++}}createOffsetLine(e,s,r){if(e.length<2)return[];const t=j(e),a=s/1e3;try{const n=r?-a:a,W=Nt(t,n,{units:"kilometers"});if(W.geometry.type==="LineString")return W.geometry.coordinates.map(u=>f.Cartesian3.fromDegrees(u[0],u[1]))}catch(n){console.warn("Failed to create offset line:",n)}return[]}clearCorridorDistanceMarkers(){try{if(this.terrainVerificationResultCache&&this.terrainVerificationResultCache.has("corridor-markers")){const e=this.terrainVerificationResultCache.get("corridor-markers");if(e&&this.entityCollectionplotting)for(let s=e.length-1;s>=0;s--){const r=e[s];try{r&&this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationResultCache.delete("corridor-markers")}}catch(e){console.warn("Error clearing corridor distance markers:",e)}}clearCorridorPolygon(){try{if(this.terrainVerificationResultCache){const e=this.terrainVerificationResultCache.get("corridor-polygon");if(e&&this.entityCollectionplotting)for(let s=e.length-1;s>=0;s--){const r=e[s];try{r&&this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationResultCache.delete("corridor-polygon")}}catch(e){console.warn("Error clearing corridor polygon:",e)}}getClickDistanceRuleConfig(){return{...this.distanceRuleConfig}}clearTreeDistanceResultsExceptCorridor(){const e=[];this.entityCollectionplotting&&this.entityCollectionplotting.values.forEach(s=>{(!s.name||!s.name.startsWith("corridor-"))&&e.push(s)});for(let s=e.length-1;s>=0;s--){const r=e[s];try{this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationCache.clear(),this.terrainVerificationResultCache.forEach((s,r)=>{r.startsWith("corridor-")||this.terrainVerificationResultCache.delete(r)})}clearTreeDistanceResults(){try{if(this.entityCollectionplotting)try{this.entityCollectionplotting.removeAll()}catch(e){console.warn("Failed to removeAll entities:",e)}}catch(e){console.warn("Error clearing tree distance results:",e)}try{this.terrainVerificationCache.clear()}catch(e){console.warn("Failed to clear terrain verification cache:",e)}try{this.terrainVerificationResultCache.clear()}catch(e){console.warn("Failed to clear terrain verification result cache:",e)}}LineChannelTerrainVerification(e,s,r,t,a,n=100,W=[],u){if(this.terrainVerificationIsRunning){console.log("地物校验已在运行中,跳过重复调用");return}this.ensurePlottingDataSourceAdded(),this.clearTreeDistanceResults(),this.terrainVerificationBatchSize=n,this.terrainVerificationBatchIndex=0,this.terrainVerificationTotalBatches=Math.ceil(e.length/n),this.terrainVerificationIsRunning=!0,console.log(`开始地物校验:共${e.length}棵树,分${this.terrainVerificationTotalBatches}批处理`),this.processTerrainVerificationBatch(e,s,r,t,a,W,u)}processTerrainVerificationBatch(e,s,r,t,a,n=[],W,u=[]){if(!this.terrainVerificationIsRunning||this.terrainVerificationBatchIndex>=this.terrainVerificationTotalBatches){this.terrainVerificationIsRunning=!1,console.log("地物校验完成"),W&&W(u);return}const c=this.terrainVerificationBatchIndex*this.terrainVerificationBatchSize,i=Math.min(c+this.terrainVerificationBatchSize,e.length);console.log(`处理第${this.terrainVerificationBatchIndex+1}/${this.terrainVerificationTotalBatches}批:${c}-${i}`);const l=[];for(let T=c;T<i;T++){const p=e[T];if(p){const o=[p.lon,p.lat,Number(p.alt||0)+Number(p.treeH||0)],A=this.performTerrainVerification(o,r,t,a,null,p.id,n);A&&l.push(A)}}u.push(...l),this.terrainVerificationBatchIndex++,setTimeout(()=>{this.processTerrainVerificationBatch(e,s,r,t,a,n,W,u)},0)}stopLineChannelTerrainVerification(){this.terrainVerificationIsRunning=!1,console.log("地物校验已停止")}enableVisibleAreaTerrainVerification(e,s,r,t,a){this.isDynamicTerrainVerificationEnabled=!0,this.setupCameraMoveListenerForTerrainVerification(e,s,r,t,a)}disableVisibleAreaTerrainVerification(){this.isDynamicTerrainVerificationEnabled=!1,this.cameraMoveHandler&&(this.cameraMoveHandler(),this.cameraMoveHandler=null)}setupCameraMoveListenerForTerrainVerification(e,s,r,t,a){this.cameraMoveHandler&&this.cameraMoveHandler(),this.cameraMoveHandler=this.viewer.camera.moveEnd.addEventListener(()=>{this.updateVisibleAreaTerrainVerification(e,s,r,t,a)})}updateVisibleAreaTerrainVerification(e,s,r,t,a){if(!this.isDynamicTerrainVerificationEnabled)return;this.getVisibleTreeIndices(s).forEach(W=>{const u=e[W];if(u){const c=[u.lon,u.lat,Number(u.alt||0)+Number(u.treeH||0)];this.performTerrainVerification(c,r,t,a)}})}getVisibleTreeIndices(e){var n;if(!this.viewer.camera||e.length===0)return[];const s=this.viewer.camera.position,r=((n=this.viewer.camera.positionCartographic)==null?void 0:n.height)||1e3;let t=Math.max(5e3,r*2);r>5e4&&(t=1e5);const a=[];for(let W=0;W<e.length;W++){const u=e[W];f.Cartesian3.distance(s,u)<=t&&a.push(W)}return a}loadTreeListen(e,s,r,t,a,n=[]){this.cameraMoveHandler&&this.removeTreeListen();const W=(c,i)=>{const l=c.scene.pick(i);if(f.defined(l)){let T=l.id;if(T===void 0&&l.primitive&&(T=l.primitive.id),T instanceof f.Entity)return T}};this.ensurePlottingDataSourceAdded(),new f.ScreenSpaceEventHandler(this.viewer.canvas).setInputAction(c=>{const i=W(this.viewer,c.position);if(i&&i.id){const l=String(i.id);if(l.startsWith("tree-")){const T=l.substring(5),p=e.find(o=>o&&o.id&&String(o.id)===T);if(p){const o=[p.lon,p.lat,Number(p.alt||0)+Number(p.treeH||0)],A=Et(o,s,r,t),g=St(o,A,p.id);a&&g&&a(g),dt(o,A,this.entityCollectionplotting,this.getClickDistanceRuleConfig(),n,U.树木)}}}},f.ScreenSpaceEventType.LEFT_CLICK)}removeTreeListen(){if(this.cameraMoveHandler){try{this.cameraMoveHandler()}catch{}this.cameraMoveHandler=null}if(this.dataSourceplotting&&this.entityCollectionplotting)try{this.entityCollectionplotting.removeAll(),this.entityCollectionplotting.show=!1}catch(e){console.warn("Error clearing tree listen entities:",e)}}loadWireListen(e,s,r,t,a,n){this.wireClickHandler&&this.removeWireListen();const W=(u,c)=>{const i=u.scene.pick(c);if(f.defined(i)){let l=i.id;if(l===void 0&&i.primitive&&(l=i.primitive.id),l instanceof f.Entity)return l}};this.ensurePlottingDataSourceAdded(),this.wireClickHandler=new f.ScreenSpaceEventHandler(this.viewer.canvas),this.wireClickHandler.setInputAction(async u=>{const c=W(this.viewer,u.position);if(c&&c.id){const i=String(c.id),l=c.name||"";if(i.includes("daoxian")||l.includes("导线")||l.includes("daoxian")){a&&c&&a(c);const p=this.viewer.scene.pickPosition(u.position);if(f.defined(p)){let o=null;if(c&&c.polyline&&c.polyline.positions){const A=c.polyline.positions.getValue(this.viewer.clock.currentTime);A&&Array.isArray(A)&&(o=A.map(g=>{const y=f.Cartographic.fromCartesian(g);return[f.Math.toDegrees(y.longitude),f.Math.toDegrees(y.latitude),y.height]}))}if((!o||o.length===0)&&(l.match(/(\d+)-(\d+)$/)&&(l.includes("A")||l.includes("_A")?o=s:l.includes("B")||l.includes("_B")?o=r:(l.includes("C")||l.includes("_C"))&&(o=t)),(!o||o.length===0)&&(o=[...s,...r,...t])),o&&o.length>1){const A=(n==null?void 0:n.measurementType)||[],g=A.includes(q.净空距离),y=A.includes(q.垂直距离)||A.includes(q.水平距离)||A.includes(q.安全距离)||A.includes(q.直线距离),L=this.interpolateWire(o,1),m=[];if(g){const B=await this.calculateAndDrawWireToGroundDistanceByType(L,[q.净空距离]).catch(v=>(console.error("Error in wire to ground distance calculation:",v),null));B&&m.push(B)}if(y){const B=(n==null?void 0:n.width)||10,v=(n==null?void 0:n.show)!==!1,b=this.drawWireCorridor(L,B);v&&this.entityCollectionplotting.add(b);const M=e.filter(S=>this.lonLatInStaticPolygonOpts(S.lon,S.lat,b));this.terrainVerificationCache.clear(),M.forEach(S=>{const R=this.calcResultSingleWire(S,L,A,this.getClickDistanceRuleConfig());R&&m.push(R)})}n!=null&&n.onMeasurementResult&&m.length>0&&n.onMeasurementResult(m)}}}}},f.ScreenSpaceEventType.LEFT_CLICK)}removeWireListen(){this.wireClickHandler&&(this.wireClickHandler.destroy(),this.wireClickHandler=null),this.clearWireCorridors()}getGroundElevation(e,s){return 0}calculateWireToGroundDistance(e){let s=1/0,r=[],t=[];for(const a of e){const[n,W,u]=a,c=this.getGroundElevation(n,W),i=Math.abs(u-c);i<s&&(s=i,r=a,t=[n,W,c])}return{distance:s,wirePoint:r,groundPoint:t}}async calculateAndDrawWireToGroundDistanceByType(e,s){if(!e||e.length===0)return null;try{const r=e.map(l=>new f.Cartographic(f.Math.toRadians(l[0]),f.Math.toRadians(l[1]))),t=this.viewer.terrainProvider;let a=[];if(t&&f.defined(t))try{a=(await f.sampleTerrainMostDetailed(t,r)).map(T=>T.height||0)}catch(l){console.warn("Terrain sampling failed, using default ground height:",l),a=new Array(e.length).fill(0)}else a=new Array(e.length).fill(0);let n=1/0,W=0;for(let l=0;l<e.length;l++){const T=e[l][2],p=a[l],o=T-p;o>0&&o<n&&(n=o,W=l)}if(n===1/0){n=1/0;for(let l=0;l<e.length;l++){const T=e[l][2],p=a[l],o=Math.abs(T-p);o<n&&(n=o,W=l)}}const u=e[W],c=[u[0],u[1],a[W]];return this.drawWireToGroundDistanceByType(u,c,n,s),{treeId:`ground-${Date.now()}`,treeCoordinates:c,conductorCoordinates:u,horizontalDistance:0,verticalDistance:parseFloat(n.toFixed(1)),straightLineDistance:parseFloat(n.toFixed(1)),clearanceDistance:parseFloat(n.toFixed(1)),timestamp:Date.now()}}catch(r){console.warn("Failed to calculate wire to ground distance:",r);const t=this.calculateWireToGroundDistance(e);return this.drawWireToGroundDistanceByType(t.wirePoint,t.groundPoint,t.distance,s),{treeId:`ground-${Date.now()}`,treeCoordinates:t.groundPoint,conductorCoordinates:t.wirePoint,horizontalDistance:0,verticalDistance:parseFloat(t.distance.toFixed(1)),straightLineDistance:parseFloat(t.distance.toFixed(1)),clearanceDistance:parseFloat(t.distance.toFixed(1)),timestamp:Date.now()}}}async calculateAndDrawWireToGroundDistanceBySegments(e,s,r,t){console.log("Calculating wire to ground distance by segments..."),console.log("A相导线数据点数:",(e==null?void 0:e.length)||0),console.log("B相导线数据点数:",(s==null?void 0:s.length)||0),console.log("C相导线数据点数:",(r==null?void 0:r.length)||0);const a=[];if(e&&e.length>=2&&a.push({name:"A",data:e}),s&&s.length>=2&&a.push({name:"B",data:s}),r&&r.length>=2&&a.push({name:"C",data:r}),console.log("有效相数:",a.length),a.length===0){console.warn("No valid wire data found for ground distance calculation");return}for(const n of a){const W=n.data;console.log(`处理${n.name}相导线,数据点数:`,W.length);const u=this.interpolateWire(W,1);console.log(`${n.name}相插值后点数:`,u.length);try{const c=u.map(g=>new f.Cartographic(f.Math.toRadians(g[0]),f.Math.toRadians(g[1]))),i=this.viewer.terrainProvider;let l=[];if(i&&f.defined(i))try{l=(await f.sampleTerrainMostDetailed(i,c)).map(y=>y.height||0)}catch(g){console.warn(`Terrain sampling failed for phase ${n.name}, using default ground height:`,g),l=new Array(u.length).fill(0)}else l=new Array(u.length).fill(0);let T=1/0,p=0;for(let g=0;g<u.length;g++){const y=u[g][2],L=l[g],m=y-L;m>0&&m<T&&(T=m,p=g)}if(T===1/0)for(let g=0;g<u.length;g++){const y=u[g][2],L=l[g],m=Math.abs(y-L);m<T&&(T=m,p=g)}console.log(`${n.name}相最低净空距离:`,T,"在索引:",p);const o=u[p],A=[o[0],o[1],l[p]];this.drawWireToGroundDistanceByType(o,A,T,t)}catch(c){console.warn(`Failed to calculate wire to ground distance for phase ${n.name}:`,c)}}console.log("Wire to ground distance calculation by segments completed.")}getDistanceTypeLabel(e,s){const r=`${s.toFixed(1)}米`;switch(e){case q.垂直距离:return`对地距离${r}`;case q.净空距离:return`净空距离${r}`;case q.安全距离:return`安全距离${r}`;default:return`距离${r}`}}drawWireToGroundDistanceByType(e,s,r,t,a=U.导线){var T,p;const n=[f.Cartesian3.fromDegrees(e[0],e[1],e[2]),f.Cartesian3.fromDegrees(s[0],s[1],s[2])];let W="#eff819",u=f.Color.RED;const c=this.distanceRuleConfig;let i,l=!1;if(t.includes(q.净空距离)&&(i=(p=(T=c.typeRules.get(a))==null?void 0:T.clearanceLevels)==null?void 0:p.find(o=>r>=o.minDistance&&r<=o.maxDistance)),i?(W=i.color,u=f.Color.fromCssColorString(i.color)):(l=!0,W="#00ff00",u=f.Color.GREEN),i||l){this.entityCollectionplotting.add({polyline:{positions:n,width:2,material:u,clampToGround:!1,shadows:f.ShadowMode.DISABLED}});const o=f.Cartesian3.midpoint(n[0],n[1],new f.Cartesian3);this.entityCollectionplotting.add({position:o,name:"净空距离",label:{text:this.getDistanceTypeLabel(q.净空距离,r),fillColor:f.Color.fromCssColorString(W),font:"12px sans-serif",pixelOffset:new f.Cartesian2(0,0),scaleByDistance:new f.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY,outlineColor:f.Color.BLACK,outlineWidth:2,style:f.LabelStyle.FILL_AND_OUTLINE}})}}clearWireCorridors(){if(!this.entityCollectionplotting)return;const e=[];this.entityCollectionplotting.values.forEach(s=>{s.name==="wire-corridor"&&e.push(s)}),e.forEach(s=>{try{this.entityCollectionplotting.remove(s)}catch{}})}interpolateWire(e,s=1){if(e.length<2)return e;const r=[];for(let t=0;t<e.length-1;t++){const a=e[t],n=e[t+1],W=f.Cartesian3.fromDegrees(a[0],a[1],a[2]),u=f.Cartesian3.fromDegrees(n[0],n[1],n[2]),c=f.Cartesian3.distance(W,u);if(c<=s){t===0&&r.push(a),r.push(n);continue}const i=Math.ceil(c/s),l=1/i;t===0&&r.push(a);for(let T=1;T<i;T++){const p=T*l,o=f.Cartesian3.lerp(W,u,p,new f.Cartesian3),A=f.Cartographic.fromCartesian(o),g=f.Math.toDegrees(A.longitude),y=f.Math.toDegrees(A.latitude),L=A.height;r.push([g,y,L])}r.push(n)}return r}lonLatInStaticPolygonOpts(e,s,r){var c;if(!(r!=null&&r.polygon))return!1;const t=r.polygon.hierarchy;if(!(t instanceof f.PolygonHierarchy))return!1;const a=t.positions;if(!a||a.length<3)return!1;const n=f.Cartographic.fromDegrees(e,s),W=new f.Cartesian2(n.longitude,n.latitude),u=a.map(i=>{const l=f.Cartographic.fromCartesian(i);return new f.Cartesian2(l.longitude,l.latitude)});if(!this.pointInRing(W,u))return!1;if((c=t.holes)!=null&&c.length)for(const i of t.holes){const l=i.positions.map(T=>{const p=f.Cartographic.fromCartesian(T);return new f.Cartesian2(p.longitude,p.latitude)});if(this.pointInRing(W,l))return!1}return!0}pointInRing(e,s){let r=!1;const t=e.x,a=e.y;for(let n=0,W=s.length-1;n<s.length;W=n++){const u=s[n].x,c=s[n].y,i=s[W].x,l=s[W].y;c>a!=l>a&&t<(i-u)*(a-c)/(l-c)+u&&(r=!r)}return r}pointInPolygon2D(e,s){let r=!1;const t=e.x,a=e.y;for(let n=0,W=s.length-1;n<s.length;W=n++){const u=s[n].x,c=s[n].y,i=s[W].x,l=s[W].y;c>a!=l>a&&t<(i-u)*(a-c)/(l-c)+u&&(r=!r)}return r}drawWireCorridor(e,s){const r=[],t=[];for(let W=0;W<e.length;W++){const u=e[W],c=f.Cartesian3.fromDegrees(u[0],u[1],u[2]);let i,l;if(W===0){const B=e[W+1];l=f.Cartesian3.fromDegrees(B[0],B[1],B[2]),i=c}else if(W===e.length-1){const B=e[W-1];i=f.Cartesian3.fromDegrees(B[0],B[1],B[2]),l=c}else{const B=e[W-1],v=e[W+1];i=f.Cartesian3.fromDegrees(B[0],B[1],B[2]),l=f.Cartesian3.fromDegrees(v[0],v[1],v[2])}const T=f.Cartesian3.subtract(l,i,new f.Cartesian3);f.Cartesian3.normalize(T,T);const p=f.Cartesian3.clone(c);f.Cartesian3.normalize(p,p);const o=f.Cartesian3.cross(T,p,new f.Cartesian3);f.Cartesian3.normalize(o,o);const A=s/2,g=f.Cartesian3.multiplyByScalar(o,A,new f.Cartesian3),y=f.Cartesian3.multiplyByScalar(o,-A,new f.Cartesian3),L=f.Cartesian3.add(c,g,new f.Cartesian3),m=f.Cartesian3.add(c,y,new f.Cartesian3);r.push(L),t.push(m)}const a=[];return a.push(...r),a.push(...t.reverse()),a.push(r[0]),{id:`wire-corridor-${Date.now()}`,name:"wire-corridor",polygon:{hierarchy:new f.PolygonHierarchy(a),material:f.Color.YELLOW.withAlpha(.3),outline:!0,outlineColor:f.Color.YELLOW,outlineWidth:2}}}calcResult(e,s,r,t,a=this.distanceRuleConfig,n=[],W=U.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const u=`${e[0].toFixed(6)}_${e[1].toFixed(6)}_${e[2].toFixed(2)}`;if(this.terrainVerificationCache.has(u)){const c=this.terrainVerificationCache.get(u);dt(e,c,this.entityCollectionplotting,a,n,W);return}else{const c=Et(e,s,r,t);this.terrainVerificationCache.set(u,c),dt(e,c,this.entityCollectionplotting,a||this.distanceRuleConfig,n,W)}}calcResultSingleWire(e,s,r,t=this.distanceRuleConfig,a=U.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return null;const n=[e.lon,e.lat,Number(e.alt||0)+Number(e.treeH||0)],W=`${n[0].toFixed(6)}_${n[1].toFixed(6)}_${n[2].toFixed(2)}`;if(this.terrainVerificationCache.has(W)){const u=this.terrainVerificationCache.get(W);return dt(n,u,this.entityCollectionplotting,t,r,a),St(n,u,e.id)}else{const u=s;return this.terrainVerificationCache.set(W,u),dt(n,u,this.entityCollectionplotting,t||this.distanceRuleConfig,r,a),St(n,u,e.id)}}LineChannelTerrainVerificationForFilteredTrees(e,s,r,t,a,n=100,W=[],u){if(console.log(`LineChannelTerrainVerificationForFilteredTrees called with ${e.length} trees`),this.terrainVerificationIsRunning){console.log("地物校验已在运行中,跳过重复调用");return}this.ensurePlottingDataSourceAdded(),this.clearTreeDistanceResultsExceptCorridor(),this.terrainVerificationBatchSize=n,this.terrainVerificationBatchIndex=0,this.terrainVerificationTotalBatches=Math.ceil(e.length/n),this.terrainVerificationIsRunning=!0,console.log(`开始对${e.length}棵树进行地物校验`),this.processTerrainVerificationBatch(e,s,r,t,a,W,u)}getChannelCalculationDataSources(){return[this.dataSourceplotting]}setWireToWireDistanceRuleConfig(e){this.wireToWireDistanceRuleConfig=e}getWireToWireDistanceRuleConfig(){const e=new zt;return e.phaseRules=new Map(this.wireToWireDistanceRuleConfig.phaseRules),e}calculateWireToWireDistance(e,s,r=G.A相,t=G.B相){const a=new fs;if(a.timestamp=Date.now(),a.phase1=r,a.phase2=t,e.length<2||s.length<2)return console.warn("导线数据点数不足,无法计算线间距离"),a;const n=this.interpolateWire(e,1),W=this.interpolateWire(s,1);let u=1/0,c=[],i=[];for(const l of n){const T=f.Cartesian3.fromDegrees(l[0],l[1],l[2]);for(const p of W){const o=f.Cartesian3.fromDegrees(p[0],p[1],p[2]),A=f.Cartesian3.distance(T,o);A<u&&(u=A,c=l,i=p)}}if(c.length>0&&i.length>0){a.wire1Coordinates=c,a.wire2Coordinates=i,a.straightLineDistance=parseFloat(u.toFixed(2));const l=this.calculateHorizontalDistance(c,i);a.horizontalDistance=parseFloat(l.toFixed(2));const T=Math.abs(c[2]-i[2]);a.verticalDistance=parseFloat(T.toFixed(2)),this.determineWireToWireStatus(a)}return a}calculateHorizontalDistance(e,s){const r=f.Cartesian3.fromDegrees(e[0],e[1],0),t=f.Cartesian3.fromDegrees(s[0],s[1],0);return f.Cartesian3.distance(r,t)}determineWireToWireStatus(e){const s=this.wireToWireDistanceRuleConfig.getRules(e.phase1,e.phase2);if(!s||s.distanceLevels.length===0){e.status="正常",e.statusColor="#00ff00";return}const r=e.straightLineDistance;for(const t of s.distanceLevels)if(r>=t.minDistance&&r<=t.maxDistance){e.status=t.name,e.statusColor=t.color;return}e.status="正常",e.statusColor="#00ff00"}drawWireToWireDistance(e){this.ensurePlottingDataSourceAdded();const s=["A相","B相","C相","地线1","地线2","全部"],r=s[e.phase1],t=s[e.phase2],a=[f.Cartesian3.fromDegrees(e.wire1Coordinates[0],e.wire1Coordinates[1],e.wire1Coordinates[2]),f.Cartesian3.fromDegrees(e.wire2Coordinates[0],e.wire2Coordinates[1],e.wire2Coordinates[2])];this.entityCollectionplotting.add({name:`线间距离-${r}-${t}-线段`,polyline:{positions:a,width:3,material:f.Color.fromCssColorString(e.statusColor),clampToGround:!1,shadows:f.ShadowMode.DISABLED}});const n=f.Cartesian3.midpoint(a[0],a[1],new f.Cartesian3);this.entityCollectionplotting.add({position:n,name:`线间距离-${r}-${t}`,label:{text:`${r}-${t}: ${e.straightLineDistance.toFixed(2)}m`,fillColor:f.Color.fromCssColorString(e.statusColor),font:"14px sans-serif",pixelOffset:new f.Cartesian2(0,0),scaleByDistance:new f.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY,outlineColor:f.Color.BLACK,outlineWidth:2,style:f.LabelStyle.FILL_AND_OUTLINE}})}createDefaultWireToWireDistanceRuleConfig(){const e=new zt,s={distanceLevels:[{name:"危险",minDistance:0,maxDistance:3,color:"#ff0000",isAlarm:!0},{name:"警告",minDistance:3,maxDistance:5,color:"#ffa500",isAlarm:!0},{name:"安全",minDistance:5,maxDistance:1/0,color:"#00ff00",isAlarm:!1}],enabled:!0},r=[G.A相,G.B相,G.C相,G.地线1,G.地线2];for(let t=0;t<r.length;t++)for(let a=t+1;a<r.length;a++)e.setRules(r[t],r[a],{...s});return e}}function As(h,e){let s=0;for(let r of h)r!=null&&(r=+r)>=r&&++s;return s}function ws(h,e){let s,r;if(e===void 0)for(const t of h)t!=null&&(s===void 0?t>=t&&(s=r=t):(s>t&&(s=t),r<t&&(r=t)));else{let t=-1;for(let a of h)(a=e(a,++t,h))!=null&&(s===void 0?a>=a&&(s=r=a):(s>a&&(s=a),r<a&&(r=a)))}return[s,r]}const Ls=Math.sqrt(50),gs=Math.sqrt(10),Is=Math.sqrt(2);function _t(h,e,s){const r=(e-h)/Math.max(0,s),t=Math.floor(Math.log10(r)),a=r/Math.pow(10,t),n=a>=Ls?10:a>=gs?5:a>=Is?2:1;let W,u,c;return t<0?(c=Math.pow(10,-t)/n,W=Math.round(h*c),u=Math.round(e*c),W/c<h&&++W,u/c>e&&--u,c=-c):(c=Math.pow(10,t)*n,W=Math.round(h/c),u=Math.round(e/c),W*c<h&&++W,u*c>e&&--u),u<W&&.5<=s&&s<2?_t(h,e,s*2):[W,u,c]}function ms(h,e,s){if(e=+e,h=+h,s=+s,!(s>0))return[];if(h===e)return[h];const r=e<h,[t,a,n]=r?_t(e,h,s):_t(h,e,s);if(!(a>=t))return[];const W=a-t+1,u=new Array(W);if(r)if(n<0)for(let c=0;c<W;++c)u[c]=(a-c)/-n;else for(let c=0;c<W;++c)u[c]=(a-c)*n;else if(n<0)for(let c=0;c<W;++c)u[c]=(t+c)/-n;else for(let c=0;c<W;++c)u[c]=(t+c)*n;return u}function ys(h,e,s){return e=+e,h=+h,s=+s,_t(h,e,s)[2]}function Bs(h,e,s){let r;for(;;){const t=ys(h,e,s);if(t===r||t===0||!isFinite(t))return[h,e];t>0?(h=Math.floor(h/t)*t,e=Math.ceil(e/t)*t):t<0&&(h=Math.ceil(h*t)/t,e=Math.floor(e*t)/t),r=t}}function Ps(h){return Math.max(1,Math.ceil(Math.log(As(h))/Math.LN2)+1)}var vs=Array.prototype,bs=vs.slice;function Ds(h,e){return h-e}function Ms(h){for(var e=0,s=h.length,r=h[s-1][1]*h[0][0]-h[s-1][0]*h[0][1];++e<s;)r+=h[e-1][1]*h[e][0]-h[e-1][0]*h[e][1];return r}const Ie=h=>()=>h;function Es(h,e){for(var s=-1,r=e.length,t;++s<r;)if(t=Rs(h,e[s]))return t;return 0}function Rs(h,e){for(var s=e[0],r=e[1],t=-1,a=0,n=h.length,W=n-1;a<n;W=a++){var u=h[a],c=u[0],i=u[1],l=h[W],T=l[0],p=l[1];if(Ss(u,l,e))return 0;i>r!=p>r&&s<(T-c)*(r-i)/(p-i)+c&&(t=-t)}return t}function Ss(h,e,s){var r;return _s(h,e,s)&&ks(h[r=+(h[0]===e[0])],s[r],e[r])}function _s(h,e,s){return(e[0]-h[0])*(s[1]-h[1])===(s[0]-h[0])*(e[1]-h[1])}function ks(h,e,s){return h<=e&&e<=s||s<=e&&e<=h}function Fs(){}var ut=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function $s(){var h=1,e=1,s=Ps,r=u;function t(c){var i=s(c);if(Array.isArray(i))i=i.slice().sort(Ds);else{const l=ws(c,Zs);for(i=ms(...Bs(l[0],l[1],i),i);i[i.length-1]>=l[1];)i.pop();for(;i[1]<l[0];)i.shift()}return i.map(l=>a(c,l))}function a(c,i){const l=i==null?NaN:+i;if(isNaN(l))throw new Error(`invalid value: ${i}`);var T=[],p=[];return n(c,l,function(o){r(o,c,l),Ms(o)>0?T.push([o]):p.push(o)}),p.forEach(function(o){for(var A=0,g=T.length,y;A<g;++A)if(Es((y=T[A])[0],o)!==-1){y.push(o);return}}),{type:"MultiPolygon",value:i,coordinates:T}}function n(c,i,l){var T=new Array,p=new Array,o,A,g,y,L,m;for(o=A=-1,y=pt(c[0],i),ut[y<<1].forEach(B);++o<h-1;)g=y,y=pt(c[o+1],i),ut[g|y<<1].forEach(B);for(ut[y<<0].forEach(B);++A<e-1;){for(o=-1,y=pt(c[A*h+h],i),L=pt(c[A*h],i),ut[y<<1|L<<2].forEach(B);++o<h-1;)g=y,y=pt(c[A*h+h+o+1],i),m=L,L=pt(c[A*h+o+1],i),ut[g|y<<1|L<<2|m<<3].forEach(B);ut[y|L<<3].forEach(B)}for(o=-1,L=c[A*h]>=i,ut[L<<2].forEach(B);++o<h-1;)m=L,L=pt(c[A*h+o+1],i),ut[L<<2|m<<3].forEach(B);ut[L<<3].forEach(B);function B(v){var b=[v[0][0]+o,v[0][1]+A],M=[v[1][0]+o,v[1][1]+A],S=W(b),R=W(M),E,D;(E=p[S])?(D=T[R])?(delete p[E.end],delete T[D.start],E===D?(E.ring.push(M),l(E.ring)):T[E.start]=p[D.end]={start:E.start,end:D.end,ring:E.ring.concat(D.ring)}):(delete p[E.end],E.ring.push(M),p[E.end=R]=E):(E=T[R])?(D=p[S])?(delete T[E.start],delete p[D.end],E===D?(E.ring.push(M),l(E.ring)):T[D.start]=p[E.end]={start:D.start,end:E.end,ring:D.ring.concat(E.ring)}):(delete T[E.start],E.ring.unshift(b),T[E.start=S]=E):T[S]=p[R]={start:S,end:R,ring:[b,M]}}}function W(c){return c[0]*2+c[1]*(h+1)*4}function u(c,i,l){c.forEach(function(T){var p=T[0],o=T[1],A=p|0,g=o|0,y=Jt(i[g*h+A]);p>0&&p<h&&A===p&&(T[0]=me(p,Jt(i[g*h+A-1]),y,l)),o>0&&o<e&&g===o&&(T[1]=me(o,Jt(i[(g-1)*h+A]),y,l))})}return t.contour=a,t.size=function(c){if(!arguments.length)return[h,e];var i=Math.floor(c[0]),l=Math.floor(c[1]);if(!(i>=0&&l>=0))throw new Error("invalid size");return h=i,e=l,t},t.thresholds=function(c){return arguments.length?(s=typeof c=="function"?c:Array.isArray(c)?Ie(bs.call(c)):Ie(c),t):s},t.smooth=function(c){return arguments.length?(r=c?u:Fs,t):r===u},t}function Zs(h){return isFinite(h)?h:NaN}function pt(h,e){return h==null?!1:+h>=e}function Jt(h){return h==null||isNaN(h=+h)?-1/0:h}function me(h,e,s,r){const t=r-e,a=s-e,n=isFinite(t)||isFinite(a)?t/a:Math.sign(t)/Math.sign(a);return isNaN(n)?h:h+n-.5}function Xs(h){return h.primitive!==void 0}class Ys{constructor(e){w(this,"viewer");w(this,"lineInfo",null);w(this,"contourEntities",[]);w(this,"mountainEntities",[]);w(this,"contourConfig",{contourInterval:50,corridorWidthKm:1,interpolationPrecision:50,contourColor:"#00ff00",contourWidth:2,showLabels:!0,labelFontSize:12});w(this,"mountainConfig",{minElev:500,minProm:300,minDistance:500});this.viewer=e}setMountainConfig(e){this.mountainConfig={...this.mountainConfig,...e}}getMountainConfig(){return{...this.mountainConfig}}setContourConfig(e){this.contourConfig={...this.contourConfig,...e}}getContourConfig(){return{...this.contourConfig}}setLineInfo(e){this.lineInfo=e}calculateCorridorBounds(){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)return null;const e=this.lineInfo.towers;let s=1/0,r=-1/0,t=1/0,a=-1/0;e.forEach(u=>{u.Longitude<s&&(s=u.Longitude),u.Longitude>r&&(r=u.Longitude),u.Latitude<t&&(t=u.Latitude),u.Latitude>a&&(a=u.Latitude)});const n=1/111,W=this.contourConfig.corridorWidthKm*n;return s-=W,r+=W,t-=W,a+=W,[s,t,r,a]}async getHeightFromTerrain(e,s){var r;try{const t=[f.Cartographic.fromDegrees(e,s)];return((r=(await f.sampleTerrainMostDetailed(this.viewer.terrainProvider,t))[0])==null?void 0:r.height)??0}catch(t){return console.warn(`获取高度失败 [${e}, ${s}]:`,t),0}}async generateGridPoints(e){const[s,r,t,a]=e,n=1/111,W=this.contourConfig.interpolationPrecision/1e3*n,u=Math.ceil((t-s)/W)+1,c=Math.ceil((a-r)/W)+1,i=u*c;let l=0;const T=new Array(i),p=[];console.log(`[d3-contour] 开始生成网格点: 总点数 ${i}, 经度步数 ${u}, 纬度步数 ${c}`);for(let o=0;o<c;o++){const A=a-o*W;for(let g=0;g<u;g++){const y=s+g*W,L=await this.getHeightFromTerrain(y,A),m=o*u+g;if(T[m]=L,p.push({longitude:y,latitude:A,height:L}),l++,l%100===0){const B=(l/i*100).toFixed(1);console.log(`[d3-contour] 网格点生成进度: ${l}/${i} (${B}%)`)}}}return console.log(`[d3-contour] 网格点生成完成: 共生成 ${p.length} 个点`),{values:T,width:u,height:c,x0:s,y0:a,dx:W,dy:-W,points:p}}generateContours(e){const s=[],{contourInterval:r}=this.contourConfig;if(e.values.length===0||e.width<2||e.height<2)return s;console.log(`[d3-contour] 开始生成等高线,等高距: ${r}m`);const t=e.values.filter(i=>i!=null);if(t.length===0)return s;const a=Math.floor(Math.min(...t)/r)*r,n=Math.ceil(Math.max(...t)/r)*r,W=[];for(let i=a;i<=n;i+=r)W.push(i);const c=$s().size([e.width,e.height]).thresholds(W)(e.values);return console.log(`[d3-contour] d3-contour 生成了 ${c.length} 条等高线`),c.forEach(i=>{const l={height:i.value,points:[]};i.coordinates.forEach(T=>{T.forEach(p=>{p.forEach(o=>{const A=e.x0+o[0]*e.dx,g=e.y0+o[1]*e.dy,y=this.getHeightAtGridPoint(e,o[0],o[1]);l.points.push({longitude:A,latitude:g,height:y})})})}),l.points.length>=2&&s.push(l)}),console.log(`[d3-contour] 转换完成,共 ${s.length} 条有效等高线`),s}getHeightAtGridPoint(e,s,r){const t=Math.floor(s),a=Math.floor(r),n=Math.min(t+1,e.width-1),W=Math.min(a+1,e.height-1),u=a*e.width+t,c=a*e.width+n,i=W*e.width+t,l=W*e.width+n,T=e.values[u]||0,p=e.values[c]||0,o=e.values[i]||0,A=e.values[l]||0,g=s-t,y=r-a,L=T*(1-g)+p*g,m=o*(1-g)+A*g;return L*(1-y)+m*y}drawContours(e){this.clearContours();const{contourColor:s,contourWidth:r,showLabels:t,labelFontSize:a}=this.contourConfig;console.log(`开始绘制等高线: ${e.length} 条, 颜色: ${s}, 宽度: ${r}`),e.forEach((n,W)=>{if(n.points.length<2)return;const u=f.Cartesian3.fromDegreesArray(n.points.flatMap(i=>[i.longitude,i.latitude])),c=new f.GroundPolylinePrimitive({geometryInstances:new f.GeometryInstance({geometry:new f.GroundPolylineGeometry({positions:u,width:r})}),appearance:new f.PolylineMaterialAppearance({material:f.Material.fromType("Color",{color:f.Color.fromCssColorString(s)})})});if(this.viewer.scene.primitives.add(c),this.contourEntities.push({primitive:c}),console.log(`绘制等高线 ${W}: 高度 ${n.height}m, 点数 ${n.points.length}`),t&&n.points.length>0){const i=Math.floor(n.points.length/2),l=n.points[i],T=this.viewer.entities.add({name:`Contour_Label_${W}_${n.height}m`,position:f.Cartesian3.fromDegrees(l.longitude,l.latitude,l.height+10),label:{text:`${n.height}m`,font:`${a}px sans-serif`,fillColor:f.Color.WHITE,outlineColor:f.Color.BLACK,outlineWidth:2,style:f.LabelStyle.FILL_AND_OUTLINE,verticalOrigin:f.VerticalOrigin.CENTER,horizontalOrigin:f.HorizontalOrigin.CENTER,heightReference:f.HeightReference.CLAMP_TO_GROUND}});this.contourEntities.push(T)}})}async getAndDrawContours(e,s){debugger;if(s&&this.setContourConfig(s),e&&this.setLineInfo(e),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");console.log(`等高线获取范围: [${r[0].toFixed(6)}, ${r[1].toFixed(6)}, ${r[2].toFixed(6)}, ${r[3].toFixed(6)}]`),console.log(`等高距: ${this.contourConfig.contourInterval}m, 插值精度: ${this.contourConfig.interpolationPrecision}m`);const t=await this.generateGridPoints(r);console.log(`生成网格点数量: ${t.points.length}`);const a=this.generateContours(t);return console.log(`生成等高线数量: ${a.length}`),this.drawContours(a),a}async getContourData(e,s){if(s&&this.setContourConfig(s),e&&this.setLineInfo(e),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");const t=await this.generateGridPoints(r);return this.generateContours(t)}async getCorridorGridData(e,s){if(s&&this.setContourConfig(s),e&&this.setLineInfo(e),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");return(await this.generateGridPoints(r)).points}clearContours(){this.contourEntities.forEach(e=>{try{Xs(e)?this.viewer.scene.primitives.remove(e.primitive):this.viewer.entities.remove(e)}catch(s){console.warn("Error removing contour entity:",s)}}),this.contourEntities=[]}setCorridorWidthKm(e){this.contourConfig.corridorWidthKm=e}setContourInterval(e){this.contourConfig.contourInterval=e}setInterpolationPrecision(e){this.contourConfig.interpolationPrecision=e}getCorridorWidthKm(){return this.contourConfig.corridorWidthKm}getContourInterval(){return this.contourConfig.contourInterval}async generateCrossSection(e,s){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const r=this.lineInfo.towers;if(e<0||e>=r.length)throw new Error("无效的塔位索引");const t={width:100,interval:10,interpolationMethod:"linear",mountainThreshold:300,mountainProminence:50,...s},a=r[e];let n=a,W=a;e>0&&(n=r[e-1]),e<r.length-1&&(W=r[e+1]);const u=W.Longitude-n.Longitude,i=-(W.Latitude-n.Latitude),l=u,T=Math.sqrt(i*i+l*l),p={dx:i/T,dy:l/T},o=t.width/2,A=6371e3,g=o/A*(180/Math.PI),y=o/A*(180/Math.PI)/Math.cos(a.Latitude*Math.PI/180),L=a.Longitude-p.dx*y,m=a.Latitude-p.dy*g,B=a.Longitude+p.dx*y,v=a.Latitude+p.dy*g,b=[],M=Math.ceil(t.width/t.interval)+1;for(let E=0;E<M;E++){const D=E/(M-1),$=L+(B-L)*D,k=m+(v-m)*D,F=(D-.5)*t.width,X=await this.getHeightFromTerrain($,k);b.push({distance:F,height:X,lon:$,lat:k,isCenter:Math.abs(F)<t.interval/2,isMountain:!1})}const S=this.applyInterpolation(b,t.interpolationMethod),R=this.detectMountains(S,t.mountainThreshold,t.mountainProminence);return R.forEach(E=>{S.forEach(D=>{D.distance>=E.startDistance&&D.distance<=E.endDistance&&(D.isMountain=!0)})}),{points:S,mountains:R}}applyInterpolation(e,s){return s==="cubic"?this.cubicSplineInterpolation(e):s==="nearest"?[...e]:[...e]}cubicSplineInterpolation(e){if(e.length<2)return e;const s=[],r=2;for(let t=0;t<e.length-1;t++){const a=e[t],n=e[t+1],W=t>0?e[t-1]:a,u=t<e.length-2?e[t+2]:n;for(let c=0;c<r;c++){const i=c/r,l=i*i,T=l*i,p=2*T-3*l+1,o=T-2*l+i,A=-2*T+3*l,g=T-l,y=p*a.height+o*(n.distance-a.distance)*this.getSlope(W,a,n)+A*n.height+g*(n.distance-a.distance)*this.getSlope(a,n,u),L=a.distance+(n.distance-a.distance)*i;s.push({distance:L,height:y,lon:a.lon,lat:a.lat,isCenter:a.isCenter||n.isCenter,isMountain:!1})}}return s.push({...e[e.length-1]}),s}getSlope(e,s,r){const t=s.distance-e.distance,a=r.distance-s.distance;return t===0?(r.height-s.height)/(a||1):a===0?(s.height-e.height)/t:((s.height-e.height)/t+(r.height-s.height)/a)/2}detectMountains(e,s,r){const t=[];if(e.length<3)return t;for(let a=1;a<e.length-1;a++){const n=e[a],W=e[a-1],u=e[a+1];if(n.height>W.height&&n.height>u.height){let c=a,i=a,l=n.height,T=n.height;for(let A=a-1;A>=0&&n.height-e[A].height>=r;A--)c=A,l=e[A].height;for(let A=a+1;A<e.length&&n.height-e[A].height>=r;A++)i=A,T=e[A].height;const p=(l+T)/2,o=n.height-p;o>=s&&t.push({id:t.length+1,peakDistance:n.distance,peakHeight:n.height,startDistance:e[c].distance,endDistance:e[i].distance,heightDiff:o,path:`[${e[c].distance.toFixed(1)}m, ${n.distance.toFixed(1)}m, ${e[i].distance.toFixed(1)}m]`})}}return t}async generateLongSection(e){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length<2)throw new Error("线路信息为空或杆塔数量不足");const s=this.lineInfo.towers,r={interval:50,interpolationMethod:"linear",...e},t=[];let a=0;t.push({towerName:s[0].name||"塔1",distance:a,height:s[0].Altitude||0,isTower:!0});for(let n=0;n<s.length-1;n++){const W=s[n],u=s[n+1],c=(u.Longitude-W.Longitude)*111e3,i=(u.Latitude-W.Latitude)*111e3,l=Math.sqrt(c*c+i*i),T=Math.floor(l/r.interval);for(let p=1;p<=T;p++){const o=p*r.interval/l,A=a+p*r.interval;if(r.interpolationMethod==="nearest"){const g=o<.5?W.Altitude||0:u.Altitude||0;t.push({towerName:"",distance:A,height:g,isTower:!1})}else{const g=(W.Altitude||0)+((u.Altitude||0)-(W.Altitude||0))*o;t.push({towerName:"",distance:A,height:g,isTower:!1})}}a+=l,t.push({towerName:u.name||`塔${n+2}`,distance:a,height:u.Altitude||0,isTower:!0})}return t}calculateCrossSectionLine(e,s){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)return null;const r=this.lineInfo.towers;if(e<0||e>=r.length)return null;const t=r[e];let a=t,n=t;e>0&&(a=r[e-1]),e<r.length-1&&(n=r[e+1]);const W=n.Longitude-a.Longitude,c=-(n.Latitude-a.Latitude),i=W,l=Math.sqrt(c*c+i*i),T={dx:c/l,dy:i/l},p=s/2,o=6371e3,A=p/o*(180/Math.PI),g=p/o*(180/Math.PI)/Math.cos(t.Latitude*Math.PI/180);return{start:{lon:t.Longitude-T.dx*g,lat:t.Latitude-T.dy*A},end:{lon:t.Longitude+T.dx*g,lat:t.Latitude+T.dy*A}}}async getAndDrawMountains(e,s,r){if(s&&this.setContourConfig(s),r&&this.setMountainConfig(r),e&&this.setLineInfo(e),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const t=this.calculateCorridorBounds();if(!t)throw new Error("无法计算通道边界");console.log(`山峰识别范围: [${t[0].toFixed(6)}, ${t[1].toFixed(6)}, ${t[2].toFixed(6)}, ${t[3].toFixed(6)}]`),console.log(`山峰识别参数: minElev=${this.mountainConfig.minElev}m, minProm=${this.mountainConfig.minProm}m`);const a=await this.generateGridPoints(t);console.log(`生成网格点数量: ${a.points.length}`);const n=this.generateContours(a);console.log(`生成等高线数量: ${n.length}`);const W=this.detectMountainsFromGrid(a,n);return console.log(`识别到山峰数量: ${W.length}, 有效山峰: ${W.filter(u=>u.isValid).length}`),this.drawContours(n),this.drawMountains(W),W}detectMountainsFromGrid(e,s){const r=this.findCandidatePeaks(e,s);console.log(`粗筛候选山峰: ${r.length} 个`);const t=r.map((n,W)=>{const u=this.calculateProminence(n,e,s);return{id:W+1,longitude:n.longitude,latitude:n.latitude,elevation:n.elevation,prominence:u.prominence,saddleElevation:u.saddleElevation,isValid:u.prominence>=this.mountainConfig.minProm}});return this.deduplicateMountains(t)}findCandidatePeaks(e,s){const r=[],{minElev:t}=this.mountainConfig,a=[...s].sort((W,u)=>u.height-W.height),n=new Set;for(const W of a)if(!(W.height<t)&&W.points.length>=3){const u=this.calculatePolygonCenter(W.points),c=Math.floor((u.longitude-e.x0)/e.dx),i=Math.floor((u.latitude-e.y0)/e.dy),l=`${c},${i}`;if(!n.has(l)){n.add(l);const T=this.getHeightAtGridPoint(e,c,i);r.push({longitude:u.longitude,latitude:u.latitude,elevation:T})}}return r}calculatePolygonCenter(e){if(e.length===0)return{longitude:0,latitude:0};let s=0,r=0;return e.forEach(t=>{s+=t.longitude,r+=t.latitude}),{longitude:s/e.length,latitude:r/e.length}}calculateProminence(e,s,r){const t=e.elevation,a=[...r].sort((c,i)=>i.height-c.height);let n=t,W=!1;for(const c of a)if(!(c.height>=t))if(this.isPointInsideContour(e,c))n=c.height,W=!0;else break;return W||(n=Math.min(...s.values.filter(i=>i>0))),{prominence:t-n,saddleElevation:n}}isPointInsideContour(e,s){if(s.points.length<3)return!1;let r=!1;const t=s.points.length;for(let a=0,n=t-1;a<t;n=a++){const W=s.points[a].longitude,u=s.points[a].latitude,c=s.points[n].longitude,i=s.points[n].latitude;u>e.latitude!=i>e.latitude&&e.longitude<(c-W)*(e.latitude-u)/(i-u)+W&&(r=!r)}return r}deduplicateMountains(e){const{minDistance:s}=this.mountainConfig,r=[],t=new Set;for(let a=0;a<e.length;a++){if(t.has(a))continue;const n=e[a],W=[n];t.add(a);for(let u=a+1;u<e.length;u++){if(t.has(u))continue;this.calculateDistance(n,e[u])<s&&(W.push(e[u]),t.add(u))}if(W.length===1)r.push(n);else{const u=W.reduce((c,i)=>i.elevation>c.elevation?i:c);r.push(u)}}return r}calculateDistance(e,s){const t=(s.latitude-e.latitude)*Math.PI/180,a=(s.longitude-e.longitude)*Math.PI/180,n=Math.sin(t/2)*Math.sin(t/2)+Math.cos(e.latitude*Math.PI/180)*Math.cos(s.latitude*Math.PI/180)*Math.sin(a/2)*Math.sin(a/2);return 6371e3*(2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n)))}drawMountains(e){this.clearMountains(),e.forEach((s,r)=>{if(!s.isValid)return;const t=this.viewer.entities.add({name:`Mountain_Peak_${r+1}`,position:f.Cartesian3.fromDegrees(s.longitude,s.latitude,s.elevation+10),point:{pixelSize:10,color:f.Color.RED,outlineColor:f.Color.WHITE,outlineWidth:2,heightReference:f.HeightReference.CLAMP_TO_GROUND},label:{text:`${s.elevation.toFixed(0)}m
2
- Prom: ${s.prominence.toFixed(0)}m`,font:"14px sans-serif",fillColor:f.Color.WHITE,outlineColor:f.Color.BLACK,outlineWidth:2,style:f.LabelStyle.FILL_AND_OUTLINE,verticalOrigin:f.VerticalOrigin.BOTTOM,horizontalOrigin:f.HorizontalOrigin.CENTER,heightReference:f.HeightReference.CLAMP_TO_GROUND,pixelOffset:new f.Cartesian2(0,-15)}});this.mountainEntities.push(t),console.log(`绘制山峰 ${r+1}: [${s.longitude.toFixed(6)}, ${s.latitude.toFixed(6)}], 海拔 ${s.elevation.toFixed(0)}m, 突出度 ${s.prominence.toFixed(0)}m`)})}clearMountains(){this.mountainEntities.forEach(e=>{try{this.viewer.entities.remove(e)}catch(s){console.warn("Error removing mountain entity:",s)}}),this.mountainEntities=[]}async getMountainData(e,s,r){if(s&&this.setContourConfig(s),r&&this.setMountainConfig(r),e&&this.setLineInfo(e),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const t=this.calculateCorridorBounds();if(!t)throw new Error("无法计算通道边界");const a=await this.generateGridPoints(t),n=this.generateContours(a);return this.detectMountainsFromGrid(a,n)}detectTerrainFeatures(e,s,r){const t=[],a=[],n=s.windowSize,W=e.length;if(W<n*2+1)return{peaks:t,valleys:a};const u=(l,T)=>T===0?90:Math.atan(Math.abs(l)/Math.abs(T))*180/Math.PI;for(let l=n;l<W-n;l++){const T=e[l];if(T.height<s.minPeakElev)continue;let p=!0,o=T.height;for(let D=l-n;D<=l+n;D++){if(e[D].height>T.height){p=!1;break}e[D].height<o&&(o=e[D].height)}if(!p)continue;const A=T.height-o;if(A<s.minPeakDiff)continue;let g=l,y=l;for(let D=l-1;D>=0&&T.height-e[D].height>=s.minPeakDiff/2;D--)g=D;for(let D=l+1;D<W&&T.height-e[D].height>=s.minPeakDiff/2;D++)y=D;const L=T.height-e[g].height,m=T.height-e[y].height,B=T.distance-e[g].distance,v=e[y].distance-T.distance,b=u(L,B),M=u(m,v),S=s.peakMode==="slope_only"||A>=s.minPeakDiff,R=s.peakMode==="height_diff"||b>=s.minPeakSlope&&M>=s.minPeakSlope,E=s.peakMode==="both"?A>=s.minPeakDiff&&b>=s.minPeakSlope&&M>=s.minPeakSlope:!0;if(s.peakMode==="both"){if(!E)continue}else if(s.peakMode==="height_diff"){if(!S)continue}else if(!R)continue;t.push({id:t.length+1,type:"peak",distance:T.distance,height:T.height,startDistance:e[g].distance,endDistance:e[y].distance,heightDiff:A})}for(let l=n;l<W-n;l++){const T=e[l];let p=!0,o=T.height;for(let D=l-n;D<=l+n;D++){if(e[D].height<T.height){p=!1;break}e[D].height>o&&(o=e[D].height)}if(!p)continue;const A=o-T.height;if(A<s.minValleyDiff)continue;let g=l,y=l;for(let D=l-1;D>=0&&e[D].height-T.height>=s.minValleyDiff/2;D--)g=D;for(let D=l+1;D<W&&e[D].height-T.height>=s.minValleyDiff/2;D++)y=D;const L=e[g].height-T.height,m=e[y].height-T.height,B=T.distance-e[g].distance,v=e[y].distance-T.distance,b=u(L,B),M=u(m,v),S=s.valleyMode==="slope_only"||A>=s.minValleyDiff,R=s.valleyMode==="height_diff"||b>=s.minValleySlope&&M>=s.minValleySlope,E=s.valleyMode==="both"?A>=s.minValleyDiff&&b>=s.minValleySlope&&M>=s.minValleySlope:!0;if(s.valleyMode==="both"){if(!E)continue}else if(s.valleyMode==="height_diff"){if(!S)continue}else if(!R)continue;a.push({id:a.length+1,type:"valley",distance:T.distance,height:T.height,startDistance:e[g].distance,endDistance:e[y].distance,heightDiff:A})}const c=this.mergeCloseFeatures(t,r*2),i=this.mergeCloseFeatures(a,r*2);return c.sort((l,T)=>l.distance-T.distance),i.sort((l,T)=>l.distance-T.distance),c.forEach((l,T)=>l.id=T+1),i.forEach((l,T)=>l.id=T+1),{peaks:c,valleys:i}}mergeCloseFeatures(e,s){if(e.length<=1)return e;const r=[...e].sort((a,n)=>a.distance-n.distance),t=[r[0]];for(let a=1;a<r.length;a++){const n=t[t.length-1],W=r[a];W.distance-n.distance<s?W.type==="peak"?W.height>n.height&&(t[t.length-1]=W):W.height<n.height&&(t[t.length-1]=W):t.push(W)}return t}async generateCrossSectionWithFeatures(e,s,r){const t=await this.generateCrossSection(e,s),a=t.points.map(c=>({distance:c.distance,height:c.height})),{peaks:n,valleys:W}=this.detectTerrainFeatures(a,r,s.interval??10),u=t.points.map(c=>({...c,type:c.isCenter?"center":"normal"}));return n.forEach(c=>{const i=u.find(l=>Math.abs(l.distance-c.distance)<(s.interval??10)/2);i&&(i.type="peak")}),W.forEach(c=>{const i=u.find(l=>Math.abs(l.distance-c.distance)<(s.interval??10)/2);i&&(i.type="valley")}),{points:u,peaks:n,valleys:W}}}class Vs{constructor(e,s,r){w(this,"viewer");w(this,"LineInfo");w(this,"lineConstruction");w(this,"terrainConstruction");w(this,"channelCalculation");w(this,"contourConstruction");w(this,"selectedWireEntity",null);w(this,"originalWireColor",null);w(this,"wireCorridorWidth",10);w(this,"showWireCorridor",!0);w(this,"wireMeasurementType",[]);w(this,"isDynamicLoadingEnabled",!0);w(this,"pathEntities",[]);w(this,"selectedWire1Entity",null);w(this,"selectedWire1Data",[]);w(this,"selectedWire1Phase",G.A相);w(this,"originalWire1Color",null);this.viewer=e,this.LineInfo=s,this.lineConstruction=new Ts(e,s,r),this.terrainConstruction=new Ut(e,s,r),this.channelCalculation=new ps(e),this.contourConstruction=new Ys(e),this.enableWireMeasurement=this.enableWireMeasurement.bind(this),this.removeWireListen=this.removeWireListen.bind(this)}setAutoCalculateRollX(e){this.lineConstruction.setAutoCalculateRollX(e)}getAutoCalculateRollX(){return this.lineConstruction.getAutoCalculateRollX()}setDynamicLoadingEnabled(e){this.isDynamicLoadingEnabled=e,this.lineConstruction.setDynamicLoadingEnabled(e),this.terrainConstruction.setDynamicLoadingEnabled(e)}setDynamicLoadingEnabled_line(e){this.lineConstruction.setDynamicLoadingEnabled(e)}setDynamicLoadingEnabled_Tree(e){this.terrainConstruction.setDynamicLoadingEnabled(e)}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}initializeLineData(){this.lineConstruction.initializeLineData()}loadLineTower(){this.lineConstruction.loadLineTower()}loadLODWireOnly(){this.lineConstruction.LODloadAllWiresOnly()}setLineVisible(e){this.lineConstruction.setLineVisible(e)}setTreeVisible(e){this.terrainConstruction.setTreeVisible(e)}loadLineModel(){this.lineConstruction.getLineDataSources().forEach(s=>{this.viewer.dataSources.contains(s)||this.viewer.dataSources.add(s)})}loadTree(){this.terrainConstruction.loadTree()}loadtreeModel(){this.terrainConstruction.getTerrainDataSources().forEach(e=>{this.viewer.dataSources.contains(e)||this.viewer.dataSources.add(e)})}addTreeData(e){this.terrainConstruction.addTreeData(e)}flyToTower(e){this.lineConstruction.flyToTower(e)}flyToTree(e){this.terrainConstruction.flyToTree(e)}loadTreeListen(e,s=[]){const r=this.terrainConstruction.getLineInfo().corridor_features,t=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.loadTreeListen(r,t.arcLine1A1,t.arcLine1B1,t.arcLine1C1,e,s)}removeTreeListen(){this.channelCalculation.removeTreeListen()}loadWireListen(){const e=this.terrainConstruction.getLineInfo().corridor_features,s=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.loadWireListen(e,s.arcLine1A1,s.arcLine1B1,s.arcLine1C1)}removeWireListen(){if(this.channelCalculation.removeWireListen(),this.selectedWireEntity&&this.originalWireColor){try{this.selectedWireEntity.polyline&&(this.selectedWireEntity.polyline.material=f.Color.fromCssColorString(this.originalWireColor))}catch(e){console.warn("Error restoring wire color:",e)}this.selectedWireEntity=null,this.originalWireColor=null}}clearWireMeasurementResults(){this.channelCalculation.clearTreeDistanceResults()}enableWireMeasurement(e){const s=this.terrainConstruction.getLineInfo().corridor_features,r=this.lineConstruction.getWireDataForChannelCalculation(),t=n=>{if(this.selectedWireEntity&&this.originalWireColor&&this.selectedWireEntity.polyline&&(this.selectedWireEntity.polyline.material=f.Color.fromCssColorString(this.originalWireColor)),n.polyline&&n.polyline.material){const W=n.polyline.material;W instanceof f.Color?this.originalWireColor=W.toCssColorString():this.originalWireColor="#ffffff",n.polyline.material=f.Color.YELLOW,this.selectedWireEntity=n}},a={width:this.wireCorridorWidth,show:this.showWireCorridor,measurementType:this.wireMeasurementType,onMeasurementResult:e};this.channelCalculation.loadWireListen(s,r.arcLine1A1,r.arcLine1B1,r.arcLine1C1,t,a)}setWireCorridorWidth(e){this.wireCorridorWidth=e}setShowWireCorridor(e){this.showWireCorridor=e}setWireMeasurementType(e){this.wireMeasurementType=e}async LineChannelTerrainVerification(e=[],s,r=100){const t=this.terrainConstruction.getLineInfo().corridor_features,a=this.terrainConstruction.getOffsetTrees(),n=this.lineConstruction.getAllWireSegments();let W=[],u=[],c=[];if(n.wireSegments1A1.length>0)n.wireSegments1A1.forEach(i=>{i&&i.length>0&&W.push(...i)}),n.wireSegments1B1.forEach(i=>{i&&i.length>0&&u.push(...i)}),n.wireSegments1C1.forEach(i=>{i&&i.length>0&&c.push(...i)}),console.log(`使用按塔段存储的导线数据: A相=${W.length}点, B相=${u.length}点, C相=${c.length}点`),await this.calculateClearanceBySegments(n);else{const i=this.lineConstruction.getWireDataForChannelCalculation();W=i.arcLine1A1,u=i.arcLine1B1,c=i.arcLine1C1,console.log(`使用整体导线数据: A相=${W.length}点, B相=${u.length}点, C相=${c.length}点`)}this.channelCalculation.LineChannelTerrainVerification(t,a,W,u,c,r,e,s)}async calculateClearanceBySegments(e){var t,a,n;console.log("========== 开始按塔段计算净空距离 ==========");const s=Math.max(e.wireSegments1A1.length,e.wireSegments1B1.length,e.wireSegments1C1.length);console.log(`塔段总数: ${s}`),console.log(`A相塔段数: ${e.wireSegments1A1.length}`),console.log(`B相塔段数: ${e.wireSegments1B1.length}`),console.log(`C相塔段数: ${e.wireSegments1C1.length}`);const r=[];if(e.wireSegments1A1.length>0&&((t=e.wireSegments1A1[0])==null?void 0:t.length)>0?(r.push({key:"A",data:e.wireSegments1A1}),console.log("A相数据有效,加入计算")):console.log("A相数据无效或为空"),e.wireSegments1B1.length>0&&((a=e.wireSegments1B1[0])==null?void 0:a.length)>0?(r.push({key:"B",data:e.wireSegments1B1}),console.log("B相数据有效,加入计算")):console.log("B相数据无效或为空"),e.wireSegments1C1.length>0&&((n=e.wireSegments1C1[0])==null?void 0:n.length)>0?(r.push({key:"C",data:e.wireSegments1C1}),console.log("C相数据有效,加入计算")):console.log("C相数据无效或为空"),console.log(`有效相数: ${r.length} (${r.map(W=>W.key).join(", ")})`),r.length===0){console.log("没有有效相数据,跳过净空距离计算");return}for(let W=0;W<s;W++){console.log(`
3
- --- 处理塔段 ${W} ---`);for(const u of r){const c=u.data[W];if(!c){console.log(`${u.key}相 塔段${W} 数据为空,跳过`);continue}if(c.length<2){console.log(`${u.key}相 塔段${W} 点数不足(${c.length}点),跳过`);continue}console.log(`${u.key}相 塔段${W}: ${c.length}个点,开始计算净空距离`);try{await this.channelCalculation.calculateAndDrawWireToGroundDistanceByType(c,[q.线间距离测量]),console.log(`${u.key}相 塔段${W} 净空距离计算完成`)}catch(i){console.error(`${u.key}相 塔段${W} 净空距离计算失败:`,i)}}}console.log(`
4
- ========== 按塔段净空距离计算完成 ==========`)}LineChannelTerrainVerificationByTowerRange(e,s,r,t=100,a=2e3,n=!1,W=!0,u=[],c=0,i="ABC"){debugger;const l=this.LineInfo.towers;let T=-1,p=-1;for(let _=0;_<l.length;_++)(l[_].id==e||l[_].name==e)&&(T=_),(l[_].id==s||l[_].name==s)&&(p=_);if(T===-1||p===-1){console.warn("未找到指定的杆塔范围,使用全部线路进行校验");return}T>p&&([T,p]=[p,T]);const o=this.lineConstruction.getAllWireSegments();console.log(`获取到的导线数据: 回路1-A相${o.wireSegments1A1.length}段, B相${o.wireSegments1B1.length}段, C相${o.wireSegments1C1.length}段; 回路2-A相${o.wireSegments2A1.length}段, B相${o.wireSegments2B1.length}段, C相${o.wireSegments2C1.length}段`),console.log(`杆塔索引范围: ${T} - ${p}`);let A=o.wireSegments1A1,g=o.wireSegments1B1,y=o.wireSegments1C1,L=[],m=[],B=[];(c===0||c===2)&&(L=o.wireSegments2A1,m=o.wireSegments2B1,B=o.wireSegments2C1);const v=[],b=[],M=[],S=[],R=[],E=[];for(let _=T+1;_<=p;_++)console.log(`检查塔段索引${_}: 回路1-A相存在=${!!A[_]}, B相存在=${!!g[_]}, C相存在=${!!y[_]}; 回路2-A相存在=${!!L[_]}, B相存在=${!!m[_]}, C相存在=${!!B[_]}`),(c===0||c===1)&&(A[_]&&v.push(A[_]),g[_]&&b.push(g[_]),y[_]&&M.push(y[_])),(c===0||c===2)&&(L[_]&&S.push(L[_]),m[_]&&R.push(m[_]),B[_]&&E.push(B[_]));console.log(`塔段范围 ${T}-${p}: 回路1-A相${v.length}段, B相${b.length}段, C相${M.length}段; 回路2-A相${S.length}段, B相${R.length}段, C相${E.length}段`);const D=[],$=[],k=[],F=[],X=[],Y=[];for(let _=0;_<v.length;_++)D.push(...v[_]);for(let _=0;_<b.length;_++)$.push(...b[_]);for(let _=0;_<M.length;_++)k.push(...M[_]);for(let _=0;_<S.length;_++)F.push(...S[_]);for(let _=0;_<R.length;_++)X.push(...R[_]);for(let _=0;_<E.length;_++)Y.push(...E[_]);i==="A"?($.splice(0),k.splice(0),X.splice(0),Y.splice(0)):i==="B"?(D.splice(0),k.splice(0),F.splice(0),Y.splice(0)):i==="C"?(D.splice(0),$.splice(0),F.splice(0),X.splice(0)):i==="AB"?(k.splice(0),Y.splice(0)):i==="AC"?($.splice(0),X.splice(0)):i==="BC"&&(D.splice(0),F.splice(0)),console.log(`导线数据状态(回路${c},相序${i}): 回路1-A相=${D.length}, B相=${$.length}, C相=${k.length}; 回路2-A相=${F.length}, B相=${X.length}, C相=${Y.length}`);const H=this.terrainConstruction.getLineInfo().corridor_features,O=this.terrainConstruction.getOffsetTrees();console.log(`总树木数量: ${H.length}`);const z=l.slice(T,p+1),yt=ds(z,a);if(n){if(yt.length>0){this.channelCalculation.drawCorridorPolygon(yt,`corridor-${e}-${s}`);const _=z.map(Tt=>[Tt.Longitude,Tt.Latitude]);this.channelCalculation.drawCorridorDistanceMarkers(_,a,`corridor-${e}-${s}`,W)}}else this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers();const At=Cs(H,yt);console.log(`通道内树木数量: ${At.length}`);const et=[],Ft=new Map;if(H.forEach((_,Tt)=>{Ft.set(_,Tt)}),At.forEach(_=>{const Tt=Ft.get(_);Tt!==void 0&&et.push(O[Tt])}),At.length===0){console.warn("指定杆塔范围的通道内没有找到树木"),r&&r([]);return}const Qt=D.length>0||$.length>0||k.length>0,Bt=F.length>0||X.length>0||Y.length>0;if(!Qt&&!Bt){console.error("过滤后的导线数据为空,无法进行测量"),r&&r([]);return}console.log(`开始对${At.length}棵树进行测量...`);let N=[...D],J=[...$],be=[...k];(c===0||c===2)&&Bt&&(N.push(...F),J.push(...X),be.push(...Y)),this.channelCalculation.LineChannelTerrainVerificationForFilteredTrees(At,et,N,J,be,t,u,_=>{if(u.includes(q.净空距离)){if(c===0||c===1)for(let ot=0;ot<v.length;ot++){const wt=T+ot,Pt=wt+1,xt=v[ot]||[],te=b[ot]||[],ee=M[ot]||[];let ht=[...xt],ft=[...te],at=[...ee];i==="A"?(ft=[],at=[]):i==="B"?(ht=[],at=[]):i==="C"?(ht=[],ft=[]):i==="AB"?at=[]:i==="AC"?ft=[]:i==="BC"&&(ht=[]),console.log(`计算塔段 ${wt}-${Pt} (回路1) 的净空距离: A相=${ht.length}, B相=${ft.length}, C相=${at.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(ht,ft,at,u).catch(se=>{console.error(`Error calculating wire to ground distance for segment ${wt}-${Pt} (circuit 1):`,se)})}if((c===0||c===2)&&Bt)for(let ot=0;ot<S.length;ot++){const wt=T+ot,Pt=wt+1,xt=S[ot]||[],te=R[ot]||[],ee=E[ot]||[];let ht=[...xt],ft=[...te],at=[...ee];i==="A"?(ft=[],at=[]):i==="B"?(ht=[],at=[]):i==="C"?(ht=[],ft=[]):i==="AB"?at=[]:i==="AC"?ft=[]:i==="BC"&&(ht=[]),console.log(`计算塔段 ${wt}-${Pt} (回路2) 的净空距离: A相=${ht.length}, B相=${ft.length}, C相=${at.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(ht,ft,at,u).catch(se=>{console.error(`Error calculating wire to ground distance for segment ${wt}-${Pt} (circuit 2):`,se)})}}r&&r(_)})}stopLineChannelTerrainVerification(){this.channelCalculation.stopLineChannelTerrainVerification()}enableVisibleAreaTerrainVerification(){const e=this.terrainConstruction.getLineInfo().corridor_features,s=this.terrainConstruction.getOffsetTrees(),r=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.enableVisibleAreaTerrainVerification(e,s,r.arcLine1A1,r.arcLine1B1,r.arcLine1C1)}disableVisibleAreaTerrainVerification(){this.channelCalculation.disableVisibleAreaTerrainVerification()}setMaxVisibleTerrainResults(e=200){this.channelCalculation.setMaxVisibleTerrainResults(e)}setDistanceRuleConfig(e){this.channelCalculation.setDistanceRuleConfig(e)}getDistanceRuleConfig(){return this.channelCalculation.getDistanceRuleConfig()}clearTreeDistanceResults(){this.channelCalculation.clearTreeDistanceResults()}clearCorridorDisplay(){try{this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers()}catch(e){console.warn("Error clearing corridor display:",e)}}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}getContourConfig(){return this.contourConstruction.getContourConfig()}setContourConfig(e){this.contourConstruction.setContourConfig(e)}setContourCorridorWidthKm(e){this.contourConstruction.setCorridorWidthKm(e)}setContourInterval(e){this.contourConstruction.setContourInterval(e)}setContourInterpolationPrecision(e){this.contourConstruction.setInterpolationPrecision(e)}async getAndDrawContours(e){return this.contourConstruction.getAndDrawContours(this.LineInfo,e)}async getContourData(e){return this.contourConstruction.getContourData(this.LineInfo,e)}async getCorridorGridData(e){return this.contourConstruction.getCorridorGridData(this.LineInfo,e)}clearContours(){this.contourConstruction.clearContours()}async getAndDrawMountains(e,s){return this.contourConstruction.getAndDrawMountains(this.LineInfo,e,s)}async getMountainData(e,s){return this.contourConstruction.getMountainData(this.LineInfo,e,s)}clearMountains(){this.contourConstruction.clearMountains()}drawLinePath(e="#ff0000",s=3,r=!1){if(this.clearLinePath(),!this.LineInfo||!this.LineInfo.towers||this.LineInfo.towers.length<2){console.warn("无法绘制路径:杆塔数据不足");return}const t=this.LineInfo.towers,a=t.map(W=>f.Cartesian3.fromDegrees(W.Longitude,W.Latitude,W.Altitude)),n=this.viewer.entities.add({name:"LinePath",polyline:{positions:a,width:s,material:f.Color.fromCssColorString(e),clampToGround:r}});this.pathEntities.push(n),console.log(`线路路径绘制完成: ${t.length} 个杆塔点`)}clearLinePath(){this.pathEntities.forEach(e=>{try{this.viewer.entities.remove(e)}catch(s){console.warn("Error removing path entity:",s)}}),this.pathEntities=[]}async generateCrossSection(e,s){return this.contourConstruction.generateCrossSection(e,s||{})}async generateLongSection(e){return this.contourConstruction.generateLongSection(e||{})}calculateCrossSectionLine(e,s){return this.contourConstruction.calculateCrossSectionLine(e,s)}async generateCrossSectionWithFeatures(e,s,r){return this.contourConstruction.generateCrossSectionWithFeatures(e,s,r)}setLineInfoForContour(e){this.contourConstruction.setLineInfo(e)}setWireToWireDistanceRuleConfig(e){this.channelCalculation.setWireToWireDistanceRuleConfig(e)}getWireToWireDistanceRuleConfig(){return this.channelCalculation.getWireToWireDistanceRuleConfig()}createDefaultWireToWireDistanceRuleConfig(){return this.channelCalculation.createDefaultWireToWireDistanceRuleConfig()}enableWireToWireMeasurement(e){const s=this.lineConstruction.getWireDataForChannelCalculation(),r=(a,n)=>{const W=a.scene.pick(n);if(f.defined(W)){let u=W.id;if(u===void 0&&W.primitive&&(u=W.primitive.id),u instanceof f.Entity)return u}},t=new f.ScreenSpaceEventHandler(this.viewer.canvas);t.setInputAction(a=>{const n=r(this.viewer,a.position);if(n&&n.id){const W=String(n.id),u=n.name||"";if(W.includes("daoxian")||u.includes("导线")||u.includes("daoxian")||W.includes("dixian")||u.includes("地线")||u.includes("ground")){let i=[],l=G.A相;if(n.polyline&&n.polyline.positions){const T=n.polyline.positions.getValue(this.viewer.clock.currentTime);T&&Array.isArray(T)&&(i=T.map(p=>{const o=f.Cartographic.fromCartesian(p);return[f.Math.toDegrees(o.longitude),f.Math.toDegrees(o.latitude),o.height]}))}if(u.includes("A相")||u.includes("_A相")||u.includes("_A")&&!u.includes("_A相")?l=G.A相:u.includes("B相")||u.includes("_B相")||u.includes("_B")&&!u.includes("_B相")?l=G.B相:u.includes("C相")||u.includes("_C相")||u.includes("_C")&&!u.includes("_C相")?l=G.C相:u.includes("地线1")||u.includes("dixian1")||u.includes("ground1")||u.includes("GD1")?l=G.地线1:u.includes("地线2")||u.includes("dixian2")||u.includes("ground2")||u.includes("GD2")?l=G.地线2:(u.includes("地线")||u.includes("dixian")||u.includes("ground")||u.includes("GD"))&&(l=G.地线1),i.length===0&&(l===G.A相?i=s.arcLine1A1:l===G.B相?i=s.arcLine1B1:l===G.C相&&(i=s.arcLine1C1)),this.selectedWire1Entity&&this.originalWire1Color)try{this.selectedWire1Entity.polyline&&(this.selectedWire1Entity.polyline.material=f.Color.fromCssColorString(this.originalWire1Color))}catch(T){console.warn("Error restoring wire color:",T)}if(this.selectedWire1Entity)if(this.selectedWire1Entity!==n){const T=this.channelCalculation.calculateWireToWireDistance(this.selectedWire1Data,i,this.selectedWire1Phase,l);this.channelCalculation.drawWireToWireDistance(T),e&&e(T),this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=G.A相,this.originalWire1Color=null,console.log(`导线间距测量完成: ${T.straightLineDistance.toFixed(2)}米`)}else this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=G.A相,this.originalWire1Color=null,console.log("已取消选择导线");else{if(this.selectedWire1Entity=n,this.selectedWire1Data=i,this.selectedWire1Phase=l,n.polyline&&n.polyline.material){const T=n.polyline.material;T instanceof f.Color?this.originalWire1Color=T.toCssColorString():this.originalWire1Color="#ffffff",n.polyline.material=f.Color.YELLOW}console.log(`已选中第一根导线: ${["A相","B相","C相","地线1","地线2","全部"][l]}`)}}}},f.ScreenSpaceEventType.LEFT_CLICK),window.wireToWireHandler=t}disableWireToWireMeasurement(){if(this.selectedWire1Entity&&this.originalWire1Color)try{this.selectedWire1Entity.polyline&&(this.selectedWire1Entity.polyline.material=f.Color.fromCssColorString(this.originalWire1Color))}catch(s){console.warn("Error restoring wire color:",s)}this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=G.A相,this.originalWire1Color=null;const e=window.wireToWireHandler;e&&(e.destroy(),window.wireToWireHandler=null)}clearWireToWireMeasurementResults(){if(this.channelCalculation){const e=this.channelCalculation.entityCollectionplotting;if(e){const s=[];e.values.forEach(r=>{r.name&&r.name.startsWith("线间距离")&&s.push(r)}),s.forEach(r=>{try{e.remove(r)}catch(t){console.warn("Error removing wire to wire measurement entity:",t)}})}}}}class Hs{constructor(){w(this,"id","");w(this,"name","");w(this,"towerFZinfo","");w(this,"towerDisFile","");w(this,"stressFileContent","");w(this,"streesistrue",0);w(this,"TowerMemberColor","#FFFFFF");w(this,"TowerMembersWidth",2);w(this,"Longitude",0);w(this,"Latitude",0);w(this,"Altitude",0);w(this,"RollX",0);w(this,"RollY",90);w(this,"RollZ",0)}}function Os(h){debugger;const e=h.split(`
1
+ (function(Z,Y){typeof exports=="object"&&typeof module<"u"?Y(exports,require("cesium")):typeof define=="function"&&define.amd?define(["exports","cesium"],Y):(Z=typeof globalThis<"u"?globalThis:Z||self,Y(Z.OW_EEngine_Power={},Z.Cesium))})(this,function(Z,Y){"use strict";var Us=Object.defineProperty;var Js=(Z,Y,At)=>Y in Z?Us(Z,Y,{enumerable:!0,configurable:!0,writable:!0,value:At}):Z[Y]=At;var w=(Z,Y,At)=>Js(Z,typeof Y!="symbol"?Y+"":Y,At);function At(h){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const s in h)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(h,s);Object.defineProperty(e,s,r.get?r:{enumerable:!0,get:()=>h[s]})}}return e.default=h,Object.freeze(e)}const f=At(Y);function De(h,e,s={}){const{color:r=Y.Color.WHITE,width:t=3,clampToGround:a=!1,zIndex:n=0,dashed:W=!1,dashLength:u=10}=s,c=W?new f.PolylineDashMaterialProperty({color:r,dashLength:u}):new f.ColorMaterialProperty(r);return h.entities.add({polyline:{positions:e,width:t,material:c,clampToGround:a,zIndex:n}})}function C(h,e,s=10,r="#ba1919",t,a=!1){const n={show:!0,positions:h,clampToGround:a,width:s,material:f.Color.fromCssColorString(r),arcType:f.ArcType.NONE,shadows:f.ShadowMode.DISABLED,granularity:a?void 0:0};let W;return W=[0,1e5],n.distanceDisplayCondition=new f.DistanceDisplayCondition(W[0],W[1]),{name:e,label:{text:e,font:"18px sans-serif",distanceDisplayCondition:new f.DistanceDisplayCondition(W[0],Math.min(W[1],5e3))},polyline:n}}function Zt(h,e,s,r,t=new f.HeadingPitchRoll(0,0,0),a=1,n){const W={show:!0,uri:r,scale:a,transition:{distanceDisplayCondition:!0,scale:!0}};return n&&(Array.isArray(n)?W.distanceDisplayCondition=new f.DistanceDisplayCondition(n[0],n[1]):W.distanceDisplayCondition=n),{id:h,name:s,position:e,orientation:f.Transforms.headingPitchRollQuaternion(e,t),model:W}}function Pt(h,e,s,r={}){const{pointColor:t=Y.Color.YELLOW,pointSize:a=12,labelColor:n=Y.Color.WHITE,fontSize:W=16,pixelOffset:u=[0,-20],heightReference:c=Y.HeightReference.NONE}=r;return h.entities.add({position:e,point:{color:t,pixelSize:a,heightReference:c,distanceDisplayCondition:new f.DistanceDisplayCondition(0,100)},label:{text:s,font:`${W}px sans-serif`,fillColor:n,pixelOffset:new f.Cartesian2(...u),style:Y.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,outlineColor:Y.Color.BLACK,heightReference:c,distanceDisplayCondition:new f.DistanceDisplayCondition(0,100)}})}var tt=63710088e-1,ie={centimeters:tt*100,centimetres:tt*100,degrees:tt/111325,feet:tt*3.28084,inches:tt*39.37,kilometers:tt/1e3,kilometres:tt/1e3,meters:tt,metres:tt,miles:tt/1609.344,millimeters:tt*1e3,millimetres:tt*1e3,nauticalmiles:tt/1852,radians:1,yards:tt*1.0936};function Wt(h,e,s){s===void 0&&(s={});var r={type:"Feature"};return(s.id===0||s.id)&&(r.id=s.id),s.bbox&&(r.bbox=s.bbox),r.properties=e||{},r.geometry=h,r}function st(h,e,s){if(s===void 0&&(s={}),!h)throw new Error("coordinates is required");if(!Array.isArray(h))throw new Error("coordinates must be an Array");if(h.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ne(h[0])||!ne(h[1]))throw new Error("coordinates must contain numbers");var r={type:"Point",coordinates:h};return Wt(r,e,s)}function Me(h,e,s){s===void 0&&(s={});for(var r=0,t=h;r<t.length;r++){var a=t[r];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var n=0;n<a[a.length-1].length;n++)if(a[a.length-1][n]!==a[0][n])throw new Error("First and last Position are not equivalent.")}var W={type:"Polygon",coordinates:h};return Wt(W,e,s)}function Q(h,e,s){if(s===void 0&&(s={}),h.length<2)throw new Error("coordinates must be an array of two or more positions");var r={type:"LineString",coordinates:h};return Wt(r,e,s)}function Ee(h,e){e===void 0&&(e={});var s={type:"FeatureCollection"};return e.id&&(s.id=e.id),e.bbox&&(s.bbox=e.bbox),s.features=h,s}function Re(h,e,s){s===void 0&&(s={});var r={type:"MultiLineString",coordinates:h};return Wt(r,e,s)}function oe(h,e){e===void 0&&(e="kilometers");var s=ie[e];if(!s)throw new Error(e+" units is invalid");return h*s}function Xt(h,e){e===void 0&&(e="kilometers");var s=ie[e];if(!s)throw new Error(e+" units is invalid");return h/s}function _e(h,e){return vt(Xt(h,e))}function vt(h){var e=h%(2*Math.PI);return e*180/Math.PI}function nt(h){var e=h%360;return e*Math.PI/180}function re(h,e,s){if(e===void 0&&(e="kilometers"),s===void 0&&(s="kilometers"),!(h>=0))throw new Error("length must be a positive number");return oe(Xt(h,e),s)}function ne(h){return!isNaN(h)&&h!==null&&!Array.isArray(h)}function he(h){return!!h&&h.constructor===Object}function fe(h,e,s){if(h!==null)for(var r,t,a,n,W,u,c,i=0,l=0,T,p=h.type,o=p==="FeatureCollection",A=p==="Feature",g=o?h.features.length:1,y=0;y<g;y++){c=o?h.features[y].geometry:A?h.geometry:h,T=c?c.type==="GeometryCollection":!1,W=T?c.geometries.length:1;for(var L=0;L<W;L++){var m=0,B=0;if(n=T?c.geometries[L]:c,n!==null){u=n.coordinates;var v=n.type;switch(i=0,v){case null:break;case"Point":if(e(u,l,y,m,B)===!1)return!1;l++,m++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(e(u[r],l,y,m,B)===!1)return!1;l++,v==="MultiPoint"&&m++}v==="LineString"&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(t=0;t<u[r].length-i;t++){if(e(u[r][t],l,y,m,B)===!1)return!1;l++}v==="MultiLineString"&&m++,v==="Polygon"&&B++}v==="Polygon"&&m++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(B=0,t=0;t<u[r].length;t++){for(a=0;a<u[r][t].length-i;a++){if(e(u[r][t][a],l,y,m,B)===!1)return!1;l++}B++}m++}break;case"GeometryCollection":for(r=0;r<n.geometries.length;r++)if(fe(n.geometries[r],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Se(h,e){if(h.type==="Feature")e(h,0);else if(h.type==="FeatureCollection")for(var s=0;s<h.features.length&&e(h.features[s],s)!==!1;s++);}function ke(h,e){var s,r,t,a,n,W,u,c,i,l,T=0,p=h.type==="FeatureCollection",o=h.type==="Feature",A=p?h.features.length:1;for(s=0;s<A;s++){for(W=p?h.features[s].geometry:o?h.geometry:h,c=p?h.features[s].properties:o?h.properties:{},i=p?h.features[s].bbox:o?h.bbox:void 0,l=p?h.features[s].id:o?h.id:void 0,u=W?W.type==="GeometryCollection":!1,n=u?W.geometries.length:1,t=0;t<n;t++){if(a=u?W.geometries[t]:W,a===null){if(e(null,T,c,i,l)===!1)return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(a,T,c,i,l)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<a.geometries.length;r++)if(e(a.geometries[r],T,c,i,l)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}T++}}function ae(h,e){ke(h,function(s,r,t,a,n){var W=s===null?null:s.type;switch(W){case null:case"Point":case"LineString":case"Polygon":return e(Wt(s,t,{bbox:a,id:n}),r,0)===!1?!1:void 0}var u;switch(W){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon";break}for(var c=0;c<s.coordinates.length;c++){var i=s.coordinates[c],l={type:u,coordinates:i};if(e(Wt(l,t),r,c)===!1)return!1}})}function Fe(h,e){ae(h,function(s,r,t){var a=0;if(s.geometry){var n=s.geometry.type;if(!(n==="Point"||n==="MultiPoint")){var W,u=0,c=0,i=0;if(fe(s,function(l,T,p,o,A){if(W===void 0||r>u||o>c||A>i){W=l,u=r,c=o,i=A,a=0;return}var g=Q([W,l],s.properties);if(e(g,r,t,A,a)===!1)return!1;a++,W=l})===!1)return!1}}})}function Ct(h){if(!h)throw new Error("coord is required");if(!Array.isArray(h)){if(h.type==="Feature"&&h.geometry!==null&&h.geometry.type==="Point")return h.geometry.coordinates;if(h.type==="Point")return h.coordinates}if(Array.isArray(h)&&h.length>=2&&!Array.isArray(h[0])&&!Array.isArray(h[1]))return h;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function $t(h){if(Array.isArray(h))return h;if(h.type==="Feature"){if(h.geometry!==null)return h.geometry.coordinates}else if(h.coordinates)return h.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function le(h,e,s){if(!h)throw new Error("No feature passed");if(!s)throw new Error(".featureOf() requires a name");if(!h||h.type!=="Feature"||!h.geometry)throw new Error("Invalid input to "+s+", Feature with geometry required");if(!h.geometry||h.geometry.type!==e)throw new Error("Invalid input to "+s+": must be a "+e+", given "+h.geometry.type)}function Ze(h){return h.type==="Feature"?h.geometry:h}function Xe(h,e){return h.type==="FeatureCollection"?"FeatureCollection":h.type==="GeometryCollection"?"GeometryCollection":h.type==="Feature"&&h.geometry!==null?h.geometry.type:h.type}var gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $e(h,e,s){if(s===void 0&&(s={}),!h)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=Ct(h),t=Ze(e),a=t.type,n=e.bbox,W=t.coordinates;if(n&&Ve(r,n)===!1)return!1;a==="Polygon"&&(W=[W]);for(var u=!1,c=0;c<W.length&&!u;c++)if(ce(r,W[c][0],s.ignoreBoundary)){for(var i=!1,l=1;l<W[c].length&&!i;)ce(r,W[c][l],!s.ignoreBoundary)&&(i=!0),l++;i||(u=!0)}return u}function ce(h,e,s){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var t=0,a=e.length-1;t<e.length;a=t++){var n=e[t][0],W=e[t][1],u=e[a][0],c=e[a][1],i=h[1]*(n-u)+W*(u-h[0])+c*(h[0]-n)===0&&(n-h[0])*(u-h[0])<=0&&(W-h[1])*(c-h[1])<=0;if(i)return!s;var l=W>h[1]!=c>h[1]&&h[0]<(u-n)*(h[1]-W)/(c-W)+n;l&&(r=!r)}return r}function Ve(h,e){return e[0]<=h[0]&&e[1]<=h[1]&&e[2]>=h[0]&&e[3]>=h[1]}function lt(h,e,s){s===void 0&&(s={});var r=Ct(h),t=Ct(e),a=nt(t[1]-r[1]),n=nt(t[0]-r[0]),W=nt(r[1]),u=nt(t[1]),c=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(n/2),2)*Math.cos(W)*Math.cos(u);return oe(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),s.units)}function Ye(h){if(!h)throw new Error("geojson is required");switch(h.type){case"Feature":return ue(h);case"FeatureCollection":return He(h);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Vt(h);default:throw new Error("unknown GeoJSON type")}}function ue(h){var e={type:"Feature"};return Object.keys(h).forEach(function(s){switch(s){case"type":case"properties":case"geometry":return;default:e[s]=h[s]}}),e.properties=We(h.properties),e.geometry=Vt(h.geometry),e}function We(h){var e={};return h&&Object.keys(h).forEach(function(s){var r=h[s];typeof r=="object"?r===null?e[s]=null:Array.isArray(r)?e[s]=r.map(function(t){return t}):e[s]=We(r):e[s]=r}),e}function He(h){var e={type:"FeatureCollection"};return Object.keys(h).forEach(function(s){switch(s){case"type":case"features":return;default:e[s]=h[s]}}),e.features=h.features.map(function(s){return ue(s)}),e}function Vt(h){var e={type:h.type};return h.bbox&&(e.bbox=h.bbox),h.type==="GeometryCollection"?(e.geometries=h.geometries.map(function(s){return Vt(s)}),e):(e.coordinates=Ce(h.coordinates),e)}function Ce(h){var e=h;return typeof e[0]!="object"?e.slice():e.map(function(s){return Ce(s)})}function Yt(h,e,s,r){r===void 0&&(r={});var t=Ct(h),a=nt(t[0]),n=nt(t[1]),W=nt(s),u=Xt(e,r.units),c=Math.asin(Math.sin(n)*Math.cos(u)+Math.cos(n)*Math.sin(u)*Math.cos(W)),i=a+Math.atan2(Math.sin(W)*Math.sin(u)*Math.cos(n),Math.cos(u)-Math.sin(n)*Math.sin(c)),l=vt(i),T=vt(c);return st([l,T],r.properties)}function bt(h,e,s){if(s===void 0&&(s={}),s.final===!0)return Oe(h,e);var r=Ct(h),t=Ct(e),a=nt(r[0]),n=nt(t[0]),W=nt(r[1]),u=nt(t[1]),c=Math.sin(n-a)*Math.cos(u),i=Math.cos(W)*Math.sin(u)-Math.sin(W)*Math.cos(u)*Math.cos(n-a);return vt(Math.atan2(c,i))}function Oe(h,e){var s=bt(e,h);return s=(s+180)%360,s}function Ne(h,e){var s=lt(h,e),r=bt(h,e),t=Yt(h,s/2,r);return t}function Ge(h,e){if(!h)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var s,r=1/0,t=0;return Se(e,function(a,n){var W=lt(h,a);W<r&&(t=n,r=W)}),s=Ye(e.features[t]),s.properties.featureIndex=t,s.properties.distanceToPoint=r,s}function ze(h,e,s){s===void 0&&(s={});var r=Ct(h),t=Ct(e);t[0]+=t[0]-r[0]>180?-360:r[0]-t[0]>180?360:0;var a=Ke(r,t),n=re(a,"meters",s.units);return n}function Ke(h,e,s){s=s===void 0?tt:Number(s);var r=s,t=h[1]*Math.PI/180,a=e[1]*Math.PI/180,n=a-t,W=Math.abs(e[0]-h[0])*Math.PI/180;W>Math.PI&&(W-=2*Math.PI);var u=Math.log(Math.tan(a/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),c=Math.abs(u)>1e-11?n/u:Math.cos(t),i=Math.sqrt(n*n+c*c*W*W),l=i*r;return l}function wt(h,e,s){if(s===void 0&&(s={}),s.method||(s.method="geodesic"),s.units||(s.units="kilometers"),!h)throw new Error("pt is required");if(Array.isArray(h)?h=st(h):h.type==="Point"?h=Wt(h):le(h,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=Q(e):e.type==="LineString"?e=Wt(e):le(e,"LineString","line");var r=1/0,t=h.geometry.coordinates;return Fe(e,function(a){var n=a.geometry.coordinates[0],W=a.geometry.coordinates[1],u=qe(t,n,W,s);u<r&&(r=u)}),re(r,"degrees",s.units)}function qe(h,e,s,r){var t=[s[0]-e[0],s[1]-e[1]],a=[h[0]-e[0],h[1]-e[1]],n=de(a,t);if(n<=0)return Ht(h,e,{method:r.method,units:"degrees"});var W=de(t,t);if(W<=n)return Ht(h,s,{method:r.method,units:"degrees"});var u=n/W,c=[e[0]+u*t[0],e[1]+u*t[1]];return Ht(h,c,{method:r.method,units:"degrees"})}function de(h,e){return h[0]*e[0]+h[1]*e[1]}function Ht(h,e,s){return s.method==="planar"?ze(h,e,s):lt(h,e,s)}function Te(h,e,s,r){if(r=r||{},!he(r))throw new Error("options is invalid");var t,a=[];if(h.type==="Feature")t=h.geometry.coordinates;else if(h.type==="LineString")t=h.coordinates;else throw new Error("input must be a LineString Feature or Geometry");for(var n=t.length,W=0,u,c,i,l=0;l<t.length&&!(e>=W&&l===t.length-1);l++){if(W>e&&a.length===0){if(u=e-W,!u)return a.push(t[l]),Q(a);c=bt(t[l],t[l-1])-180,i=Yt(t[l],u,c,r),a.push(i.geometry.coordinates)}if(W>=s)return u=s-W,u?(c=bt(t[l],t[l-1])-180,i=Yt(t[l],u,c,r),a.push(i.geometry.coordinates),Q(a)):(a.push(t[l]),Q(a));if(W>=e&&a.push(t[l]),l===t.length-1)return Q(a);W+=lt(t[l],t[l+1],r)}if(W<e&&t.length===n)throw new Error("Start position is beyond line");var T=t[t.length-1];return Q([T,T])}function Dt(h){var e=h[0],s=h[1];return[s[0]-e[0],s[1]-e[1]]}function Ot(h,e){return h[0]*e[1]-e[0]*h[1]}function Ue(h,e){return[h[0]+e[0],h[1]+e[1]]}function Je(h,e){return[h[0]-e[0],h[1]-e[1]]}function je(h,e){return[h*e[0],h*e[1]]}function Qe(h,e){var s=h[0],r=Dt(h),t=e[0],a=Dt(e),n=Ot(r,a),W=Je(t,s),u=Ot(W,a),c=u/n,i=Ue(s,je(c,r));return i}function xe(h,e){var s=Dt(h),r=Dt(e);return Ot(s,r)===0}function ts(h,e){return xe(h,e)?!1:Qe(h,e)}function Nt(h,e,s){if(s=s||{},!he(s))throw new Error("options is invalid");var r=s.units;if(!h)throw new Error("geojson is required");if(e==null||isNaN(e))throw new Error("distance is required");var t=Xe(h),a=h.properties;switch(t){case"LineString":return pe(h,e,r);case"MultiLineString":var n=[];return ae(h,function(W){n.push(pe(W,e,r).geometry.coordinates)}),Re(n,a);default:throw new Error("geometry "+t+" is not supported")}}function pe(h,e,s){var r=[],t=_e(e,s),a=$t(h),n=[];return a.forEach(function(W,u){if(u!==a.length-1){var c=es(W,a[u+1],t);if(r.push(c),u>0){var i=r[u-1],l=ts(c,i);l!==!1&&(i[1]=l,c[0]=l),n.push(i[0]),u===a.length-2&&(n.push(c[0]),n.push(c[1]))}a.length===2&&(n.push(c[0]),n.push(c[1]))}}),Q(n,h.properties)}function es(h,e,s){var r=Math.sqrt((h[0]-e[0])*(h[0]-e[0])+(h[1]-e[1])*(h[1]-e[1])),t=h[0]+s*(e[1]-h[1])/r,a=e[0]+s*(e[1]-h[1])/r,n=h[1]+s*(h[0]-e[0])/r,W=e[1]+s*(h[0]-e[0])/r;return[[t,n],[a,W]]}class ss{constructor(){w(this,"LineID","myEntity1");w(this,"Tag","");w(this,"towers",[]);w(this,"ISPhaseSequence",!1);w(this,"Wairnum",0);w(this,"Type",0);w(this,"corridor_features",[]);w(this,"wireAColor","#FFFFFF");w(this,"wireBColor","#FFFFFF");w(this,"wireCColor","#FFFFFF");w(this,"wireTColor","#FFFFFF");w(this,"wireD1Color","#FFFFFF");w(this,"wireD2Color","#FFFFFF");w(this,"wireWidth",1);w(this,"LineDistanceDisplaymin",0);w(this,"LineDistanceDisplaymax",5e3)}}class is{constructor(){w(this,"id","");w(this,"type",0);w(this,"modelid","");w(this,"lon",0);w(this,"lat",0);w(this,"alt",0);w(this,"modelH",0);w(this,"modelurl","");w(this,"modelScale",1);w(this,"modelbox","")}}var J=(h=>(h[h.树木=0]="树木",h[h.房屋=1]="房屋",h[h.高速公路=2]="高速公路",h[h.电力线=3]="电力线",h[h.导线=4]="导线",h[h.地面=5]="地面",h[h.其他地物=6]="其他地物",h))(J||{});class os{constructor(){w(this,"id","");w(this,"name","");w(this,"type",0);w(this,"Longitude",0);w(this,"Latitude",0);w(this,"Altitude",0);w(this,"RollX",0);w(this,"RollY",90);w(this,"RollZ",0);w(this,"towerScale",1);w(this,"towerHeight",0);w(this,"towerModelUri","");w(this,"towerPoint",[]);w(this,"Insulators",[]);w(this,"DistanceDisplaymin",0);w(this,"DistanceDisplaymax",1e3)}}class rs{constructor(){w(this,"treeId",0);w(this,"treeCoordinates",[0,0,0]);w(this,"conductorCoordinates",[0,0,0]);w(this,"horizontalDistance",0);w(this,"verticalDistance",0);w(this,"straightLineDistance",0);w(this,"clearanceDistance",0);w(this,"timestamp",0)}}class ns{constructor(){w(this,"id","");w(this,"name","");w(this,"type",0);w(this,"WairFX","进");w(this,"linenum",1);w(this,"Wairnum",0);w(this,"PhaseSequence",0);w(this,"RollX",0);w(this,"RollY",0);w(this,"RollZ",0);w(this,"InsulatorScale",1);w(this,"InsulatorLength",0);w(this,"InsulatorModelUri","");w(this,"InsulatorPoint",[]);w(this,"DistanceDisplaymin",0);w(this,"DistanceDisplaymax",500)}}class hs{constructor(){w(this,"name","");w(this,"X",-45);w(this,"Y",90);w(this,"Z",0)}}var x=(h=>(h[h.A相=0]="A相",h[h.B相=1]="B相",h[h.C相=2]="C相",h[h.地线1=3]="地线1",h[h.地线2=4]="地线2",h))(x||{}),rt=(h=>(h[h.直线塔=0]="直线塔",h[h.耐张塔=1]="耐张塔",h[h.门架塔=2]="门架塔",h[h.换位塔=3]="换位塔",h))(rt||{}),Ae=(h=>(h[h.交流单回路=0]="交流单回路",h[h.交流双回路=1]="交流双回路",h[h.直流单回路=2]="直流单回路",h[h.直流双回路=3]="直流双回路",h[h.交流四回路=4]="交流四回路",h))(Ae||{}),It=(h=>(h[h.地线=0]="地线",h[h.回路一=1]="回路一",h[h.回路二=2]="回路二",h[h.回路三=3]="回路三",h[h.回路四=4]="回路四",h))(It||{}),q=(h=>(h[h.悬垂串=0]="悬垂串",h[h.耐张串=1]="耐张串",h[h.跳线串=2]="跳线串",h[h.硬跳串=3]="硬跳串",h[h.V串=4]="V串",h[h.地线串=5]="地线串",h[h.绕跳临时=6]="绕跳临时",h))(q||{}),I=(h=>(h[h.单分裂=0]="单分裂",h[h.双分裂=1]="双分裂",h[h.四分裂=2]="四分裂",h[h.六分裂=3]="六分裂",h[h.八分裂=4]="八分裂",h))(I||{}),U=(h=>(h[h.直线距离=0]="直线距离",h[h.水平距离=1]="水平距离",h[h.垂直距离=2]="垂直距离",h[h.净空距离=3]="净空距离",h[h.安全距离=4]="安全距离",h[h.线间距离测量=5]="线间距离测量",h))(U||{});class we{constructor(){w(this,"horizontalLevels");w(this,"verticalLevels");w(this,"straightLineLevels");w(this,"clearanceLevels");w(this,"wireToWireLevels")}}class Gt{constructor(){w(this,"typeRules",new Map)}}var G=(h=>(h[h.A相=0]="A相",h[h.B相=1]="B相",h[h.C相=2]="C相",h[h.地线1=3]="地线1",h[h.地线2=4]="地线2",h[h.全部=5]="全部",h))(G||{});class zt{constructor(){w(this,"phaseRules",new Map)}getRules(e,s){const r=e<=s?`${e}-${s}`:`${s}-${e}`;return this.phaseRules.get(r)}setRules(e,s,r){const t=e<=s?`${e}-${s}`:`${s}-${e}`;this.phaseRules.set(t,r)}}class fs{constructor(){w(this,"timestamp",0);w(this,"phase1",0);w(this,"wire1Coordinates",[0,0,0]);w(this,"phase2",1);w(this,"wire2Coordinates",[0,0,0]);w(this,"horizontalDistance",0);w(this,"verticalDistance",0);w(this,"straightLineDistance",0);w(this,"status","正常");w(this,"statusColor","#00ff00")}}const it={units:"kilometers"};function Mt(h,e,s,r){const t=Kt(h,e),a=Kt(h,s),n=Kt(h,r),W=Math.min(t,a,n);return W===t?e:W===a?s:r}function Kt(h,e){if(!e||e.length===0)return 1/0;let s=1/0;for(let t=0;t<e.length;t++){const a=e[t],n=h[0]-a[0],W=h[1]-a[1],u=n*n+W*W;u<s&&(s=u)}return Math.sqrt(s)}const Et=()=>({horizontalLevels:[{id:"critical",name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{id:"danger",name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{id:"warning",name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{id:"safe",name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],verticalLevels:[{id:"critical",name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{id:"danger",name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{id:"warning",name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{id:"safe",name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],straightLineLevels:[{id:"critical",name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{id:"danger",name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{id:"warning",name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{id:"safe",name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],clearanceLevels:[{id:"critical",name:"critical",minDistance:0,maxDistance:10,color:"#ff0000"},{id:"danger",name:"danger",minDistance:10,maxDistance:15,color:"#ff6600"},{id:"warning",name:"warning",minDistance:15,maxDistance:20,color:"#ffa500"},{id:"safe",name:"safe",minDistance:20,maxDistance:1/0,color:"#00ff00"}]}),Le=(()=>{const h=new Gt;return h.typeRules.set(J.树木,Et()),h.typeRules.set(J.房屋,Et()),h.typeRules.set(J.高速公路,Et()),h.typeRules.set(J.电力线,Et()),h})(),as=(h,e)=>h.typeRules.get(e)||new we,dt=(h,e,s,r=Le,t,a=J.树木)=>{const W=as(r||Le,a),u=st(h.slice(0,2)),{nearestCoord:c}=ge(h,e),i=e.findIndex(N=>N[0]==c[0]&&N[1]==c[1]);let l=[];if(i==0)l.push(e[0],e[1]);else if(i==e.length-1)l.push(e[e.length-2],e[e.length-1]);else{const N=[e[i],e[i+1]],j=[e[i-1],e[i]];var T=wt(u,Q(N),it),p=wt(u,Q(j),it);l=T>p?j:N}const o=Q([l[0].slice(0,2),l[1].slice(0,2)]),A=st(l[0].slice(0,2)),g=st(l[1].slice(0,2));var y=wt(u,o,it),L=lt(u,A,it)||0,m=Math.sqrt(L*L-y*y)||0;let B=l[0].slice(0,2);m>0&&(B=Te(o,0,m,it).geometry.coordinates[1]);const v=lt(A,g,it),b=Math.abs(l[0][2]-l[1][2]),M=Math.min(l[0][2],l[1][2]),_=Math.max(l[0][2],l[1][2]),R=l[0][2]>l[1][2]?_-m/v*b:m/v*b+M,E=R-h[2],D=y*1e3,X=Math.sqrt(D*D+E*E);let k="#eff819",F=f.Color.RED;const $=f.Cartesian3.fromDegrees(h[0],h[1],h[2]),V=f.Cartesian3.fromDegrees(B[0],B[1],h[2]),O=f.Cartesian3.fromDegrees(B[0],B[1],R);var H=Ne(st([h[0],h[1]]),st([B[0],B[1]])).geometry.coordinates;const z=f.Cartesian3.fromDegrees(H[0],H[1],h[2]),mt=f.Cartesian3.fromDegrees(H[0],H[1],R-E/2),yt=f.Cartesian3.fromDegrees(B[0],B[1],R-E/2);let K;if(t.includes(U.水平距离)&&(W.horizontalLevels&&(K=W.horizontalLevels.find(N=>D>=N.minDistance&&D<=N.maxDistance)),K)){k=K.color,F=f.Color.fromCssColorString(K.color);const N={position:z,name:K.id,label:{text:`水平距离${D.toFixed(1)}米`,fillColor:f.Color.fromCssColorString(k),font:"12px sans-serif",pixelOffset:new f.Cartesian2(0,0),scaleByDistance:new f.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},j=[];j.push($),j.push(V);var kt={name:K.id,polyline:{show:!0,positions:j,clampToGround:!1,width:2,material:F,shadows:f.ShadowMode.DISABLED}};s.add(N),s.add(kt)}if(t.includes(U.垂直距离)&&(W.verticalLevels&&(K=W.verticalLevels.find(N=>E>=N.minDistance&&E<=N.maxDistance)),K)){k=K.color,F=f.Color.fromCssColorString(K.color);const N={position:yt,name:K.id,label:{text:`垂直距离${E.toFixed(1)}米`,fillColor:f.Color.fromCssColorString(k),font:"12px sans-serif",pixelOffset:new f.Cartesian2(0,0),scaleByDistance:new f.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},j=[];j.push(V),j.push(O);var Qt={name:K.id,polyline:{show:!0,positions:j,clampToGround:!1,width:2,material:F,shadows:f.ShadowMode.DISABLED}};s.add(N),s.add(Qt)}if(t.includes(U.直线距离)&&(W.straightLineLevels&&(K=W.straightLineLevels.find(N=>X>=N.minDistance&&X<=N.maxDistance)),K)){k=K.color,F=f.Color.fromCssColorString(K.color);const N={position:mt,name:K.id,label:{text:`直线距离${X.toFixed(1)}米`,fillColor:f.Color.fromCssColorString(k),font:"12px sans-serif",pixelOffset:new f.Cartesian2(0,0),scaleByDistance:new f.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY}},j=[];j.push($),j.push(O);var Bt={name:K.id,polyline:{show:!0,positions:j,clampToGround:!1,width:2,material:F,shadows:f.ShadowMode.DISABLED}};s.add(N),s.add(Bt)}},Rt=(h,e,s)=>{const r=st(h.slice(0,2)),{nearestCoord:t}=ge(h,e),a=e.findIndex(E=>E[0]==t[0]&&E[1]==t[1]);let n=[];if(a==0)n.push(e[0],e[1]);else if(a==e.length-1)n.push(e[e.length-2],e[e.length-1]);else{const E=[e[a],e[a+1]],D=[e[a-1],e[a]];var W=wt(r,Q(E),it),u=wt(r,Q(D),it);n=W>u?D:E}const c=Q([n[0].slice(0,2),n[1].slice(0,2)]),i=st(n[0].slice(0,2)),l=st(n[1].slice(0,2));var T=wt(r,c,it),p=lt(r,i,it)||0,o=Math.sqrt(p*p-T*T)||0;let A=n[0].slice(0,2);o>0&&(A=Te(c,0,o,it).geometry.coordinates[1]);const g=lt(i,l,it),y=Math.abs(n[0][2]-n[1][2]),L=Math.min(n[0][2],n[1][2]),m=Math.max(n[0][2],n[1][2]),B=n[0][2]>n[1][2]?m-o/g*y:o/g*y+L,v=B-h[2],b=T*1e3,M=Math.sqrt(b*b+v*v),_=parseFloat(B.toFixed(1));return{treeId:s,treeCoordinates:[h[0],h[1],h[2]],conductorCoordinates:[A[0],A[1],B],horizontalDistance:parseFloat(b.toFixed(1)),verticalDistance:parseFloat(v.toFixed(1)),straightLineDistance:parseFloat(M.toFixed(1)),clearanceDistance:_,timestamp:Date.now()}};function ge(h,e){const s=st(h.slice(0,2)),r=[];e.forEach(W=>{r.push(st([W[0],W[1]]))});const t=Ee(r),a=Ge(s,t),n=lt(s,a,it);return{nearestCoord:a.geometry.coordinates,nearestDistance:n}}function P(h,e,s,r,t){s||(s=new f.HeadingPitchRoll);const a=f.Transforms.headingPitchRollQuaternion(h,s,r,t),n=f.Matrix4.fromRotationTranslation(f.Matrix3.fromQuaternion(a,new f.Matrix3),h,new f.Matrix4);return f.Matrix4.multiplyByPoint(n,e,new f.Cartesian3)}function et(h,e){var s=h.cartesianToCartographic(e),r=f.Math.toDegrees(s.latitude),t=f.Math.toDegrees(s.longitude),a=s.height;return[t,r,a]}function ct(h,e,s,r){const t=e*Math.PI/180,a=h*Math.PI/180,n=r*Math.PI/180,W=s*Math.PI/180,u=Math.sin(W-a)*Math.cos(n),c=Math.cos(t)*Math.sin(n)-Math.sin(t)*Math.cos(n)*Math.cos(W-a);let i=Math.atan2(u,c)*180/Math.PI;return i=(i+360)%360,i}function d(h,e=6){const s=[];for(var r=0;r<h.length-1;r++)s.push(...ls(h[r],h[r+1],e*-1e3,100));return s}function ls(h,e,s,r){var t=[],a=f.Cartographic.fromCartesian(h),n=f.Cartographic.fromCartesian(e),W=a.longitude*180/Math.PI,u=a.latitude*180/Math.PI,c=n.longitude*180/Math.PI,i=n.latitude*180/Math.PI,l=Math.sqrt((W-c)*(W-c)+(u-i)*(u-i)),T=l*s,p=f.Cartesian3.clone(h),o=f.Cartesian3.clone(e),A=f.Cartesian3.distance(p,f.Cartesian3.ZERO),g=f.Cartesian3.distance(o,f.Cartesian3.ZERO);if(f.Cartesian3.normalize(p,p),f.Cartesian3.normalize(o,o),f.Cartesian3.distance(p,o)==0)return t;var y=f.Cartesian3.angleBetween(p,o);t.push(h);for(var L=1;L<r-1;L++){var m=L*1/(r-1),B=1-m,v=Math.sin(B*y)/Math.sin(y),b=Math.sin(m*y)/Math.sin(y),M=f.Cartesian3.multiplyByScalar(p,v,new f.Cartesian3),_=f.Cartesian3.multiplyByScalar(o,b,new f.Cartesian3),R=f.Cartesian3.add(M,_,new f.Cartesian3),E=m*Math.PI,D=A*B+g*m+Math.sin(E)*T;R=f.Cartesian3.multiplyByScalar(R,D,R),t.push(R)}return t.push(e),t}function cs(h,e,s=30){const r=h.length;if(r<=2||e===0||e===r-1)return!1;const t=ct(h[e-1].Longitude,h[e-1].Latitude,h[e].Longitude,h[e].Latitude);let n=ct(h[e].Longitude,h[e].Latitude,h[e+1].Longitude,h[e+1].Latitude)-t;return n>180&&(n-=360),n<-180&&(n+=360),Math.abs(n)>=s}function qt(h,e,s=2){const r=h.length;if(r<=1)return 0;if(cs(h,e,15))return e<r-1?ct(h[e].Longitude,h[e].Latitude,h[e+1].Longitude,h[e+1].Latitude):ct(h[e-1].Longitude,h[e-1].Latitude,h[e].Longitude,h[e].Latitude);let t=Math.max(0,e-s),a=Math.min(r-1,e+s);if(a-t<1)return e===r-1?ct(h[e-1].Longitude,h[e-1].Latitude,h[e].Longitude,h[e].Latitude):ct(h[e].Longitude,h[e].Latitude,h[e+1].Longitude,h[e+1].Latitude);const n=[];for(let i=t;i<a;i++){const l=ct(h[i].Longitude,h[i].Latitude,h[i+1].Longitude,h[i+1].Latitude);n.push(l)}if(n.length===1)return n[0];let W=0,u=0;for(const i of n){const l=i*Math.PI/180;W+=Math.cos(l),u+=Math.sin(l)}return(Math.atan2(u,W)*180/Math.PI+360)%360}function us(h,e){const s=h*Math.PI/180,r=e*Math.PI/180,t=Math.cos(s),a=Math.sin(s),n=Math.cos(r),W=Math.sin(r),u=t+n,c=a+W;if(Math.abs(u)<1e-10&&Math.abs(c)<1e-10)return(h+90)%360;let i=Math.atan2(c,u)*180/Math.PI;return i=(i+360)%360,i}function Ws(h,e){if(!e||e.length<2)return!1;const s=st(h),r=Me([e]);return $e(s,r)}function Cs(h,e=[]){return!h||!e||e.length<2?[]:h.filter(r=>{if(r.lon===void 0||r.lat===void 0)return console.warn("filterTreesInCorridor: tree missing lon/lat properties",r),!1;const t=[r.lon,r.lat],a=Ws(t,e);return h.indexOf(r)<5,a})}function ds(h,e=2e3){if(!h||h.length<2)return[];const s=h.map(t=>[t.Longitude,t.Latitude]),r=Q(s);try{const t=e/1e3,a=Nt(r,t,{units:"kilometers"}),n=Nt(r,-t,{units:"kilometers"}),W=$t(a),u=$t(n);return[...W,...u.reverse(),W[0]]}catch{return[]}}class Ts{constructor(e,s,r){w(this,"viewer");w(this,"LineInfo");w(this,"Keym","");w(this,"dataSource2");w(this,"entityCollection2");w(this,"offsetTowers",[]);w(this,"autoCalculateRollX",!0);w(this,"towerWirePoints",new Map);w(this,"loadedWireSegments",new Set);w(this,"loadedTowerIndices",new Set);w(this,"isDynamicLoadingEnabled",!0);w(this,"isLineModelRemoved",!1);w(this,"cameraMoveHandler",null);w(this,"offsetWires11",[]);w(this,"offsetWires12",[]);w(this,"offsetWires13",[]);w(this,"offsetWires21",[]);w(this,"offsetWires22",[]);w(this,"offsetWires23",[]);w(this,"ToffsetArcWires1A",[]);w(this,"ToffsetArcWires2A",[]);w(this,"ToffsetWires1A1",[]);w(this,"ToffsetWires1A2",[]);w(this,"ToffsetArcWires1B",[]);w(this,"ToffsetArcWires2B",[]);w(this,"ToffsetWires1B1",[]);w(this,"ToffsetWires1B2",[]);w(this,"ToffsetArcWires1C",[]);w(this,"ToffsetArcWires2C",[]);w(this,"ToffsetWires1C1",[]);w(this,"ToffsetWires1C2",[]);w(this,"ToffsetArcWires1A2",[]);w(this,"ToffsetArcWires2A2",[]);w(this,"ToffsetWires2A1",[]);w(this,"ToffsetWires2A2",[]);w(this,"ToffsetArcWires1B2",[]);w(this,"ToffsetArcWires2B2",[]);w(this,"ToffsetWires2B1",[]);w(this,"ToffsetWires2B2",[]);w(this,"ToffsetArcWires1C2",[]);w(this,"ToffsetArcWires2C2",[]);w(this,"ToffsetWires2C1",[]);w(this,"ToffsetWires2C2",[]);w(this,"offsetArcWires1A",[]);w(this,"offsetArcWires1B",[]);w(this,"offsetArcWires1C",[]);w(this,"offsetArcWires2A",[]);w(this,"offsetArcWires2B",[]);w(this,"offsetArcWires2C",[]);w(this,"offsetGrouundWires1",[]);w(this,"offsetGrouundWires2",[]);w(this,"offsetGrouundWires11",[]);w(this,"offsetGrouundWires12",[]);w(this,"arcLine1A1",[]);w(this,"arcLine1B1",[]);w(this,"arcLine1C1",[]);w(this,"LinedataSource2");w(this,"LineentityCollection2");w(this,"modelCache",new Map);this.Keym=r,this.viewer=e,this.LineInfo=s,this.dataSource2=new f.CustomDataSource(this.LineInfo.LineID),this.entityCollection2=this.dataSource2.entities,this.LinedataSource2=new f.CustomDataSource(this.LineInfo.LineID+"daoxian"),this.LineentityCollection2=this.LinedataSource2.entities}createModelCacheKey(e,s,r,t){return`${e}_${s}_${r}_${t}`}getCachedModelConfig(e,s,r,t){const a=Math.max(0,r),n=Math.min(t,5e4),W=this.createModelCacheKey(e,s,a,n);if(!this.modelCache.has(W)){const u={uri:e,scale:s,distanceDisplayCondition:[a,n]};this.modelCache.set(W,u)}return this.modelCache.get(W)}addModelToCollection(e,s,r,t,a,n,W){const u=this.getCachedModelConfig(t,n,W[0],W[1]);this.entityCollection2.add(Zt(e,s,r,u.uri,a,u.scale,u.distanceDisplayCondition))}setAutoCalculateRollX(e){this.autoCalculateRollX=e}getAutoCalculateRollX(){return this.autoCalculateRollX}setDynamicLoadingEnabled(e){this.isDynamicLoadingEnabled=e}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}setupCameraMoveListener(){this.cameraMoveHandler&&this.cameraMoveHandler(),this.cameraMoveHandler=this.viewer.camera.moveEnd.addEventListener(()=>{this.updateVisibleTowers()})}getVisibleTowerIndices(){var u;if(!this.viewer.camera||this.offsetTowers.length===0)return{start:0,end:0};const e=this.viewer.camera.position,s=((u=this.viewer.camera.positionCartographic)==null?void 0:u.height)||1e3;let r=5;s>5e4?r=2:s>1e4?r=3:s>5e3?r=5:r=10;let t=0,a=Number.MAX_VALUE;for(let c=0;c<this.offsetTowers.length;c++){const i=f.Cartesian3.distance(e,this.offsetTowers[c]);i<a&&(a=i,t=c)}const n=Math.max(0,t-r),W=Math.min(this.offsetTowers.length-1,t+r);return{start:n,end:W}}updateVisibleTowers(){const{start:e,end:s}=this.getVisibleTowerIndices();this.isLineModelRemoved||this.loadTowersInRange(e,s)}initializeLineData(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.towers.forEach(e=>{this.offsetTowers.push(f.Cartesian3.fromDegrees(e.Longitude,e.Latitude,e.Altitude))}),this.autoCalculateRollX&&this.calculateTowerOrientations())}calculateTowerOrientations(){const e=this.LineInfo.towers.length;if(e!==0){if(e===1){this.LineInfo.towers[0].RollX===void 0&&(this.LineInfo.towers[0].RollX=90);return}for(let s=0;s<e;s++){let r=0;if(this.LineInfo.towers[s].type===rt.耐张塔)if(s===0)r=(qt(this.LineInfo.towers,s,3)-90+360)%360;else if(s===e-1)r=(qt(this.LineInfo.towers,s,3)-90+360)%360;else{const t=this.LineInfo.towers[s-1],a=this.LineInfo.towers[s],n=this.LineInfo.towers[s+1],W=ct(t.Longitude,t.Latitude,a.Longitude,a.Latitude),u=ct(a.Longitude,a.Latitude,n.Longitude,n.Latitude);r=(us(W,u)-90+360)%360}else r=(qt(this.LineInfo.towers,s,2)-90+360)%360;this.LineInfo.towers[s].RollX=r}}}loadTowersInRange(e,s){if(e<0||s>=this.LineInfo.towers.length)return;const r=Math.max(0,e-1),t=Math.min(this.LineInfo.towers.length-1,s+1);for(let a=r;a<=t;a++)this.loadedTowerIndices.has(a)||(this.loadTowerAndCollectWirePoints(a),this.loadedTowerIndices.add(a));for(let a=r;a<t;a++){const n=`${a}-${a+1}`;this.loadedWireSegments.has(n)||(this.loadWireSegmentBetweenTowers(a,a+1),this.loadedWireSegments.add(n))}}loadTowerAndCollectWirePoints(e){const s=this.offsetTowers[e],r=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[e].RollX),f.Math.toRadians(this.LineInfo.towers[e].RollY),f.Math.toRadians(this.LineInfo.towers[e].RollZ));this.addModelToCollection(this.LineInfo.towers[e].id,s,this.LineInfo.towers[e].name,this.LineInfo.towers[e].towerModelUri,r,this.LineInfo.towers[e].towerScale,[this.LineInfo.towers[e].DistanceDisplaymin,this.LineInfo.towers[e].DistanceDisplaymax]);const t=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[e].RollX),0,0),a=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[e].RollX),0,0);let n=0;const W=[];this.LineInfo.towers[e].Insulators.forEach(u=>{const c=P(s,new f.Cartesian3(this.LineInfo.towers[e].towerPoint[n].X,this.LineInfo.towers[e].towerPoint[n].Y,this.LineInfo.towers[e].towerPoint[n].Z),this.LineInfo.towers[e].type===rt.耐张塔?a:t);let i,l;if(this.autoCalculateRollX?l=this.LineInfo.towers[e].RollX:l=u.RollX,this.LineInfo.towers[e].type===rt.耐张塔)switch(u.type){case q.耐张串:i=u.WairFX==="进"?new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(-180),f.Math.toRadians(180)):new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(0),f.Math.toRadians(0));break;case q.跳线串:i=new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(u.RollY),f.Math.toRadians(u.RollZ));break;case q.地线串:i=new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(u.RollY),f.Math.toRadians(u.RollZ));break;default:i=new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(u.RollY),f.Math.toRadians(u.RollZ))}else i=new f.HeadingPitchRoll(f.Math.toRadians(l),f.Math.toRadians(u.RollY),f.Math.toRadians(u.RollZ));this.addModelToCollection(u.id,c,u.name,u.InsulatorModelUri,i,u.InsulatorScale,[u.DistanceDisplaymin,u.DistanceDisplaymax]);const T={insulator:u,insulatorIndex:n,position:s,lineroll:t,WairPoint:[]};u.InsulatorPoint.forEach(p=>{p.Y=p.Y+this.LineInfo.towers[e].towerPoint[n].Y,p.Z=p.Z+this.LineInfo.towers[e].towerPoint[n].Z,T.WairPoint.push(P(s,new f.Cartesian3(p.X,p.Y,p.Z),t))}),W.push(T),n++}),this.towerWirePoints.set(e,W)}loadWireSegmentBetweenTowers(e,s){const r=this.towerWirePoints.get(e),t=this.towerWirePoints.get(s);!r||!t||(this.resetWireArraysForTwoTowers(),console.log(`加载导线段: ${e}-${s}`))}resetWireArraysForTwoTowers(){this.offsetWires11=[],this.offsetWires12=[],this.offsetWires13=[],this.offsetWires21=[],this.offsetWires22=[],this.offsetWires23=[],this.ToffsetWires1A1=[],this.ToffsetWires1A2=[]}getLineDataSources(){return[this.dataSource2,this.LinedataSource2]}removeLineModels(){this.isLineModelRemoved=!0,this.entityCollection2.removeAll(),this.LineentityCollection2.removeAll(),this.loadedTowerIndices.clear(),this.loadedWireSegments.clear()}restoreLineModels(){this.isLineModelRemoved=!1,this.isDynamicLoadingEnabled?(this.setupCameraMoveListener(),this.updateVisibleTowers()):this.loadAllTowersAtOnce()}loadAllTowersAtOnce(){let e=0,s=0;this.offsetTowers.forEach((r,t)=>{const a=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[t].RollX),f.Math.toRadians(this.LineInfo.towers[t].RollY),f.Math.toRadians(this.LineInfo.towers[t].RollZ));this.addModelToCollection(this.LineInfo.towers[t].id,r,this.LineInfo.towers[t].name,this.LineInfo.towers[t].towerModelUri,a,this.LineInfo.towers[t].towerScale,[this.LineInfo.towers[t].DistanceDisplaymin,this.LineInfo.towers[t].DistanceDisplaymax]);const n=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[t].RollX),0,0),W=new f.HeadingPitchRoll(f.Math.toRadians(this.LineInfo.towers[t].RollX),0,0);let u=0;if(this.LineInfo.towers[t].Insulators.forEach(i=>{const l=P(r,new f.Cartesian3(this.LineInfo.towers[t].towerPoint[u].X,this.LineInfo.towers[t].towerPoint[u].Y,this.LineInfo.towers[t].towerPoint[u].Z),this.LineInfo.towers[t].type===rt.耐张塔?W:n);let T,p;if(this.autoCalculateRollX?p=this.LineInfo.towers[t].RollX:p=i.RollX,this.LineInfo.towers[t].type===rt.耐张塔)switch(i.type){case q.耐张串:T=i.WairFX==="进"?new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(-180),f.Math.toRadians(180)):new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(0),f.Math.toRadians(0));break;case q.跳线串:T=new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(i.RollY),f.Math.toRadians(i.RollZ));break;case q.地线串:T=new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(i.RollY),f.Math.toRadians(i.RollZ));break;default:T=new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(i.RollY),f.Math.toRadians(i.RollZ))}else T=new f.HeadingPitchRoll(f.Math.toRadians(p),f.Math.toRadians(i.RollY),f.Math.toRadians(i.RollZ));this.addModelToCollection(i.id,l,i.name,i.InsulatorModelUri,T,i.InsulatorScale,[i.DistanceDisplaymin,i.DistanceDisplaymax]);const o=[];switch(i.InsulatorPoint.forEach(A=>{A.Y=A.Y+this.LineInfo.towers[t].towerPoint[u].Y,A.Z=A.Z+this.LineInfo.towers[t].towerPoint[u].Z,o.push(P(r,new f.Cartesian3(A.X,A.Y,A.Z),n))}),i.linenum){case It.回路一:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[t].type==rt.耐张塔)switch(i.PhaseSequence){case x.A相:if(i.type==q.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires11.push(o[0]),this.ToffsetWires1A1.push(o[0]);break;case I.双分裂:this.offsetWires11.push(o[0]),this.offsetWires11.push(o[1]),this.ToffsetWires1A1.push(o[2]),this.ToffsetWires1A1.push(o[3]);break;case I.四分裂:this.offsetWires11.push(o[0]),this.offsetWires11.push(o[1]),this.offsetWires11.push(o[2]),this.offsetWires11.push(o[3]),this.ToffsetWires1A1.push(o[4]),this.ToffsetWires1A1.push(o[5]),this.ToffsetWires1A1.push(o[6]),this.ToffsetWires1A1.push(o[7]);break;case I.六分裂:this.offsetWires11.push(o[0]),this.offsetWires11.push(o[1]),this.offsetWires11.push(o[2]),this.offsetWires11.push(o[3]),this.offsetWires11.push(o[4]),this.offsetWires11.push(o[5]),this.ToffsetWires1A1.push(o[6]),this.ToffsetWires1A1.push(o[7]),this.ToffsetWires1A1.push(o[8]),this.ToffsetWires1A1.push(o[9]),this.ToffsetWires1A1.push(o[10]),this.ToffsetWires1A1.push(o[11]);break;case I.八分裂:this.offsetWires11.push(o[0]),this.offsetWires11.push(o[1]),this.offsetWires11.push(o[2]),this.offsetWires11.push(o[3]),this.offsetWires11.push(o[4]),this.offsetWires11.push(o[5]),this.offsetWires11.push(o[6]),this.offsetWires11.push(o[7]),this.ToffsetWires1A1.push(o[8]),this.ToffsetWires1A1.push(o[9]),this.ToffsetWires1A1.push(o[10]),this.ToffsetWires1A1.push(o[11]),this.ToffsetWires1A1.push(o[12]),this.ToffsetWires1A1.push(o[13]),this.ToffsetWires1A1.push(o[14]),this.ToffsetWires1A1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires11.push(A),this.ToffsetWires1A2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires11.push(g),this.offsetWires11.push(y),this.ToffsetWires1A2.push(g),this.ToffsetWires1A2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires11.push(L),this.offsetWires11.push(m),this.offsetWires11.push(B),this.offsetWires11.push(v),this.ToffsetWires1A2.push(L),this.ToffsetWires1A2.push(m),this.ToffsetWires1A2.push(B),this.ToffsetWires1A2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),_=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires11.push(b),this.offsetWires11.push(M),this.offsetWires11.push(_),this.offsetWires11.push(R),this.offsetWires11.push(E),this.offsetWires11.push(D),this.ToffsetWires1A2.push(b),this.ToffsetWires1A2.push(M),this.ToffsetWires1A2.push(_),this.ToffsetWires1A2.push(R),this.ToffsetWires1A2.push(E),this.ToffsetWires1A2.push(D);break;case I.八分裂:const X=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),$=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),V=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires11.push(X),this.offsetWires11.push(k),this.offsetWires11.push(F),this.offsetWires11.push($),this.offsetWires11.push(V),this.offsetWires11.push(O),this.offsetWires11.push(H),this.offsetWires11.push(z),this.ToffsetWires1A2.push(X),this.ToffsetWires1A2.push(k),this.ToffsetWires1A2.push(F),this.ToffsetWires1A2.push($),this.ToffsetWires1A2.push(V),this.ToffsetWires1A2.push(O),this.ToffsetWires1A2.push(H),this.ToffsetWires1A2.push(z);break}else if(i.type==q.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A2.push(o[1]);break;case I.双分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A1.push(o[1]),this.ToffsetWires1A2.push(o[2]),this.ToffsetWires1A2.push(o[3]);break;case I.四分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A1.push(o[1]),this.ToffsetWires1A1.push(o[2]),this.ToffsetWires1A1.push(o[3]),this.ToffsetWires1A2.push(o[4]),this.ToffsetWires1A2.push(o[5]),this.ToffsetWires1A2.push(o[6]),this.ToffsetWires1A2.push(o[7]);break;case I.六分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A1.push(o[1]),this.ToffsetWires1A1.push(o[2]),this.ToffsetWires1A1.push(o[3]),this.ToffsetWires1A1.push(o[4]),this.ToffsetWires1A1.push(o[5]),this.ToffsetWires1A2.push(o[6]),this.ToffsetWires1A2.push(o[7]),this.ToffsetWires1A2.push(o[8]),this.ToffsetWires1A2.push(o[9]),this.ToffsetWires1A2.push(o[10]),this.ToffsetWires1A2.push(o[11]);break;case I.八分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A1.push(o[1]),this.ToffsetWires1A1.push(o[2]),this.ToffsetWires1A1.push(o[3]),this.ToffsetWires1A1.push(o[4]),this.ToffsetWires1A1.push(o[5]),this.ToffsetWires1A1.push(o[6]),this.ToffsetWires1A1.push(o[7]),this.ToffsetWires1A2.push(o[8]),this.ToffsetWires1A2.push(o[9]),this.ToffsetWires1A2.push(o[10]),this.ToffsetWires1A2.push(o[11]),this.ToffsetWires1A2.push(o[12]),this.ToffsetWires1A2.push(o[13]),this.ToffsetWires1A2.push(o[14]),this.ToffsetWires1A2.push(o[15]);break}break;case x.B相:if(i.type==q.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires12.push(o[0]),this.ToffsetWires1B1.push(o[1]);break;case I.双分裂:this.offsetWires12.push(o[0]),this.offsetWires12.push(o[1]),this.ToffsetWires1B1.push(o[2]),this.ToffsetWires1B1.push(o[3]);break;case I.四分裂:this.offsetWires12.push(o[0]),this.offsetWires12.push(o[1]),this.offsetWires12.push(o[2]),this.offsetWires12.push(o[3]),this.ToffsetWires1B1.push(o[4]),this.ToffsetWires1B1.push(o[5]),this.ToffsetWires1B1.push(o[6]),this.ToffsetWires1B1.push(o[7]);break;case I.六分裂:this.offsetWires12.push(o[0]),this.offsetWires12.push(o[1]),this.offsetWires12.push(o[2]),this.offsetWires12.push(o[3]),this.offsetWires12.push(o[4]),this.offsetWires12.push(o[5]),this.ToffsetWires1B1.push(o[6]),this.ToffsetWires1B1.push(o[7]),this.ToffsetWires1B1.push(o[8]),this.ToffsetWires1B1.push(o[9]),this.ToffsetWires1B1.push(o[10]),this.ToffsetWires1B1.push(o[11]);break;case I.八分裂:this.offsetWires12.push(o[0]),this.offsetWires12.push(o[1]),this.offsetWires12.push(o[2]),this.offsetWires12.push(o[3]),this.offsetWires12.push(o[4]),this.offsetWires12.push(o[5]),this.offsetWires12.push(o[6]),this.offsetWires12.push(o[7]),this.ToffsetWires1B1.push(o[8]),this.ToffsetWires1B1.push(o[9]),this.ToffsetWires1B1.push(o[10]),this.ToffsetWires1B1.push(o[11]),this.ToffsetWires1B1.push(o[12]),this.ToffsetWires1B1.push(o[13]),this.ToffsetWires1B1.push(o[14]),this.ToffsetWires1B1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires12.push(A),this.ToffsetWires1B2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires12.push(g),this.offsetWires12.push(y),this.ToffsetWires1B2.push(g),this.ToffsetWires1B2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires12.push(L),this.offsetWires12.push(m),this.offsetWires12.push(B),this.offsetWires12.push(v),this.ToffsetWires1B2.push(L),this.ToffsetWires1B2.push(m),this.ToffsetWires1B2.push(B),this.ToffsetWires1B2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),_=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires12.push(b),this.offsetWires12.push(M),this.offsetWires12.push(_),this.offsetWires12.push(R),this.offsetWires12.push(E),this.offsetWires12.push(D),this.ToffsetWires1B2.push(b),this.ToffsetWires1B2.push(M),this.ToffsetWires1B2.push(_),this.ToffsetWires1B2.push(R),this.ToffsetWires1B2.push(E),this.ToffsetWires1B2.push(D);break;case I.八分裂:const X=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),$=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),V=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires12.push(X),this.offsetWires12.push(k),this.offsetWires12.push(F),this.offsetWires12.push($),this.offsetWires12.push(V),this.offsetWires12.push(O),this.offsetWires12.push(H),this.offsetWires12.push(z),this.ToffsetWires1B2.push(X),this.ToffsetWires1B2.push(k),this.ToffsetWires1B2.push(F),this.ToffsetWires1B2.push($),this.ToffsetWires1B2.push(V),this.ToffsetWires1B2.push(O),this.ToffsetWires1B2.push(H),this.ToffsetWires1B2.push(z);break}else if(i.type==q.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1B1.push(o[0]),this.ToffsetWires1B2.push(o[0]);break;case I.双分裂:this.ToffsetWires1B1.push(o[0]),this.ToffsetWires1B1.push(o[1]),this.ToffsetWires1B2.push(o[2]),this.ToffsetWires1B2.push(o[3]);break;case I.四分裂:this.ToffsetWires1B1.push(o[0]),this.ToffsetWires1B1.push(o[1]),this.ToffsetWires1B1.push(o[2]),this.ToffsetWires1B1.push(o[3]),this.ToffsetWires1B2.push(o[4]),this.ToffsetWires1B2.push(o[5]),this.ToffsetWires1B2.push(o[6]),this.ToffsetWires1B2.push(o[7]);break;case I.六分裂:this.ToffsetWires1B1.push(o[0]),this.ToffsetWires1B1.push(o[1]),this.ToffsetWires1B1.push(o[2]),this.ToffsetWires1B1.push(o[3]),this.ToffsetWires1B1.push(o[4]),this.ToffsetWires1B1.push(o[5]),this.ToffsetWires1B2.push(o[6]),this.ToffsetWires1B2.push(o[7]),this.ToffsetWires1B2.push(o[8]),this.ToffsetWires1B2.push(o[9]),this.ToffsetWires1B2.push(o[10]),this.ToffsetWires1B2.push(o[11]);break;case I.八分裂:this.ToffsetWires1B1.push(o[0]),this.ToffsetWires1B1.push(o[1]),this.ToffsetWires1B1.push(o[2]),this.ToffsetWires1B1.push(o[3]),this.ToffsetWires1B1.push(o[4]),this.ToffsetWires1B1.push(o[5]),this.ToffsetWires1B1.push(o[6]),this.ToffsetWires1B1.push(o[7]),this.ToffsetWires1B2.push(o[8]),this.ToffsetWires1B2.push(o[9]),this.ToffsetWires1B2.push(o[10]),this.ToffsetWires1B2.push(o[11]),this.ToffsetWires1B2.push(o[12]),this.ToffsetWires1B2.push(o[13]),this.ToffsetWires1B2.push(o[14]),this.ToffsetWires1B2.push(o[15]);break}break;case x.C相:if(i.type==q.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires13.push(o[0]),this.ToffsetWires1C1.push(o[1]);break;case I.双分裂:this.offsetWires13.push(o[0]),this.offsetWires13.push(o[1]),this.ToffsetWires1C1.push(o[2]),this.ToffsetWires1C1.push(o[3]);break;case I.四分裂:this.offsetWires13.push(o[0]),this.offsetWires13.push(o[1]),this.offsetWires13.push(o[2]),this.offsetWires13.push(o[3]),this.ToffsetWires1C1.push(o[4]),this.ToffsetWires1C1.push(o[5]),this.ToffsetWires1C1.push(o[6]),this.ToffsetWires1C1.push(o[7]);break;case I.六分裂:this.offsetWires13.push(o[0]),this.offsetWires13.push(o[1]),this.offsetWires13.push(o[2]),this.offsetWires13.push(o[3]),this.offsetWires13.push(o[4]),this.offsetWires13.push(o[5]),this.ToffsetWires1C1.push(o[6]),this.ToffsetWires1C1.push(o[7]),this.ToffsetWires1C1.push(o[8]),this.ToffsetWires1C1.push(o[9]),this.ToffsetWires1C1.push(o[10]),this.ToffsetWires1C1.push(o[11]);break;case I.八分裂:this.offsetWires13.push(o[0]),this.offsetWires13.push(o[1]),this.offsetWires13.push(o[2]),this.offsetWires13.push(o[3]),this.offsetWires13.push(o[4]),this.offsetWires13.push(o[5]),this.offsetWires13.push(o[6]),this.offsetWires13.push(o[7]),this.ToffsetWires1C1.push(o[8]),this.ToffsetWires1C1.push(o[9]),this.ToffsetWires1C1.push(o[10]),this.ToffsetWires1C1.push(o[11]),this.ToffsetWires1C1.push(o[12]),this.ToffsetWires1C1.push(o[13]),this.ToffsetWires1C1.push(o[14]),this.ToffsetWires1C1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires13.push(A),this.ToffsetWires1C2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires13.push(g),this.offsetWires13.push(y),this.ToffsetWires1C2.push(g),this.ToffsetWires1C2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires13.push(L),this.offsetWires13.push(m),this.offsetWires13.push(B),this.offsetWires13.push(v),this.ToffsetWires1C2.push(L),this.ToffsetWires1C2.push(m),this.ToffsetWires1C2.push(B),this.ToffsetWires1C2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),_=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires13.push(b),this.offsetWires13.push(M),this.offsetWires13.push(_),this.offsetWires13.push(R),this.offsetWires13.push(E),this.offsetWires13.push(D),this.ToffsetWires1C2.push(b),this.ToffsetWires1C2.push(M),this.ToffsetWires1C2.push(_),this.ToffsetWires1C2.push(R),this.ToffsetWires1C2.push(E),this.ToffsetWires1C2.push(D);break;case I.八分裂:const X=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),$=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),V=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires13.push(X),this.offsetWires13.push(k),this.offsetWires13.push(F),this.offsetWires13.push($),this.offsetWires13.push(V),this.offsetWires13.push(O),this.offsetWires13.push(H),this.offsetWires13.push(z),this.ToffsetWires1C2.push(X),this.ToffsetWires1C2.push(k),this.ToffsetWires1C2.push(F),this.ToffsetWires1C2.push($),this.ToffsetWires1C2.push(V),this.ToffsetWires1C2.push(O),this.ToffsetWires1C2.push(H),this.ToffsetWires1C2.push(z);break}else if(i.type==q.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1C1.push(o[0]),this.ToffsetWires1C2.push(o[0]);break;case I.双分裂:this.ToffsetWires1C1.push(o[0]),this.ToffsetWires1C1.push(o[1]),this.ToffsetWires1C2.push(o[2]),this.ToffsetWires1C2.push(o[3]);break;case I.四分裂:this.ToffsetWires1C1.push(o[0]),this.ToffsetWires1C1.push(o[1]),this.ToffsetWires1C1.push(o[2]),this.ToffsetWires1C1.push(o[3]),this.ToffsetWires1C2.push(o[4]),this.ToffsetWires1C2.push(o[5]),this.ToffsetWires1C2.push(o[6]),this.ToffsetWires1C2.push(o[7]);break;case I.六分裂:this.ToffsetWires1C1.push(o[0]),this.ToffsetWires1C1.push(o[1]),this.ToffsetWires1C1.push(o[2]),this.ToffsetWires1C1.push(o[3]),this.ToffsetWires1C1.push(o[4]),this.ToffsetWires1C1.push(o[5]),this.ToffsetWires1C2.push(o[6]),this.ToffsetWires1C2.push(o[7]),this.ToffsetWires1C2.push(o[8]),this.ToffsetWires1C2.push(o[9]),this.ToffsetWires1C2.push(o[10]),this.ToffsetWires1C2.push(o[11]);break;case I.八分裂:this.ToffsetWires1C1.push(o[0]),this.ToffsetWires1C1.push(o[1]),this.ToffsetWires1C1.push(o[2]),this.ToffsetWires1C1.push(o[3]),this.ToffsetWires1C1.push(o[4]),this.ToffsetWires1C1.push(o[5]),this.ToffsetWires1C1.push(o[6]),this.ToffsetWires1C1.push(o[7]),this.ToffsetWires1C2.push(o[8]),this.ToffsetWires1C2.push(o[9]),this.ToffsetWires1C2.push(o[10]),this.ToffsetWires1C2.push(o[11]),this.ToffsetWires1C2.push(o[12]),this.ToffsetWires1C2.push(o[13]),this.ToffsetWires1C2.push(o[14]),this.ToffsetWires1C2.push(o[15]);break}break}else switch(i.PhaseSequence){case x.A相:o.forEach(A=>{this.offsetWires11.push(A)});break;case x.B相:o.forEach(A=>{this.offsetWires12.push(A)});break;case x.C相:o.forEach(A=>{this.offsetWires13.push(A)});break}else if(this.LineInfo.towers[t].type==rt.耐张塔)switch(u){case 2:switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires11.push(o[0]),this.ToffsetWires1A1.push(o[0]);break;case I.双分裂:this.offsetWires11.push(o[0]),this.offsetWires11.push(o[1]),this.ToffsetWires1A1.push(o[2]),this.ToffsetWires1A1.push(o[3]);break}break;case 3:switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A2.push(o[0]);break;case I.双分裂:this.ToffsetWires1A1.push(o[0]),this.ToffsetWires1A1.push(o[1]),this.ToffsetWires1A2.push(o[2]),this.ToffsetWires1A2.push(o[3]);break}break;case 4:switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires11.push(A),this.ToffsetWires1A2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires11.push(g),this.offsetWires11.push(y),this.ToffsetWires1A2.push(g),this.ToffsetWires1A2.push(y);break}break;case 5:o.forEach(A=>{this.offsetWires12.push(A),this.ToffsetWires1B1.push(A)});break;case 6:o.forEach(A=>{this.ToffsetWires1B1.push(A),this.ToffsetWires1B2.push(A)});break;case 7:i.InsulatorPoint.forEach(A=>{const g=P(r,new f.Cartesian3(A.X*-1,A.Y,A.Z),n);this.offsetWires12.push(g),this.ToffsetWires1B2.push(g)});break;case 8:o.forEach(A=>{this.offsetWires13.push(A),this.ToffsetWires1C1.push(A)});break;case 9:o.forEach(A=>{this.ToffsetWires1C1.push(A),this.ToffsetWires1C2.push(A)});break;case 10:i.InsulatorPoint.forEach(A=>{const g=P(r,new f.Cartesian3(A.X*-1,A.Y,A.Z),n);this.offsetWires13.push(g),this.ToffsetWires1C2.push(g)});break}else switch(u){case 2:o.forEach(A=>{this.offsetWires11.push(A)});break;case 3:o.forEach(A=>{this.offsetWires12.push(A)});break;case 4:o.forEach(A=>{this.offsetWires13.push(A)});break}break;case It.回路二:if(this.LineInfo.ISPhaseSequence)if(this.LineInfo.towers[t].type==rt.耐张塔)switch(i.PhaseSequence){case x.A相:if(i.type==q.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires21.push(o[0]),this.ToffsetWires2A1.push(o[0]);break;case I.双分裂:this.offsetWires21.push(o[0]),this.offsetWires21.push(o[1]),this.ToffsetWires2A1.push(o[2]),this.ToffsetWires2A1.push(o[3]);break;case I.四分裂:this.offsetWires21.push(o[0]),this.offsetWires21.push(o[1]),this.offsetWires21.push(o[2]),this.offsetWires21.push(o[3]),this.ToffsetWires2A1.push(o[4]),this.ToffsetWires2A1.push(o[5]),this.ToffsetWires2A1.push(o[6]),this.ToffsetWires2A1.push(o[7]);break;case I.六分裂:this.offsetWires21.push(o[0]),this.offsetWires21.push(o[1]),this.offsetWires21.push(o[2]),this.offsetWires21.push(o[3]),this.offsetWires21.push(o[4]),this.offsetWires21.push(o[5]),this.ToffsetWires2A1.push(o[6]),this.ToffsetWires2A1.push(o[7]),this.ToffsetWires2A1.push(o[8]),this.ToffsetWires2A1.push(o[9]),this.ToffsetWires2A1.push(o[10]),this.ToffsetWires2A1.push(o[11]);break;case I.八分裂:this.offsetWires21.push(o[0]),this.offsetWires21.push(o[1]),this.offsetWires21.push(o[2]),this.offsetWires21.push(o[3]),this.offsetWires21.push(o[4]),this.offsetWires21.push(o[5]),this.offsetWires21.push(o[6]),this.offsetWires21.push(o[7]),this.ToffsetWires2A1.push(o[8]),this.ToffsetWires2A1.push(o[9]),this.ToffsetWires2A1.push(o[10]),this.ToffsetWires2A1.push(o[11]),this.ToffsetWires2A1.push(o[12]),this.ToffsetWires2A1.push(o[13]),this.ToffsetWires2A1.push(o[14]),this.ToffsetWires2A1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires21.push(A),this.ToffsetWires2A2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires21.push(g),this.offsetWires21.push(y),this.ToffsetWires2A2.push(g),this.ToffsetWires2A2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires21.push(L),this.offsetWires21.push(m),this.offsetWires21.push(B),this.offsetWires21.push(v),this.ToffsetWires2A2.push(L),this.ToffsetWires2A2.push(m),this.ToffsetWires2A2.push(B),this.ToffsetWires2A2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),_=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires21.push(b),this.offsetWires21.push(M),this.offsetWires21.push(_),this.offsetWires21.push(R),this.offsetWires21.push(E),this.offsetWires21.push(D),this.ToffsetWires2A2.push(b),this.ToffsetWires2A2.push(M),this.ToffsetWires2A2.push(_),this.ToffsetWires2A2.push(R),this.ToffsetWires2A2.push(E),this.ToffsetWires2A2.push(D);break;case I.八分裂:const X=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),$=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),V=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires21.push(X),this.offsetWires21.push(k),this.offsetWires21.push(F),this.offsetWires21.push($),this.offsetWires21.push(V),this.offsetWires21.push(O),this.offsetWires21.push(H),this.offsetWires21.push(z),this.ToffsetWires2A2.push(X),this.ToffsetWires2A2.push(k),this.ToffsetWires2A2.push(F),this.ToffsetWires2A2.push($),this.ToffsetWires2A2.push(V),this.ToffsetWires2A2.push(O),this.ToffsetWires2A2.push(H),this.ToffsetWires2A2.push(z);break}else if(i.type==q.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A2.push(o[0]);break;case I.双分裂:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A1.push(o[1]),this.ToffsetWires2A2.push(o[2]),this.ToffsetWires2A2.push(o[3]);break;case I.四分裂:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A1.push(o[1]),this.ToffsetWires2A1.push(o[2]),this.ToffsetWires2A1.push(o[3]),this.ToffsetWires2A2.push(o[4]),this.ToffsetWires2A2.push(o[5]),this.ToffsetWires2A2.push(o[6]),this.ToffsetWires2A2.push(o[7]);break;case I.六分裂:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A1.push(o[1]),this.ToffsetWires2A1.push(o[2]),this.ToffsetWires2A1.push(o[3]),this.ToffsetWires2A1.push(o[4]),this.ToffsetWires2A1.push(o[5]),this.ToffsetWires2A2.push(o[6]),this.ToffsetWires2A2.push(o[7]),this.ToffsetWires2A2.push(o[8]),this.ToffsetWires2A2.push(o[9]),this.ToffsetWires2A2.push(o[10]),this.ToffsetWires2A2.push(o[11]);break;case I.八分裂:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A1.push(o[1]),this.ToffsetWires2A1.push(o[2]),this.ToffsetWires2A1.push(o[3]),this.ToffsetWires2A1.push(o[4]),this.ToffsetWires2A1.push(o[5]),this.ToffsetWires2A1.push(o[6]),this.ToffsetWires2A1.push(o[7]),this.ToffsetWires2A2.push(o[8]),this.ToffsetWires2A2.push(o[9]),this.ToffsetWires2A2.push(o[10]),this.ToffsetWires2A2.push(o[11]),this.ToffsetWires2A2.push(o[12]),this.ToffsetWires2A2.push(o[13]),this.ToffsetWires2A2.push(o[14]),this.ToffsetWires2A2.push(o[15]);break}break;case x.B相:if(i.type==q.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires22.push(o[0]),this.ToffsetWires2B1.push(o[0]);break;case I.双分裂:this.offsetWires22.push(o[0]),this.offsetWires22.push(o[1]),this.ToffsetWires2B1.push(o[2]),this.ToffsetWires2B1.push(o[3]);break;case I.四分裂:this.offsetWires22.push(o[0]),this.offsetWires22.push(o[1]),this.offsetWires22.push(o[2]),this.offsetWires22.push(o[3]),this.ToffsetWires2B1.push(o[4]),this.ToffsetWires2B1.push(o[5]),this.ToffsetWires2B1.push(o[6]),this.ToffsetWires2B1.push(o[7]);break;case I.六分裂:this.offsetWires22.push(o[0]),this.offsetWires22.push(o[1]),this.offsetWires22.push(o[2]),this.offsetWires22.push(o[3]),this.offsetWires22.push(o[4]),this.offsetWires22.push(o[5]),this.ToffsetWires2B1.push(o[6]),this.ToffsetWires2B1.push(o[7]),this.ToffsetWires2B1.push(o[8]),this.ToffsetWires2B1.push(o[9]),this.ToffsetWires2B1.push(o[10]),this.ToffsetWires2B1.push(o[11]);break;case I.八分裂:this.offsetWires22.push(o[0]),this.offsetWires22.push(o[1]),this.offsetWires22.push(o[2]),this.offsetWires22.push(o[3]),this.offsetWires22.push(o[4]),this.offsetWires22.push(o[5]),this.offsetWires22.push(o[6]),this.offsetWires22.push(o[7]),this.ToffsetWires2B1.push(o[8]),this.ToffsetWires2B1.push(o[9]),this.ToffsetWires2B1.push(o[10]),this.ToffsetWires2B1.push(o[11]),this.ToffsetWires2B1.push(o[12]),this.ToffsetWires2B1.push(o[13]),this.ToffsetWires2B1.push(o[14]),this.ToffsetWires2B1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires22.push(A),this.ToffsetWires2B2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires22.push(g),this.offsetWires22.push(y),this.ToffsetWires2B2.push(g),this.ToffsetWires2B2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires22.push(L),this.offsetWires22.push(m),this.offsetWires22.push(B),this.offsetWires22.push(v),this.ToffsetWires2B2.push(L),this.ToffsetWires2B2.push(m),this.ToffsetWires2B2.push(B),this.ToffsetWires2B2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),_=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires22.push(b),this.offsetWires22.push(M),this.offsetWires22.push(_),this.offsetWires22.push(R),this.offsetWires22.push(E),this.offsetWires22.push(D),this.ToffsetWires2B2.push(b),this.ToffsetWires2B2.push(M),this.ToffsetWires2B2.push(_),this.ToffsetWires2B2.push(R),this.ToffsetWires2B2.push(E),this.ToffsetWires2B2.push(D);break;case I.八分裂:const X=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),$=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),V=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires22.push(X),this.offsetWires22.push(k),this.offsetWires22.push(F),this.offsetWires22.push($),this.offsetWires22.push(V),this.offsetWires22.push(O),this.offsetWires22.push(H),this.offsetWires22.push(z),this.ToffsetWires2B2.push(X),this.ToffsetWires2B2.push(k),this.ToffsetWires2B2.push(F),this.ToffsetWires2B2.push($),this.ToffsetWires2B2.push(V),this.ToffsetWires2B2.push(O),this.ToffsetWires2B2.push(H),this.ToffsetWires2B2.push(z);break}else if(i.type==q.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B2.push(o[0]);break;case I.双分裂:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B1.push(o[1]),this.ToffsetWires2B2.push(o[2]),this.ToffsetWires2B2.push(o[3]);break;case I.四分裂:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B1.push(o[1]),this.ToffsetWires2B1.push(o[2]),this.ToffsetWires2B1.push(o[3]),this.ToffsetWires2B2.push(o[4]),this.ToffsetWires2B2.push(o[5]),this.ToffsetWires2B2.push(o[6]),this.ToffsetWires2B2.push(o[7]);break;case I.六分裂:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B1.push(o[1]),this.ToffsetWires2B1.push(o[2]),this.ToffsetWires2B1.push(o[3]),this.ToffsetWires2B1.push(o[4]),this.ToffsetWires2B1.push(o[5]),this.ToffsetWires2B2.push(o[6]),this.ToffsetWires2B2.push(o[7]),this.ToffsetWires2B2.push(o[8]),this.ToffsetWires2B2.push(o[9]),this.ToffsetWires2B2.push(o[10]),this.ToffsetWires2B2.push(o[11]);break;case I.八分裂:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B1.push(o[1]),this.ToffsetWires2B1.push(o[2]),this.ToffsetWires2B1.push(o[3]),this.ToffsetWires2B1.push(o[4]),this.ToffsetWires2B1.push(o[5]),this.ToffsetWires2B1.push(o[6]),this.ToffsetWires2B1.push(o[7]),this.ToffsetWires2B2.push(o[8]),this.ToffsetWires2B2.push(o[9]),this.ToffsetWires2B2.push(o[10]),this.ToffsetWires2B2.push(o[11]),this.ToffsetWires2B2.push(o[12]),this.ToffsetWires2B2.push(o[13]),this.ToffsetWires2B2.push(o[14]),this.ToffsetWires2B2.push(o[15]);break}break;case x.C相:if(i.type==q.耐张串)if(i.WairFX=="进")switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires23.push(o[0]),this.ToffsetWires2C1.push(o[0]);break;case I.双分裂:this.offsetWires23.push(o[0]),this.offsetWires23.push(o[1]),this.ToffsetWires2C1.push(o[2]),this.ToffsetWires2C1.push(o[3]);break;case I.四分裂:this.offsetWires23.push(o[0]),this.offsetWires23.push(o[1]),this.offsetWires23.push(o[2]),this.offsetWires23.push(o[3]),this.ToffsetWires2C1.push(o[4]),this.ToffsetWires2C1.push(o[5]),this.ToffsetWires2C1.push(o[6]),this.ToffsetWires2C1.push(o[7]);break;case I.六分裂:this.offsetWires23.push(o[0]),this.offsetWires23.push(o[1]),this.offsetWires23.push(o[2]),this.offsetWires23.push(o[3]),this.offsetWires23.push(o[4]),this.offsetWires23.push(o[5]),this.ToffsetWires2C1.push(o[6]),this.ToffsetWires2C1.push(o[7]),this.ToffsetWires2C1.push(o[8]),this.ToffsetWires2C1.push(o[9]),this.ToffsetWires2C1.push(o[10]),this.ToffsetWires2C1.push(o[11]);break;case I.八分裂:this.offsetWires23.push(o[0]),this.offsetWires23.push(o[1]),this.offsetWires23.push(o[2]),this.offsetWires23.push(o[3]),this.offsetWires23.push(o[4]),this.offsetWires23.push(o[5]),this.offsetWires23.push(o[6]),this.offsetWires23.push(o[7]),this.ToffsetWires2C1.push(o[8]),this.ToffsetWires2C1.push(o[9]),this.ToffsetWires2C1.push(o[10]),this.ToffsetWires2C1.push(o[11]),this.ToffsetWires2C1.push(o[12]),this.ToffsetWires2C1.push(o[13]),this.ToffsetWires2C1.push(o[14]),this.ToffsetWires2C1.push(o[15]);break}else switch(this.LineInfo.Wairnum){case I.单分裂:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires23.push(A),this.ToffsetWires2C2.push(A);break;case I.双分裂:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),y=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n);this.offsetWires23.push(g),this.offsetWires23.push(y),this.ToffsetWires2C2.push(g),this.ToffsetWires2C2.push(y);break;case I.四分裂:const L=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),m=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),B=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),v=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n);this.offsetWires23.push(L),this.offsetWires23.push(m),this.offsetWires23.push(B),this.offsetWires23.push(v),this.ToffsetWires2C2.push(L),this.ToffsetWires2C2.push(m),this.ToffsetWires2C2.push(B),this.ToffsetWires2C2.push(v);break;case I.六分裂:const b=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),M=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),_=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),R=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),E=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),D=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n);this.offsetWires23.push(b),this.offsetWires23.push(M),this.offsetWires23.push(_),this.offsetWires23.push(R),this.offsetWires23.push(E),this.offsetWires23.push(D),this.ToffsetWires2C2.push(b),this.ToffsetWires2C2.push(M),this.ToffsetWires2C2.push(_),this.ToffsetWires2C2.push(R),this.ToffsetWires2C2.push(E),this.ToffsetWires2C2.push(D);break;case I.八分裂:const X=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n),k=P(r,new f.Cartesian3(i.InsulatorPoint[1].X*-1,i.InsulatorPoint[1].Y,i.InsulatorPoint[1].Z),n),F=P(r,new f.Cartesian3(i.InsulatorPoint[2].X*-1,i.InsulatorPoint[2].Y,i.InsulatorPoint[2].Z),n),$=P(r,new f.Cartesian3(i.InsulatorPoint[3].X*-1,i.InsulatorPoint[3].Y,i.InsulatorPoint[3].Z),n),V=P(r,new f.Cartesian3(i.InsulatorPoint[4].X*-1,i.InsulatorPoint[4].Y,i.InsulatorPoint[4].Z),n),O=P(r,new f.Cartesian3(i.InsulatorPoint[5].X*-1,i.InsulatorPoint[5].Y,i.InsulatorPoint[5].Z),n),H=P(r,new f.Cartesian3(i.InsulatorPoint[6].X*-1,i.InsulatorPoint[6].Y,i.InsulatorPoint[6].Z),n),z=P(r,new f.Cartesian3(i.InsulatorPoint[7].X*-1,i.InsulatorPoint[7].Y,i.InsulatorPoint[7].Z),n);this.offsetWires23.push(X),this.offsetWires23.push(k),this.offsetWires23.push(F),this.offsetWires23.push($),this.offsetWires23.push(V),this.offsetWires23.push(O),this.offsetWires23.push(H),this.offsetWires23.push(z),this.ToffsetWires2C2.push(X),this.ToffsetWires2C2.push(k),this.ToffsetWires2C2.push(F),this.ToffsetWires2C2.push($),this.ToffsetWires2C2.push(V),this.ToffsetWires2C2.push(O),this.ToffsetWires2C2.push(H),this.ToffsetWires2C2.push(z);break}else if(i.type==q.跳线串)switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C2.push(o[0]);break;case I.双分裂:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C1.push(o[1]),this.ToffsetWires2C2.push(o[2]),this.ToffsetWires2C2.push(o[3]);break;case I.四分裂:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C1.push(o[1]),this.ToffsetWires2C1.push(o[2]),this.ToffsetWires2C1.push(o[3]),this.ToffsetWires2C2.push(o[4]),this.ToffsetWires2C2.push(o[5]),this.ToffsetWires2C2.push(o[6]),this.ToffsetWires2C2.push(o[7]);break;case I.六分裂:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C1.push(o[1]),this.ToffsetWires2C1.push(o[2]),this.ToffsetWires2C1.push(o[3]),this.ToffsetWires2C1.push(o[4]),this.ToffsetWires2C1.push(o[5]),this.ToffsetWires2C2.push(o[6]),this.ToffsetWires2C2.push(o[7]),this.ToffsetWires2C2.push(o[8]),this.ToffsetWires2C2.push(o[9]),this.ToffsetWires2C2.push(o[10]),this.ToffsetWires2C2.push(o[11]);break;case I.八分裂:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C1.push(o[1]),this.ToffsetWires2C1.push(o[2]),this.ToffsetWires2C1.push(o[3]),this.ToffsetWires2C1.push(o[4]),this.ToffsetWires2C1.push(o[5]),this.ToffsetWires2C1.push(o[6]),this.ToffsetWires2C1.push(o[7]),this.ToffsetWires2C2.push(o[8]),this.ToffsetWires2C2.push(o[9]),this.ToffsetWires2C2.push(o[10]),this.ToffsetWires2C2.push(o[11]),this.ToffsetWires2C2.push(o[12]),this.ToffsetWires2C2.push(o[13]),this.ToffsetWires2C2.push(o[14]),this.ToffsetWires2C2.push(o[15]);break}break}else switch(i.PhaseSequence){case x.A相:o.forEach(A=>{this.offsetWires21.push(A)});break;case x.B相:o.forEach(A=>{this.offsetWires22.push(A)});break;case x.C相:o.forEach(A=>{this.offsetWires23.push(A)});break}else if(this.LineInfo.towers[t].type==rt.耐张塔)switch(u){case 11:this.offsetWires21.push(o[0]),this.ToffsetWires2A1.push(o[0]);break;case 12:this.ToffsetWires2A1.push(o[0]),this.ToffsetWires2A2.push(o[0]);break;case 13:const A=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires21.push(A),this.ToffsetWires2A2.push(A);break;case 14:this.offsetWires22.push(o[0]),this.ToffsetWires2B1.push(o[0]);break;case 15:this.ToffsetWires2B1.push(o[0]),this.ToffsetWires2B2.push(o[0]);break;case 16:const g=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires22.push(g),this.ToffsetWires2B2.push(g);break;case 17:this.offsetWires23.push(o[0]),this.ToffsetWires2C1.push(o[0]);break;case 18:this.ToffsetWires2C1.push(o[0]),this.ToffsetWires2C2.push(o[0]);break;case 19:const y=P(r,new f.Cartesian3(i.InsulatorPoint[0].X*-1,i.InsulatorPoint[0].Y,i.InsulatorPoint[0].Z),n);this.offsetWires23.push(y),this.ToffsetWires2C2.push(y);break}else switch(u){case 5:o.forEach(A=>{this.offsetWires21.push(A)});break;case 6:o.forEach(A=>{this.offsetWires22.push(A)});break;case 7:o.forEach(A=>{this.offsetWires23.push(A)});break}break;case It.地线:if(this.LineInfo.ISPhaseSequence)switch(i.PhaseSequence){case x.地线1:this.offsetGrouundWires11.push(o[0]);break;case x.地线2:this.offsetGrouundWires12.push(o[0]);break}else switch(u){case 0:this.offsetGrouundWires11.push(o[0]);break;case 1:this.offsetGrouundWires12.push(o[0]);break}break}u=u+1}),this.offsetWires11.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.offsetWires11.length>=2&&(i.push(this.offsetWires11[e]),i.push(this.offsetWires11[e-1]),this.offsetArcWires1A=d(i),this.offsetArcWires1A.forEach(L=>{const m=et(this.viewer.scene.globe.ellipsoid,L);this.arcLine1A1.push(m)}),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case I.双分裂:this.offsetWires11.length>=4&&(i.push(this.offsetWires11[e]),i.push(this.offsetWires11[e-2]),this.offsetArcWires1A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(L=>{this.arcLine1A1.push(et(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires11[e+1]),l.push(this.offsetWires11[e-1]),this.offsetArcWires1A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case I.四分裂:this.offsetWires11.length>=8&&(i.push(this.offsetWires11[e]),i.push(this.offsetWires11[e-4]),this.offsetArcWires1A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(L=>{this.arcLine1A1.push(et(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires11[e+1]),l.push(this.offsetWires11[e-3]),this.offsetArcWires1A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires11[e+2]),T.push(this.offsetWires11[e-2]),this.offsetArcWires1A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[e+3]),p.push(this.offsetWires11[e-1]),this.offsetArcWires1A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case I.六分裂:this.offsetWires11.length>=12&&(i.push(this.offsetWires11[e]),i.push(this.offsetWires11[e-6]),this.offsetArcWires1A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(L=>{this.arcLine1A1.push(et(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires11[e+1]),l.push(this.offsetWires11[e-5]),this.offsetArcWires1A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires11[e+2]),T.push(this.offsetWires11[e-4]),this.offsetArcWires1A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[e+3]),p.push(this.offsetWires11[e-3]),this.offsetArcWires1A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires11[e+4]),o.push(this.offsetWires11[e-2]),this.offsetArcWires1A=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires11[e+5]),A.push(this.offsetWires11[e-1]),this.offsetArcWires1A=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break;case I.八分裂:this.offsetWires11.length>=16&&(i.push(this.offsetWires11[e]),i.push(this.offsetWires11[e-8]),this.offsetArcWires1A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1A.forEach(L=>{this.arcLine1A1.push(et(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires11[e+1]),l.push(this.offsetWires11[e-7]),this.offsetArcWires1A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires11[e+2]),T.push(this.offsetWires11[e-6]),this.offsetArcWires1A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires11[e+3]),p.push(this.offsetWires11[e-5]),this.offsetArcWires1A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires11[e+4]),o.push(this.offsetWires11[e-4]),this.offsetArcWires1A=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires11[e+5]),A.push(this.offsetWires11[e-3]),this.offsetArcWires1A=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires11[e+6]),g.push(this.offsetWires11[e-2]),this.offsetArcWires1A=d(g),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires11[e+7]),y.push(this.offsetWires11[e-1]),this.offsetArcWires1A=d(y),this.LineentityCollection2.add(C(this.offsetArcWires1A,"导线1_A8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)));break}}if(this.offsetWires12.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:i.push(this.offsetWires12[e]),i.push(this.offsetWires12[e-1]),this.offsetArcWires1B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(L=>{this.arcLine1B1.push(et(this.viewer.scene.globe.ellipsoid,L))});break;case I.双分裂:i.push(this.offsetWires12[e]),i.push(this.offsetWires12[e-2]),this.offsetArcWires1B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(L=>{this.arcLine1B1.push(et(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires12[e+1]),l.push(this.offsetWires12[e-1]),this.offsetArcWires1B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.四分裂:i.push(this.offsetWires12[e]),i.push(this.offsetWires12[e-4]),this.offsetArcWires1B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(L=>{this.arcLine1B1.push(et(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires12[e+1]),l.push(this.offsetWires12[e-3]),this.offsetArcWires1B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires12[e+2]),T.push(this.offsetWires12[e-2]),this.offsetArcWires1B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[e+3]),p.push(this.offsetWires12[e-1]),this.offsetArcWires1B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.六分裂:i.push(this.offsetWires12[e]),i.push(this.offsetWires12[e-6]),this.offsetArcWires1B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(L=>{this.arcLine1B1.push(et(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires12[e+1]),l.push(this.offsetWires12[e-5]),this.offsetArcWires1B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires12[e+2]),T.push(this.offsetWires12[e-4]),this.offsetArcWires1B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[e+3]),p.push(this.offsetWires12[e-3]),this.offsetArcWires1B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires12[e+4]),o.push(this.offsetWires12[e-2]),this.offsetArcWires1B=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires12[e+5]),A.push(this.offsetWires12[e-1]),this.offsetArcWires1B=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.八分裂:i.push(this.offsetWires12[e]),i.push(this.offsetWires12[e-8]),this.offsetArcWires1B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1B.forEach(L=>{this.arcLine1B1.push(et(this.viewer.scene.globe.ellipsoid,L))}),l.push(this.offsetWires12[e+1]),l.push(this.offsetWires12[e-7]),this.offsetArcWires1B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires12[e+2]),T.push(this.offsetWires12[e-6]),this.offsetArcWires1B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires12[e+3]),p.push(this.offsetWires12[e-5]),this.offsetArcWires1B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires12[e+4]),o.push(this.offsetWires12[e-4]),this.offsetArcWires1B=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires12[e+5]),A.push(this.offsetWires12[e-3]),this.offsetArcWires1B=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires12[e+6]),g.push(this.offsetWires12[e-2]),this.offsetArcWires1B=d(g),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires12[e+7]),y.push(this.offsetWires12[e-1]),this.offsetArcWires1B=d(y),this.LineentityCollection2.add(C(this.offsetArcWires1B,"导线1_B8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires13.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:i.push(this.offsetWires13[e]),i.push(this.offsetWires13[e-1]),this.offsetArcWires1C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(L=>{this.arcLine1C1.push(et(this.viewer.scene.globe.ellipsoid,L))});break;case I.双分裂:i.push(this.offsetWires13[e]),i.push(this.offsetWires13[e-2]),this.offsetArcWires1C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires13[e+1]),l.push(this.offsetWires13[e-1]),this.offsetArcWires1C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(L=>{this.arcLine1C1.push(et(this.viewer.scene.globe.ellipsoid,L))});break;case I.四分裂:i.push(this.offsetWires13[e]),i.push(this.offsetWires13[e-4]),this.offsetArcWires1C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires13[e+1]),l.push(this.offsetWires13[e-3]),this.offsetArcWires1C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires13[e+2]),T.push(this.offsetWires13[e-2]),this.offsetArcWires1C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[e+3]),p.push(this.offsetWires13[e-1]),this.offsetArcWires1C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(L=>{this.arcLine1C1.push(et(this.viewer.scene.globe.ellipsoid,L))});break;case I.六分裂:i.push(this.offsetWires13[e]),i.push(this.offsetWires13[e-6]),this.offsetArcWires1C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires13[e+1]),l.push(this.offsetWires13[e-5]),this.offsetArcWires1C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires13[e+2]),T.push(this.offsetWires13[e-4]),this.offsetArcWires1C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[e+3]),p.push(this.offsetWires13[e-3]),this.offsetArcWires1C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires13[e+4]),o.push(this.offsetWires13[e-2]),this.offsetArcWires1C=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires13[e+5]),A.push(this.offsetWires13[e-1]),this.offsetArcWires1C=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(L=>{this.arcLine1C1.push(et(this.viewer.scene.globe.ellipsoid,L))});break;case I.八分裂:i.push(this.offsetWires13[e]),i.push(this.offsetWires13[e-8]),this.offsetArcWires1C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires13[e+1]),l.push(this.offsetWires13[e-7]),this.offsetArcWires1C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires13[e+2]),T.push(this.offsetWires13[e-6]),this.offsetArcWires1C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires13[e+3]),p.push(this.offsetWires13[e-5]),this.offsetArcWires1C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires13[e+4]),o.push(this.offsetWires13[e-4]),this.offsetArcWires1C=d(o),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires13[e+5]),A.push(this.offsetWires13[e-3]),this.offsetArcWires1C=d(A),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires13[e+6]),g.push(this.offsetWires13[e-2]),this.offsetArcWires1C=d(g),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires13[e+7]),y.push(this.offsetWires13[e-1]),this.offsetArcWires1C=d(y),this.LineentityCollection2.add(C(this.offsetArcWires1C,"导线1_C8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.offsetArcWires1C.forEach(L=>{this.arcLine1C1.push(et(this.viewer.scene.globe.ellipsoid,L))});break}}if(this.offsetWires21.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:i.push(this.offsetWires21[e]),i.push(this.offsetWires21[e-1]),this.offsetArcWires2A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.双分裂:i.push(this.offsetWires21[e]),i.push(this.offsetWires21[e-2]),this.offsetArcWires2A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires21[e+1]),l.push(this.offsetWires21[e-1]),this.offsetArcWires2A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.四分裂:i.push(this.offsetWires21[e]),i.push(this.offsetWires21[e-4]),this.offsetArcWires2A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires21[e+1]),l.push(this.offsetWires21[e-3]),this.offsetArcWires2A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires21[e+2]),T.push(this.offsetWires21[e-2]),this.offsetArcWires2A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[e+3]),p.push(this.offsetWires21[e-1]),this.offsetArcWires2A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.六分裂:i.push(this.offsetWires21[e]),i.push(this.offsetWires21[e-6]),this.offsetArcWires2A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires21[e+1]),l.push(this.offsetWires21[e-5]),this.offsetArcWires2A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires21[e+2]),T.push(this.offsetWires21[e-4]),this.offsetArcWires2A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[e+3]),p.push(this.offsetWires21[e-3]),this.offsetArcWires2A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires21[e+4]),o.push(this.offsetWires21[e-2]),this.offsetArcWires2A=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires21[e+5]),A.push(this.offsetWires21[e-1]),this.offsetArcWires2A=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.八分裂:i.push(this.offsetWires21[e]),i.push(this.offsetWires21[e-8]),this.offsetArcWires2A=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires21[e+1]),l.push(this.offsetWires21[e-7]),this.offsetArcWires2A=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires21[e+2]),T.push(this.offsetWires21[e-6]),this.offsetArcWires2A=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires21[e+3]),p.push(this.offsetWires21[e-5]),this.offsetArcWires2A=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires21[e+4]),o.push(this.offsetWires21[e-4]),this.offsetArcWires2A=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires21[e+5]),A.push(this.offsetWires21[e-3]),this.offsetArcWires2A=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires21[e+6]),g.push(this.offsetWires21[e-2]),this.offsetArcWires2A=d(g),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires21[e+7]),y.push(this.offsetWires21[e-1]),this.offsetArcWires2A=d(y),this.LineentityCollection2.add(C(this.offsetArcWires2A,"导线2_A8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires22.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:i.push(this.offsetWires22[e]),i.push(this.offsetWires22[e-1]),this.offsetArcWires2B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.双分裂:i.push(this.offsetWires22[e]),i.push(this.offsetWires22[e-2]),this.offsetArcWires2B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires22[e+1]),l.push(this.offsetWires22[e-1]),this.offsetArcWires2B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.四分裂:i.push(this.offsetWires22[e]),i.push(this.offsetWires22[e-4]),this.offsetArcWires2B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires22[e+1]),l.push(this.offsetWires22[e-3]),this.offsetArcWires2B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires22[e+2]),T.push(this.offsetWires22[e-2]),this.offsetArcWires2B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[e+3]),p.push(this.offsetWires22[e-1]),this.offsetArcWires2B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.六分裂:i.push(this.offsetWires22[e]),i.push(this.offsetWires22[e-6]),this.offsetArcWires2B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires22[e+1]),l.push(this.offsetWires22[e-5]),this.offsetArcWires2B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires22[e+2]),T.push(this.offsetWires22[e-4]),this.offsetArcWires2B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[e+3]),p.push(this.offsetWires22[e-3]),this.offsetArcWires2B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires22[e+4]),o.push(this.offsetWires22[e-2]),this.offsetArcWires2B=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires22[e+5]),A.push(this.offsetWires22[e-1]),this.offsetArcWires2B=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.八分裂:i.push(this.offsetWires22[e]),i.push(this.offsetWires22[e-8]),this.offsetArcWires2B=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires22[e+1]),l.push(this.offsetWires22[e-7]),this.offsetArcWires2B=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires22[e+2]),T.push(this.offsetWires22[e-6]),this.offsetArcWires2B=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires22[e+3]),p.push(this.offsetWires22[e-5]),this.offsetArcWires2B=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires22[e+4]),o.push(this.offsetWires22[e-4]),this.offsetArcWires2B=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires22[e+5]),A.push(this.offsetWires22[e-3]),this.offsetArcWires2B=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires22[e+6]),g.push(this.offsetWires22[e-2]),this.offsetArcWires2B=d(g),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires22[e+7]),y.push(this.offsetWires22[e-1]),this.offsetArcWires2B=d(y),this.LineentityCollection2.add(C(this.offsetArcWires2B,"导线2_B8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetWires23.length>0&&t>0){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[];switch(this.LineInfo.Wairnum){case I.单分裂:i.push(this.offsetWires23[e]),i.push(this.offsetWires23[e-1]),this.offsetArcWires2C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.双分裂:i.push(this.offsetWires23[e]),i.push(this.offsetWires23[e-2]),this.offsetArcWires2C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires23[e+1]),l.push(this.offsetWires23[e-1]),this.offsetArcWires2C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.四分裂:i.push(this.offsetWires23[e]),i.push(this.offsetWires23[e-4]),this.offsetArcWires2C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires23[e+1]),l.push(this.offsetWires23[e-3]),this.offsetArcWires2C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires23[e+2]),T.push(this.offsetWires23[e-2]),this.offsetArcWires2C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[e+3]),p.push(this.offsetWires23[e-1]),this.offsetArcWires2C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.六分裂:i.push(this.offsetWires23[e]),i.push(this.offsetWires23[e-6]),this.offsetArcWires2C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires23[e+1]),l.push(this.offsetWires23[e-5]),this.offsetArcWires2C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires23[e+2]),T.push(this.offsetWires23[e-4]),this.offsetArcWires2C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[e+3]),p.push(this.offsetWires23[e-3]),this.offsetArcWires2C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires23[e+4]),o.push(this.offsetWires23[e-2]),this.offsetArcWires2C=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires23[e+5]),A.push(this.offsetWires23[e-1]),this.offsetArcWires2C=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break;case I.八分裂:i.push(this.offsetWires23[e]),i.push(this.offsetWires23[e-8]),this.offsetArcWires2C=d(i),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),l.push(this.offsetWires23[e+1]),l.push(this.offsetWires23[e-7]),this.offsetArcWires2C=d(l),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),T.push(this.offsetWires23[e+2]),T.push(this.offsetWires23[e-6]),this.offsetArcWires2C=d(T),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),p.push(this.offsetWires23[e+3]),p.push(this.offsetWires23[e-5]),this.offsetArcWires2C=d(p),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),o.push(this.offsetWires23[e+4]),o.push(this.offsetWires23[e-4]),this.offsetArcWires2C=d(o),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),A.push(this.offsetWires23[e+5]),A.push(this.offsetWires23[e-3]),this.offsetArcWires2C=d(A),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),g.push(this.offsetWires23[e+6]),g.push(this.offsetWires23[e-2]),this.offsetArcWires2C=d(g),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor)),y.push(this.offsetWires23[e+7]),y.push(this.offsetWires23[e-1]),this.offsetArcWires2C=d(y),this.LineentityCollection2.add(C(this.offsetArcWires2C,"导线2_C8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireAColor));break}}if(this.offsetGrouundWires11.length>1){const i=[];i.push(this.offsetGrouundWires11[t]),i.push(this.offsetGrouundWires11[t-1]);const l=[];l.push(this.offsetGrouundWires12[t]),l.push(this.offsetGrouundWires12[t-1]),this.offsetGrouundWires1=d(i,2),this.offsetGrouundWires2=d(l,2),this.LineentityCollection2.add(C(this.offsetGrouundWires1,"地线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireD1Color)),this.LineentityCollection2.add(C(this.offsetGrouundWires2,"地线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireD2Color))}let c=2;if(this.LineInfo.towers[t].type==rt.耐张塔){switch(this.LineInfo.Wairnum){case I.单分裂:e=e+c,s=s+c;break;case I.双分裂:e=e+c*2,s=s+c*2;break;case I.四分裂:e=e+c*4,s=s+c*4;break;case I.六分裂:e=e+c*6,s=s+c*6;break;case I.八分裂:e=e+c*8,s=s+c*8;break}if(this.ToffsetWires1A1.length>1&&this.ToffsetWires1A2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],_=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1A1.length>=2&&(i.push(this.ToffsetWires1A1[s-2]),i.push(this.ToffsetWires1A1[s-1]),this.ToffsetArcWires1A=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=2&&(L.push(this.ToffsetWires1A2[s-2]),L.push(this.ToffsetWires1A2[s-1]),this.ToffsetArcWires2A=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires1A1.length>=4&&(i.push(this.ToffsetWires1A1[s-4]),i.push(this.ToffsetWires1A1[s-2]),this.ToffsetArcWires1A=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1A1[s-3]),l.push(this.ToffsetWires1A1[s-1]),this.ToffsetArcWires1A=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=4&&(L.push(this.ToffsetWires1A2[s-4]),L.push(this.ToffsetWires1A2[s-2]),this.ToffsetArcWires2A=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A2[s-3]),m.push(this.ToffsetWires1A2[s-1]),this.ToffsetArcWires2A=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires1A1.length>=8&&(i.push(this.ToffsetWires1A1[s-8]),i.push(this.ToffsetWires1A1[s-4]),this.ToffsetArcWires1A=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1A1[s-7]),l.push(this.ToffsetWires1A1[s-3]),this.ToffsetArcWires1A=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A1[s-6]),T.push(this.ToffsetWires1A1[s-2]),this.ToffsetArcWires1A=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[s-5]),p.push(this.ToffsetWires1A1[s-1]),this.ToffsetArcWires1A=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=8&&(L.push(this.ToffsetWires1A2[s-8]),L.push(this.ToffsetWires1A2[s-4]),this.ToffsetArcWires2A=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A2[s-7]),m.push(this.ToffsetWires1A2[s-3]),this.ToffsetArcWires2A=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[s-6]),B.push(this.ToffsetWires1A2[s-2]),this.ToffsetArcWires2A=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1A2[s-5]),v.push(this.ToffsetWires1A2[s-1]),this.ToffsetArcWires2A=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires1A1.length>=12&&(i.push(this.ToffsetWires1A1[s-12]),i.push(this.ToffsetWires1A1[s-6]),this.ToffsetArcWires1A=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1A1[s-11]),l.push(this.ToffsetWires1A1[s-5]),this.ToffsetArcWires1A=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A1[s-10]),T.push(this.ToffsetWires1A1[s-4]),this.ToffsetArcWires1A=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[s-9]),p.push(this.ToffsetWires1A1[s-3]),this.ToffsetArcWires1A=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1A1[s-8]),o.push(this.ToffsetWires1A1[s-2]),this.ToffsetArcWires1A=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1A1[s-7]),A.push(this.ToffsetWires1A1[s-1]),this.ToffsetArcWires1A=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=12&&(L.push(this.ToffsetWires1A2[s-12]),L.push(this.ToffsetWires1A2[s-6]),this.ToffsetArcWires2A=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A2[s-11]),m.push(this.ToffsetWires1A2[s-5]),this.ToffsetArcWires2A=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[s-10]),B.push(this.ToffsetWires1A2[s-4]),this.ToffsetArcWires2A=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1A2[s-9]),v.push(this.ToffsetWires1A2[s-3]),this.ToffsetArcWires2A=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[s-8]),b.push(this.ToffsetWires1A2[s-2]),this.ToffsetArcWires2A=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1A2[s-7]),M.push(this.ToffsetWires1A2[s-1]),this.ToffsetArcWires2A=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires1A1.length>=16&&(i.push(this.ToffsetWires1A1[s-16]),i.push(this.ToffsetWires1A1[s-8]),this.ToffsetArcWires1A=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1A1[s-15]),l.push(this.ToffsetWires1A1[s-7]),this.ToffsetArcWires1A=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1A1[s-14]),T.push(this.ToffsetWires1A1[s-6]),this.ToffsetArcWires1A=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1A1[s-13]),p.push(this.ToffsetWires1A1[s-5]),this.ToffsetArcWires1A=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1A1[s-12]),o.push(this.ToffsetWires1A1[s-4]),this.ToffsetArcWires1A=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1A1[s-11]),A.push(this.ToffsetWires1A1[s-3]),this.ToffsetArcWires1A=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires1A1[s-10]),g.push(this.ToffsetWires1A1[s-2]),this.ToffsetArcWires1A=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1A1[s-9]),y.push(this.ToffsetWires1A1[s-1]),this.ToffsetArcWires1A=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A,"1A1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1A2.length>=16&&(L.push(this.ToffsetWires1A2[s-16]),L.push(this.ToffsetWires1A2[s-8]),this.ToffsetArcWires2A=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1A2[s-15]),m.push(this.ToffsetWires1A2[s-7]),this.ToffsetArcWires2A=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1A2[s-14]),B.push(this.ToffsetWires1A2[s-6]),this.ToffsetArcWires2A=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1A2[s-13]),v.push(this.ToffsetWires1A2[s-5]),this.ToffsetArcWires2A=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1A2[s-12]),b.push(this.ToffsetWires1A2[s-4]),this.ToffsetArcWires2A=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1A2[s-11]),M.push(this.ToffsetWires1A2[s-3]),this.ToffsetArcWires2A=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires1A2[s-10]),_.push(this.ToffsetWires1A2[s-2]),this.ToffsetArcWires2A=d(_,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1A2[s-9]),R.push(this.ToffsetWires1A2[s-1]),this.ToffsetArcWires2A=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A,"1A2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1B1.length>1&&this.ToffsetWires1B2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],_=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1B1.length>=2&&(i.push(this.ToffsetWires1B1[s-2]),i.push(this.ToffsetWires1B1[s-1]),this.ToffsetArcWires1B=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=2&&(L.push(this.ToffsetWires1B2[s-2]),L.push(this.ToffsetWires1B2[s-1]),this.ToffsetArcWires2B=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires1B1.length>=4&&(i.push(this.ToffsetWires1B1[s-4]),i.push(this.ToffsetWires1B1[s-2]),this.ToffsetArcWires1B=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1B1[s-3]),l.push(this.ToffsetWires1B1[s-1]),this.ToffsetArcWires1B=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=4&&(L.push(this.ToffsetWires1B2[s-4]),L.push(this.ToffsetWires1B2[s-2]),this.ToffsetArcWires2B=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B2[s-3]),m.push(this.ToffsetWires1B2[s-1]),this.ToffsetArcWires2B=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires1B1.length>=8&&(i.push(this.ToffsetWires1B1[s-8]),i.push(this.ToffsetWires1B1[s-4]),this.ToffsetArcWires1B=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1B1[s-7]),l.push(this.ToffsetWires1B1[s-3]),this.ToffsetArcWires1B=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B1[s-6]),T.push(this.ToffsetWires1B1[s-2]),this.ToffsetArcWires1B=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[s-5]),p.push(this.ToffsetWires1B1[s-1]),this.ToffsetArcWires1B=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=8&&(L.push(this.ToffsetWires1B2[s-8]),L.push(this.ToffsetWires1B2[s-4]),this.ToffsetArcWires2B=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B2[s-7]),m.push(this.ToffsetWires1B2[s-3]),this.ToffsetArcWires2B=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[s-6]),B.push(this.ToffsetWires1B2[s-2]),this.ToffsetArcWires2B=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1B2[s-5]),v.push(this.ToffsetWires1B2[s-1]),this.ToffsetArcWires2B=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires1B1.length>=12&&(i.push(this.ToffsetWires1B1[s-12]),i.push(this.ToffsetWires1B1[s-6]),this.ToffsetArcWires1B=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1B1[s-11]),l.push(this.ToffsetWires1B1[s-5]),this.ToffsetArcWires1B=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B1[s-10]),T.push(this.ToffsetWires1B1[s-4]),this.ToffsetArcWires1B=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[s-9]),p.push(this.ToffsetWires1B1[s-3]),this.ToffsetArcWires1B=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1B1[s-8]),o.push(this.ToffsetWires1B1[s-2]),this.ToffsetArcWires1B=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1B1[s-7]),A.push(this.ToffsetWires1B1[s-1]),this.ToffsetArcWires1B=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=12&&(L.push(this.ToffsetWires1B2[s-12]),L.push(this.ToffsetWires1B2[s-6]),this.ToffsetArcWires2B=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B2[s-11]),m.push(this.ToffsetWires1B2[s-5]),this.ToffsetArcWires2B=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[s-10]),B.push(this.ToffsetWires1B2[s-4]),this.ToffsetArcWires2B=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1B2[s-9]),v.push(this.ToffsetWires1B2[s-3]),this.ToffsetArcWires2B=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[s-8]),b.push(this.ToffsetWires1B2[s-2]),this.ToffsetArcWires2B=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1B2[s-7]),M.push(this.ToffsetWires1B2[s-1]),this.ToffsetArcWires2B=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires1B1.length>=16&&(i.push(this.ToffsetWires1B1[s-16]),i.push(this.ToffsetWires1B1[s-8]),this.ToffsetArcWires1B=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1B1[s-15]),l.push(this.ToffsetWires1B1[s-7]),this.ToffsetArcWires1B=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1B1[s-14]),T.push(this.ToffsetWires1B1[s-6]),this.ToffsetArcWires1B=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1B1[s-13]),p.push(this.ToffsetWires1B1[s-5]),this.ToffsetArcWires1B=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1B1[s-12]),o.push(this.ToffsetWires1B1[s-4]),this.ToffsetArcWires1B=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1B1[s-11]),A.push(this.ToffsetWires1B1[s-3]),this.ToffsetArcWires1B=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires1B1[s-10]),g.push(this.ToffsetWires1B1[s-2]),this.ToffsetArcWires1B=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1B1[s-9]),y.push(this.ToffsetWires1B1[s-1]),this.ToffsetArcWires1B=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B,"1B1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1B2.length>=16&&(L.push(this.ToffsetWires1B2[s-16]),L.push(this.ToffsetWires1B2[s-8]),this.ToffsetArcWires2B=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1B2[s-15]),m.push(this.ToffsetWires1B2[s-7]),this.ToffsetArcWires2B=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1B2[s-14]),B.push(this.ToffsetWires1B2[s-6]),this.ToffsetArcWires2B=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1B2[s-13]),v.push(this.ToffsetWires1B2[s-5]),this.ToffsetArcWires2B=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1B2[s-12]),b.push(this.ToffsetWires1B2[s-4]),this.ToffsetArcWires2B=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1B2[s-11]),M.push(this.ToffsetWires1B2[s-3]),this.ToffsetArcWires2B=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires1B2[s-10]),_.push(this.ToffsetWires1B2[s-2]),this.ToffsetArcWires2B=d(_,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1B2[s-9]),R.push(this.ToffsetWires1B2[s-1]),this.ToffsetArcWires2B=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B,"1B2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires1C1.length>1&&this.ToffsetWires1C2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],_=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires1C1.length>=2&&(i.push(this.ToffsetWires1C1[s-2]),i.push(this.ToffsetWires1C1[s-1]),this.ToffsetArcWires1C=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=2&&(L.push(this.ToffsetWires1C2[s-2]),L.push(this.ToffsetWires1C2[s-1]),this.ToffsetArcWires2C=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires1C1.length>=4&&(i.push(this.ToffsetWires1C1[s-4]),i.push(this.ToffsetWires1C1[s-2]),this.ToffsetArcWires1C=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1C1[s-3]),l.push(this.ToffsetWires1C1[s-1]),this.ToffsetArcWires1C=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=4&&(L.push(this.ToffsetWires1C2[s-4]),L.push(this.ToffsetWires1C2[s-2]),this.ToffsetArcWires2C=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C2[s-3]),m.push(this.ToffsetWires1C2[s-1]),this.ToffsetArcWires2C=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires1C1.length>=8&&(i.push(this.ToffsetWires1C1[s-8]),i.push(this.ToffsetWires1C1[s-4]),this.ToffsetArcWires1C=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1C1[s-7]),l.push(this.ToffsetWires1C1[s-3]),this.ToffsetArcWires1C=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C1[s-6]),T.push(this.ToffsetWires1C1[s-2]),this.ToffsetArcWires1C=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[s-5]),p.push(this.ToffsetWires1C1[s-1]),this.ToffsetArcWires1C=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=8&&(L.push(this.ToffsetWires1C2[s-8]),L.push(this.ToffsetWires1C2[s-4]),this.ToffsetArcWires2C=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C2[s-7]),m.push(this.ToffsetWires1C2[s-3]),this.ToffsetArcWires2C=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[s-6]),B.push(this.ToffsetWires1C2[s-2]),this.ToffsetArcWires2C=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1C2[s-5]),v.push(this.ToffsetWires1C2[s-1]),this.ToffsetArcWires2C=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires1C1.length>=12&&(i.push(this.ToffsetWires1C1[s-12]),i.push(this.ToffsetWires1C1[s-6]),this.ToffsetArcWires1C=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1C1[s-11]),l.push(this.ToffsetWires1C1[s-5]),this.ToffsetArcWires1C=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C1[s-10]),T.push(this.ToffsetWires1C1[s-4]),this.ToffsetArcWires1C=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[s-9]),p.push(this.ToffsetWires1C1[s-3]),this.ToffsetArcWires1C=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1C1[s-8]),o.push(this.ToffsetWires1C1[s-2]),this.ToffsetArcWires1C=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1C1[s-7]),A.push(this.ToffsetWires1C1[s-1]),this.ToffsetArcWires1C=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=12&&(L.push(this.ToffsetWires1C2[s-12]),L.push(this.ToffsetWires1C2[s-6]),this.ToffsetArcWires2C=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C2[s-11]),m.push(this.ToffsetWires1C2[s-5]),this.ToffsetArcWires2C=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[s-10]),B.push(this.ToffsetWires1C2[s-4]),this.ToffsetArcWires2C=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1C2[s-9]),v.push(this.ToffsetWires1C2[s-3]),this.ToffsetArcWires2C=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[s-8]),b.push(this.ToffsetWires1C2[s-2]),this.ToffsetArcWires2C=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1C2[s-7]),M.push(this.ToffsetWires1C2[s-1]),this.ToffsetArcWires2C=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires1C1.length>=16&&(i.push(this.ToffsetWires1C1[s-16]),i.push(this.ToffsetWires1C1[s-8]),this.ToffsetArcWires1C=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires1C1[s-15]),l.push(this.ToffsetWires1C1[s-7]),this.ToffsetArcWires1C=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires1C1[s-14]),T.push(this.ToffsetWires1C1[s-6]),this.ToffsetArcWires1C=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires1C1[s-13]),p.push(this.ToffsetWires1C1[s-5]),this.ToffsetArcWires1C=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires1C1[s-12]),o.push(this.ToffsetWires1C1[s-4]),this.ToffsetArcWires1C=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires1C1[s-11]),A.push(this.ToffsetWires1C1[s-3]),this.ToffsetArcWires1C=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires1C1[s-10]),g.push(this.ToffsetWires1C1[s-2]),this.ToffsetArcWires1C=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires1C1[s-9]),y.push(this.ToffsetWires1C1[s-1]),this.ToffsetArcWires1C=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C,"1C1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires1C2.length>=16&&(L.push(this.ToffsetWires1C2[s-16]),L.push(this.ToffsetWires1C2[s-8]),this.ToffsetArcWires2C=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires1C2[s-15]),m.push(this.ToffsetWires1C2[s-7]),this.ToffsetArcWires2C=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires1C2[s-14]),B.push(this.ToffsetWires1C2[s-6]),this.ToffsetArcWires2C=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires1C2[s-13]),v.push(this.ToffsetWires1C2[s-5]),this.ToffsetArcWires2C=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires1C2[s-12]),b.push(this.ToffsetWires1C2[s-4]),this.ToffsetArcWires2C=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires1C2[s-11]),M.push(this.ToffsetWires1C2[s-3]),this.ToffsetArcWires2C=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires1C2[s-10]),_.push(this.ToffsetWires1C2[s-2]),this.ToffsetArcWires2C=d(_,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires1C2[s-9]),R.push(this.ToffsetWires1C2[s-1]),this.ToffsetArcWires2C=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C,"1C2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2A1.length>1&&this.ToffsetWires2A2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],_=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2A1.length>=2&&(i.push(this.ToffsetWires2A1[s-2]),i.push(this.ToffsetWires2A1[s-1]),this.ToffsetArcWires1A2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=2&&(L.push(this.ToffsetWires2A2[s-2]),L.push(this.ToffsetWires2A2[s-1]),this.ToffsetArcWires2A2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires2A1.length>=4&&(i.push(this.ToffsetWires2A1[s-4]),i.push(this.ToffsetWires2A1[s-2]),this.ToffsetArcWires1A2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2A1[s-3]),l.push(this.ToffsetWires2A1[s-1]),this.ToffsetArcWires1A2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=4&&(L.push(this.ToffsetWires2A2[s-4]),L.push(this.ToffsetWires2A2[s-2]),this.ToffsetArcWires2A2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A2[s-3]),m.push(this.ToffsetWires2A2[s-1]),this.ToffsetArcWires2A2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires2A1.length>=8&&(i.push(this.ToffsetWires2A1[s-8]),i.push(this.ToffsetWires2A1[s-4]),this.ToffsetArcWires1A2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2A1[s-7]),l.push(this.ToffsetWires2A1[s-3]),this.ToffsetArcWires1A2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A1[s-6]),T.push(this.ToffsetWires2A1[s-2]),this.ToffsetArcWires1A2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[s-5]),p.push(this.ToffsetWires2A1[s-1]),this.ToffsetArcWires1A2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=8&&(L.push(this.ToffsetWires2A2[s-8]),L.push(this.ToffsetWires2A2[s-4]),this.ToffsetArcWires2A2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A2[s-7]),m.push(this.ToffsetWires2A2[s-3]),this.ToffsetArcWires2A2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[s-6]),B.push(this.ToffsetWires2A2[s-2]),this.ToffsetArcWires2A2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2A2[s-5]),v.push(this.ToffsetWires2A2[s-1]),this.ToffsetArcWires2A2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires2A1.length>=12&&(i.push(this.ToffsetWires2A1[s-12]),i.push(this.ToffsetWires2A1[s-6]),this.ToffsetArcWires1A2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2A1[s-11]),l.push(this.ToffsetWires2A1[s-5]),this.ToffsetArcWires1A2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A1[s-10]),T.push(this.ToffsetWires2A1[s-4]),this.ToffsetArcWires1A2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[s-9]),p.push(this.ToffsetWires2A1[s-3]),this.ToffsetArcWires1A2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2A1[s-8]),o.push(this.ToffsetWires2A1[s-2]),this.ToffsetArcWires1A2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2A1[s-7]),A.push(this.ToffsetWires2A1[s-1]),this.ToffsetArcWires1A2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=12&&(L.push(this.ToffsetWires2A2[s-12]),L.push(this.ToffsetWires2A2[s-6]),this.ToffsetArcWires2A2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A2[s-11]),m.push(this.ToffsetWires2A2[s-5]),this.ToffsetArcWires2A2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[s-10]),B.push(this.ToffsetWires2A2[s-4]),this.ToffsetArcWires2A2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2A2[s-9]),v.push(this.ToffsetWires2A2[s-3]),this.ToffsetArcWires2A2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[s-8]),b.push(this.ToffsetWires2A2[s-2]),this.ToffsetArcWires2A2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2A2[s-7]),M.push(this.ToffsetWires2A2[s-1]),this.ToffsetArcWires2A2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires2A1.length>=16&&(i.push(this.ToffsetWires2A1[s-16]),i.push(this.ToffsetWires2A1[s-8]),this.ToffsetArcWires1A2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2A1[s-15]),l.push(this.ToffsetWires2A1[s-7]),this.ToffsetArcWires1A2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2A1[s-14]),T.push(this.ToffsetWires2A1[s-6]),this.ToffsetArcWires1A2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2A1[s-13]),p.push(this.ToffsetWires2A1[s-5]),this.ToffsetArcWires1A2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2A1[s-12]),o.push(this.ToffsetWires2A1[s-4]),this.ToffsetArcWires1A2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2A1[s-11]),A.push(this.ToffsetWires2A1[s-3]),this.ToffsetArcWires1A2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires2A1[s-10]),g.push(this.ToffsetWires2A1[s-2]),this.ToffsetArcWires1A2=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2A1[s-9]),y.push(this.ToffsetWires2A1[s-1]),this.ToffsetArcWires1A2=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1A2,"2A1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2A2.length>=16&&(L.push(this.ToffsetWires2A2[s-16]),L.push(this.ToffsetWires2A2[s-8]),this.ToffsetArcWires2A2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2A2[s-15]),m.push(this.ToffsetWires2A2[s-7]),this.ToffsetArcWires2A2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2A2[s-14]),B.push(this.ToffsetWires2A2[s-6]),this.ToffsetArcWires2A2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2A2[s-13]),v.push(this.ToffsetWires2A2[s-5]),this.ToffsetArcWires2A2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2A2[s-12]),b.push(this.ToffsetWires2A2[s-4]),this.ToffsetArcWires2A2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2A2[s-11]),M.push(this.ToffsetWires2A2[s-3]),this.ToffsetArcWires2A2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires2A2[s-10]),_.push(this.ToffsetWires2A2[s-2]),this.ToffsetArcWires2A2=d(_,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2A2[s-9]),R.push(this.ToffsetWires2A2[s-1]),this.ToffsetArcWires2A2=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2A2,"2A2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2B1.length>1&&this.ToffsetWires2B2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],_=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2B1.length>=2&&(i.push(this.ToffsetWires2B1[s-2]),i.push(this.ToffsetWires2B1[s-1]),this.ToffsetArcWires1B2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=2&&(L.push(this.ToffsetWires2B2[s-2]),L.push(this.ToffsetWires2B2[s-1]),this.ToffsetArcWires2B2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires2B1.length>=4&&(i.push(this.ToffsetWires2B1[s-4]),i.push(this.ToffsetWires2B1[s-2]),this.ToffsetArcWires1B2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2B1[s-3]),l.push(this.ToffsetWires2B1[s-1]),this.ToffsetArcWires1B2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=4&&(L.push(this.ToffsetWires2B2[s-4]),L.push(this.ToffsetWires2B2[s-2]),this.ToffsetArcWires2B2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B2[s-3]),m.push(this.ToffsetWires2B2[s-1]),this.ToffsetArcWires2B2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires2B1.length>=8&&(i.push(this.ToffsetWires2B1[s-8]),i.push(this.ToffsetWires2B1[s-4]),this.ToffsetArcWires1B2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2B1[s-7]),l.push(this.ToffsetWires2B1[s-3]),this.ToffsetArcWires1B2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B1[s-6]),T.push(this.ToffsetWires2B1[s-2]),this.ToffsetArcWires1B2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[s-5]),p.push(this.ToffsetWires2B1[s-1]),this.ToffsetArcWires1B2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=8&&(L.push(this.ToffsetWires2B2[s-8]),L.push(this.ToffsetWires2B2[s-4]),this.ToffsetArcWires2B2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B2[s-7]),m.push(this.ToffsetWires2B2[s-3]),this.ToffsetArcWires2B2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[s-6]),B.push(this.ToffsetWires2B2[s-2]),this.ToffsetArcWires2B2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2B2[s-5]),v.push(this.ToffsetWires2B2[s-1]),this.ToffsetArcWires2B2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires2B1.length>=12&&(i.push(this.ToffsetWires2B1[s-12]),i.push(this.ToffsetWires2B1[s-6]),this.ToffsetArcWires1B2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2B1[s-11]),l.push(this.ToffsetWires2B1[s-5]),this.ToffsetArcWires1B2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B1[s-10]),T.push(this.ToffsetWires2B1[s-4]),this.ToffsetArcWires1B2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[s-9]),p.push(this.ToffsetWires2B1[s-3]),this.ToffsetArcWires1B2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2B1[s-8]),o.push(this.ToffsetWires2B1[s-2]),this.ToffsetArcWires1B2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2B1[s-7]),A.push(this.ToffsetWires2B1[s-1]),this.ToffsetArcWires1B2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=12&&(L.push(this.ToffsetWires2B2[s-12]),L.push(this.ToffsetWires2B2[s-6]),this.ToffsetArcWires2B2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B2[s-11]),m.push(this.ToffsetWires2B2[s-5]),this.ToffsetArcWires2B2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[s-10]),B.push(this.ToffsetWires2B2[s-4]),this.ToffsetArcWires2B2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2B2[s-9]),v.push(this.ToffsetWires2B2[s-3]),this.ToffsetArcWires2B2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[s-8]),b.push(this.ToffsetWires2B2[s-2]),this.ToffsetArcWires2B2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2B2[s-7]),M.push(this.ToffsetWires2B2[s-1]),this.ToffsetArcWires2B2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires2B1.length>=16&&(i.push(this.ToffsetWires2B1[s-16]),i.push(this.ToffsetWires2B1[s-8]),this.ToffsetArcWires1B2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2B1[s-15]),l.push(this.ToffsetWires2B1[s-7]),this.ToffsetArcWires1B2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2B1[s-14]),T.push(this.ToffsetWires2B1[s-6]),this.ToffsetArcWires1B2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2B1[s-13]),p.push(this.ToffsetWires2B1[s-5]),this.ToffsetArcWires1B2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2B1[s-12]),o.push(this.ToffsetWires2B1[s-4]),this.ToffsetArcWires1B2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2B1[s-11]),A.push(this.ToffsetWires2B1[s-3]),this.ToffsetArcWires1B2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires2B1[s-10]),g.push(this.ToffsetWires2B1[s-2]),this.ToffsetArcWires1B2=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2B1[s-9]),y.push(this.ToffsetWires2B1[s-1]),this.ToffsetArcWires1B2=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1B2,"2B1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2B2.length>=16&&(L.push(this.ToffsetWires2B2[s-16]),L.push(this.ToffsetWires2B2[s-8]),this.ToffsetArcWires2B2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2B2[s-15]),m.push(this.ToffsetWires2B2[s-7]),this.ToffsetArcWires2B2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2B2[s-14]),B.push(this.ToffsetWires2B2[s-6]),this.ToffsetArcWires2B2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2B2[s-13]),v.push(this.ToffsetWires2B2[s-5]),this.ToffsetArcWires2B2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2B2[s-12]),b.push(this.ToffsetWires2B2[s-4]),this.ToffsetArcWires2B2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2B2[s-11]),M.push(this.ToffsetWires2B2[s-3]),this.ToffsetArcWires2B2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires2B2[s-10]),_.push(this.ToffsetWires2B2[s-2]),this.ToffsetArcWires2B2=d(_,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2B2[s-9]),R.push(this.ToffsetWires2B2[s-1]),this.ToffsetArcWires2B2=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2B2,"2B2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}if(this.ToffsetWires2C1.length>1&&this.ToffsetWires2C2.length>1){const i=[],l=[],T=[],p=[],o=[],A=[],g=[],y=[],L=[],m=[],B=[],v=[],b=[],M=[],_=[],R=[];switch(this.LineInfo.Wairnum){case I.单分裂:this.ToffsetWires2C1.length>=2&&(i.push(this.ToffsetWires2C1[s-2]),i.push(this.ToffsetWires2C1[s-1]),this.ToffsetArcWires1C2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=2&&(L.push(this.ToffsetWires2C2[s-2]),L.push(this.ToffsetWires2C2[s-1]),this.ToffsetArcWires2C2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.双分裂:this.ToffsetWires2C1.length>=4&&(i.push(this.ToffsetWires2C1[s-4]),i.push(this.ToffsetWires2C1[s-2]),this.ToffsetArcWires1C2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2C1[s-3]),l.push(this.ToffsetWires2C1[s-1]),this.ToffsetArcWires1C2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=4&&(L.push(this.ToffsetWires2C2[s-4]),L.push(this.ToffsetWires2C2[s-2]),this.ToffsetArcWires2C2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C2[s-3]),m.push(this.ToffsetWires2C2[s-1]),this.ToffsetArcWires2C2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.四分裂:this.ToffsetWires2C1.length>=8&&(i.push(this.ToffsetWires2C1[s-8]),i.push(this.ToffsetWires2C1[s-4]),this.ToffsetArcWires1C2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2C1[s-7]),l.push(this.ToffsetWires2C1[s-3]),this.ToffsetArcWires1C2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C1[s-6]),T.push(this.ToffsetWires2C1[s-2]),this.ToffsetArcWires1C2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[s-5]),p.push(this.ToffsetWires2C1[s-1]),this.ToffsetArcWires1C2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=8&&(L.push(this.ToffsetWires2C2[s-8]),L.push(this.ToffsetWires2C2[s-4]),this.ToffsetArcWires2C2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C2[s-7]),m.push(this.ToffsetWires2C2[s-3]),this.ToffsetArcWires2C2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[s-6]),B.push(this.ToffsetWires2C2[s-2]),this.ToffsetArcWires2C2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2C2[s-5]),v.push(this.ToffsetWires2C2[s-1]),this.ToffsetArcWires2C2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.六分裂:this.ToffsetWires2C1.length>=12&&(i.push(this.ToffsetWires2C1[s-12]),i.push(this.ToffsetWires2C1[s-6]),this.ToffsetArcWires1C2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2C1[s-11]),l.push(this.ToffsetWires2C1[s-5]),this.ToffsetArcWires1C2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C1[s-10]),T.push(this.ToffsetWires2C1[s-4]),this.ToffsetArcWires1C2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[s-9]),p.push(this.ToffsetWires2C1[s-3]),this.ToffsetArcWires1C2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2C1[s-8]),o.push(this.ToffsetWires2C1[s-2]),this.ToffsetArcWires1C2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2C1[s-7]),A.push(this.ToffsetWires2C1[s-1]),this.ToffsetArcWires1C2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=12&&(L.push(this.ToffsetWires2C2[s-12]),L.push(this.ToffsetWires2C2[s-6]),this.ToffsetArcWires2C2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C2[s-11]),m.push(this.ToffsetWires2C2[s-5]),this.ToffsetArcWires2C2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[s-10]),B.push(this.ToffsetWires2C2[s-4]),this.ToffsetArcWires2C2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2C2[s-9]),v.push(this.ToffsetWires2C2[s-3]),this.ToffsetArcWires2C2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[s-8]),b.push(this.ToffsetWires2C2[s-2]),this.ToffsetArcWires2C2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2C2[s-7]),M.push(this.ToffsetWires2C2[s-1]),this.ToffsetArcWires2C2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break;case I.八分裂:this.ToffsetWires2C1.length>=16&&(i.push(this.ToffsetWires2C1[s-16]),i.push(this.ToffsetWires2C1[s-8]),this.ToffsetArcWires1C2=d(i,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),l.push(this.ToffsetWires2C1[s-15]),l.push(this.ToffsetWires2C1[s-7]),this.ToffsetArcWires1C2=d(l,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),T.push(this.ToffsetWires2C1[s-14]),T.push(this.ToffsetWires2C1[s-6]),this.ToffsetArcWires1C2=d(T,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),p.push(this.ToffsetWires2C1[s-13]),p.push(this.ToffsetWires2C1[s-5]),this.ToffsetArcWires1C2=d(p,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),o.push(this.ToffsetWires2C1[s-12]),o.push(this.ToffsetWires2C1[s-4]),this.ToffsetArcWires1C2=d(o,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),A.push(this.ToffsetWires2C1[s-11]),A.push(this.ToffsetWires2C1[s-3]),this.ToffsetArcWires1C2=d(A,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),g.push(this.ToffsetWires2C1[s-10]),g.push(this.ToffsetWires2C1[s-2]),this.ToffsetArcWires1C2=d(g,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),y.push(this.ToffsetWires2C1[s-9]),y.push(this.ToffsetWires2C1[s-1]),this.ToffsetArcWires1C2=d(y,15),this.LineentityCollection2.add(C(this.ToffsetArcWires1C2,"2C1跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor))),this.ToffsetWires2C2.length>=16&&(L.push(this.ToffsetWires2C2[s-16]),L.push(this.ToffsetWires2C2[s-8]),this.ToffsetArcWires2C2=d(L,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线1"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),m.push(this.ToffsetWires2C2[s-15]),m.push(this.ToffsetWires2C2[s-7]),this.ToffsetArcWires2C2=d(m,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线2"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),B.push(this.ToffsetWires2C2[s-14]),B.push(this.ToffsetWires2C2[s-6]),this.ToffsetArcWires2C2=d(B,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线3"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),v.push(this.ToffsetWires2C2[s-13]),v.push(this.ToffsetWires2C2[s-5]),this.ToffsetArcWires2C2=d(v,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线4"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),b.push(this.ToffsetWires2C2[s-12]),b.push(this.ToffsetWires2C2[s-4]),this.ToffsetArcWires2C2=d(b,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线5"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),M.push(this.ToffsetWires2C2[s-11]),M.push(this.ToffsetWires2C2[s-3]),this.ToffsetArcWires2C2=d(M,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线6"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),_.push(this.ToffsetWires2C2[s-10]),_.push(this.ToffsetWires2C2[s-2]),this.ToffsetArcWires2C2=d(_,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线7"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)),R.push(this.ToffsetWires2C2[s-9]),R.push(this.ToffsetWires2C2[s-1]),this.ToffsetArcWires2C2=d(R,15),this.LineentityCollection2.add(C(this.ToffsetArcWires2C2,"2C2跳线8"+(t-1)+"-"+t,this.LineInfo.wireWidth,this.LineInfo.wireTColor)));break}}}else switch(this.LineInfo.Wairnum){case I.单分裂:e=e+1;break;case I.双分裂:e=e+2;break;case I.四分裂:e=e+4;break;case I.六分裂:e=e+6;break;case I.八分裂:e=e+8;break}})}getWireDataForChannelCalculation(){return{arcLine1A1:this.arcLine1A1,arcLine1B1:this.arcLine1B1,arcLine1C1:this.arcLine1C1}}getWireDataForChannelCalculationByTowerRange(e,s){if(e<0||s>=this.LineInfo.towers.length||e>s)return console.warn(`无效的杆塔索引范围: ${e} - ${s}`),{arcLine1A1:[],arcLine1B1:[],arcLine1C1:[]};const r=[],t=[],a=[],n=this.LineInfo.towers,W={minLon:Math.min(...n.slice(e,s+1).map(c=>c.Longitude)),maxLon:Math.max(...n.slice(e,s+1).map(c=>c.Longitude)),minLat:Math.min(...n.slice(e,s+1).map(c=>c.Latitude)),maxLat:Math.max(...n.slice(e,s+1).map(c=>c.Latitude))},u=.005;return W.minLon-=u,W.maxLon+=u,W.minLat-=u,W.maxLat+=u,this.arcLine1A1.forEach(c=>{c[0]>=W.minLon&&c[0]<=W.maxLon&&c[1]>=W.minLat&&c[1]<=W.maxLat&&r.push(c)}),this.arcLine1B1.forEach(c=>{c[0]>=W.minLon&&c[0]<=W.maxLon&&c[1]>=W.minLat&&c[1]<=W.maxLat&&t.push(c)}),this.arcLine1C1.forEach(c=>{c[0]>=W.minLon&&c[0]<=W.maxLon&&c[1]>=W.minLat&&c[1]<=W.maxLat&&a.push(c)}),{arcLine1A1:r,arcLine1B1:t,arcLine1C1:a}}parseWireEntityName(e){if(e=="导线1_A111-12")debugger;const s=e.match(/^导线(\d+)_([ABC])\d*(\d+)-(\d+)$/);return s?{circuit:parseInt(s[1]),phase:s[2],startTowerIndex:parseInt(s[3]),endTowerIndex:parseInt(s[4])}:null}getWireSegmentByTowerRange(e,s){const r={arcLine1A1:[],arcLine1B1:[],arcLine1C1:[]};return this.LineentityCollection2.values.forEach(t=>{if(t.name&&t.polyline&&t.polyline.positions){const a=this.parseWireEntityName(t.name);if(a&&a.circuit===1&&a.startTowerIndex===e&&a.endTowerIndex===s){const n=t.polyline.positions.getValue(f.JulianDate.now());if(n&&n.length>0){const W=[];for(let u=0;u<n.length;u++){const c=f.Cartographic.fromCartesian(n[u]);W.push([f.Math.toDegrees(c.longitude),f.Math.toDegrees(c.latitude),c.height])}switch(a.phase){case"A":r.arcLine1A1=W;break;case"B":r.arcLine1B1=W;break;case"C":r.arcLine1C1=W;break}}}}}),r}getAllWireSegments(){const e=[],s=[],r=[],t=[],a=[],n=[],W=new Map;return this.LineInfo&&this.LineInfo.towers&&this.LineInfo.towers.forEach((u,c)=>{W.set(u.id,c),u.name&&W.set(u.name,c)}),this.LineentityCollection2.values.forEach(u=>{if(u.name&&u.polyline&&u.polyline.positions){console.log(u.name);const c=this.parseWireEntityName(u.name);if(c){const i=u.polyline.positions.getValue(f.JulianDate.now());if(i&&i.length>0){const l=[];for(let o=0;o<i.length;o++){const A=f.Cartographic.fromCartesian(i[o]);l.push([f.Math.toDegrees(A.longitude),f.Math.toDegrees(A.latitude),A.height])}const T=c.endTowerIndex,p=W.get(T)??T;if(c.circuit===1)switch(c.phase){case"A":e[p]=l;break;case"B":s[p]=l;break;case"C":r[p]=l;break}else if(c.circuit===2)switch(c.phase){case"A":t[p]=l;break;case"B":a[p]=l;break;case"C":n[p]=l;break}}}}}),console.log(`从LineentityCollection2提取导线数据完成: 回路1-A相${e.length}段, B相${s.length}段, C相${r.length}段; 回路2-A相${t.length}段, B相${a.length}段, C相${n.length}段`),{wireSegments1A1:e,wireSegments1B1:s,wireSegments1C1:r,wireSegments2A1:t,wireSegments2B1:a,wireSegments2C1:n}}getOffsetTowers(){return this.offsetTowers}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}flyToTower(e){if(e<0||e>=this.offsetTowers.length){console.warn(`Invalid tower index: ${e}. Valid range: 0-${this.offsetTowers.length-1}`);return}const s=this.offsetTowers[e];console.log(s),this.viewer.camera.flyTo({destination:s,duration:2,orientation:{heading:f.Math.toRadians(0),pitch:f.Math.toRadians(-60),roll:f.Math.toRadians(0)}})}loadLineTower(){this.initializeLineData(),this.isDynamicLoadingEnabled?(this.loadAllWiresOnly(),this.setupCameraMoveListener(),this.updateVisibleTowers()):this.loadAllTowersAtOnce()}LODloadAllWiresOnly(){this.initializeLineData(),this.loadAllWiresOnly()}loadAllWiresOnly(){const e=new f.EntityCollection,s=this.entityCollection2;this.entityCollection2=e,this.loadAllTowersAtOnce();const r=[];e.values.forEach(t=>{var a;t.name&&(t.name.includes("导线")||t.name.includes("daoxian")||(a=t.id)!=null&&a.toString().includes("daoxian"))&&r.push(t)}),this.entityCollection2=s,r.forEach(t=>{this.entityCollection2.add(t)}),e.removeAll()}setLineVisible(e){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=e,this.LineentityCollection2.show=e)}getArcLine1A1(){return this.arcLine1A1}getArcLine1B1(){return this.arcLine1B1}getArcLine1C1(){return this.arcLine1C1}}const St=class St{constructor(e,s,r){w(this,"viewer");w(this,"LineInfo");w(this,"Keym","");w(this,"offsetTrees",[]);w(this,"dataSourcetree");w(this,"entityCollectiontree");w(this,"isDynamicLoadingEnabled",!0);w(this,"loadedTreeIndices",new Set);w(this,"isTreeModelRemoved",!1);w(this,"modelCache",new Map);this.Keym=r,this.viewer=e,this.LineInfo=s,this.dataSourcetree=new f.CustomDataSource(this.LineInfo.LineID+"tree"),this.entityCollectiontree=this.dataSourcetree.entities}createModelCacheKey(e,s,r,t){return`${e}_${s}_${r}_${t}`}getCachedModelConfig(e,s,r,t){const a=Math.max(0,r),n=Math.min(t,5e4),W=this.createModelCacheKey(e,s,a,n);if(!this.modelCache.has(W)){const u={uri:e,scale:s,distanceDisplayCondition:[a,n]};this.modelCache.set(W,u)}return this.modelCache.get(W)}setDynamicLoadingEnabled(e){this.isDynamicLoadingEnabled=e}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}getVisibleTreeIndices(){var a;if(!this.viewer.camera||this.offsetTrees.length===0)return[];const e=this.viewer.camera.position,s=((a=this.viewer.camera.positionCartographic)==null?void 0:a.height)||1e3;let r=Math.max(5e3,s*2);console.log(`相机高度: ${s}, 加载距离: ${r}`),s>5e4&&(r=1e5);const t=[];for(let n=0;n<this.offsetTrees.length;n++){const W=this.offsetTrees[n];f.Cartesian3.distance(e,W)<=r&&t.push(n)}if(t.length===0&&this.offsetTrees.length>0){const n=Math.min(20,this.offsetTrees.length);for(let W=0;W<n;W++)t.push(W)}return t}updateVisibleTrees(){if(this.isTreeModelRemoved)return;const e=this.getVisibleTreeIndices(),s=[];this.loadedTreeIndices.forEach(r=>{e.includes(r)||s.push(r)}),s.forEach(r=>{const t="tree-"+this.LineInfo.corridor_features[r].id;this.entityCollectiontree.removeById(t),this.loadedTreeIndices.delete(r)}),e.forEach(r=>{if(!this.loadedTreeIndices.has(r))if(r>=0&&r<this.offsetTrees.length&&r<this.LineInfo.corridor_features.length){const t=this.offsetTrees[r],a=this.LineInfo.corridor_features[r];t&&a?(this.loadTreeAtIndex(r,t),this.loadedTreeIndices.add(r)):console.warn(`跳过无效的动态加载树木数据,索引: ${r}`)}else console.warn(`动态加载树木索引超出范围: ${r}`)})}loadTree(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.corridor_features.forEach(e=>{this.offsetTrees.push(f.Cartesian3.fromDegrees(e.lon,e.lat,e.alt))}),this.entityCollectiontree.show=!0,this.isDynamicLoadingEnabled?this.updateVisibleTrees():this.loadAllTreesAtOnce())}loadAllTreesAtOnce(){this.LineInfo.corridor_features.length!==this.offsetTrees.length&&console.warn(`树木数据长度 (${this.LineInfo.corridor_features.length}) 与位置数据长度 (${this.offsetTrees.length}) 不匹配`);const e=Math.min(this.LineInfo.corridor_features.length,this.offsetTrees.length);for(let s=0;s<e;s++){const r=this.LineInfo.corridor_features[s],t=this.offsetTrees[s];r&&t?this.loadTreeAtIndex(s,t):console.warn(`跳过无效的树木数据,索引: ${s}`)}}loadTreeAtIndex(e,s){const r=this.LineInfo.corridor_features[e];if(!r.modelurl||r.modelurl.trim()===""){console.warn(`Tree ${e} has invalid model URL: ${r.modelurl}. Skipping...`);return}let t=1;r.modelScale>0&&r.modelH>0?(t=r.modelH/r.modelScale,t<=0&&(t=1)):r.modelH>0&&(t=r.modelH);const a=this.getCachedModelConfig(r.modelurl,t,0,2e4);this.entityCollectiontree.add(Zt("tree-"+r.id,s,"tree-"+r.id,a.uri,new f.HeadingPitchRoll(0,0,0),a.scale,a.distanceDisplayCondition))}flyToTree(e){if(e<0||e>=this.LineInfo.corridor_features.length){console.warn(`Invalid tree index: ${e}. Valid range: 0-${this.LineInfo.corridor_features.length-1}`);return}const s=this.LineInfo.corridor_features[e],r=f.Cartesian3.fromDegrees(s.lon,s.lat,s.alt+(s.modelH||0));this.viewer.camera.flyTo({destination:r,duration:2,orientation:{heading:f.Math.toRadians(0),pitch:f.Math.toRadians(-60),roll:f.Math.toRadians(0)}})}removeTreeModels(){this.isTreeModelRemoved=!0,this.entityCollectiontree.removeAll(),this.loadedTreeIndices.clear()}restoreTreeModels(){this.isTreeModelRemoved=!1,this.isDynamicLoadingEnabled?this.updateVisibleTrees():this.loadAllTreesAtOnce()}addTreeData(e){this.LineInfo.corridor_features.push(e)}getTreeCoordinates(){return this.LineInfo.corridor_features.map(e=>[e.lon,e.lat,Number(e.alt||0)+Number(e.treeH||0)])}getOffsetTrees(){return this.offsetTrees}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}getTerrainDataSources(){return[this.dataSourcetree]}static getTreeEntityPrefix(){return St.TREE_ENTITY_PREFIX}setTreeVisible(e){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollectiontree.show=e)}};w(St,"TREE_ENTITY_PREFIX","tree-");let Ut=St;class ps{constructor(e){w(this,"viewer");w(this,"dataSourceplotting");w(this,"entityCollectionplotting");w(this,"terrainVerificationCache",new Map);w(this,"terrainVerificationResultCache",new Map);w(this,"maxVisibleResults",200);w(this,"terrainVerificationBatchIndex",0);w(this,"terrainVerificationTotalBatches",0);w(this,"terrainVerificationIsRunning",!1);w(this,"terrainVerificationBatchSize",100);w(this,"cameraMoveHandler",null);w(this,"isDynamicTerrainVerificationEnabled",!1);w(this,"wireClickHandler",null);w(this,"distanceRuleConfig",new Gt);w(this,"wireToWireDistanceRuleConfig",new zt);this.viewer=e,this.dataSourceplotting=new f.CustomDataSource("plotting"),this.entityCollectionplotting=this.dataSourceplotting.entities}ensurePlottingDataSourceAdded(){this.viewer.dataSources.contains(this.dataSourceplotting)||this.viewer.dataSources.add(this.dataSourceplotting),this.entityCollectionplotting.show=!0}calcResultByType(e,s,r,t,a,n=this.distanceRuleConfig,W=J.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const u=`${e[0].toFixed(6)}_${e[1].toFixed(6)}_${e[2].toFixed(2)}`;if(this.terrainVerificationCache.has(u)){const c=this.terrainVerificationCache.get(u);dt(e,c,this.entityCollectionplotting,n,a,W);return}else{const c=Mt(e,s,r,t);this.terrainVerificationCache.set(u,c),dt(e,c,this.entityCollectionplotting,n||this.distanceRuleConfig,a,W)}}performTerrainVerification(e,s,r,t,a=null,n,W=[],u=J.树木){const c=`${e[0].toFixed(6)}_${e[1].toFixed(6)}_${e[2].toFixed(2)}`,i=Mt(e,s,r,t);return this.terrainVerificationCache.set(c,i),dt(e,i,this.entityCollectionplotting,a||this.distanceRuleConfig,W,u),Rt(e,i,n??"unknown")}setMaxVisibleTerrainResults(e=200){this.maxVisibleResults=Math.max(10,e)}setDistanceRuleConfig(e){this.distanceRuleConfig=e}getDistanceRuleConfig(){return{...this.distanceRuleConfig}}setDistanceRulesByType(e,s){this.distanceRuleConfig.typeRules.set(e,s)}getDistanceRulesByType(e){return this.distanceRuleConfig.typeRules.get(e)}getDistanceRulesByTypeOrDefault(e){return this.distanceRuleConfig.typeRules.get(e)||new we}hasDistanceRulesForType(e){return this.distanceRuleConfig.typeRules.has(e)}getConfiguredDistanceRuleTypes(){return Array.from(this.distanceRuleConfig.typeRules.keys())}clearDistanceRuleConfig(){this.distanceRuleConfig.typeRules.clear()}getDistanceRuleConfigCount(){return this.distanceRuleConfig.typeRules.size}getHorizontalDistanceLevels(e){var s;return(s=this.distanceRuleConfig.typeRules.get(e))==null?void 0:s.horizontalLevels}getVerticalDistanceLevels(e){var s;return(s=this.distanceRuleConfig.typeRules.get(e))==null?void 0:s.verticalLevels}getStraightLineDistanceLevels(e){var s;return(s=this.distanceRuleConfig.typeRules.get(e))==null?void 0:s.straightLineLevels}getClearanceDistanceLevels(e){var s;return(s=this.distanceRuleConfig.typeRules.get(e))==null?void 0:s.clearanceLevels}createDefaultDistanceRuleConfig(){const e={horizontalLevels:[{id:"critical",name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{id:"danger",name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{id:"warning",name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{id:"safe",name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],verticalLevels:[{id:"critical",name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{id:"danger",name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{id:"warning",name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{id:"safe",name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],straightLineLevels:[{id:"critical",name:"critical",minDistance:0,maxDistance:160,color:"#ff0000"},{id:"danger",name:"danger",minDistance:160,maxDistance:170,color:"#ff0000"},{id:"warning",name:"warning",minDistance:170,maxDistance:180,color:"#ffa500"},{id:"safe",name:"safe",minDistance:180,maxDistance:1/0,color:"#00ff00"}],clearanceLevels:[{id:"critical",name:"critical",minDistance:0,maxDistance:10,color:"#ff0000"},{id:"danger",name:"danger",minDistance:10,maxDistance:15,color:"#ff6600"},{id:"warning",name:"warning",minDistance:15,maxDistance:20,color:"#ffa500"},{id:"safe",name:"safe",minDistance:20,maxDistance:1/0,color:"#00ff00"}]};this.setDistanceRulesByType(J.树木,{...e}),this.setDistanceRulesByType(J.房屋,{...e}),this.setDistanceRulesByType(J.高速公路,{...e}),this.setDistanceRulesByType(J.电力线,{...e})}drawCorridorPolygon(e,s="corridor-polygon"){if(!e||e.length<3)return;this.ensurePlottingDataSourceAdded();const r=e.map(a=>f.Cartesian3.fromDegrees(a[0],a[1])),t=this.entityCollectionplotting.add({name:s,polygon:{hierarchy:new f.PolygonHierarchy(r),material:f.Color.GREEN.withAlpha(.3),outline:!0,outlineColor:f.Color.GREEN,outlineWidth:2,heightReference:f.HeightReference.CLAMP_TO_GROUND,perPositionHeight:!1}});this.terrainVerificationResultCache.has("corridor-polygon")||this.terrainVerificationResultCache.set("corridor-polygon",[]),this.terrainVerificationResultCache.get("corridor-polygon").push(t)}drawCorridorDistanceMarkers(e,s,r="corridor-markers",t=!0){!e||e.length<2||(this.ensurePlottingDataSourceAdded(),this.addPerpendicularWidthMarkers(e,s,r),t&&this.addParallelIntervalMarkers(e,s,10,r))}addPerpendicularWidthMarkers(e,s,r){const t=e[0],a=e.length>1?e[1]:e[e.length-1],n=f.Cartesian3.fromDegrees(t[0],t[1]),W=f.Cartesian3.fromDegrees(a[0],a[1]),u=f.Cartesian3.subtract(W,n,new f.Cartesian3);f.Cartesian3.normalize(u,u);const c=f.Cartesian3.clone(n);f.Cartesian3.normalize(c,c);const i=f.Cartesian3.cross(c,u,new f.Cartesian3);f.Cartesian3.normalize(i,i);const l=s,T=f.Cartesian3.add(n,f.Cartesian3.multiplyByScalar(i,l,new f.Cartesian3),new f.Cartesian3),p=f.Cartesian3.add(n,f.Cartesian3.multiplyByScalar(i,-l,new f.Cartesian3),new f.Cartesian3),o=f.Cartographic.fromCartesian(T),A=f.Cartographic.fromCartesian(p),g=f.Math.toDegrees(o.longitude),y=f.Math.toDegrees(o.latitude),L=f.Math.toDegrees(A.longitude),m=f.Math.toDegrees(A.latitude),B=this.entityCollectionplotting.add({name:`${r}-left-width-marker`,polyline:{positions:[f.Cartesian3.fromDegrees(t[0],t[1]),f.Cartesian3.fromDegrees(g,y)],width:3,material:new f.PolylineDashMaterialProperty({color:f.Color.RED,dashLength:12}),clampToGround:!0}}),v=this.entityCollectionplotting.add({name:`${r}-right-width-marker`,polyline:{positions:[f.Cartesian3.fromDegrees(t[0],t[1]),f.Cartesian3.fromDegrees(L,m)],width:3,material:new f.PolylineDashMaterialProperty({color:f.Color.RED,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.has("corridor-markers")||this.terrainVerificationResultCache.set("corridor-markers",[]),this.terrainVerificationResultCache.get("corridor-markers").push(B),this.terrainVerificationResultCache.get("corridor-markers").push(v)}addParallelIntervalMarkers(e,s,r,t){if(e.length<2||s<=0||r<=0)return;let a=r,n=1;for(;a<=s;){let W;a<=50?W=f.Color.RED.withAlpha(.7):a<=100?W=f.Color.ORANGE.withAlpha(.7):W=f.Color.GREEN.withAlpha(.7);const u=this.createOffsetLine(e,a,!0);if(u.length>0){const c=this.entityCollectionplotting.add({name:`${t}-parallel-left-${n}`,polyline:{positions:u,width:3,material:new f.PolylineDashMaterialProperty({color:W,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.has("corridor-markers")||this.terrainVerificationResultCache.set("corridor-markers",[]),this.terrainVerificationResultCache.get("corridor-markers").push(c)}a+=r,n++}for(a=r,n=1;a<=s;){let W;a<=50?W=f.Color.RED.withAlpha(.7):a<=100?W=f.Color.ORANGE.withAlpha(.7):W=f.Color.GREEN.withAlpha(.7);const u=this.createOffsetLine(e,a,!1);if(u.length>0){const c=this.entityCollectionplotting.add({name:`${t}-parallel-right-${n}`,polyline:{positions:u,width:3,material:new f.PolylineDashMaterialProperty({color:W,dashLength:12}),clampToGround:!0}});this.terrainVerificationResultCache.get("corridor-markers").push(c)}a+=r,n++}}createOffsetLine(e,s,r){if(e.length<2)return[];const t=Q(e),a=s/1e3;try{const n=r?-a:a,W=Nt(t,n,{units:"kilometers"});if(W.geometry.type==="LineString")return W.geometry.coordinates.map(u=>f.Cartesian3.fromDegrees(u[0],u[1]))}catch(n){console.warn("Failed to create offset line:",n)}return[]}clearCorridorDistanceMarkers(){try{if(this.terrainVerificationResultCache&&this.terrainVerificationResultCache.has("corridor-markers")){const e=this.terrainVerificationResultCache.get("corridor-markers");if(e&&this.entityCollectionplotting)for(let s=e.length-1;s>=0;s--){const r=e[s];try{r&&this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationResultCache.delete("corridor-markers")}}catch(e){console.warn("Error clearing corridor distance markers:",e)}}clearCorridorPolygon(){try{if(this.terrainVerificationResultCache){const e=this.terrainVerificationResultCache.get("corridor-polygon");if(e&&this.entityCollectionplotting)for(let s=e.length-1;s>=0;s--){const r=e[s];try{r&&this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationResultCache.delete("corridor-polygon")}}catch(e){console.warn("Error clearing corridor polygon:",e)}}getClickDistanceRuleConfig(){return{...this.distanceRuleConfig}}clearTreeDistanceResultsExceptCorridor(){const e=[];this.entityCollectionplotting&&this.entityCollectionplotting.values.forEach(s=>{(!s.name||!s.name.startsWith("corridor-"))&&e.push(s)});for(let s=e.length-1;s>=0;s--){const r=e[s];try{this.entityCollectionplotting.remove(r)}catch{}}this.terrainVerificationCache.clear(),this.terrainVerificationResultCache.forEach((s,r)=>{r.startsWith("corridor-")||this.terrainVerificationResultCache.delete(r)})}clearTreeDistanceResults(){try{if(this.entityCollectionplotting)try{this.entityCollectionplotting.removeAll()}catch(e){console.warn("Failed to removeAll entities:",e)}}catch(e){console.warn("Error clearing tree distance results:",e)}try{this.terrainVerificationCache.clear()}catch(e){console.warn("Failed to clear terrain verification cache:",e)}try{this.terrainVerificationResultCache.clear()}catch(e){console.warn("Failed to clear terrain verification result cache:",e)}}LineChannelTerrainVerification(e,s,r,t,a,n=100,W=[],u){if(this.terrainVerificationIsRunning){console.log("地物校验已在运行中,跳过重复调用");return}this.ensurePlottingDataSourceAdded(),this.clearTreeDistanceResults(),this.terrainVerificationBatchSize=n,this.terrainVerificationBatchIndex=0,this.terrainVerificationTotalBatches=Math.ceil(e.length/n),this.terrainVerificationIsRunning=!0,console.log(`开始地物校验:共${e.length}棵树,分${this.terrainVerificationTotalBatches}批处理`),this.processTerrainVerificationBatch(e,s,r,t,a,W,u)}processTerrainVerificationBatch(e,s,r,t,a,n=[],W,u=[]){if(!this.terrainVerificationIsRunning||this.terrainVerificationBatchIndex>=this.terrainVerificationTotalBatches){this.terrainVerificationIsRunning=!1,console.log("地物校验完成"),W&&W(u);return}const c=this.terrainVerificationBatchIndex*this.terrainVerificationBatchSize,i=Math.min(c+this.terrainVerificationBatchSize,e.length);console.log(`处理第${this.terrainVerificationBatchIndex+1}/${this.terrainVerificationTotalBatches}批:${c}-${i}`);const l=[];for(let T=c;T<i;T++){const p=e[T];if(p){const o=[p.lon,p.lat,Number(p.alt||0)+Number(p.treeH||0)],A=this.performTerrainVerification(o,r,t,a,null,p.id,n);A&&l.push(A)}}u.push(...l),this.terrainVerificationBatchIndex++,setTimeout(()=>{this.processTerrainVerificationBatch(e,s,r,t,a,n,W,u)},0)}stopLineChannelTerrainVerification(){this.terrainVerificationIsRunning=!1,console.log("地物校验已停止")}enableVisibleAreaTerrainVerification(e,s,r,t,a){this.isDynamicTerrainVerificationEnabled=!0,this.setupCameraMoveListenerForTerrainVerification(e,s,r,t,a)}disableVisibleAreaTerrainVerification(){this.isDynamicTerrainVerificationEnabled=!1,this.cameraMoveHandler&&(this.cameraMoveHandler(),this.cameraMoveHandler=null)}setupCameraMoveListenerForTerrainVerification(e,s,r,t,a){this.cameraMoveHandler&&this.cameraMoveHandler(),this.cameraMoveHandler=this.viewer.camera.moveEnd.addEventListener(()=>{this.updateVisibleAreaTerrainVerification(e,s,r,t,a)})}updateVisibleAreaTerrainVerification(e,s,r,t,a){if(!this.isDynamicTerrainVerificationEnabled)return;this.getVisibleTreeIndices(s).forEach(W=>{const u=e[W];if(u){const c=[u.lon,u.lat,Number(u.alt||0)+Number(u.treeH||0)];this.performTerrainVerification(c,r,t,a)}})}getVisibleTreeIndices(e){var n;if(!this.viewer.camera||e.length===0)return[];const s=this.viewer.camera.position,r=((n=this.viewer.camera.positionCartographic)==null?void 0:n.height)||1e3;let t=Math.max(5e3,r*2);r>5e4&&(t=1e5);const a=[];for(let W=0;W<e.length;W++){const u=e[W];f.Cartesian3.distance(s,u)<=t&&a.push(W)}return a}loadTreeListen(e,s,r,t,a,n=[]){this.cameraMoveHandler&&this.removeTreeListen();const W=(c,i)=>{const l=c.scene.pick(i);if(f.defined(l)){let T=l.id;if(T===void 0&&l.primitive&&(T=l.primitive.id),T instanceof f.Entity)return T}};this.ensurePlottingDataSourceAdded(),new f.ScreenSpaceEventHandler(this.viewer.canvas).setInputAction(c=>{const i=W(this.viewer,c.position);if(i&&i.id){const l=String(i.id);if(l.startsWith("tree-")){const T=l.substring(5),p=e.find(o=>o&&o.id&&String(o.id)===T);if(p){const o=[p.lon,p.lat,Number(p.alt||0)+Number(p.treeH||0)],A=Mt(o,s,r,t),g=Rt(o,A,p.id);a&&g&&a(g),dt(o,A,this.entityCollectionplotting,this.getClickDistanceRuleConfig(),n,J.树木)}}}},f.ScreenSpaceEventType.LEFT_CLICK)}removeTreeListen(){if(this.cameraMoveHandler){try{this.cameraMoveHandler()}catch{}this.cameraMoveHandler=null}if(this.dataSourceplotting&&this.entityCollectionplotting)try{this.entityCollectionplotting.removeAll(),this.entityCollectionplotting.show=!1}catch(e){console.warn("Error clearing tree listen entities:",e)}}loadWireListen(e,s,r,t,a,n){this.wireClickHandler&&this.removeWireListen();const W=(u,c)=>{const i=u.scene.pick(c);if(f.defined(i)){let l=i.id;if(l===void 0&&i.primitive&&(l=i.primitive.id),l instanceof f.Entity)return l}};this.ensurePlottingDataSourceAdded(),this.wireClickHandler=new f.ScreenSpaceEventHandler(this.viewer.canvas),this.wireClickHandler.setInputAction(async u=>{const c=W(this.viewer,u.position);if(c&&c.id){const i=String(c.id),l=c.name||"";if(i.includes("daoxian")||l.includes("导线")||l.includes("daoxian")){a&&c&&a(c);const p=this.viewer.scene.pickPosition(u.position);if(f.defined(p)){let o=null;if(c&&c.polyline&&c.polyline.positions){const A=c.polyline.positions.getValue(this.viewer.clock.currentTime);A&&Array.isArray(A)&&(o=A.map(g=>{const y=f.Cartographic.fromCartesian(g);return[f.Math.toDegrees(y.longitude),f.Math.toDegrees(y.latitude),y.height]}))}if((!o||o.length===0)&&(l.match(/(\d+)-(\d+)$/)&&(l.includes("A")||l.includes("_A")?o=s:l.includes("B")||l.includes("_B")?o=r:(l.includes("C")||l.includes("_C"))&&(o=t)),(!o||o.length===0)&&(o=[...s,...r,...t])),o&&o.length>1){const A=(n==null?void 0:n.measurementType)||[],g=A.includes(U.净空距离),y=A.includes(U.垂直距离)||A.includes(U.水平距离)||A.includes(U.安全距离)||A.includes(U.直线距离),L=this.interpolateWire(o,1),m=[];if(g){const B=await this.calculateAndDrawWireToGroundDistanceByType(L,[U.净空距离]).catch(v=>(console.error("Error in wire to ground distance calculation:",v),null));B&&m.push(B)}if(y){const B=(n==null?void 0:n.width)||10,v=(n==null?void 0:n.show)!==!1,b=this.drawWireCorridor(L,B);v&&this.entityCollectionplotting.add(b);const M=e.filter(_=>this.lonLatInStaticPolygonOpts(_.lon,_.lat,b));this.terrainVerificationCache.clear(),M.forEach(_=>{const R=this.calcResultSingleWire(_,L,A,this.getClickDistanceRuleConfig());R&&m.push(R)})}n!=null&&n.onMeasurementResult&&m.length>0&&n.onMeasurementResult(m)}}}}},f.ScreenSpaceEventType.LEFT_CLICK)}removeWireListen(){this.wireClickHandler&&(this.wireClickHandler.destroy(),this.wireClickHandler=null),this.clearWireCorridors()}getGroundElevation(e,s){return 0}calculateWireToGroundDistance(e){let s=1/0,r=[],t=[];for(const a of e){const[n,W,u]=a,c=this.getGroundElevation(n,W),i=Math.abs(u-c);i<s&&(s=i,r=a,t=[n,W,c])}return{distance:s,wirePoint:r,groundPoint:t}}async calculateAndDrawWireToGroundDistanceByType(e,s){if(!e||e.length===0)return null;try{const r=e.map(l=>new f.Cartographic(f.Math.toRadians(l[0]),f.Math.toRadians(l[1]))),t=this.viewer.terrainProvider;let a=[];if(t&&f.defined(t))try{a=(await f.sampleTerrainMostDetailed(t,r)).map(T=>T.height||0)}catch(l){console.warn("Terrain sampling failed, using default ground height:",l),a=new Array(e.length).fill(0)}else a=new Array(e.length).fill(0);let n=1/0,W=0;for(let l=0;l<e.length;l++){const T=e[l][2],p=a[l],o=T-p;o>0&&o<n&&(n=o,W=l)}if(n===1/0){n=1/0;for(let l=0;l<e.length;l++){const T=e[l][2],p=a[l],o=Math.abs(T-p);o<n&&(n=o,W=l)}}const u=e[W],c=[u[0],u[1],a[W]];return this.drawWireToGroundDistanceByType(u,c,n,s),{treeId:`ground-${Date.now()}`,treeCoordinates:c,conductorCoordinates:u,horizontalDistance:0,verticalDistance:parseFloat(n.toFixed(1)),straightLineDistance:parseFloat(n.toFixed(1)),clearanceDistance:parseFloat(n.toFixed(1)),timestamp:Date.now()}}catch(r){console.warn("Failed to calculate wire to ground distance:",r);const t=this.calculateWireToGroundDistance(e);return this.drawWireToGroundDistanceByType(t.wirePoint,t.groundPoint,t.distance,s),{treeId:`ground-${Date.now()}`,treeCoordinates:t.groundPoint,conductorCoordinates:t.wirePoint,horizontalDistance:0,verticalDistance:parseFloat(t.distance.toFixed(1)),straightLineDistance:parseFloat(t.distance.toFixed(1)),clearanceDistance:parseFloat(t.distance.toFixed(1)),timestamp:Date.now()}}}async calculateAndDrawWireToGroundDistanceBySegments(e,s,r,t){console.log("Calculating wire to ground distance by segments..."),console.log("A相导线数据点数:",(e==null?void 0:e.length)||0),console.log("B相导线数据点数:",(s==null?void 0:s.length)||0),console.log("C相导线数据点数:",(r==null?void 0:r.length)||0);const a=[];if(e&&e.length>=2&&a.push({name:"A",data:e}),s&&s.length>=2&&a.push({name:"B",data:s}),r&&r.length>=2&&a.push({name:"C",data:r}),console.log("有效相数:",a.length),a.length===0){console.warn("No valid wire data found for ground distance calculation");return}for(const n of a){const W=n.data;console.log(`处理${n.name}相导线,数据点数:`,W.length);const u=this.interpolateWire(W,1);console.log(`${n.name}相插值后点数:`,u.length);try{const c=u.map(g=>new f.Cartographic(f.Math.toRadians(g[0]),f.Math.toRadians(g[1]))),i=this.viewer.terrainProvider;let l=[];if(i&&f.defined(i))try{l=(await f.sampleTerrainMostDetailed(i,c)).map(y=>y.height||0)}catch(g){console.warn(`Terrain sampling failed for phase ${n.name}, using default ground height:`,g),l=new Array(u.length).fill(0)}else l=new Array(u.length).fill(0);let T=1/0,p=0;for(let g=0;g<u.length;g++){const y=u[g][2],L=l[g],m=y-L;m>0&&m<T&&(T=m,p=g)}if(T===1/0)for(let g=0;g<u.length;g++){const y=u[g][2],L=l[g],m=Math.abs(y-L);m<T&&(T=m,p=g)}console.log(`${n.name}相最低净空距离:`,T,"在索引:",p);const o=u[p],A=[o[0],o[1],l[p]];this.drawWireToGroundDistanceByType(o,A,T,t)}catch(c){console.warn(`Failed to calculate wire to ground distance for phase ${n.name}:`,c)}}console.log("Wire to ground distance calculation by segments completed.")}getDistanceTypeLabel(e,s){const r=`${s.toFixed(1)}米`;switch(e){case U.垂直距离:return`对地距离${r}`;case U.净空距离:return`净空距离${r}`;case U.安全距离:return`安全距离${r}`;default:return`距离${r}`}}drawWireToGroundDistanceByType(e,s,r,t,a=J.导线){var T,p;const n=[f.Cartesian3.fromDegrees(e[0],e[1],e[2]),f.Cartesian3.fromDegrees(s[0],s[1],s[2])];let W="#eff819",u=f.Color.RED;const c=this.distanceRuleConfig;let i,l=!1;if(t.includes(U.净空距离)&&(i=(p=(T=c.typeRules.get(a))==null?void 0:T.clearanceLevels)==null?void 0:p.find(o=>r>=o.minDistance&&r<=o.maxDistance)),i?(W=i.color,u=f.Color.fromCssColorString(i.color)):(l=!0,W="#00ff00",u=f.Color.GREEN),i||l){this.entityCollectionplotting.add({name:i.id,polyline:{positions:n,width:2,material:u,clampToGround:!1,shadows:f.ShadowMode.DISABLED}});const o=f.Cartesian3.midpoint(n[0],n[1],new f.Cartesian3);this.entityCollectionplotting.add({position:o,name:i.id,label:{text:this.getDistanceTypeLabel(U.净空距离,r),fillColor:f.Color.fromCssColorString(W),font:"12px sans-serif",pixelOffset:new f.Cartesian2(0,0),scaleByDistance:new f.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY,outlineColor:f.Color.BLACK,outlineWidth:2,style:f.LabelStyle.FILL_AND_OUTLINE}})}}clearWireCorridors(){if(!this.entityCollectionplotting)return;const e=[];this.entityCollectionplotting.values.forEach(s=>{s.name==="wire-corridor"&&e.push(s)}),e.forEach(s=>{try{this.entityCollectionplotting.remove(s)}catch{}})}interpolateWire(e,s=1){if(e.length<2)return e;const r=[];for(let t=0;t<e.length-1;t++){const a=e[t],n=e[t+1],W=f.Cartesian3.fromDegrees(a[0],a[1],a[2]),u=f.Cartesian3.fromDegrees(n[0],n[1],n[2]),c=f.Cartesian3.distance(W,u);if(c<=s){t===0&&r.push(a),r.push(n);continue}const i=Math.ceil(c/s),l=1/i;t===0&&r.push(a);for(let T=1;T<i;T++){const p=T*l,o=f.Cartesian3.lerp(W,u,p,new f.Cartesian3),A=f.Cartographic.fromCartesian(o),g=f.Math.toDegrees(A.longitude),y=f.Math.toDegrees(A.latitude),L=A.height;r.push([g,y,L])}r.push(n)}return r}lonLatInStaticPolygonOpts(e,s,r){var c;if(!(r!=null&&r.polygon))return!1;const t=r.polygon.hierarchy;if(!(t instanceof f.PolygonHierarchy))return!1;const a=t.positions;if(!a||a.length<3)return!1;const n=f.Cartographic.fromDegrees(e,s),W=new f.Cartesian2(n.longitude,n.latitude),u=a.map(i=>{const l=f.Cartographic.fromCartesian(i);return new f.Cartesian2(l.longitude,l.latitude)});if(!this.pointInRing(W,u))return!1;if((c=t.holes)!=null&&c.length)for(const i of t.holes){const l=i.positions.map(T=>{const p=f.Cartographic.fromCartesian(T);return new f.Cartesian2(p.longitude,p.latitude)});if(this.pointInRing(W,l))return!1}return!0}pointInRing(e,s){let r=!1;const t=e.x,a=e.y;for(let n=0,W=s.length-1;n<s.length;W=n++){const u=s[n].x,c=s[n].y,i=s[W].x,l=s[W].y;c>a!=l>a&&t<(i-u)*(a-c)/(l-c)+u&&(r=!r)}return r}pointInPolygon2D(e,s){let r=!1;const t=e.x,a=e.y;for(let n=0,W=s.length-1;n<s.length;W=n++){const u=s[n].x,c=s[n].y,i=s[W].x,l=s[W].y;c>a!=l>a&&t<(i-u)*(a-c)/(l-c)+u&&(r=!r)}return r}drawWireCorridor(e,s){const r=[],t=[];for(let W=0;W<e.length;W++){const u=e[W],c=f.Cartesian3.fromDegrees(u[0],u[1],u[2]);let i,l;if(W===0){const B=e[W+1];l=f.Cartesian3.fromDegrees(B[0],B[1],B[2]),i=c}else if(W===e.length-1){const B=e[W-1];i=f.Cartesian3.fromDegrees(B[0],B[1],B[2]),l=c}else{const B=e[W-1],v=e[W+1];i=f.Cartesian3.fromDegrees(B[0],B[1],B[2]),l=f.Cartesian3.fromDegrees(v[0],v[1],v[2])}const T=f.Cartesian3.subtract(l,i,new f.Cartesian3);f.Cartesian3.normalize(T,T);const p=f.Cartesian3.clone(c);f.Cartesian3.normalize(p,p);const o=f.Cartesian3.cross(T,p,new f.Cartesian3);f.Cartesian3.normalize(o,o);const A=s/2,g=f.Cartesian3.multiplyByScalar(o,A,new f.Cartesian3),y=f.Cartesian3.multiplyByScalar(o,-A,new f.Cartesian3),L=f.Cartesian3.add(c,g,new f.Cartesian3),m=f.Cartesian3.add(c,y,new f.Cartesian3);r.push(L),t.push(m)}const a=[];return a.push(...r),a.push(...t.reverse()),a.push(r[0]),{id:`wire-corridor-${Date.now()}`,name:"wire-corridor",polygon:{hierarchy:new f.PolygonHierarchy(a),material:f.Color.YELLOW.withAlpha(.3),outline:!0,outlineColor:f.Color.YELLOW,outlineWidth:2}}}calcResult(e,s,r,t,a=this.distanceRuleConfig,n=[],W=J.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return;const u=`${e[0].toFixed(6)}_${e[1].toFixed(6)}_${e[2].toFixed(2)}`;if(this.terrainVerificationCache.has(u)){const c=this.terrainVerificationCache.get(u);dt(e,c,this.entityCollectionplotting,a,n,W);return}else{const c=Mt(e,s,r,t);this.terrainVerificationCache.set(u,c),dt(e,c,this.entityCollectionplotting,a||this.distanceRuleConfig,n,W)}}calcResultSingleWire(e,s,r,t=this.distanceRuleConfig,a=J.树木){if(this.entityCollectionplotting.values.length>=this.maxVisibleResults)return null;const n=[e.lon,e.lat,Number(e.alt||0)+Number(e.treeH||0)],W=`${n[0].toFixed(6)}_${n[1].toFixed(6)}_${n[2].toFixed(2)}`;if(this.terrainVerificationCache.has(W)){const u=this.terrainVerificationCache.get(W);return dt(n,u,this.entityCollectionplotting,t,r,a),Rt(n,u,e.id)}else{const u=s;return this.terrainVerificationCache.set(W,u),dt(n,u,this.entityCollectionplotting,t||this.distanceRuleConfig,r,a),Rt(n,u,e.id)}}LineChannelTerrainVerificationForFilteredTrees(e,s,r,t,a,n=100,W=[],u){if(console.log(`LineChannelTerrainVerificationForFilteredTrees called with ${e.length} trees`),this.terrainVerificationIsRunning){console.log("地物校验已在运行中,跳过重复调用");return}this.ensurePlottingDataSourceAdded(),this.clearTreeDistanceResultsExceptCorridor(),this.terrainVerificationBatchSize=n,this.terrainVerificationBatchIndex=0,this.terrainVerificationTotalBatches=Math.ceil(e.length/n),this.terrainVerificationIsRunning=!0,console.log(`开始对${e.length}棵树进行地物校验`),this.processTerrainVerificationBatch(e,s,r,t,a,W,u)}getChannelCalculationDataSources(){return[this.dataSourceplotting]}setWireToWireDistanceRuleConfig(e){this.wireToWireDistanceRuleConfig=e}getWireToWireDistanceRuleConfig(){const e=new zt;return e.phaseRules=new Map(this.wireToWireDistanceRuleConfig.phaseRules),e}calculateWireToWireDistance(e,s,r=G.A相,t=G.B相){const a=new fs;if(a.timestamp=Date.now(),a.phase1=r,a.phase2=t,e.length<2||s.length<2)return console.warn("导线数据点数不足,无法计算线间距离"),a;const n=this.interpolateWire(e,1),W=this.interpolateWire(s,1);let u=1/0,c=[],i=[];for(const l of n){const T=f.Cartesian3.fromDegrees(l[0],l[1],l[2]);for(const p of W){const o=f.Cartesian3.fromDegrees(p[0],p[1],p[2]),A=f.Cartesian3.distance(T,o);A<u&&(u=A,c=l,i=p)}}if(c.length>0&&i.length>0){a.wire1Coordinates=c,a.wire2Coordinates=i,a.straightLineDistance=parseFloat(u.toFixed(2));const l=this.calculateHorizontalDistance(c,i);a.horizontalDistance=parseFloat(l.toFixed(2));const T=Math.abs(c[2]-i[2]);a.verticalDistance=parseFloat(T.toFixed(2)),this.determineWireToWireStatus(a)}return a}calculateHorizontalDistance(e,s){const r=f.Cartesian3.fromDegrees(e[0],e[1],0),t=f.Cartesian3.fromDegrees(s[0],s[1],0);return f.Cartesian3.distance(r,t)}determineWireToWireStatus(e){const s=this.wireToWireDistanceRuleConfig.getRules(e.phase1,e.phase2);if(!s||s.distanceLevels.length===0){e.status="正常",e.statusColor="#00ff00";return}const r=e.straightLineDistance;for(const t of s.distanceLevels)if(r>=t.minDistance&&r<=t.maxDistance){e.status=t.name,e.statusColor=t.color;return}e.status="正常",e.statusColor="#00ff00"}drawWireToWireDistance(e){this.ensurePlottingDataSourceAdded();const s=["A相","B相","C相","地线1","地线2","全部"],r=s[e.phase1],t=s[e.phase2],a=[f.Cartesian3.fromDegrees(e.wire1Coordinates[0],e.wire1Coordinates[1],e.wire1Coordinates[2]),f.Cartesian3.fromDegrees(e.wire2Coordinates[0],e.wire2Coordinates[1],e.wire2Coordinates[2])];this.entityCollectionplotting.add({name:`线间距离-${r}-${t}-线段`,polyline:{positions:a,width:3,material:f.Color.fromCssColorString(e.statusColor),clampToGround:!1,shadows:f.ShadowMode.DISABLED}});const n=f.Cartesian3.midpoint(a[0],a[1],new f.Cartesian3);this.entityCollectionplotting.add({position:n,name:`线间距离-${r}-${t}`,label:{text:`${r}-${t}: ${e.straightLineDistance.toFixed(2)}m`,fillColor:f.Color.fromCssColorString(e.statusColor),font:"14px sans-serif",pixelOffset:new f.Cartesian2(0,0),scaleByDistance:new f.NearFarScalar(1e3,1.5,2e3,1),disableDepthTestDistance:Number.POSITIVE_INFINITY,outlineColor:f.Color.BLACK,outlineWidth:2,style:f.LabelStyle.FILL_AND_OUTLINE}})}createDefaultWireToWireDistanceRuleConfig(){const e=new zt,s={distanceLevels:[{name:"危险",minDistance:0,maxDistance:3,color:"#ff0000",isAlarm:!0},{name:"警告",minDistance:3,maxDistance:5,color:"#ffa500",isAlarm:!0},{name:"安全",minDistance:5,maxDistance:1/0,color:"#00ff00",isAlarm:!1}],enabled:!0},r=[G.A相,G.B相,G.C相,G.地线1,G.地线2];for(let t=0;t<r.length;t++)for(let a=t+1;a<r.length;a++)e.setRules(r[t],r[a],{...s});return e}setPlottingEntityVisible(e,s){const r=this.entityCollectionplotting.values;for(const t of r)t.name===e&&(t.show=s)}}function As(h,e){let s=0;for(let r of h)r!=null&&(r=+r)>=r&&++s;return s}function ws(h,e){let s,r;if(e===void 0)for(const t of h)t!=null&&(s===void 0?t>=t&&(s=r=t):(s>t&&(s=t),r<t&&(r=t)));else{let t=-1;for(let a of h)(a=e(a,++t,h))!=null&&(s===void 0?a>=a&&(s=r=a):(s>a&&(s=a),r<a&&(r=a)))}return[s,r]}const Ls=Math.sqrt(50),gs=Math.sqrt(10),Is=Math.sqrt(2);function _t(h,e,s){const r=(e-h)/Math.max(0,s),t=Math.floor(Math.log10(r)),a=r/Math.pow(10,t),n=a>=Ls?10:a>=gs?5:a>=Is?2:1;let W,u,c;return t<0?(c=Math.pow(10,-t)/n,W=Math.round(h*c),u=Math.round(e*c),W/c<h&&++W,u/c>e&&--u,c=-c):(c=Math.pow(10,t)*n,W=Math.round(h/c),u=Math.round(e/c),W*c<h&&++W,u*c>e&&--u),u<W&&.5<=s&&s<2?_t(h,e,s*2):[W,u,c]}function ms(h,e,s){if(e=+e,h=+h,s=+s,!(s>0))return[];if(h===e)return[h];const r=e<h,[t,a,n]=r?_t(e,h,s):_t(h,e,s);if(!(a>=t))return[];const W=a-t+1,u=new Array(W);if(r)if(n<0)for(let c=0;c<W;++c)u[c]=(a-c)/-n;else for(let c=0;c<W;++c)u[c]=(a-c)*n;else if(n<0)for(let c=0;c<W;++c)u[c]=(t+c)/-n;else for(let c=0;c<W;++c)u[c]=(t+c)*n;return u}function ys(h,e,s){return e=+e,h=+h,s=+s,_t(h,e,s)[2]}function Bs(h,e,s){let r;for(;;){const t=ys(h,e,s);if(t===r||t===0||!isFinite(t))return[h,e];t>0?(h=Math.floor(h/t)*t,e=Math.ceil(e/t)*t):t<0&&(h=Math.ceil(h*t)/t,e=Math.floor(e*t)/t),r=t}}function Ps(h){return Math.max(1,Math.ceil(Math.log(As(h))/Math.LN2)+1)}var vs=Array.prototype,bs=vs.slice;function Ds(h,e){return h-e}function Ms(h){for(var e=0,s=h.length,r=h[s-1][1]*h[0][0]-h[s-1][0]*h[0][1];++e<s;)r+=h[e-1][1]*h[e][0]-h[e-1][0]*h[e][1];return r}const Ie=h=>()=>h;function Es(h,e){for(var s=-1,r=e.length,t;++s<r;)if(t=Rs(h,e[s]))return t;return 0}function Rs(h,e){for(var s=e[0],r=e[1],t=-1,a=0,n=h.length,W=n-1;a<n;W=a++){var u=h[a],c=u[0],i=u[1],l=h[W],T=l[0],p=l[1];if(_s(u,l,e))return 0;i>r!=p>r&&s<(T-c)*(r-i)/(p-i)+c&&(t=-t)}return t}function _s(h,e,s){var r;return Ss(h,e,s)&&ks(h[r=+(h[0]===e[0])],s[r],e[r])}function Ss(h,e,s){return(e[0]-h[0])*(s[1]-h[1])===(s[0]-h[0])*(e[1]-h[1])}function ks(h,e,s){return h<=e&&e<=s||s<=e&&e<=h}function Fs(){}var ut=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Zs(){var h=1,e=1,s=Ps,r=u;function t(c){var i=s(c);if(Array.isArray(i))i=i.slice().sort(Ds);else{const l=ws(c,Xs);for(i=ms(...Bs(l[0],l[1],i),i);i[i.length-1]>=l[1];)i.pop();for(;i[1]<l[0];)i.shift()}return i.map(l=>a(c,l))}function a(c,i){const l=i==null?NaN:+i;if(isNaN(l))throw new Error(`invalid value: ${i}`);var T=[],p=[];return n(c,l,function(o){r(o,c,l),Ms(o)>0?T.push([o]):p.push(o)}),p.forEach(function(o){for(var A=0,g=T.length,y;A<g;++A)if(Es((y=T[A])[0],o)!==-1){y.push(o);return}}),{type:"MultiPolygon",value:i,coordinates:T}}function n(c,i,l){var T=new Array,p=new Array,o,A,g,y,L,m;for(o=A=-1,y=pt(c[0],i),ut[y<<1].forEach(B);++o<h-1;)g=y,y=pt(c[o+1],i),ut[g|y<<1].forEach(B);for(ut[y<<0].forEach(B);++A<e-1;){for(o=-1,y=pt(c[A*h+h],i),L=pt(c[A*h],i),ut[y<<1|L<<2].forEach(B);++o<h-1;)g=y,y=pt(c[A*h+h+o+1],i),m=L,L=pt(c[A*h+o+1],i),ut[g|y<<1|L<<2|m<<3].forEach(B);ut[y|L<<3].forEach(B)}for(o=-1,L=c[A*h]>=i,ut[L<<2].forEach(B);++o<h-1;)m=L,L=pt(c[A*h+o+1],i),ut[L<<2|m<<3].forEach(B);ut[L<<3].forEach(B);function B(v){var b=[v[0][0]+o,v[0][1]+A],M=[v[1][0]+o,v[1][1]+A],_=W(b),R=W(M),E,D;(E=p[_])?(D=T[R])?(delete p[E.end],delete T[D.start],E===D?(E.ring.push(M),l(E.ring)):T[E.start]=p[D.end]={start:E.start,end:D.end,ring:E.ring.concat(D.ring)}):(delete p[E.end],E.ring.push(M),p[E.end=R]=E):(E=T[R])?(D=p[_])?(delete T[E.start],delete p[D.end],E===D?(E.ring.push(M),l(E.ring)):T[D.start]=p[E.end]={start:D.start,end:E.end,ring:D.ring.concat(E.ring)}):(delete T[E.start],E.ring.unshift(b),T[E.start=_]=E):T[_]=p[R]={start:_,end:R,ring:[b,M]}}}function W(c){return c[0]*2+c[1]*(h+1)*4}function u(c,i,l){c.forEach(function(T){var p=T[0],o=T[1],A=p|0,g=o|0,y=Jt(i[g*h+A]);p>0&&p<h&&A===p&&(T[0]=me(p,Jt(i[g*h+A-1]),y,l)),o>0&&o<e&&g===o&&(T[1]=me(o,Jt(i[(g-1)*h+A]),y,l))})}return t.contour=a,t.size=function(c){if(!arguments.length)return[h,e];var i=Math.floor(c[0]),l=Math.floor(c[1]);if(!(i>=0&&l>=0))throw new Error("invalid size");return h=i,e=l,t},t.thresholds=function(c){return arguments.length?(s=typeof c=="function"?c:Array.isArray(c)?Ie(bs.call(c)):Ie(c),t):s},t.smooth=function(c){return arguments.length?(r=c?u:Fs,t):r===u},t}function Xs(h){return isFinite(h)?h:NaN}function pt(h,e){return h==null?!1:+h>=e}function Jt(h){return h==null||isNaN(h=+h)?-1/0:h}function me(h,e,s,r){const t=r-e,a=s-e,n=isFinite(t)||isFinite(a)?t/a:Math.sign(t)/Math.sign(a);return isNaN(n)?h:h+n-.5}function $s(h){return h.primitive!==void 0}class Vs{constructor(e){w(this,"viewer");w(this,"lineInfo",null);w(this,"contourEntities",[]);w(this,"mountainEntities",[]);w(this,"contourConfig",{contourInterval:50,corridorWidthKm:1,interpolationPrecision:50,contourColor:"#00ff00",contourWidth:2,showLabels:!0,labelFontSize:12});w(this,"mountainConfig",{minElev:500,minProm:300,minDistance:500});this.viewer=e}setMountainConfig(e){this.mountainConfig={...this.mountainConfig,...e}}getMountainConfig(){return{...this.mountainConfig}}setContourConfig(e){this.contourConfig={...this.contourConfig,...e}}getContourConfig(){return{...this.contourConfig}}setLineInfo(e){this.lineInfo=e}calculateCorridorBounds(){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)return null;const e=this.lineInfo.towers;let s=1/0,r=-1/0,t=1/0,a=-1/0;e.forEach(u=>{u.Longitude<s&&(s=u.Longitude),u.Longitude>r&&(r=u.Longitude),u.Latitude<t&&(t=u.Latitude),u.Latitude>a&&(a=u.Latitude)});const n=1/111,W=this.contourConfig.corridorWidthKm*n;return s-=W,r+=W,t-=W,a+=W,[s,t,r,a]}async getHeightFromTerrain(e,s){var r;try{const t=[f.Cartographic.fromDegrees(e,s)];return((r=(await f.sampleTerrainMostDetailed(this.viewer.terrainProvider,t))[0])==null?void 0:r.height)??0}catch(t){return console.warn(`获取高度失败 [${e}, ${s}]:`,t),0}}async generateGridPoints(e){const[s,r,t,a]=e,n=1/111,W=this.contourConfig.interpolationPrecision/1e3*n,u=Math.ceil((t-s)/W)+1,c=Math.ceil((a-r)/W)+1,i=u*c;let l=0;const T=new Array(i),p=[];console.log(`[d3-contour] 开始生成网格点: 总点数 ${i}, 经度步数 ${u}, 纬度步数 ${c}`);for(let o=0;o<c;o++){const A=a-o*W;for(let g=0;g<u;g++){const y=s+g*W,L=await this.getHeightFromTerrain(y,A),m=o*u+g;if(T[m]=L,p.push({longitude:y,latitude:A,height:L}),l++,l%100===0){const B=(l/i*100).toFixed(1);console.log(`[d3-contour] 网格点生成进度: ${l}/${i} (${B}%)`)}}}return console.log(`[d3-contour] 网格点生成完成: 共生成 ${p.length} 个点`),{values:T,width:u,height:c,x0:s,y0:a,dx:W,dy:-W,points:p}}generateContours(e){const s=[],{contourInterval:r}=this.contourConfig;if(e.values.length===0||e.width<2||e.height<2)return s;console.log(`[d3-contour] 开始生成等高线,等高距: ${r}m`);const t=e.values.filter(i=>i!=null);if(t.length===0)return s;const a=Math.floor(Math.min(...t)/r)*r,n=Math.ceil(Math.max(...t)/r)*r,W=[];for(let i=a;i<=n;i+=r)W.push(i);const c=Zs().size([e.width,e.height]).thresholds(W)(e.values);return console.log(`[d3-contour] d3-contour 生成了 ${c.length} 条等高线`),c.forEach(i=>{const l={height:i.value,points:[]};i.coordinates.forEach(T=>{T.forEach(p=>{p.forEach(o=>{const A=e.x0+o[0]*e.dx,g=e.y0+o[1]*e.dy,y=this.getHeightAtGridPoint(e,o[0],o[1]);l.points.push({longitude:A,latitude:g,height:y})})})}),l.points.length>=2&&s.push(l)}),console.log(`[d3-contour] 转换完成,共 ${s.length} 条有效等高线`),s}getHeightAtGridPoint(e,s,r){const t=Math.floor(s),a=Math.floor(r),n=Math.min(t+1,e.width-1),W=Math.min(a+1,e.height-1),u=a*e.width+t,c=a*e.width+n,i=W*e.width+t,l=W*e.width+n,T=e.values[u]||0,p=e.values[c]||0,o=e.values[i]||0,A=e.values[l]||0,g=s-t,y=r-a,L=T*(1-g)+p*g,m=o*(1-g)+A*g;return L*(1-y)+m*y}drawContours(e){this.clearContours();const{contourColor:s,contourWidth:r,showLabels:t,labelFontSize:a}=this.contourConfig;console.log(`开始绘制等高线: ${e.length} 条, 颜色: ${s}, 宽度: ${r}`),e.forEach((n,W)=>{if(n.points.length<2)return;const u=f.Cartesian3.fromDegreesArray(n.points.flatMap(i=>[i.longitude,i.latitude])),c=new f.GroundPolylinePrimitive({geometryInstances:new f.GeometryInstance({geometry:new f.GroundPolylineGeometry({positions:u,width:r})}),appearance:new f.PolylineMaterialAppearance({material:f.Material.fromType("Color",{color:f.Color.fromCssColorString(s)})})});if(this.viewer.scene.primitives.add(c),this.contourEntities.push({primitive:c}),console.log(`绘制等高线 ${W}: 高度 ${n.height}m, 点数 ${n.points.length}`),t&&n.points.length>0){const i=Math.floor(n.points.length/2),l=n.points[i],T=this.viewer.entities.add({name:`Contour_Label_${W}_${n.height}m`,position:f.Cartesian3.fromDegrees(l.longitude,l.latitude,l.height+10),label:{text:`${n.height}m`,font:`${a}px sans-serif`,fillColor:f.Color.WHITE,outlineColor:f.Color.BLACK,outlineWidth:2,style:f.LabelStyle.FILL_AND_OUTLINE,verticalOrigin:f.VerticalOrigin.CENTER,horizontalOrigin:f.HorizontalOrigin.CENTER,heightReference:f.HeightReference.CLAMP_TO_GROUND}});this.contourEntities.push(T)}})}async getAndDrawContours(e,s){debugger;if(s&&this.setContourConfig(s),e&&this.setLineInfo(e),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");console.log(`等高线获取范围: [${r[0].toFixed(6)}, ${r[1].toFixed(6)}, ${r[2].toFixed(6)}, ${r[3].toFixed(6)}]`),console.log(`等高距: ${this.contourConfig.contourInterval}m, 插值精度: ${this.contourConfig.interpolationPrecision}m`);const t=await this.generateGridPoints(r);console.log(`生成网格点数量: ${t.points.length}`);const a=this.generateContours(t);return console.log(`生成等高线数量: ${a.length}`),this.drawContours(a),a}async getContourData(e,s){if(s&&this.setContourConfig(s),e&&this.setLineInfo(e),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");const t=await this.generateGridPoints(r);return this.generateContours(t)}async getCorridorGridData(e,s){if(s&&this.setContourConfig(s),e&&this.setLineInfo(e),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const r=this.calculateCorridorBounds();if(!r)throw new Error("无法计算通道边界");return(await this.generateGridPoints(r)).points}clearContours(){this.contourEntities.forEach(e=>{try{$s(e)?this.viewer.scene.primitives.remove(e.primitive):this.viewer.entities.remove(e)}catch(s){console.warn("Error removing contour entity:",s)}}),this.contourEntities=[]}setCorridorWidthKm(e){this.contourConfig.corridorWidthKm=e}setContourInterval(e){this.contourConfig.contourInterval=e}setInterpolationPrecision(e){this.contourConfig.interpolationPrecision=e}getCorridorWidthKm(){return this.contourConfig.corridorWidthKm}getContourInterval(){return this.contourConfig.contourInterval}async generateCrossSection(e,s){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const r=this.lineInfo.towers;if(e<0||e>=r.length)throw new Error("无效的塔位索引");const t={width:100,interval:10,interpolationMethod:"linear",mountainThreshold:300,mountainProminence:50,...s},a=r[e];let n=a,W=a;e>0&&(n=r[e-1]),e<r.length-1&&(W=r[e+1]);const u=W.Longitude-n.Longitude,i=-(W.Latitude-n.Latitude),l=u,T=Math.sqrt(i*i+l*l),p={dx:i/T,dy:l/T},o=t.width/2,A=6371e3,g=o/A*(180/Math.PI),y=o/A*(180/Math.PI)/Math.cos(a.Latitude*Math.PI/180),L=a.Longitude-p.dx*y,m=a.Latitude-p.dy*g,B=a.Longitude+p.dx*y,v=a.Latitude+p.dy*g,b=[],M=Math.ceil(t.width/t.interval)+1;for(let E=0;E<M;E++){const D=E/(M-1),X=L+(B-L)*D,k=m+(v-m)*D,F=(D-.5)*t.width,$=await this.getHeightFromTerrain(X,k);b.push({distance:F,height:$,lon:X,lat:k,isCenter:Math.abs(F)<t.interval/2,isMountain:!1})}const _=this.applyInterpolation(b,t.interpolationMethod),R=this.detectMountains(_,t.mountainThreshold,t.mountainProminence);return R.forEach(E=>{_.forEach(D=>{D.distance>=E.startDistance&&D.distance<=E.endDistance&&(D.isMountain=!0)})}),{points:_,mountains:R}}applyInterpolation(e,s){return s==="cubic"?this.cubicSplineInterpolation(e):s==="nearest"?[...e]:[...e]}cubicSplineInterpolation(e){if(e.length<2)return e;const s=[],r=2;for(let t=0;t<e.length-1;t++){const a=e[t],n=e[t+1],W=t>0?e[t-1]:a,u=t<e.length-2?e[t+2]:n;for(let c=0;c<r;c++){const i=c/r,l=i*i,T=l*i,p=2*T-3*l+1,o=T-2*l+i,A=-2*T+3*l,g=T-l,y=p*a.height+o*(n.distance-a.distance)*this.getSlope(W,a,n)+A*n.height+g*(n.distance-a.distance)*this.getSlope(a,n,u),L=a.distance+(n.distance-a.distance)*i;s.push({distance:L,height:y,lon:a.lon,lat:a.lat,isCenter:a.isCenter||n.isCenter,isMountain:!1})}}return s.push({...e[e.length-1]}),s}getSlope(e,s,r){const t=s.distance-e.distance,a=r.distance-s.distance;return t===0?(r.height-s.height)/(a||1):a===0?(s.height-e.height)/t:((s.height-e.height)/t+(r.height-s.height)/a)/2}detectMountains(e,s,r){const t=[];if(e.length<3)return t;for(let a=1;a<e.length-1;a++){const n=e[a],W=e[a-1],u=e[a+1];if(n.height>W.height&&n.height>u.height){let c=a,i=a,l=n.height,T=n.height;for(let A=a-1;A>=0&&n.height-e[A].height>=r;A--)c=A,l=e[A].height;for(let A=a+1;A<e.length&&n.height-e[A].height>=r;A++)i=A,T=e[A].height;const p=(l+T)/2,o=n.height-p;o>=s&&t.push({id:t.length+1,peakDistance:n.distance,peakHeight:n.height,startDistance:e[c].distance,endDistance:e[i].distance,heightDiff:o,path:`[${e[c].distance.toFixed(1)}m, ${n.distance.toFixed(1)}m, ${e[i].distance.toFixed(1)}m]`})}}return t}async generateLongSection(e){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length<2)throw new Error("线路信息为空或杆塔数量不足");const s=this.lineInfo.towers,r={interval:50,interpolationMethod:"linear",...e},t=[];let a=0;t.push({towerName:s[0].name||"塔1",distance:a,height:s[0].Altitude||0,isTower:!0});for(let n=0;n<s.length-1;n++){const W=s[n],u=s[n+1],c=(u.Longitude-W.Longitude)*111e3,i=(u.Latitude-W.Latitude)*111e3,l=Math.sqrt(c*c+i*i),T=Math.floor(l/r.interval);for(let p=1;p<=T;p++){const o=p*r.interval/l,A=a+p*r.interval;if(r.interpolationMethod==="nearest"){const g=o<.5?W.Altitude||0:u.Altitude||0;t.push({towerName:"",distance:A,height:g,isTower:!1})}else{const g=(W.Altitude||0)+((u.Altitude||0)-(W.Altitude||0))*o;t.push({towerName:"",distance:A,height:g,isTower:!1})}}a+=l,t.push({towerName:u.name||`塔${n+2}`,distance:a,height:u.Altitude||0,isTower:!0})}return t}calculateCrossSectionLine(e,s){if(!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)return null;const r=this.lineInfo.towers;if(e<0||e>=r.length)return null;const t=r[e];let a=t,n=t;e>0&&(a=r[e-1]),e<r.length-1&&(n=r[e+1]);const W=n.Longitude-a.Longitude,c=-(n.Latitude-a.Latitude),i=W,l=Math.sqrt(c*c+i*i),T={dx:c/l,dy:i/l},p=s/2,o=6371e3,A=p/o*(180/Math.PI),g=p/o*(180/Math.PI)/Math.cos(t.Latitude*Math.PI/180);return{start:{lon:t.Longitude-T.dx*g,lat:t.Latitude-T.dy*A},end:{lon:t.Longitude+T.dx*g,lat:t.Latitude+T.dy*A}}}async getAndDrawMountains(e,s,r){if(s&&this.setContourConfig(s),r&&this.setMountainConfig(r),e&&this.setLineInfo(e),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空,请先加载线路数据");const t=this.calculateCorridorBounds();if(!t)throw new Error("无法计算通道边界");console.log(`山峰识别范围: [${t[0].toFixed(6)}, ${t[1].toFixed(6)}, ${t[2].toFixed(6)}, ${t[3].toFixed(6)}]`),console.log(`山峰识别参数: minElev=${this.mountainConfig.minElev}m, minProm=${this.mountainConfig.minProm}m`);const a=await this.generateGridPoints(t);console.log(`生成网格点数量: ${a.points.length}`);const n=this.generateContours(a);console.log(`生成等高线数量: ${n.length}`);const W=this.detectMountainsFromGrid(a,n);return console.log(`识别到山峰数量: ${W.length}, 有效山峰: ${W.filter(u=>u.isValid).length}`),this.drawContours(n),this.drawMountains(W),W}detectMountainsFromGrid(e,s){const r=this.findCandidatePeaks(e,s);console.log(`粗筛候选山峰: ${r.length} 个`);const t=r.map((n,W)=>{const u=this.calculateProminence(n,e,s);return{id:W+1,longitude:n.longitude,latitude:n.latitude,elevation:n.elevation,prominence:u.prominence,saddleElevation:u.saddleElevation,isValid:u.prominence>=this.mountainConfig.minProm}});return this.deduplicateMountains(t)}findCandidatePeaks(e,s){const r=[],{minElev:t}=this.mountainConfig,a=[...s].sort((W,u)=>u.height-W.height),n=new Set;for(const W of a)if(!(W.height<t)&&W.points.length>=3){const u=this.calculatePolygonCenter(W.points),c=Math.floor((u.longitude-e.x0)/e.dx),i=Math.floor((u.latitude-e.y0)/e.dy),l=`${c},${i}`;if(!n.has(l)){n.add(l);const T=this.getHeightAtGridPoint(e,c,i);r.push({longitude:u.longitude,latitude:u.latitude,elevation:T})}}return r}calculatePolygonCenter(e){if(e.length===0)return{longitude:0,latitude:0};let s=0,r=0;return e.forEach(t=>{s+=t.longitude,r+=t.latitude}),{longitude:s/e.length,latitude:r/e.length}}calculateProminence(e,s,r){const t=e.elevation,a=[...r].sort((c,i)=>i.height-c.height);let n=t,W=!1;for(const c of a)if(!(c.height>=t))if(this.isPointInsideContour(e,c))n=c.height,W=!0;else break;return W||(n=Math.min(...s.values.filter(i=>i>0))),{prominence:t-n,saddleElevation:n}}isPointInsideContour(e,s){if(s.points.length<3)return!1;let r=!1;const t=s.points.length;for(let a=0,n=t-1;a<t;n=a++){const W=s.points[a].longitude,u=s.points[a].latitude,c=s.points[n].longitude,i=s.points[n].latitude;u>e.latitude!=i>e.latitude&&e.longitude<(c-W)*(e.latitude-u)/(i-u)+W&&(r=!r)}return r}deduplicateMountains(e){const{minDistance:s}=this.mountainConfig,r=[],t=new Set;for(let a=0;a<e.length;a++){if(t.has(a))continue;const n=e[a],W=[n];t.add(a);for(let u=a+1;u<e.length;u++){if(t.has(u))continue;this.calculateDistance(n,e[u])<s&&(W.push(e[u]),t.add(u))}if(W.length===1)r.push(n);else{const u=W.reduce((c,i)=>i.elevation>c.elevation?i:c);r.push(u)}}return r}calculateDistance(e,s){const t=(s.latitude-e.latitude)*Math.PI/180,a=(s.longitude-e.longitude)*Math.PI/180,n=Math.sin(t/2)*Math.sin(t/2)+Math.cos(e.latitude*Math.PI/180)*Math.cos(s.latitude*Math.PI/180)*Math.sin(a/2)*Math.sin(a/2);return 6371e3*(2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n)))}drawMountains(e){this.clearMountains(),e.forEach((s,r)=>{if(!s.isValid)return;const t=this.viewer.entities.add({name:`Mountain_Peak_${r+1}`,position:f.Cartesian3.fromDegrees(s.longitude,s.latitude,s.elevation+10),point:{pixelSize:10,color:f.Color.RED,outlineColor:f.Color.WHITE,outlineWidth:2,heightReference:f.HeightReference.CLAMP_TO_GROUND},label:{text:`${s.elevation.toFixed(0)}m
2
+ Prom: ${s.prominence.toFixed(0)}m`,font:"14px sans-serif",fillColor:f.Color.WHITE,outlineColor:f.Color.BLACK,outlineWidth:2,style:f.LabelStyle.FILL_AND_OUTLINE,verticalOrigin:f.VerticalOrigin.BOTTOM,horizontalOrigin:f.HorizontalOrigin.CENTER,heightReference:f.HeightReference.CLAMP_TO_GROUND,pixelOffset:new f.Cartesian2(0,-15)}});this.mountainEntities.push(t),console.log(`绘制山峰 ${r+1}: [${s.longitude.toFixed(6)}, ${s.latitude.toFixed(6)}], 海拔 ${s.elevation.toFixed(0)}m, 突出度 ${s.prominence.toFixed(0)}m`)})}clearMountains(){this.mountainEntities.forEach(e=>{try{this.viewer.entities.remove(e)}catch(s){console.warn("Error removing mountain entity:",s)}}),this.mountainEntities=[]}async getMountainData(e,s,r){if(s&&this.setContourConfig(s),r&&this.setMountainConfig(r),e&&this.setLineInfo(e),!this.lineInfo||!this.lineInfo.towers||this.lineInfo.towers.length===0)throw new Error("线路信息为空");const t=this.calculateCorridorBounds();if(!t)throw new Error("无法计算通道边界");const a=await this.generateGridPoints(t),n=this.generateContours(a);return this.detectMountainsFromGrid(a,n)}detectTerrainFeatures(e,s,r){const t=[],a=[],n=s.windowSize,W=e.length;if(W<n*2+1)return{peaks:t,valleys:a};const u=(l,T)=>T===0?90:Math.atan(Math.abs(l)/Math.abs(T))*180/Math.PI;for(let l=n;l<W-n;l++){const T=e[l];if(T.height<s.minPeakElev)continue;let p=!0,o=T.height;for(let D=l-n;D<=l+n;D++){if(e[D].height>T.height){p=!1;break}e[D].height<o&&(o=e[D].height)}if(!p)continue;const A=T.height-o;if(A<s.minPeakDiff)continue;let g=l,y=l;for(let D=l-1;D>=0&&T.height-e[D].height>=s.minPeakDiff/2;D--)g=D;for(let D=l+1;D<W&&T.height-e[D].height>=s.minPeakDiff/2;D++)y=D;const L=T.height-e[g].height,m=T.height-e[y].height,B=T.distance-e[g].distance,v=e[y].distance-T.distance,b=u(L,B),M=u(m,v),_=s.peakMode==="slope_only"||A>=s.minPeakDiff,R=s.peakMode==="height_diff"||b>=s.minPeakSlope&&M>=s.minPeakSlope,E=s.peakMode==="both"?A>=s.minPeakDiff&&b>=s.minPeakSlope&&M>=s.minPeakSlope:!0;if(s.peakMode==="both"){if(!E)continue}else if(s.peakMode==="height_diff"){if(!_)continue}else if(!R)continue;t.push({id:t.length+1,type:"peak",distance:T.distance,height:T.height,startDistance:e[g].distance,endDistance:e[y].distance,heightDiff:A})}for(let l=n;l<W-n;l++){const T=e[l];let p=!0,o=T.height;for(let D=l-n;D<=l+n;D++){if(e[D].height<T.height){p=!1;break}e[D].height>o&&(o=e[D].height)}if(!p)continue;const A=o-T.height;if(A<s.minValleyDiff)continue;let g=l,y=l;for(let D=l-1;D>=0&&e[D].height-T.height>=s.minValleyDiff/2;D--)g=D;for(let D=l+1;D<W&&e[D].height-T.height>=s.minValleyDiff/2;D++)y=D;const L=e[g].height-T.height,m=e[y].height-T.height,B=T.distance-e[g].distance,v=e[y].distance-T.distance,b=u(L,B),M=u(m,v),_=s.valleyMode==="slope_only"||A>=s.minValleyDiff,R=s.valleyMode==="height_diff"||b>=s.minValleySlope&&M>=s.minValleySlope,E=s.valleyMode==="both"?A>=s.minValleyDiff&&b>=s.minValleySlope&&M>=s.minValleySlope:!0;if(s.valleyMode==="both"){if(!E)continue}else if(s.valleyMode==="height_diff"){if(!_)continue}else if(!R)continue;a.push({id:a.length+1,type:"valley",distance:T.distance,height:T.height,startDistance:e[g].distance,endDistance:e[y].distance,heightDiff:A})}const c=this.mergeCloseFeatures(t,r*2),i=this.mergeCloseFeatures(a,r*2);return c.sort((l,T)=>l.distance-T.distance),i.sort((l,T)=>l.distance-T.distance),c.forEach((l,T)=>l.id=T+1),i.forEach((l,T)=>l.id=T+1),{peaks:c,valleys:i}}mergeCloseFeatures(e,s){if(e.length<=1)return e;const r=[...e].sort((a,n)=>a.distance-n.distance),t=[r[0]];for(let a=1;a<r.length;a++){const n=t[t.length-1],W=r[a];W.distance-n.distance<s?W.type==="peak"?W.height>n.height&&(t[t.length-1]=W):W.height<n.height&&(t[t.length-1]=W):t.push(W)}return t}async generateCrossSectionWithFeatures(e,s,r){const t=await this.generateCrossSection(e,s),a=t.points.map(c=>({distance:c.distance,height:c.height})),{peaks:n,valleys:W}=this.detectTerrainFeatures(a,r,s.interval??10),u=t.points.map(c=>({...c,type:c.isCenter?"center":"normal"}));return n.forEach(c=>{const i=u.find(l=>Math.abs(l.distance-c.distance)<(s.interval??10)/2);i&&(i.type="peak")}),W.forEach(c=>{const i=u.find(l=>Math.abs(l.distance-c.distance)<(s.interval??10)/2);i&&(i.type="valley")}),{points:u,peaks:n,valleys:W}}}class Ys{constructor(e,s,r){w(this,"viewer");w(this,"LineInfo");w(this,"lineConstruction");w(this,"terrainConstruction");w(this,"channelCalculation");w(this,"contourConstruction");w(this,"selectedWireEntity",null);w(this,"originalWireColor",null);w(this,"wireCorridorWidth",10);w(this,"showWireCorridor",!0);w(this,"wireMeasurementType",[]);w(this,"isDynamicLoadingEnabled",!0);w(this,"pathEntities",[]);w(this,"selectedWire1Entity",null);w(this,"selectedWire1Data",[]);w(this,"selectedWire1Phase",G.A相);w(this,"originalWire1Color",null);this.viewer=e,this.LineInfo=s,this.lineConstruction=new Ts(e,s,r),this.terrainConstruction=new Ut(e,s,r),this.channelCalculation=new ps(e),this.contourConstruction=new Vs(e),this.enableWireMeasurement=this.enableWireMeasurement.bind(this),this.removeWireListen=this.removeWireListen.bind(this)}setAutoCalculateRollX(e){this.lineConstruction.setAutoCalculateRollX(e)}getAutoCalculateRollX(){return this.lineConstruction.getAutoCalculateRollX()}setDynamicLoadingEnabled(e){this.isDynamicLoadingEnabled=e,this.lineConstruction.setDynamicLoadingEnabled(e),this.terrainConstruction.setDynamicLoadingEnabled(e)}setDynamicLoadingEnabled_line(e){this.lineConstruction.setDynamicLoadingEnabled(e)}setDynamicLoadingEnabled_Tree(e){this.terrainConstruction.setDynamicLoadingEnabled(e)}getDynamicLoadingEnabled(){return this.isDynamicLoadingEnabled}initializeLineData(){this.lineConstruction.initializeLineData()}loadLineTower(){this.lineConstruction.loadLineTower()}loadLODWireOnly(){this.lineConstruction.LODloadAllWiresOnly()}setLineVisible(e){this.lineConstruction.setLineVisible(e)}setTreeVisible(e){this.terrainConstruction.setTreeVisible(e)}loadLineModel(){this.lineConstruction.getLineDataSources().forEach(s=>{this.viewer.dataSources.contains(s)||this.viewer.dataSources.add(s)})}loadTree(){this.terrainConstruction.loadTree()}loadtreeModel(){this.terrainConstruction.getTerrainDataSources().forEach(e=>{this.viewer.dataSources.contains(e)||this.viewer.dataSources.add(e)})}addTreeData(e){this.terrainConstruction.addTreeData(e)}flyToTower(e){this.lineConstruction.flyToTower(e)}flyToTree(e){this.terrainConstruction.flyToTree(e)}loadTreeListen(e,s=[]){const r=this.terrainConstruction.getLineInfo().corridor_features,t=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.loadTreeListen(r,t.arcLine1A1,t.arcLine1B1,t.arcLine1C1,e,s)}removeTreeListen(){this.channelCalculation.removeTreeListen()}loadWireListen(){const e=this.terrainConstruction.getLineInfo().corridor_features,s=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.loadWireListen(e,s.arcLine1A1,s.arcLine1B1,s.arcLine1C1)}removeWireListen(){if(this.channelCalculation.removeWireListen(),this.selectedWireEntity&&this.originalWireColor){try{this.selectedWireEntity.polyline&&(this.selectedWireEntity.polyline.material=f.Color.fromCssColorString(this.originalWireColor))}catch(e){console.warn("Error restoring wire color:",e)}this.selectedWireEntity=null,this.originalWireColor=null}}clearWireMeasurementResults(){this.channelCalculation.clearTreeDistanceResults()}enableWireMeasurement(e){const s=this.terrainConstruction.getLineInfo().corridor_features,r=this.lineConstruction.getWireDataForChannelCalculation(),t=n=>{if(this.selectedWireEntity&&this.originalWireColor&&this.selectedWireEntity.polyline&&(this.selectedWireEntity.polyline.material=f.Color.fromCssColorString(this.originalWireColor)),n.polyline&&n.polyline.material){const W=n.polyline.material;W instanceof f.Color?this.originalWireColor=W.toCssColorString():this.originalWireColor="#ffffff",n.polyline.material=f.Color.YELLOW,this.selectedWireEntity=n}},a={width:this.wireCorridorWidth,show:this.showWireCorridor,measurementType:this.wireMeasurementType,onMeasurementResult:e};this.channelCalculation.loadWireListen(s,r.arcLine1A1,r.arcLine1B1,r.arcLine1C1,t,a)}setWireCorridorWidth(e){this.wireCorridorWidth=e}setShowWireCorridor(e){this.showWireCorridor=e}setWireMeasurementType(e){this.wireMeasurementType=e}async LineChannelTerrainVerification(e=[],s,r=100){const t=this.terrainConstruction.getLineInfo().corridor_features,a=this.terrainConstruction.getOffsetTrees(),n=this.lineConstruction.getAllWireSegments();let W=[],u=[],c=[];if(n.wireSegments1A1.length>0)n.wireSegments1A1.forEach(i=>{i&&i.length>0&&W.push(...i)}),n.wireSegments1B1.forEach(i=>{i&&i.length>0&&u.push(...i)}),n.wireSegments1C1.forEach(i=>{i&&i.length>0&&c.push(...i)}),await this.calculateClearanceBySegments(n);else{const i=this.lineConstruction.getWireDataForChannelCalculation();W=i.arcLine1A1,u=i.arcLine1B1,c=i.arcLine1C1}this.channelCalculation.LineChannelTerrainVerification(t,a,W,u,c,r,e,s)}async calculateClearanceBySegments(e){var t,a,n;const s=Math.max(e.wireSegments1A1.length,e.wireSegments1B1.length,e.wireSegments1C1.length),r=[];if(e.wireSegments1A1.length>0&&((t=e.wireSegments1A1[0])==null?void 0:t.length)>0&&r.push({key:"A",data:e.wireSegments1A1}),e.wireSegments1B1.length>0&&((a=e.wireSegments1B1[0])==null?void 0:a.length)>0&&r.push({key:"B",data:e.wireSegments1B1}),e.wireSegments1C1.length>0&&((n=e.wireSegments1C1[0])==null?void 0:n.length)>0&&r.push({key:"C",data:e.wireSegments1C1}),r.length!==0)for(let W=0;W<s;W++)for(const u of r){const c=u.data[W];if(c&&!(c.length<2))try{await this.channelCalculation.calculateAndDrawWireToGroundDistanceByType(c,[U.线间距离测量])}catch(i){console.error(`${u.key}相 塔段${W} 净空距离计算失败:`,i)}}}LineChannelTerrainVerificationByTowerRange(e,s,r,t=100,a=2e3,n=!1,W=!0,u=[],c=0,i="ABC"){const l=this.LineInfo.towers;let T=-1,p=-1;for(let S=0;S<l.length;S++)(l[S].id==e||l[S].name==e)&&(T=S),(l[S].id==s||l[S].name==s)&&(p=S);if(T===-1||p===-1){console.warn("未找到指定的杆塔范围,使用全部线路进行校验");return}T>p&&([T,p]=[p,T]);const o=this.lineConstruction.getAllWireSegments();let A=o.wireSegments1A1,g=o.wireSegments1B1,y=o.wireSegments1C1,L=[],m=[],B=[];(c===0||c===2)&&(L=o.wireSegments2A1,m=o.wireSegments2B1,B=o.wireSegments2C1);const v=[],b=[],M=[],_=[],R=[],E=[];for(let S=T+1;S<=p;S++)(c===0||c===1)&&(A[S]&&v.push(A[S]),g[S]&&b.push(g[S]),y[S]&&M.push(y[S])),(c===0||c===2)&&(L[S]&&_.push(L[S]),m[S]&&R.push(m[S]),B[S]&&E.push(B[S]));const D=[],X=[],k=[],F=[],$=[],V=[];for(let S=0;S<v.length;S++)D.push(...v[S]);for(let S=0;S<b.length;S++)X.push(...b[S]);for(let S=0;S<M.length;S++)k.push(...M[S]);for(let S=0;S<_.length;S++)F.push(..._[S]);for(let S=0;S<R.length;S++)$.push(...R[S]);for(let S=0;S<E.length;S++)V.push(...E[S]);i==="A"?(X.splice(0),k.splice(0),$.splice(0),V.splice(0)):i==="B"?(D.splice(0),k.splice(0),F.splice(0),V.splice(0)):i==="C"?(D.splice(0),X.splice(0),F.splice(0),$.splice(0)):i==="AB"?(k.splice(0),V.splice(0)):i==="AC"?(X.splice(0),$.splice(0)):i==="BC"&&(D.splice(0),F.splice(0));const O=this.terrainConstruction.getLineInfo().corridor_features,H=this.terrainConstruction.getOffsetTrees(),z=l.slice(T,p+1),mt=ds(z,a);if(n){if(mt.length>0){this.channelCalculation.drawCorridorPolygon(mt,`corridor-${e}-${s}`);const S=z.map(Tt=>[Tt.Longitude,Tt.Latitude]);this.channelCalculation.drawCorridorDistanceMarkers(S,a,`corridor-${e}-${s}`,W)}}else this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers();const yt=Cs(O,mt),K=[],kt=new Map;if(O.forEach((S,Tt)=>{kt.set(S,Tt)}),yt.forEach(S=>{const Tt=kt.get(S);Tt!==void 0&&K.push(H[Tt])}),yt.length===0){console.warn("指定杆塔范围的通道内没有找到树木"),r&&r([]);return}const Qt=D.length>0||X.length>0||k.length>0,Bt=F.length>0||$.length>0||V.length>0;if(!Qt&&!Bt){r&&r([]);return}let N=[...D],j=[...X],be=[...k];(c===0||c===2)&&Bt&&(N.push(...F),j.push(...$),be.push(...V)),this.channelCalculation.LineChannelTerrainVerificationForFilteredTrees(yt,K,N,j,be,t,u,S=>{if(u.includes(U.净空距离)){if(c===0||c===1)for(let ot=0;ot<v.length;ot++){const Lt=T+ot,Ft=Lt+1,xt=v[ot]||[],te=b[ot]||[],ee=M[ot]||[];let ht=[...xt],ft=[...te],at=[...ee];i==="A"?(ft=[],at=[]):i==="B"?(ht=[],at=[]):i==="C"?(ht=[],ft=[]):i==="AB"?at=[]:i==="AC"?ft=[]:i==="BC"&&(ht=[]),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(ht,ft,at,u).catch(se=>{console.error(`Error calculating wire to ground distance for segment ${Lt}-${Ft} (circuit 1):`,se)})}if((c===0||c===2)&&Bt)for(let ot=0;ot<_.length;ot++){const Lt=T+ot,Ft=Lt+1,xt=_[ot]||[],te=R[ot]||[],ee=E[ot]||[];let ht=[...xt],ft=[...te],at=[...ee];i==="A"?(ft=[],at=[]):i==="B"?(ht=[],at=[]):i==="C"?(ht=[],ft=[]):i==="AB"?at=[]:i==="AC"?ft=[]:i==="BC"&&(ht=[]),console.log(`计算塔段 ${Lt}-${Ft} (回路2) 的净空距离: A相=${ht.length}, B相=${ft.length}, C相=${at.length}`),this.channelCalculation.calculateAndDrawWireToGroundDistanceBySegments(ht,ft,at,u).catch(se=>{console.error(`Error calculating wire to ground distance for segment ${Lt}-${Ft} (circuit 2):`,se)})}}r&&r(S)})}stopLineChannelTerrainVerification(){this.channelCalculation.stopLineChannelTerrainVerification()}enableVisibleAreaTerrainVerification(){const e=this.terrainConstruction.getLineInfo().corridor_features,s=this.terrainConstruction.getOffsetTrees(),r=this.lineConstruction.getWireDataForChannelCalculation();this.channelCalculation.enableVisibleAreaTerrainVerification(e,s,r.arcLine1A1,r.arcLine1B1,r.arcLine1C1)}setPlottingEntityVisible(e,s){this.channelCalculation.setPlottingEntityVisible(e,s)}disableVisibleAreaTerrainVerification(){this.channelCalculation.disableVisibleAreaTerrainVerification()}setMaxVisibleTerrainResults(e=200){this.channelCalculation.setMaxVisibleTerrainResults(e)}setDistanceRuleConfig(e){this.channelCalculation.setDistanceRuleConfig(e)}getDistanceRuleConfig(){return this.channelCalculation.getDistanceRuleConfig()}clearTreeDistanceResults(){this.channelCalculation.clearTreeDistanceResults()}clearCorridorDisplay(){try{this.channelCalculation.clearCorridorPolygon(),this.channelCalculation.clearCorridorDistanceMarkers()}catch(e){console.warn("Error clearing corridor display:",e)}}getLineInfo(){return this.LineInfo}getViewer(){return this.viewer}getContourConfig(){return this.contourConstruction.getContourConfig()}setContourConfig(e){this.contourConstruction.setContourConfig(e)}setContourCorridorWidthKm(e){this.contourConstruction.setCorridorWidthKm(e)}setContourInterval(e){this.contourConstruction.setContourInterval(e)}setContourInterpolationPrecision(e){this.contourConstruction.setInterpolationPrecision(e)}async getAndDrawContours(e){return this.contourConstruction.getAndDrawContours(this.LineInfo,e)}async getContourData(e){return this.contourConstruction.getContourData(this.LineInfo,e)}async getCorridorGridData(e){return this.contourConstruction.getCorridorGridData(this.LineInfo,e)}clearContours(){this.contourConstruction.clearContours()}async getAndDrawMountains(e,s){return this.contourConstruction.getAndDrawMountains(this.LineInfo,e,s)}async getMountainData(e,s){return this.contourConstruction.getMountainData(this.LineInfo,e,s)}clearMountains(){this.contourConstruction.clearMountains()}drawLinePath(e="#ff0000",s=3,r=!1){if(this.clearLinePath(),!this.LineInfo||!this.LineInfo.towers||this.LineInfo.towers.length<2){console.warn("无法绘制路径:杆塔数据不足");return}const t=this.LineInfo.towers,a=t.map(W=>f.Cartesian3.fromDegrees(W.Longitude,W.Latitude,W.Altitude)),n=this.viewer.entities.add({name:"LinePath",polyline:{positions:a,width:s,material:f.Color.fromCssColorString(e),clampToGround:r}});this.pathEntities.push(n),console.log(`线路路径绘制完成: ${t.length} 个杆塔点`)}clearLinePath(){this.pathEntities.forEach(e=>{try{this.viewer.entities.remove(e)}catch(s){console.warn("Error removing path entity:",s)}}),this.pathEntities=[]}async generateCrossSection(e,s){return this.contourConstruction.generateCrossSection(e,s||{})}async generateLongSection(e){return this.contourConstruction.generateLongSection(e||{})}calculateCrossSectionLine(e,s){return this.contourConstruction.calculateCrossSectionLine(e,s)}async generateCrossSectionWithFeatures(e,s,r){return this.contourConstruction.generateCrossSectionWithFeatures(e,s,r)}setLineInfoForContour(e){this.contourConstruction.setLineInfo(e)}setWireToWireDistanceRuleConfig(e){this.channelCalculation.setWireToWireDistanceRuleConfig(e)}getWireToWireDistanceRuleConfig(){return this.channelCalculation.getWireToWireDistanceRuleConfig()}createDefaultWireToWireDistanceRuleConfig(){return this.channelCalculation.createDefaultWireToWireDistanceRuleConfig()}enableWireToWireMeasurement(e){const s=this.lineConstruction.getWireDataForChannelCalculation(),r=(a,n)=>{const W=a.scene.pick(n);if(f.defined(W)){let u=W.id;if(u===void 0&&W.primitive&&(u=W.primitive.id),u instanceof f.Entity)return u}},t=new f.ScreenSpaceEventHandler(this.viewer.canvas);t.setInputAction(a=>{const n=r(this.viewer,a.position);if(n&&n.id){const W=String(n.id),u=n.name||"";if(W.includes("daoxian")||u.includes("导线")||u.includes("daoxian")||W.includes("dixian")||u.includes("地线")||u.includes("ground")){let i=[],l=G.A相;if(n.polyline&&n.polyline.positions){const T=n.polyline.positions.getValue(this.viewer.clock.currentTime);T&&Array.isArray(T)&&(i=T.map(p=>{const o=f.Cartographic.fromCartesian(p);return[f.Math.toDegrees(o.longitude),f.Math.toDegrees(o.latitude),o.height]}))}if(u.includes("A相")||u.includes("_A相")||u.includes("_A")&&!u.includes("_A相")?l=G.A相:u.includes("B相")||u.includes("_B相")||u.includes("_B")&&!u.includes("_B相")?l=G.B相:u.includes("C相")||u.includes("_C相")||u.includes("_C")&&!u.includes("_C相")?l=G.C相:u.includes("地线1")||u.includes("dixian1")||u.includes("ground1")||u.includes("GD1")?l=G.地线1:u.includes("地线2")||u.includes("dixian2")||u.includes("ground2")||u.includes("GD2")?l=G.地线2:(u.includes("地线")||u.includes("dixian")||u.includes("ground")||u.includes("GD"))&&(l=G.地线1),i.length===0&&(l===G.A相?i=s.arcLine1A1:l===G.B相?i=s.arcLine1B1:l===G.C相&&(i=s.arcLine1C1)),this.selectedWire1Entity&&this.originalWire1Color)try{this.selectedWire1Entity.polyline&&(this.selectedWire1Entity.polyline.material=f.Color.fromCssColorString(this.originalWire1Color))}catch(T){console.warn("Error restoring wire color:",T)}if(this.selectedWire1Entity)if(this.selectedWire1Entity!==n){const T=this.channelCalculation.calculateWireToWireDistance(this.selectedWire1Data,i,this.selectedWire1Phase,l);this.channelCalculation.drawWireToWireDistance(T),e&&e(T),this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=G.A相,this.originalWire1Color=null}else this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=G.A相,this.originalWire1Color=null;else if(this.selectedWire1Entity=n,this.selectedWire1Data=i,this.selectedWire1Phase=l,n.polyline&&n.polyline.material){const T=n.polyline.material;T instanceof f.Color?this.originalWire1Color=T.toCssColorString():this.originalWire1Color="#ffffff",n.polyline.material=f.Color.YELLOW}}}},f.ScreenSpaceEventType.LEFT_CLICK),window.wireToWireHandler=t}disableWireToWireMeasurement(){if(this.selectedWire1Entity&&this.originalWire1Color)try{this.selectedWire1Entity.polyline&&(this.selectedWire1Entity.polyline.material=f.Color.fromCssColorString(this.originalWire1Color))}catch(s){console.warn("Error restoring wire color:",s)}this.selectedWire1Entity=null,this.selectedWire1Data=[],this.selectedWire1Phase=G.A相,this.originalWire1Color=null;const e=window.wireToWireHandler;e&&(e.destroy(),window.wireToWireHandler=null)}clearWireToWireMeasurementResults(){if(this.channelCalculation){const e=this.channelCalculation.entityCollectionplotting;if(e){const s=[];e.values.forEach(r=>{r.name&&r.name.startsWith("线间距离")&&s.push(r)}),s.forEach(r=>{try{e.remove(r)}catch(t){console.warn("Error removing wire to wire measurement entity:",t)}})}}}}class Hs{constructor(){w(this,"id","");w(this,"name","");w(this,"towerFZinfo","");w(this,"towerDisFile","");w(this,"stressFileContent","");w(this,"streesistrue",0);w(this,"TowerMemberColor","#FFFFFF");w(this,"TowerMembersWidth",2);w(this,"Longitude",0);w(this,"Latitude",0);w(this,"Altitude",0);w(this,"RollX",0);w(this,"RollY",90);w(this,"RollZ",0)}}function Os(h){debugger;const e=h.split(`
5
3
  `),s=[],r=[],t=/^\s*(\d+)\s+([\d.-]+)\s+([\d.-]+)\s+([\d.-]+)\s+(-?\d+)/,a=/^\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:#|$)/;for(const n of e){const W=n.trim();if(!W)continue;const u=W.match(t);if(u){s.push({id:parseInt(u[1]),x:parseFloat(u[2]),y:parseFloat(u[3]),z:parseFloat(u[4]),flag:parseInt(u[5])});continue}const c=W.match(a);c&&r.push({from:parseInt(c[1]),to:parseInt(c[2]),type:parseInt(c[3])})}return{TowerNodes:s,connections:r}}function Ns(h){const e=h.split(`
6
4
  `),s=[];for(const r of e){if(!r.trim())continue;const t=r.trim().split(/\s+/).filter(W=>W!==""),a=parseInt(t[0]);if(isNaN(a))continue;const n=[];for(let W=1;W<t.length;W+=3){const u=parseFloat(t[W]),c=parseFloat(t[W+1]),i=parseFloat(t[W+2]);if(!isNaN(u)&&!isNaN(c)&&!isNaN(i)){const l=Math.floor((W-1)/3)+1;n.push({timeStep:l,x:u,y:c,z:i})}}s.push({nodeId:a,displacements:n})}return s}function ye(h){const e={};return h.forEach(s=>{s.displacements.forEach(r=>{e[r.timeStep]||(e[r.timeStep]=[]),e[r.timeStep].push({nodeId:s.nodeId,...r})})}),e}function Gs(h){const e=h.split(`
7
- `),s=[];for(const t of e){if(!t.trim())continue;const a=t.match(/^\s*(\d+-\s*\d+)\s+((?:\d+\.\d+\s*)+)/);if(a){const n=a[1].replace(/\s+/g,""),W=a[2].trim().split(/\s+/).map(Number);s.push({elementId:n,stressRatios:W})}}const r=[];if(s.length>0){const t=s[0].stressRatios.length;for(let a=0;a<t;a++){const n={timeIndex:a,elements:[]};for(const W of s){let u;const c=W.stressRatios[a];c>1?u=V.Color.RED:c>.95&&c<=1?u=V.Color.PINK:c>.85&&c<=.95?u=V.Color.YELLOW:c>.7&&c<=.85?u=V.Color.GREEN:u=V.Color.BLUE,n.elements.push({elementId:W.elementId,stressRatio:c,ylbColor:u})}r.push(n)}}return{byElement:s,byTime:r}}class Be{constructor(e){w(this,"viewer");w(this,"lines",[]);this.viewer=e}addLine(e,s){const r=De(this.viewer,e,s);return this.lines.push(r),r}removeAll(){this.lines.forEach(e=>this.viewer.entities.remove(e)),this.lines=[]}}var Pe={exports:{}};(function(h,e){(function(s,r){r()})(It,function(){function s(c,i){return typeof i>"u"?i={autoBom:!1}:typeof i!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,i,l){var T=new XMLHttpRequest;T.open("GET",c),T.responseType="blob",T.onload=function(){u(T.response,i,l)},T.onerror=function(){console.error("could not download file")},T.send()}function t(c){var i=new XMLHttpRequest;i.open("HEAD",c,!1);try{i.send()}catch{}return 200<=i.status&&299>=i.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(i)}}var n=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof It=="object"&&It.global===It?It:void 0,W=n.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=n.saveAs||(typeof window!="object"||window!==n?function(){}:"download"in HTMLAnchorElement.prototype&&!W?function(c,i,l){var T=n.URL||n.webkitURL,p=document.createElement("a");i=i||c.name||"download",p.download=i,p.rel="noopener",typeof c=="string"?(p.href=c,p.origin===location.origin?a(p):t(p.href)?r(c,i,l):a(p,p.target="_blank")):(p.href=T.createObjectURL(c),setTimeout(function(){T.revokeObjectURL(p.href)},4e4),setTimeout(function(){a(p)},0))}:"msSaveOrOpenBlob"in navigator?function(c,i,l){if(i=i||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(s(c,l),i);else if(t(c))r(c,i,l);else{var T=document.createElement("a");T.href=c,T.target="_blank",setTimeout(function(){a(T)})}}:function(c,i,l,T){if(T=T||open("","_blank"),T&&(T.document.title=T.document.body.innerText="downloading..."),typeof c=="string")return r(c,i,l);var p=c.type==="application/octet-stream",o=/constructor/i.test(n.HTMLElement)||n.safari,A=/CriOS\/[\d]+/.test(navigator.userAgent);if((A||p&&o||W)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var m=g.result;m=A?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),T?T.location.href=m:location=m,T=null},g.readAsDataURL(c)}else{var y=n.URL||n.webkitURL,L=y.createObjectURL(c);T?T.location=L:location.href=L,T=null,setTimeout(function(){y.revokeObjectURL(L)},4e4)}});n.saveAs=u.saveAs=u,h.exports=u})})(Pe);var jt=Pe.exports;const ve=require("shp-write");class zs{constructor(e,s,r){w(this,"towerNodes",[]);w(this,"connections",[]);w(this,"towerFZS");this.towerNodes=e,this.connections=s,this.towerFZS=r}async exportTowerToSHP(){try{const e=await this.generatePointFeatures(),s=await this.generateLineFeatures();await this.generateSHPFiles(e,s),console.log("SHP文件导出成功")}catch(e){console.error("导出SHP文件失败:",e)}}async generatePointFeatures(){const e=[],s=new f.HeadingPitchRoll(f.Math.toRadians(this.towerFZS.RollX),this.towerFZS.RollY,this.towerFZS.RollZ),r=f.Cartesian3.fromDegrees(this.towerFZS.Longitude,this.towerFZS.Latitude,this.towerFZS.Altitude);for(const t of this.towerNodes){const a=new f.Cartesian3(t.x,t.y,t.z),n=this.getPositionByHprAndOffset(r,a,s),W=f.Ellipsoid.WGS84.cartesianToCartographic(n),u=f.Math.toDegrees(W.longitude),c=f.Math.toDegrees(W.latitude),i=W.height,l={type:"Feature",geometry:{type:"Point",coordinates:[u,c]},properties:{id:t.id,node_id:t.id,x:t.x,y:t.y,z:t.z,longitude:u,latitude:c,height:i,elevation:i,type:"tower_node"}};e.push(l)}return e}async generateLineFeatures(){const e=[],s=new f.HeadingPitchRoll(f.Math.toRadians(this.towerFZS.RollX),this.towerFZS.RollY,this.towerFZS.RollZ),r=f.Cartesian3.fromDegrees(this.towerFZS.Longitude,this.towerFZS.Latitude,this.towerFZS.Altitude);for(const t of this.connections){const a=this.towerNodes.find(B=>B.id===t.from),n=this.towerNodes.find(B=>B.id===t.to);if(!a||!n)continue;const W=new f.Cartesian3(a.x,a.y,a.z),u=new f.Cartesian3(n.x,n.y,n.z),c=this.getPositionByHprAndOffset(r,W,s),i=this.getPositionByHprAndOffset(r,u,s),l=f.Ellipsoid.WGS84.cartesianToCartographic(c),T=f.Ellipsoid.WGS84.cartesianToCartographic(i),p=f.Math.toDegrees(l.longitude),o=f.Math.toDegrees(l.latitude),A=l.height,g=f.Math.toDegrees(T.longitude),y=f.Math.toDegrees(T.latitude),L=T.height,m={type:"Feature",geometry:{type:"LineString",coordinates:[[p,o],[g,y]]},properties:{id:`${t.from}-${t.to}`,from_node:t.from,to_node:t.to,from_height:A,to_height:L,avg_height:(A+L)/2,length:this.calculateDistance(c,i),type:"tower_member",width:this.towerFZS.TowerMembersWidth,from_longitude:p,from_latitude:o,to_longitude:g,to_latitude:y}};e.push(m)}return e}async generateSHPFiles(e,s){try{if(e.length>0){const r={type:"FeatureCollection",features:e},t=ve.point(r);this.downloadSHPFiles(t,"tower_nodes")}if(s.length>0){const r={type:"FeatureCollection",features:s},t=ve.line(r);this.downloadSHPFiles(t,"tower_members")}}catch(r){console.error("生成SHP文件时出错:",r),await this.alternativeExport(e,s)}}downloadSHPFiles(e,s){const r=new Blob([e],{type:"application/zip"});jt.saveAs(r,`${s}.zip`)}async alternativeExport(e,s){if(console.log("使用备用方案导出为GeoJSON格式"),e.length>0){const r={type:"FeatureCollection",features:e};this.downloadJSON(r,"tower_nodes.geojson")}if(s.length>0){const r={type:"FeatureCollection",features:s};this.downloadJSON(r,"tower_members.geojson")}}downloadJSON(e,s){const r=new Blob([JSON.stringify(e,null,2)],{type:"application/json"});jt.saveAs(r,s)}calculateDistance(e,s){return f.Cartesian3.distance(e,s)}getPositionByHprAndOffset(e,s,r){const t=f.Transforms.headingPitchRollToFixedFrame(e,r);return f.Matrix4.multiplyByPoint(t,s,new f.Cartesian3)}}class Ks{static async exportToCSV(e,s,r){const t=this.exportNodesToCSV(e,r);this.downloadCSV(t,"tower_nodes.csv");const a=this.exportConnectionsToCSV(s,e,r);this.downloadCSV(a,"tower_connections.csv")}static exportNodesToCSV(e,s){let r=`ID,X,Y,Z,Longitude,Latitude,Height
5
+ `),s=[];for(const t of e){if(!t.trim())continue;const a=t.match(/^\s*(\d+-\s*\d+)\s+((?:\d+\.\d+\s*)+)/);if(a){const n=a[1].replace(/\s+/g,""),W=a[2].trim().split(/\s+/).map(Number);s.push({elementId:n,stressRatios:W})}}const r=[];if(s.length>0){const t=s[0].stressRatios.length;for(let a=0;a<t;a++){const n={timeIndex:a,elements:[]};for(const W of s){let u;const c=W.stressRatios[a];c>1?u=Y.Color.RED:c>.95&&c<=1?u=Y.Color.PINK:c>.85&&c<=.95?u=Y.Color.YELLOW:c>.7&&c<=.85?u=Y.Color.GREEN:u=Y.Color.BLUE,n.elements.push({elementId:W.elementId,stressRatio:c,ylbColor:u})}r.push(n)}}return{byElement:s,byTime:r}}class Be{constructor(e){w(this,"viewer");w(this,"lines",[]);this.viewer=e}addLine(e,s){const r=De(this.viewer,e,s);return this.lines.push(r),r}removeAll(){this.lines.forEach(e=>this.viewer.entities.remove(e)),this.lines=[]}}var Pe={exports:{}};(function(h,e){(function(s,r){r()})(gt,function(){function s(c,i){return typeof i>"u"?i={autoBom:!1}:typeof i!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,i,l){var T=new XMLHttpRequest;T.open("GET",c),T.responseType="blob",T.onload=function(){u(T.response,i,l)},T.onerror=function(){console.error("could not download file")},T.send()}function t(c){var i=new XMLHttpRequest;i.open("HEAD",c,!1);try{i.send()}catch{}return 200<=i.status&&299>=i.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(i)}}var n=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof gt=="object"&&gt.global===gt?gt:void 0,W=n.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=n.saveAs||(typeof window!="object"||window!==n?function(){}:"download"in HTMLAnchorElement.prototype&&!W?function(c,i,l){var T=n.URL||n.webkitURL,p=document.createElement("a");i=i||c.name||"download",p.download=i,p.rel="noopener",typeof c=="string"?(p.href=c,p.origin===location.origin?a(p):t(p.href)?r(c,i,l):a(p,p.target="_blank")):(p.href=T.createObjectURL(c),setTimeout(function(){T.revokeObjectURL(p.href)},4e4),setTimeout(function(){a(p)},0))}:"msSaveOrOpenBlob"in navigator?function(c,i,l){if(i=i||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(s(c,l),i);else if(t(c))r(c,i,l);else{var T=document.createElement("a");T.href=c,T.target="_blank",setTimeout(function(){a(T)})}}:function(c,i,l,T){if(T=T||open("","_blank"),T&&(T.document.title=T.document.body.innerText="downloading..."),typeof c=="string")return r(c,i,l);var p=c.type==="application/octet-stream",o=/constructor/i.test(n.HTMLElement)||n.safari,A=/CriOS\/[\d]+/.test(navigator.userAgent);if((A||p&&o||W)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var m=g.result;m=A?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),T?T.location.href=m:location=m,T=null},g.readAsDataURL(c)}else{var y=n.URL||n.webkitURL,L=y.createObjectURL(c);T?T.location=L:location.href=L,T=null,setTimeout(function(){y.revokeObjectURL(L)},4e4)}});n.saveAs=u.saveAs=u,h.exports=u})})(Pe);var jt=Pe.exports;const ve=require("shp-write");class zs{constructor(e,s,r){w(this,"towerNodes",[]);w(this,"connections",[]);w(this,"towerFZS");this.towerNodes=e,this.connections=s,this.towerFZS=r}async exportTowerToSHP(){try{const e=await this.generatePointFeatures(),s=await this.generateLineFeatures();await this.generateSHPFiles(e,s),console.log("SHP文件导出成功")}catch(e){console.error("导出SHP文件失败:",e)}}async generatePointFeatures(){const e=[],s=new f.HeadingPitchRoll(f.Math.toRadians(this.towerFZS.RollX),this.towerFZS.RollY,this.towerFZS.RollZ),r=f.Cartesian3.fromDegrees(this.towerFZS.Longitude,this.towerFZS.Latitude,this.towerFZS.Altitude);for(const t of this.towerNodes){const a=new f.Cartesian3(t.x,t.y,t.z),n=this.getPositionByHprAndOffset(r,a,s),W=f.Ellipsoid.WGS84.cartesianToCartographic(n),u=f.Math.toDegrees(W.longitude),c=f.Math.toDegrees(W.latitude),i=W.height,l={type:"Feature",geometry:{type:"Point",coordinates:[u,c]},properties:{id:t.id,node_id:t.id,x:t.x,y:t.y,z:t.z,longitude:u,latitude:c,height:i,elevation:i,type:"tower_node"}};e.push(l)}return e}async generateLineFeatures(){const e=[],s=new f.HeadingPitchRoll(f.Math.toRadians(this.towerFZS.RollX),this.towerFZS.RollY,this.towerFZS.RollZ),r=f.Cartesian3.fromDegrees(this.towerFZS.Longitude,this.towerFZS.Latitude,this.towerFZS.Altitude);for(const t of this.connections){const a=this.towerNodes.find(B=>B.id===t.from),n=this.towerNodes.find(B=>B.id===t.to);if(!a||!n)continue;const W=new f.Cartesian3(a.x,a.y,a.z),u=new f.Cartesian3(n.x,n.y,n.z),c=this.getPositionByHprAndOffset(r,W,s),i=this.getPositionByHprAndOffset(r,u,s),l=f.Ellipsoid.WGS84.cartesianToCartographic(c),T=f.Ellipsoid.WGS84.cartesianToCartographic(i),p=f.Math.toDegrees(l.longitude),o=f.Math.toDegrees(l.latitude),A=l.height,g=f.Math.toDegrees(T.longitude),y=f.Math.toDegrees(T.latitude),L=T.height,m={type:"Feature",geometry:{type:"LineString",coordinates:[[p,o],[g,y]]},properties:{id:`${t.from}-${t.to}`,from_node:t.from,to_node:t.to,from_height:A,to_height:L,avg_height:(A+L)/2,length:this.calculateDistance(c,i),type:"tower_member",width:this.towerFZS.TowerMembersWidth,from_longitude:p,from_latitude:o,to_longitude:g,to_latitude:y}};e.push(m)}return e}async generateSHPFiles(e,s){try{if(e.length>0){const r={type:"FeatureCollection",features:e},t=ve.point(r);this.downloadSHPFiles(t,"tower_nodes")}if(s.length>0){const r={type:"FeatureCollection",features:s},t=ve.line(r);this.downloadSHPFiles(t,"tower_members")}}catch(r){console.error("生成SHP文件时出错:",r),await this.alternativeExport(e,s)}}downloadSHPFiles(e,s){const r=new Blob([e],{type:"application/zip"});jt.saveAs(r,`${s}.zip`)}async alternativeExport(e,s){if(console.log("使用备用方案导出为GeoJSON格式"),e.length>0){const r={type:"FeatureCollection",features:e};this.downloadJSON(r,"tower_nodes.geojson")}if(s.length>0){const r={type:"FeatureCollection",features:s};this.downloadJSON(r,"tower_members.geojson")}}downloadJSON(e,s){const r=new Blob([JSON.stringify(e,null,2)],{type:"application/json"});jt.saveAs(r,s)}calculateDistance(e,s){return f.Cartesian3.distance(e,s)}getPositionByHprAndOffset(e,s,r){const t=f.Transforms.headingPitchRollToFixedFrame(e,r);return f.Matrix4.multiplyByPoint(t,s,new f.Cartesian3)}}class Ks{static async exportToCSV(e,s,r){const t=this.exportNodesToCSV(e,r);this.downloadCSV(t,"tower_nodes.csv");const a=this.exportConnectionsToCSV(s,e,r);this.downloadCSV(a,"tower_connections.csv")}static exportNodesToCSV(e,s){let r=`ID,X,Y,Z,Longitude,Latitude,Height
8
6
  `;const t=new f.HeadingPitchRoll(f.Math.toRadians(s.RollX),s.RollY,s.RollZ),a=f.Cartesian3.fromDegrees(s.Longitude,s.Latitude,s.Altitude);return e.forEach(n=>{const W=new f.Cartesian3(n.x,n.y,n.z),u=this.getPositionByHprAndOffset(a,W,t),c=f.Ellipsoid.WGS84.cartesianToCartographic(u),i=f.Math.toDegrees(c.longitude),l=f.Math.toDegrees(c.latitude),T=c.height;r+=`${n.id},${n.x},${n.y},${n.z},${i},${l},${T}
9
7
  `}),r}static exportConnectionsToCSV(e,s,r){let t=`FromNode,ToNode,FromX,FromY,FromZ,ToX,ToY,ToZ,Length
10
8
  `;const a=new f.HeadingPitchRoll(f.Math.toRadians(r.RollX),r.RollY,r.RollZ),n=f.Cartesian3.fromDegrees(r.Longitude,r.Latitude,r.Altitude);return e.forEach(W=>{const u=s.find(A=>A.id===W.from),c=s.find(A=>A.id===W.to);if(!u||!c)return;const i=new f.Cartesian3(u.x,u.y,u.z),l=new f.Cartesian3(c.x,c.y,c.z),T=this.getPositionByHprAndOffset(n,i,a),p=this.getPositionByHprAndOffset(n,l,a),o=f.Cartesian3.distance(T,p);t+=`${W.from},${W.to},${u.x},${u.y},${u.z},${c.x},${c.y},${c.z},${o}
11
- `}),t}static downloadCSV(e,s){const r=new Blob([e],{type:"text/csv;charset=utf-8;"});jt.saveAs(r,s)}static getPositionByHprAndOffset(e,s,r){const t=f.Transforms.headingPitchRollToFixedFrame(e,r);return f.Matrix4.multiplyByPoint(t,s,new f.Cartesian3)}}class qs{constructor(e,s,r){w(this,"viewer");w(this,"TowerFZS");w(this,"Keym","");w(this,"dataSource2");w(this,"entityCollection2");w(this,"pointEntities",[]);w(this,"TowerLineManager");w(this,"TowerNodes",[]);w(this,"connections",[]);w(this,"displacementData",[]);w(this,"byTimes",[]);w(this,"_animationInterval",null);this.Keym=r,this.viewer=e,this.TowerFZS=s,this.dataSource2=new f.CustomDataSource(this.TowerFZS.id),this.entityCollection2=this.dataSource2.entities,this.TowerLineManager=new Be(this.viewer)}initSHPExporter(){}loadfile(){if(this.Keym!="OW_JPS_EEngin_001")return;const{TowerNodes:e,connections:s}=Os(this.TowerFZS.towerFZinfo);this.TowerNodes=e,this.connections=s,this.displacementData=Ns(this.TowerFZS.towerDisFile);const{byTime:r}=Gs(this.TowerFZS.stressFileContent);this.byTimes=r;debugger}loadFZTower(){if(this.Keym!="OW_JPS_EEngin_001")return;let e=new f.HeadingPitchRoll(f.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const s=f.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(r=>{const t=this.TowerNodes.find(l=>l.id===r.from),a=this.TowerNodes.find(l=>l.id===r.to),n=[],W=new f.Cartesian3(t==null?void 0:t.x,t==null?void 0:t.y,t==null?void 0:t.z);n.push(P(s,W,e));const u=vt(this.viewer,n[0],(t==null?void 0:t.id)+"",{pointColor:f.Color.RED,labelColor:f.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(u);const c=new f.Cartesian3(a==null?void 0:a.x,a==null?void 0:a.y,a==null?void 0:a.z);n.push(P(s,c,e));const i=vt(this.viewer,n[1],(t==null?void 0:t.id)+"",{pointColor:f.Color.RED,labelColor:f.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(i),this.TowerLineManager.addLine(n)}),this.initSHPExporter()}async exportToSHP(){await new zs(this.TowerNodes,this.connections,this.TowerFZS).exportTowerToSHP()}async exportToCSV(){await Ks.exportToCSV(this.TowerNodes,this.connections,this.TowerFZS)}loadFZDISTower(e){if(this.Keym!=="OW_JPS_EEngin_001")return;const r=ye(this.displacementData)[e],t=this.byTimes.find(W=>W.timeIndex===e);debugger;if(!r){console.warn(`未找到时间步 ${e} 的位移数据`);return}const a=new f.HeadingPitchRoll(f.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ),n=f.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(W=>{const u=this.TowerNodes.find(v=>v.id===W.from),c=this.TowerNodes.find(v=>v.id===W.to);if(!u||!c){console.warn(`找不到连接 ${W.from}->${W.to} 的节点`);return}debugger;const i=r.find(v=>v.nodeId===W.from),l=r.find(v=>v.nodeId===W.to);if(!i||!l){console.warn(`找不到连接 ${W.from}->${W.to} 的位移数据`);return}const T=new f.Cartesian3(u.x-i.x,u.y-i.y,u.z-i.z),p=new f.Cartesian3(c.x-l.x,c.y-l.y,c.z-l.z),o=P(n,T,a),A=vt(this.viewer,o,W.from+"",{pointColor:f.Color.RED,labelColor:f.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(A);const g=P(n,p,a),y=vt(this.viewer,g,W.to+"",{pointColor:f.Color.RED,labelColor:f.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(y);const L=[o,g],m=W.from+"-"+W.to,B=t==null?void 0:t.elements.find(v=>v.elementId===m);debugger;this.TowerLineManager.addLine(L,{color:B==null?void 0:B.ylbColor,width:3,clampToGround:!1,zIndex:0,dashed:!1,dashLength:10})})}loadFZDISTower1(e){if(this.Keym!="OW_JPS_EEngin_001")return;const s=ye(this.displacementData);let r=new f.HeadingPitchRoll(f.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const t=f.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(a=>{const n=this.TowerNodes.find(p=>p.id===a.from),W=s[e].find(p=>p.nodeId===a.from),u=this.TowerNodes.find(p=>p.id===a.to),c=s[e].find(p=>p.nodeId===a.to),i=[],l=new f.Cartesian3(n.x-W.x,n.y-W.y,n.z-W.z);i.push(P(t,l,r));const T=new f.Cartesian3(u.x-c.x,u.y-c.y,u.z-c.z);i.push(P(t,T,r));debugger;this.entityCollection2.add(C(i,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 e=1;const s=this.displacementData.length;this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null);const r=()=>{if(this.viewer.dataSources.contains(this.dataSource2)&&this.viewer.dataSources.remove(this.dataSource2,!0),e>s){e=1;return}this.dataSource2=new f.CustomDataSource("fztower"),this.entityCollection2=this.dataSource2.entities;try{this.loadFZDISTower(e),this.loadFZModel(),console.log(`正在显示位移帧: ${e}/${s}`),e++}catch(t){console.error("加载位移帧时出错:",t),this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}};r(),this._animationInterval=setInterval(r,300)}stopDisplacementAnimation(){this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}toggleAnimation(e){e?this.stopDisplacementAnimation():this.loadAllFZDisTower()}loadFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.entities.show)}setFZModelVisible(e){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=e)}RemoveFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.TowerLineManager.removeAll(),this.pointEntities.forEach(e=>this.viewer.entities.remove(e)),this.pointEntities.length=0)}}Z.DistanceRuleConfig=Gt,Z.GUAPoint=hs,Z.InsulatorInfo=ns,Z.InsulatorType=K,Z.LineManager=Be,Z.LineNum=mt,Z.LineType=Ae,Z.MeasurementResult=rs,Z.OWEEgineFZManager=qs,Z.OWEEgineManager=Vs,Z.PhaseSType=Q,Z.TowerFZInfo=Hs,Z.TowerInfo=os,Z.TowerLineInfo=ss,Z.TowerType=rt,Z.WairnumType=I,Z.corFeatureType=is,Z.corType=U,Z.drawModel=$t,Z.primaryDistanceType=q,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
9
+ `}),t}static downloadCSV(e,s){const r=new Blob([e],{type:"text/csv;charset=utf-8;"});jt.saveAs(r,s)}static getPositionByHprAndOffset(e,s,r){const t=f.Transforms.headingPitchRollToFixedFrame(e,r);return f.Matrix4.multiplyByPoint(t,s,new f.Cartesian3)}}class qs{constructor(e,s,r){w(this,"viewer");w(this,"TowerFZS");w(this,"Keym","");w(this,"dataSource2");w(this,"entityCollection2");w(this,"pointEntities",[]);w(this,"TowerLineManager");w(this,"TowerNodes",[]);w(this,"connections",[]);w(this,"displacementData",[]);w(this,"byTimes",[]);w(this,"_animationInterval",null);this.Keym=r,this.viewer=e,this.TowerFZS=s,this.dataSource2=new f.CustomDataSource(this.TowerFZS.id),this.entityCollection2=this.dataSource2.entities,this.TowerLineManager=new Be(this.viewer)}initSHPExporter(){}loadfile(){if(this.Keym!="OW_JPS_EEngin_001")return;const{TowerNodes:e,connections:s}=Os(this.TowerFZS.towerFZinfo);this.TowerNodes=e,this.connections=s,this.displacementData=Ns(this.TowerFZS.towerDisFile);const{byTime:r}=Gs(this.TowerFZS.stressFileContent);this.byTimes=r;debugger}loadFZTower(){if(this.Keym!="OW_JPS_EEngin_001")return;let e=new f.HeadingPitchRoll(f.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const s=f.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(r=>{const t=this.TowerNodes.find(l=>l.id===r.from),a=this.TowerNodes.find(l=>l.id===r.to),n=[],W=new f.Cartesian3(t==null?void 0:t.x,t==null?void 0:t.y,t==null?void 0:t.z);n.push(P(s,W,e));const u=Pt(this.viewer,n[0],(t==null?void 0:t.id)+"",{pointColor:f.Color.RED,labelColor:f.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(u);const c=new f.Cartesian3(a==null?void 0:a.x,a==null?void 0:a.y,a==null?void 0:a.z);n.push(P(s,c,e));const i=Pt(this.viewer,n[1],(t==null?void 0:t.id)+"",{pointColor:f.Color.RED,labelColor:f.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(i),this.TowerLineManager.addLine(n)}),this.initSHPExporter()}async exportToSHP(){await new zs(this.TowerNodes,this.connections,this.TowerFZS).exportTowerToSHP()}async exportToCSV(){await Ks.exportToCSV(this.TowerNodes,this.connections,this.TowerFZS)}loadFZDISTower(e){if(this.Keym!=="OW_JPS_EEngin_001")return;const r=ye(this.displacementData)[e],t=this.byTimes.find(W=>W.timeIndex===e);debugger;if(!r){console.warn(`未找到时间步 ${e} 的位移数据`);return}const a=new f.HeadingPitchRoll(f.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ),n=f.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(W=>{const u=this.TowerNodes.find(v=>v.id===W.from),c=this.TowerNodes.find(v=>v.id===W.to);if(!u||!c){console.warn(`找不到连接 ${W.from}->${W.to} 的节点`);return}debugger;const i=r.find(v=>v.nodeId===W.from),l=r.find(v=>v.nodeId===W.to);if(!i||!l){console.warn(`找不到连接 ${W.from}->${W.to} 的位移数据`);return}const T=new f.Cartesian3(u.x-i.x,u.y-i.y,u.z-i.z),p=new f.Cartesian3(c.x-l.x,c.y-l.y,c.z-l.z),o=P(n,T,a),A=Pt(this.viewer,o,W.from+"",{pointColor:f.Color.RED,labelColor:f.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(A);const g=P(n,p,a),y=Pt(this.viewer,g,W.to+"",{pointColor:f.Color.RED,labelColor:f.Color.GOLD,fontSize:18,pixelOffset:[0,-30]});this.pointEntities.push(y);const L=[o,g],m=W.from+"-"+W.to,B=t==null?void 0:t.elements.find(v=>v.elementId===m);debugger;this.TowerLineManager.addLine(L,{color:B==null?void 0:B.ylbColor,width:3,clampToGround:!1,zIndex:0,dashed:!1,dashLength:10})})}loadFZDISTower1(e){if(this.Keym!="OW_JPS_EEngin_001")return;const s=ye(this.displacementData);let r=new f.HeadingPitchRoll(f.Math.toRadians(this.TowerFZS.RollX),this.TowerFZS.RollY,this.TowerFZS.RollZ);const t=f.Cartesian3.fromDegrees(this.TowerFZS.Longitude,this.TowerFZS.Latitude,this.TowerFZS.Altitude);this.connections.forEach(a=>{const n=this.TowerNodes.find(p=>p.id===a.from),W=s[e].find(p=>p.nodeId===a.from),u=this.TowerNodes.find(p=>p.id===a.to),c=s[e].find(p=>p.nodeId===a.to),i=[],l=new f.Cartesian3(n.x-W.x,n.y-W.y,n.z-W.z);i.push(P(t,l,r));const T=new f.Cartesian3(u.x-c.x,u.y-c.y,u.z-c.z);i.push(P(t,T,r));debugger;this.entityCollection2.add(C(i,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 e=1;const s=this.displacementData.length;this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null);const r=()=>{if(this.viewer.dataSources.contains(this.dataSource2)&&this.viewer.dataSources.remove(this.dataSource2,!0),e>s){e=1;return}this.dataSource2=new f.CustomDataSource("fztower"),this.entityCollection2=this.dataSource2.entities;try{this.loadFZDISTower(e),this.loadFZModel(),console.log(`正在显示位移帧: ${e}/${s}`),e++}catch(t){console.error("加载位移帧时出错:",t),this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}};r(),this._animationInterval=setInterval(r,300)}stopDisplacementAnimation(){this._animationInterval&&(clearInterval(this._animationInterval),this._animationInterval=null)}toggleAnimation(e){e?this.stopDisplacementAnimation():this.loadAllFZDisTower()}loadFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.entities.show)}setFZModelVisible(e){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=e)}RemoveFZModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.TowerLineManager.removeAll(),this.pointEntities.forEach(e=>this.viewer.entities.remove(e)),this.pointEntities.length=0)}}Z.DistanceRuleConfig=Gt,Z.GUAPoint=hs,Z.InsulatorInfo=ns,Z.InsulatorType=q,Z.LineManager=Be,Z.LineNum=It,Z.LineType=Ae,Z.MeasurementResult=rs,Z.OWEEgineFZManager=qs,Z.OWEEgineManager=Ys,Z.PhaseSType=x,Z.TowerFZInfo=Hs,Z.TowerInfo=os,Z.TowerLineInfo=ss,Z.TowerType=rt,Z.WairnumType=I,Z.corFeatureType=is,Z.corType=J,Z.drawModel=Zt,Z.primaryDistanceType=U,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});