internal void Draw(FarFieldC farField, string c1) { //int k1 = CurveNames.FirstOrDefault(x => x.Value == c1).Key; //int count = farField.Count; //for (int j = 0; j < count; j++) //{ // FarFieldElementC ffe = farField[j]; // //ListPointPairs[k1].Add(ffe.LocalTheta, ffe.Etotal); //} //AxisChange(); //Refresh(); }
public void Add(string title, FarFieldC farField, Aperture ap, string Component, string Type) { int count = farField.Count; double[] x = new double[count]; double[] y = new double[count]; double val = 0; for (int j = 0; j < count; j++) { if (Form1.Instance.radioButtonX1.Checked) { x[j] = farField[j].LocalTheta; } else { x[j] = farField[j].LocalPhi; } if (Type == "Модуль") { switch (Component) { case "Total": val = farField[j].Etotal; break; case "Theta": val = farField[j].EdirectMagnitude(ap); break; case "Phi": val = farField[j].EcrossMagnitude(ap); break; default: break; } } else { switch (Component) { case "Theta": val = farField[j].EdirectPhase(ap); break; case "Phi": val = farField[j].EcrossPhase(ap); break; default: break; } } y[j] = val; } //ListPointPairs.Add(new PointPairList(x, y)); PointPairList ppl = new PointPairList(x, y); //Random rnd = new Random(); Color color = FindUniqueColor(); Curves.Add(new GraphData(title, x, y, Component, Type, color)); //if (key != 0) //{ // int stop = 0; // CurveItem ci = myPane.CurveList.Find(v => v.Label.Text == CurveNames[key-1]); // Color b = ci.Color; // while ((a.R - b.R) * (a.R - b.R) + (a.G - b.G) * (a.G - b.G) + (a.B - b.B) * (a.B - b.B) < 0.25 * 3 * 255 * 255) // { // a = uniqueColors[rnd.Next(0, 57)]; // stop++; // if (stop > 100) // { // break; // } // } //} LineItem curve = myPane.AddCurve(title, ppl, color, SymbolType.None); curve.Line.Width = 2F; curve.Symbol.Size = 2F; AxisChange(); Refresh(); }