Beispiel #1
0
        private void btnStartSpill_Click(object sender, EventArgs e)
        {
            PP.myRun.Events.Clear();
            packet_counter = 0;

            RC_client.Arm();
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int  TotalNumEvents = 0;
            bool res            = true;

            gStopThis = false;
            PP.myRun.Events.Clear();
            res = res && RC_client.Arm();
            btnStopThis.Visible = true;
            gFake = true;
            for (int i = 0; i < 2000; i++)
            {
                PP.myRun.Events.Clear();
                packet_counter = 0;

                RC_client.Arm();
                for (int j = 0; j < 128; j++)
                {
                    Thread.Sleep(5);
                    RC_client.SoftwareTrig();
                    if (gStopThis)
                    {
                        i = 2001; btnStopThis.Visible = false; gFake = false;
                    }
                }


                lblDaqMessage2.Text = "fake spill started for spill # " + i.ToString() + " at " + DateTime.Now.TimeOfDay + "with " + TotalNumEvents;
                if (TotalNumEvents > 40000)
                {
                    i = 2001; btnStopThis.Visible = false;
                }
                Application.DoEvents();
                for (int j = 0; j < 50; j++)
                {
                    Thread.Sleep(5);
                    if (gStopThis)
                    {
                        i = 2001; btnStopThis.Visible = false; gFake = false;
                    }
                }

                btnStopSpill_Click(null, null);
                lblDaqMessage2.Text = "fake spill ended for spill # " + i.ToString() + " at " + DateTime.Now.TimeOfDay + " with " + PP.myRun.Events.Count;
                TotalNumEvents     += PP.myRun.Events.Count;
                Thread.Sleep(1000);
                Application.DoEvents();
                for (int j = 0; j < 10; j++)
                {
                    Thread.Sleep(5);
                    Application.DoEvents();
                    lblDaqMessage.Text = "waiting for " + (10 - j) * 5 / 1000;
                    if (gStopThis)
                    {
                        i = 2001; btnStopThis.Visible = false; gFake = false;
                    }
                }
            }
        }