Beispiel #1
0
        public int TargetCallback(Header header, ABSPacket packet, CommNode node)
        {
            TargetDesignationCommand comm = ABSPacket.GetValue <TargetDesignationCommand>(packet);

            Console.WriteLine("I got.  X: {0}\tY: {1}\tZ: {2}", comm.x, comm.y, comm.z);
            return((Int32)CallBackCodes.CALLBACK_SUCCESS);
        }
Beispiel #2
0
        public int PingCallback(Header header, ABSPacket packet, CommNode node)
        {
            Ping ping = ABSPacket.GetValue <Ping>(packet);

            Console.WriteLine("Ping message recieved: " + ping.GetMessage());
            Ping pins = new Ping("C# got dat message mate...");

            return((Int32)(CallBackCodes.CALLBACK_SUCCESS | CallBackCodes.CALLBACK_DESTROY_PACKET));
        }
Beispiel #3
0
        private int ArmPositionCallBack(Header header, ABSPacket packet, CommNode node)
        {
            //display arm position need to invoke becuase this is an internal thread and is unsafe
            //only need to invoke once all will require an invoke
            if (lblBase_pp.InvokeRequired)
            {
                lblBase_pp.Invoke(new MethodInvoker(() => { ArmPositionCallBack(header, packet, node); }));
            }
            else
            {
                NGCP.ArmPosition armPosition = ABSPacket.GetValue <NGCP.ArmPosition>(packet);
                lblBase_pp.Text = armPosition.position1.ToString();
            }

            return((Int32)(CallBackCodes.CALLBACK_SUCCESS | CallBackCodes.CALLBACK_DESTROY_PACKET));
        }