Exemple #1
0
        static void Main(string[] args)
        {
            _robot = new robot(args);
            _robot.onConnectGate  += onGateHandle;
            _robot.onAckGetLogic  += onAckGetLogic;
            _robot.onConnectLogic += onConnectLogic;
            _robot.onConnectHub   += onConnectHub;

            _robot.connect_server(service.timerservice.Tick);

            Int64 oldtick = 0;
            Int64 tick    = 0;

            while (true)
            {
                oldtick = tick;
                tick    = _robot.poll();

                Int64 ticktime = (tick - oldtick);
                if (ticktime < 50)
                {
                    Thread.Sleep(15);
                }
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            _robot = new robot(args);
            _robot.onConnectGate += onGateHandle;
            _robot.onConnectHub  += onConnectHub;

            _robot.connect_server(service.timerservice.Tick);

            while (true)
            {
                if (_robot.poll() < 50)
                {
                    Thread.Sleep(15);
                }
            }
        }
Exemple #3
0
        static void Main(string[] args)
        {
            _robot = new robot(20);
            _robot.onConnectGate  += onGateHandle;
            _robot.onAckGetLogic  += onAckGetLogic;
            _robot.onConnectLogic += onConnectLogic;
            _robot.onConnectHub   += onConnectHub;

            Int64 tick = Environment.TickCount;

            _robot.connect_server("127.0.0.1", 3236, tick);

            Int64 tickcount = 0;

            while (true)
            {
                Int64 tmptick = (Environment.TickCount & UInt32.MaxValue);
                if (tmptick < tick)
                {
                    tickcount += 1;
                    tmptick    = tmptick + tickcount * UInt32.MaxValue;
                }
                tick = tmptick;

                _robot.poll(tick);

                tmptick = (Environment.TickCount & UInt32.MaxValue);
                if (tmptick < tick)
                {
                    tickcount += 1;
                    tmptick    = tmptick + tickcount * UInt32.MaxValue;
                }
                Int64 ticktime = (tmptick - tick);
                tick = tmptick;

                if (ticktime < 50)
                {
                    Thread.Sleep(15);
                }
            }
        }