Exemple #1
0
        private async void ButtonAction3_Click(object sender, RoutedEventArgs e)
        {
            DevicesInformation += $"Test started {Environment.NewLine}";

            var tourTheStairs = new TourTheStairs(_rsServiceDiscovery.PowerMotors, _rsServiceDiscovery.DateTime, _rsServiceDiscovery.InitCount1To20, _rsServiceDiscovery.EmergencyStop);

            var result = await tourTheStairs.Init();

            if (tourTheStairs.HasExceptionStack)
            {
                DevicesInformation += tourTheStairs.GetExceptionStack();
            }
            DevicesInformation += $"Init {result} {Environment.NewLine}";

            result = await tourTheStairs.Takeoff();

            if (tourTheStairs.HasExceptionStack)
            {
                DevicesInformation += tourTheStairs.GetExceptionStack();
            }
            DevicesInformation += $"TakeOff {result} {Environment.NewLine}";

            result = await tourTheStairs.Motors(true, 0, 10, 0, 0, 0.0f, 15);

            if (tourTheStairs.HasExceptionStack)
            {
                DevicesInformation += tourTheStairs.GetExceptionStack();
            }
            DevicesInformation += $"Motors 1 {result} {Environment.NewLine}";

            tourTheStairs.ClearExceptions();
            for (int i = 0; i < 100; i++)
            {
                if (await tourTheStairs.Motors(true, 0, 10, 0, 0, 0.0f, 20) == false)
                {
                    break;
                }
            }
            if (tourTheStairs.HasExceptionStack)
            {
                DevicesInformation += tourTheStairs.GetExceptionStack();
            }
            DevicesInformation += $"Motors 2 For i to 100 {result} {Environment.NewLine}";


            result = await tourTheStairs.Land();

            if (tourTheStairs.HasExceptionStack)
            {
                DevicesInformation += tourTheStairs.GetExceptionStack();
            }
            DevicesInformation += $"Land {result} {Environment.NewLine}";

            result = await tourTheStairs.Motors(false, 0, 0, 0, 0, 0.0f, 20); // it has to land anyway

            if (tourTheStairs.HasExceptionStack)
            {
                DevicesInformation += tourTheStairs.GetExceptionStack();
            }
            DevicesInformation += $"Motors 3 {result} {Environment.NewLine}";
        }
Exemple #2
0
        private async void ButtonAction3_Click(object sender, RoutedEventArgs e)
        {
            DevicesInformation += $"Test started {Environment.NewLine}";

            var tourTheStairs = new TourTheStairs(_rsServiceDiscovery.PowerMotors, _rsServiceDiscovery.DateTime, _rsServiceDiscovery.InitCount1To20, _rsServiceDiscovery.EmergencyStop);

            var result = await tourTheStairs.Init();
            if (tourTheStairs.HasExceptionStack)
                DevicesInformation += tourTheStairs.GetExceptionStack();
            DevicesInformation += $"Init {result} {Environment.NewLine}";

            result = await tourTheStairs.Takeoff();
            if (tourTheStairs.HasExceptionStack)
                DevicesInformation += tourTheStairs.GetExceptionStack();
            DevicesInformation += $"TakeOff {result} {Environment.NewLine}";

            result = await tourTheStairs.Motors(true, 0, 10, 0, 0, 0.0f, 15);
            if (tourTheStairs.HasExceptionStack)
                DevicesInformation += tourTheStairs.GetExceptionStack();
            DevicesInformation += $"Motors 1 {result} {Environment.NewLine}";

            tourTheStairs.ClearExceptions();
            for (int i = 0; i < 100; i++)
            {
                if (await tourTheStairs.Motors(true, 0, 10, 0, 0, 0.0f, 20) == false)
                    break;
            }
            if (tourTheStairs.HasExceptionStack)
                DevicesInformation += tourTheStairs.GetExceptionStack();
            DevicesInformation += $"Motors 2 For i to 100 {result} {Environment.NewLine}";


            result = await tourTheStairs.Land();
            if (tourTheStairs.HasExceptionStack)
                DevicesInformation += tourTheStairs.GetExceptionStack();
            DevicesInformation += $"Land {result} {Environment.NewLine}";

            result = await tourTheStairs.Motors(false, 0, 0, 0, 0, 0.0f, 20); // it has to land anyway
            if (tourTheStairs.HasExceptionStack)
                DevicesInformation += tourTheStairs.GetExceptionStack();
            DevicesInformation += $"Motors 3 {result} {Environment.NewLine}";
        }