public void Evaluate(int SpreadMax)
        {
            if (FInputInit[0])
            {
                if (m_NatNet != null)
                {
                    m_NatNet.Disconnect();
                }

                m_NatNet = new NatNetML.NatNetClientML();

                NatNetClientML.ConnectParams _params = new NatNetClientML.ConnectParams();
                _params.ServerAddress  = FInputIPServer[0];
                _params.LocalAddress   = FInputIPClient[0];
                _params.ConnectionType = ConnectionType.Multicast;
                returnCode             = m_NatNet.Connect(_params);
                returnCode             = m_NatNet.GetServerDescription(desc);

                FOutputStatus.SliceCount = 1;
                FOutputStatus[0]         = "";

                m_NatNet.OnFrameReady += new NatNetML.FrameReadyEventHandler(m_NatNet_OnFrameReady);

                //Version info
                int[] ver = new int[4];
                ver = m_NatNet.NatNetVersion();
                FOutputVersion.SliceCount = 1;
                FOutputVersion[0]         = String.Format("{0}.{1}.{2}.{3}", ver[0], ver[1], ver[2], ver[3]);
                FOutputClient.SliceCount  = 1;
                FOutputClient[0]          = m_NatNet;
            }
        }
        /// <summary>
        /// Create a new NatNet client, which manages all communication with the NatNet server (e.g. Motive)
        /// </summary>
        /// <param name="iConnectionType">0 = Multicast, 1 = Unicast</param>
        /// <returns></returns>
        private int CreateClient(int iConnectionType)
        {
            // release any previous instance
            if (m_NatNet != null)
            {
                m_NatNet.Uninitialize();
            }

            // [NatNet] create a new NatNet instance
            m_NatNet = new NatNetML.NatNetClientML(iConnectionType);

            // [NatNet] set a "Frame Ready" callback function (event handler) handler that will be
            // called by NatNet when NatNet receives a frame of data from the server application
            m_NatNet.OnFrameReady += new NatNetML.FrameReadyEventHandler(m_NatNet_OnFrameReady);

            /*
             * // [NatNet] for testing only - event signature format required by some types of .NET applications (e.g. MatLab)
             * m_NatNet.OnFrameReady2 += new FrameReadyEventHandler2(m_NatNet_OnFrameReady2);
             */

            // [NatNet] print version info
            int[] ver = new int[4];
            ver = m_NatNet.NatNetVersion();
            String strVersion = String.Format("NatNet Version : {0}.{1}.{2}.{3}", ver[0], ver[1], ver[2], ver[3]);

            OutputMessage(strVersion);

            return(0);
        }
Пример #3
0
        private static void connectToServer()
        {
            /*  [NatNet] Instantiate the client object  */
            mNatNet = new NatNetML.NatNetClientML();

            /*  [NatNet] Checking verions of the NatNet SDK library  */
            int[] verNatNet = new int[4];           // Saving NatNet SDK version number
            verNatNet = mNatNet.NatNetVersion();
            Console.WriteLine("NatNet SDK Version: {0}.{1}.{2}.{3}", verNatNet[0], verNatNet[1], verNatNet[2], verNatNet[3]);

            /*  [NatNet] Connecting to the Server    */
            Console.WriteLine("\nConnecting...\n\tLocal IP address: {0}\n\tServer IP Address: {1}\n\n", mStrLocalIP, mStrServerIP);

            NatNetClientML.ConnectParams connectParams = new NatNetClientML.ConnectParams();
            connectParams.ConnectionType = mConnectionType;
            connectParams.ServerAddress  = mStrServerIP;
            connectParams.LocalAddress   = mStrLocalIP;
            mNatNet.Connect(connectParams);
        }
Пример #4
0
        private int CreateClient(int iConnectionType)
        {
            if (m_NatNet != null)
            {
                m_NatNet.Uninitialize();
            }
            m_NatNet = new NatNetML.NatNetClientML(iConnectionType);

            // [NatNet] set a "Frame Ready" callback function (event handler) handler that will be
            // called by NatNet when NatNet receives a frame of data from the server application
            m_NatNet.OnFrameReady += new NatNetML.FrameReadyEventHandler(m_NatNet_OnFrameReady);

            // [NatNet] print version info
            int[] ver = new int[4];
            ver = m_NatNet.NatNetVersion();
            String strVersion = String.Format("NatNet Version : {0}.{1}.{2}.{3}", ver[0], ver[1], ver[2], ver[3]);

            OutputMessage(strVersion);

            return(0);
        }
Пример #5
0
        static void connectToServer()
        {
            /*  [NatNet] Instantiate the client object  */
            m_NatNet = new NatNetML.NatNetClientML(iConnectionType);

            /*  [NatNet] Checking verions of the NatNet SDK library  */
            int[] verNatNet = new int[4];           // Saving NatNet SDK version number
            verNatNet = m_NatNet.NatNetVersion();
            Console.WriteLine("NatNet SDK Version: {0}.{1}.{2}.{3}", verNatNet[0], verNatNet[1], verNatNet[2], verNatNet[3]);

            /*  [NatNet] Connecting to the Server    */
            Console.WriteLine("\nConnecting...\n\tLocal IP address: {0}\n\tServer IP Address: {1}\n\n", strLocalIP, strServerIP);
            m_NatNet.Initialize(strLocalIP, strServerIP);
        }
Пример #6
0
        private int CreateClient(int iConnectionType)
        {
            if(m_NatNet != null)
            {
                m_NatNet.Uninitialize();
            }
            m_NatNet = new NatNetML.NatNetClientML(iConnectionType);

            // [NatNet] set a "Frame Ready" callback function (event handler) handler that will be
            // called by NatNet when NatNet receives a frame of data from the server application
            m_NatNet.OnFrameReady += new NatNetML.FrameReadyEventHandler(m_NatNet_OnFrameReady);
            
            /*
            // [NatNet] for testing only - event signature format required by some types of .NET applications (e.g. MatLab)
            m_NatNet.OnFrameReady2 += new FrameReadyEventHandler2(m_NatNet_OnFrameReady2);
            */

            // [NatNet] print version info
            int[] ver = new int[4];
            ver = m_NatNet.NatNetVersion();
            String strVersion = String.Format("NatNet Version : {0}.{1}.{2}.{3}", ver[0], ver[1],ver[2],ver[3]);
            OutputMessage(strVersion);

            return 0;
            
        }
Пример #7
0
        /// <summary>
        /// Create a new NatNet client, which manages all communication with the NatNet server (e.g. Motive)
        /// </summary>
        /// <param name="iConnectionType">0 = Multicast, 1 = Unicast</param>
        /// <returns></returns>
        private static int CreateClient(int iConnectionType)
        {
            // release any previous instance
            if (m_NatNet != null)
            {
                m_NatNet.Uninitialize();
            }

            // [NatNet] create a new NatNet instance
            m_NatNet = new NatNetML.NatNetClientML(iConnectionType);

            // [NatNet] set a "Frame Ready" callback function (event handler) handler that will be
            // called by NatNet when NatNet receives a frame of data from the server application
            m_NatNet.OnFrameReady += new NatNetML.FrameReadyEventHandler(m_NatNet_OnFrameReady);

            // [NatNet] print version info
            int[] ver = new int[4];
            ver = m_NatNet.NatNetVersion();
            String strVersion = String.Format("NatNet Version : {0}.{1}.{2}.{3}", ver[0], ver[1], ver[2], ver[3]);
            Console.WriteLine(strVersion);

            return 0;
        }