Ejemplo n.º 1
0
        private void WriteData(ApproxCalc apc)
        {
            var data = apc.data[0];

            chart1.Series[0].Points.Clear();
            var pressures = new double[data.GetLength(0)];
            int serial    = 0;

            if (apc.pressure != null)
            {
                pressures = apc.pressure;
            }
            for (int i = 0; i < data.GetLength(0); i++)
            {
                if (apc.isdummy[i] | apc.iswall[i])
                {
                    chart1.Series[1].Points.AddXY(data[i, 0], data[i, 1]);
                }
                else
                {
                    chart1.Series[0].Points.AddXY(data[i, 0], data[i, 1]);
                    int cl = (int)(Math.Max(0, Math.Min(255, 128 * (pressures[i] + 0.5))));
                    chart1.Series[0].Points[serial].Color = Color.FromArgb(cl, 0, 0, 0);
                    serial++;
                }
            }
        }
Ejemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     apc = new ApproxCalc();
     WriteData(apc);
 }