Пример #1
0
        static void Main(string[] Args)
        {
            ParseArgs(Args);
            StateStore.Start(ScienceConstants.CLIENT_NAME);
            Log.SetGlobalOutputLevel(LogLevel);
            //Log.SetSingleOutputLevel(Log.Source.NETWORK, Log.Severity.DEBUG);
            Log.ErrorCodes  = ScienceErrors.ERROR_CODES;
            Log.SystemNames = ScienceErrors.SYSTEMS;
            Log.Destination = Log.WriteDestination.ALL;
            Log.Begin();
            Log.ForceOutput(Log.Severity.INFO, Log.Source.OTHER, "Science Station - Rover Side");
            Client.Start(IP, PortTCP, PortUDP, ScienceConstants.CLIENT_NAME, OperationPeriod: 5);
            //Client.TraceLogging = true;
            PacketHandler Handler = new PacketHandler();

            //BeagleBone.Initialize(SystemMode.DEFAULT, true);

            IOHandler = new IOHandler();
            IOHandler.InitializeSystems();
            //((Turntable)IOHandler.TurntableController).TargetAngle = 50;

            while (Console.KeyAvailable)
            {
                Console.ReadKey();
            }                                                   // Clear previous keypresses
            Log.ForceOutput(Log.Severity.INFO, Log.Source.OTHER, "Press any key to exit.");

            while (!Console.KeyAvailable)
            {
                IOHandler.UpdateStates();
                Thread.Sleep(20);
            }
            IOHandler.Exit();
            Client.Stop();
            Environment.Exit(0);
        }