Ejemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="MyUdpPort">Port number of this computer</param>
 /// <param name="DestUdpPort">Port number of the robot</param>
 /// <param name="destIP">IP Address of the robot</param>
 public MessageProcessorC(int MyUdpPort, int DestUdpPort, IPAddress destIP, OrientationModule om)
 {
     this.om = om;
     UdpPort = new NetClient(MyUdpPort, DestUdpPort, destIP);
     UdpPort.AfterReceive += new NetClient.UdpReceivedEventHandler(UdpPort_AfterReceive);
     UdpPort.StartReceiving();
     Tx_Buff[0]    = 0xFF;               //This value is never changed
     Tx_Buff[1]    = 0x80;               //This value is never changed
     g_SCI2_TX_LEN = SCI2_HEAD_LEN;
 }
Ejemplo n.º 2
0
        protected void SetOrientation()
        {
            var orientation = OrientationModule.GetOrientationForElement(TargetNodes.First());

            switch (orientation)
            {
            case Orientation.Horizontal:
                StringOrientation = StringOrientation.Horizontal;
                break;

            default:
                StringOrientation = StringOrientation.Vertical;
                break;
            }
        }
Ejemplo n.º 3
0
        protected Tuple <bool, StringOrientation> GetOrientation()
        {
            var value = new Tuple <bool, StringOrientation>(false, StringOrientation.Vertical);
            var node  = TargetNodes.FirstOrDefault();

            if (node != null && node.Properties.Contains(OrientationDescriptor._typeId))
            {
                var orientation = OrientationModule.GetOrientationForElement(node);
                switch (orientation)
                {
                case Orientation.Horizontal:
                    value = new Tuple <bool, StringOrientation>(true, StringOrientation.Horizontal);
                    break;

                default:
                    value = new Tuple <bool, StringOrientation>(true, StringOrientation.Vertical);
                    break;
                }
            }

            return(value);
        }