public LayerView(IonControlPoint starticp, double beamMU, double MU_weight_ratio) { this.MU_weight_ratio = MU_weight_ratio; this.Energy = starticp.NominalBeamEnergy; this.SpotNo = starticp.FinalSpotList.Count(); this.TotalMU = starticp.FinalSpotList.Sum(s => s.Weight) * MU_weight_ratio; this.MaxMU = starticp.FinalSpotList.Max(s => s.Weight) * MU_weight_ratio; this.MinMU = starticp.FinalSpotList.Min(s => s.Weight) * MU_weight_ratio; this.MUpercent = this.TotalMU / beamMU * 100; this.Spots = starticp.FinalSpotList; this.xmax = Spots.Max(s => s.Position.x); this.xmin = Spots.Min(s => s.Position.x); this.ymax = Spots.Max(s => s.Position.y); this.ymin = Spots.Min(s => s.Position.y); }