private void lswComponents_SelectedIndexChanged(object sender, EventArgs e) { if (this.currPInfo.Trajectory == null || this.currPInfo.Trajectory.PointList.Count <= 0) { return; } if (this.lswComponents.SelectedIndices.Count > 0) { TrajPoint p = this.currPInfo.Trajectory.PointsModified[this.lswComponents.SelectedIndices[0]]; if (p.Mid != null) { this.trajectoryChart1.ShowPoint(p.Mid); } } }
public Result Load() { Result res = Result.OK; this.PointList.Clear(); foreach (CompProperty compProperty in this.compList) { compProperty.GetPoints(CADImport.Instance.curLib); if (this.PointList.Count == 0) { if (compProperty.points.Count > 0) { PointD p = new PointD(); p.X = compProperty.points[0].point.X; p.Y = compProperty.points[0].point.Y; TrajPoint trPoint = new TrajPoint() { Desig = compProperty.Desig, Comp = compProperty.Comp, Mid = p, Rotation = compProperty.Rotation, LayOut = compProperty.LayOut, Weight = compProperty.points[0].Weight, IsWeight = compProperty.points[0].IsWeight, NumShots = compProperty.points[0].NunShots }; this.PointList.Add(trPoint); } } bool findFlag = false; foreach (GlueDot compP in compProperty.points) { findFlag = false; foreach (TrajPoint pL in this.PointList) { if ((compP.point == pL.Mid)) { findFlag = true; break; } } if (findFlag == false) { PointD p = new PointD(); p.X = compP.point.X; p.Y = compP.point.Y; TrajPoint trPoint = new TrajPoint() { Desig = compProperty.Desig, Comp = compProperty.Comp, Mid = p, Rotation = compProperty.Rotation, LayOut = compProperty.LayOut, Weight = compP.Weight, IsWeight = compP.IsWeight, NumShots = compP.NunShots }; this.PointList.Add(trPoint); } } } this.CurPoints = this.GetPts(); this.PointsModified.Clear(); this.PointsModified.AddRange(this.PointList); this.GetDistance(); return(res); }