public virtual void Run(string[] args = null)
        {
            if ((args != null) && (args.Length > 0))
            {
                //assume if args given is single test
                this.RunSingleTest(args);
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                var testsConfig = this._testsConfig.CloneJson();
                var testParams  = testsConfig.SingleTestParameters;
                var option      = ChooseOptionForm.ShowOptions(this.GetOptions(testParams), CHOOSE_FORM_TEXT);
                if (option == null)
                {
                    return;
                }
                if (option.Equals(GetSingleTestOption(testParams)))
                {
                    this.RunSingleTest(args);
                }
                else if (option.Equals(OPTIM_TEST_OPTION))
                {
                    this.RunOptimTest(args);
                }
                else if (option.Equals(MANUAL_SELECT_OPTION))
                {
                    this.OpenTestList();
                }
                else if (option.Equals(CREATE_CONFIGS_OPTION))
                {
                    this.CreateTestList();
                }
                else if (option.Equals(RANK_TEST_OPTION))
                {
                    this.RunRankTest();
                }
                else if (option.Equals(CREATE_CONDOR_OPTION))
                {
                    this.CreateCondorScript();
                }
            }
        }
Esempio n. 2
0
        protected override void RunSimulation(FitnessTest test)
        {
            //tests execution only on console
            if (this.ForceConsole || !this.TestsConfig.GraphicsEnabled)
            {
                this.RunConsoleApplication(test);
                return;
            }

            //shows menu
            InitApplication();
            using (var chooseForm =
                       new ChooseOptionForm(new List <string> {
                OPTION_CONSOLE, OPTION_FORM
            })
            {
                Text = OPTIONS_FORM_TITLE + test.TestName
            })
            {
                chooseForm.Show();
                while (!chooseForm.IsDisposed)
                {
                    Application.DoEvents();
                }

                switch (chooseForm.ChosenOption)
                {
                case OPTION_FORM:
                    this.RunFormApplication(this.TestsConfig.CellSize, false, test);
                    break;

                case OPTION_CONSOLE:
                    this.RunConsoleApplication(test);
                    break;

                default:
                    this.RunFormApplication(this.TestsConfig.CellSize, true, test);
                    break;
                }
            }
        }
Esempio n. 3
0
 private async Task DatesFormComplete(IDialogContext context, IAwaitable <ChooseDateForm> result)
 {
     try
     {
         var form = await result;
         if (form != null)
         {
             exitFromForm(context);
             movieDate = form.Date;
             map       = t.getMovieTimes(completeWeekResponse, movieName, movieDate);
             ChooseMovieFormatForm.formatList = map.Keys.ToList();
             context.Call(ChooseMovieFormatForm.BuildDatesDialog(FormOptions.PromptInStart), FormatsFormComplete);
         }
         else
         {
             await context.PostAsync("Form returned empty response! Type anything to restart it.");
         }
     }
     catch (OperationCanceledException)
     {
         context.Call(ChooseOptionForm.BuildOptionsDialog(FormOptions.PromptInStart), OptionsComplete);
     }
 }
Esempio n. 4
0
        private async Task TimesFormComplete(IDialogContext context, IAwaitable <ChooseMovieTime> result)
        {
            try
            {
                var form = await result;
                if (form != null)
                {
                    exitFromForm(context);
                    string link = t.getSeanse(completeWeekResponse, movieName, movieDate, form.Time);
                    await context.PostAsync(link);
                }
                else
                {
                    await context.PostAsync("Form returned empty response! Type anything to restart it.");
                }
            }
            catch (OperationCanceledException)
            {
                context.Call(ChooseOptionForm.BuildOptionsDialog(FormOptions.PromptInStart), OptionsComplete);
            }

            //context.Wait(MessageReceivedAsync);
        }
Esempio n. 5
0
        private async Task FormComplete(IDialogContext context, IAwaitable <ChooseFilmForm> result)
        {
            try
            {
                var form = await result;
                if (form != null)
                {
                    exitFromForm(context);
                    movieName = form.MovieName;
                    ChooseDateForm.datesList = t.getMovieDates(completeWeekResponse, movieName);
                    context.Call(ChooseDateForm.BuildDatesDialog(FormOptions.PromptInStart), DatesFormComplete);
                }
                else
                {
                    await context.PostAsync("Form returned empty response! Type anything to restart it.");
                }
            }
            catch (OperationCanceledException)
            {
                context.Call(ChooseOptionForm.BuildOptionsDialog(FormOptions.PromptInStart), OptionsComplete);
            }

            //context.Wait(MessageReceivedAsync);
        }
Esempio n. 6
0
 private async Task FormatsFormComplete(IDialogContext context, IAwaitable <ChooseMovieFormatForm> result)
 {
     try
     {
         var form = await result;
         if (form != null)
         {
             exitFromForm(context);
             movieFormat = form.Format;
             List <string> movieTimes = new List <string>();
             map.TryGetValue(movieFormat, out movieTimes);
             ChooseMovieTime.timesList = movieTimes;
             context.Call(ChooseMovieTime.BuildDatesDialog(FormOptions.PromptInStart), TimesFormComplete);
         }
         else
         {
             await context.PostAsync("Form returned empty response! Type anything to restart it.");
         }
     }
     catch (OperationCanceledException)
     {
         context.Call(ChooseOptionForm.BuildOptionsDialog(FormOptions.PromptInStart), OptionsComplete);
     }
 }
Esempio n. 7
0
        private async Task MessageReceivedAsync(IDialogContext context, IAwaitable <object> result)
        {
            var activity = await result as Activity;

            context.Call(ChooseOptionForm.BuildOptionsDialog(FormOptions.PromptInStart), OptionsComplete);
        }