Page 1 of 1

Infinite burst

PostPosted: Thu Jan 31, 2008 10:48 pm
by streets97f1
Is there a way to give UIRT a command to infinitly transmit a burst until a halt command is give to stop burst? This would make repeating buttons (ie volume up and down) faster and more reponsive.

PostPosted: Thu Feb 14, 2008 9:53 pm
by canoewhiteh2o
Below is code that I use to repeatedly transmit while the mouse button is held down.

Code: Select all
private Thread repeatThread = null;
private int initialLongPause = 200;       
private bool threadStarted = false;
private object repeatSender; //object used to copy button to repeat

        protected void repeatCommand()
        {           
            //Initial long pause
            System.Threading.Thread.Sleep(initialLongPause);
            TimeSpan ts;
            bool senderState = false;
            threadStarted = true;               
            if (repeatSender.GetType() == typeof(System.Windows.Forms.Button))
            {
                Button irsender;
                irsender = ((Button)(repeatSender));
                if (irsender.Enabled) senderState = true;
            }
            while (!senderState)
            {
                System.Threading.Thread.Sleep(10);
            }
        }

        private void MainForm_MouseUp(object sender, MouseEventArgs e)
        {
            buttonVolUp.Enabled = true;
            buttonVolDown.Enabled = true;
            buttonChUp.Enabled = true;
            buttonChDown.Enabled = true;
            threadStarted = false;
            if (repeatThread != null) repeatThread.Abort();//Abort thread


hopefully this may be helpful.

Gary B

PostPosted: Fri Feb 15, 2008 1:14 am
by canoewhiteh2o