handleInput() public static method

public static handleInput ( string message, bool canMove ) : void
message string
canMove bool
return void
Beispiel #1
0
        public static void Read()
        {
            while (_continue)
            {
                try
                {
                    UserVariables.isInitiated = true;

                    string message = Connection._serialPort.ReadLine();

                    UserInterface.logPrinter(message);

                    DecisionHandler.handleInput(message);
                }
                catch (TimeoutException) { }
            } //end while
        }     //end void
Beispiel #2
0
        }     //end void

        public static void HandleRead()
        {
            Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("en-US");

            while (_continue)
            {
                try
                {
                    bool hasData;
                    lock (readLineData)
                    {
                        hasData = readLineData.Any();
                    }

                    while (isCalibrating && hasData)
                    {
                        //wait for ok to perform calculation?
                        UserVariables.isInitiated = true;
                        bool canMove;

                        if (readLineData.First().Contains("wait"))
                        {
                            canMove = true;
                        }
                        else
                        {
                            canMove = false;
                        }

                        DecisionHandler.handleInput(readLineData.First(), canMove);
                        readLineData.RemoveAt(0);
                    }//end while
                }
                catch (Exception) { }
            }//end while continue
        }