void OnAcqOnOffMenue(object sender, EventArgs e) //Toggle Acq. On/Off
        {
            if (_communicationType == _communicationCom)
            {
                if (acqOnOffMenuItem.Checked)
                {
                    m_serialPort.DiscardInBuffer();
                    System.Threading.Thread.Sleep(200);

                    m_protocolHandler.SwitchAcq(true);
                    m_protocolHandler.Flush();
                }
                else
                {
                    try
                    {
                        m_protocolHandler.SwitchAcq(false);
                        m_protocolHandler.Flush();
                    }
                    catch (NullReferenceException)
                    {
                        Console.Out.WriteLine("NullReferenceException caught!");
                    }

                    System.Threading.Thread.Sleep(200);
                }
            }
            else if (_communicationType == _communicationSocket)
            {
                if (acqOnOffMenuItem.Checked)
                {
                    System.Threading.Thread.Sleep(200);
                    m_protocolHandler.SwitchAcq(true);
                    m_protocolHandler.Flush();
                }
                else
                {
                    try
                    {
                        m_protocolHandler.SwitchAcq(false);
                        m_protocolHandler.Flush();
                    }
                    catch (NullReferenceException)
                    {
                        Console.Out.WriteLine("NullReferenceException caught!");
                    }
                    System.Threading.Thread.Sleep(200);
                }
            }
        }
Esempio n. 2
0
 void OnAcqOnOffMenue(object sender, EventArgs e)
 {
     if (acqOnOffMenuItem.Checked)
     {
         m_SerPort.DiscardInBuffer();
         Thread.Sleep(200);
         ph.SwitchAcq(true); ph.Flush();
         // m_DispTimer.Enabled = true;
         // stw.Reset(); stw.Start();
     }
     else
     {
         ph.SwitchAcq(false); ph.Flush();
         Thread.Sleep(200);
         // m_SerPort.DiscardInBuffer();
         // m_DispTimer.Enabled = false;
         // stw.Stop();
     }
 }