Example #1
0
        private void btnTestDrawing_Click(object sender, EventArgs e)
        {
            lblChooseDisplay.Visible = true;
            cbIsPosition.Visible     = true;
            cbIsTorque.Visible       = true;

            vSti = new Stimulations(v.pictureBox1.Width, v.pictureBox1.Height, 1);



            dp1 = new drawProcess(this.pictureBox1.Width, this.pictureBox1.Height, Color.DarkCyan);

            timer2.Start();
            //while (!ifStop)
            //{
            //    Application.DoEvents();
            //    newStart = timeGetTime();

            //    if (newStart - start >= 100)
            //    {


            //        if (isOpenCircle)
            //        {
            //            degree += degree;
            //        }
            //        float torqueVoltageValue;
            //        float troque = float.Parse(pc.AnalogInput(1, out torqueVoltageValue));
            //        troque = troque / 100;
            //        troque_trans = (troque - 2048) / 2048 * 80;


            //        debug mode
            //        troque_trans = 10;

            //        count++;
            //        start = newStart;

            //        Wert = p1_c1 * p1_c2 * trq + p1_c3 * p1_c4 * p1_bias_  'p1_c1=0/1 (open closed); p1_c2=+1/-1 (norm/inverted); p1_c3=0/1 (p1_bias on/off); p1_c4=+1/-1 (cw/ccw)
            //        dPsi1 = p1_k * Wert * dt_
            //        ArenaPos1 = ArenaPos1 + dPsi1


            //        float k = float.Parse(tbKValue.Text);
            //        degree += troque_trans * k * 0.01f;
            //        this.lblPositionValue.Text = degree.ToString();
            //        this.lblTorqueValue.Text = troque.ToString();
            //        this.lblTroqueTransValue.Text = troque_trans.ToString();

            //        if (degree > 180)
            //        {
            //            degree = degree - 360;
            //        }
            //        if (degree < -180)
            //        {
            //            degree = degree + 360;
            //        }
            //        v.pictureBox1.CreateGraphics().DrawImage(vSti.DrawV_Test(degree), 0, 0);

            //        lpf1.Add(degree);
            //        lpf2.Add(troque_trans);

            //        lpf1.Add(180);
            //        lpf2.Add(10);
            //        if (lpf1.Count == 400)
            //        {
            //            lpf1.Remove(lpf1[0]);
            //        }

            //        if (lpf2.Count == 400)
            //        {
            //            lpf2.Remove(lpf2[0]);
            //        }

            //        this.pictureBox1.CreateGraphics().DrawImage(dp1.drawSignalCurve(lpf1, lpf2), 0, 0);


            //    }

            //    if (count == 20000)
            //    {
            //        ifStop = true;
            //        break;
            //    }



            //}

            //this.pictureBox1.CreateGraphics().DrawImage(dp.drawTest(), 0, 0);
        }
Example #2
0
        private void btnRunPattern_Click(object sender, EventArgs e)
        {
            vSti = new Stimulations(v.pictureBox1.Width, v.pictureBox1.Height, 1);

            this.pbChoosedPattern.BackgroundImage = vSti.DrawV_Test(0);
        }