Ejemplo n.º 1
0
        public void SendVCSCommands()
        {
            while (true)
            {
                try
                {
                    //Waiting here untill we get a barcode to decode.
                    Barcode result = _vcsTxStack.Take();

                    //Create a task entry in the SQL Server.
                    var agvTask = agvTaskDequer.CreateTask(result);

                    //Convert Barcode to bytes.
                    byte[] message       = ToBytes(agvTask, result);
                    var    messagetoSend = new Communication.Communication.IPandMessage(IP, message);

                    //Send Barcode to VCS.
                    serverForVcs.sendMessage(messagetoSend);
                }
                catch (Exception e)
                {
                    e.WriteLog().SaveToDataBase();
                    break;
                }
            }
        }
Ejemplo n.º 2
0
 private void btn_ServerSend_Click(object sender, EventArgs e)
 {
     try
     {
         //Message
         byte[] message = new byte[4];
         message[0] = byte.Parse(textBox4.Text);
         message[1] = byte.Parse(textBox5.Text);
         message[2] = byte.Parse(textBox6.Text);
         message[3] = byte.Parse(textBox7.Text);
         //Package
         Communication.Communication.IPandMessage sendMessage = new Communication.Communication.IPandMessage(IP, message);
         Server.sendMessage(sendMessage);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }