Exemple #1
0
        static void LsTest(bool last)
        {
            int num = 360;

            float[] x  = new float[num];
            float[] y  = new float[num];
            float[] x1 = new float[num * 2];
            float[] z  = new float[num * 2];
            for (int i = 0; i < num; i++)
            {
                x[i]        = (float)((i - 180) * Math.PI / 180.0);
                x1[i]       = x[i];
                x1[i + num] = (float)(x[i] + 2 * Math.PI);
                y[i]        = (float)(Math.Sin(x[i]));
                z[i]        = (float)(Math.Cos(x[i]));
                z[i + num]  = z[i];
            }
            series a = new series(x, y);

            a.sColor = System.Drawing.Color.Red;
            series b = new series(x1, z);

            List <series> t = new List <series>();

            t.Add(a);
            t.Add(b);

            LongStripForm lsf = new LongStripForm();

            lsf.longStrip1.JudgeLine0Enable = true;
            lsf.longStrip1.JudgeLine0       = 0.5f;
            ///动态画图时,必须fixRange
            lsf.FigureInitial(t, true, new float[4] {
                x[0], x1[2 * num - 1], -1, 1
            });
            if (!last)
            {
                lsf.Show();
            }
            else
            {
                lsf.ShowDialog();
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num = 360;

            float[] tx = new float[num * 100];
            float[] ty = new float[num * 100];
            for (int i = 0; i < num; i++)
            {
                tx[i] = (float)((i - 180) * Math.PI / 180.0);
                ty[i] = (float)(Math.Sin(tx[i])) * 50 + 50;
            }
            LongStripForm ascanTest = new LongStripForm();

            ascanTest.FigureInitial(new List <series>()
            {
                new series(tx, ty)
            }, false, new float[] { 0, 1, 0, 1 });
            ascanTest.Show();

            int k = 10;

            while (true)
            {
                for (int i = num; i < num + k; i++)
                {
                    tx[i] = (float)((i - 180) * Math.PI / 180.0);
                    ty[i] = (float)(Math.Sin(tx[i])) * 50 + 50;
                }
                num += k;
                //ascanTest.longStrip1.ima.rawData[0] = new series(tx, ty);
                ascanTest.longStrip1.ima.Refresh(true);
                ascanTest.longStrip1.Refresh();
                ascanTest.rulerBarH.Refresh();
                ascanTest.rulerBarV.Refresh();
                //ascanTest.Refresh();
                Application.DoEvents();
                Thread.Sleep(100);
            }
        }