Example #1
0
        public void GoTo(MotionSystemMotorPosition[] positions)
        {
            SerialOutMessage cmd = new SerialOutMessage();

            foreach (var pos in positions)
            {
                cmd.Add(pos.Channel, pos.Value, pos.StepSize);
            }
            Send(cmd);
        }
Example #2
0
 private void Send(SerialOutMessage data)
 {
     if (_serialPort != null && _serialPort.IsOpen)
     {
         lock (_lockObject) {
             //var seroutbytes = data.Data;
             //_serialPort.Write(seroutbytes, 0, seroutbytes.Length);
             //_timer.Change(5000, 5000);
             _sendBuffer.Add(data);
         }
     }
     else
     {
         LogOutput?.Invoke(this, new LogOutputEventArgs {
             Text = "Send failed since Serial Port is not open."
         });
     }
 }