Пример #1
0
        void tc_Multi()
        {
            RaiseEvent(new RoutedEventArgs(TreeControl.MultiEvent));

            ShadowMaker.ShadowUp();
            modelControlGrid.IsEnabled = false;

            var x = new StartMultirunBindingSource()
            {
                DisableAnimation = true,
                NumberOfRuns = 3
            };

            var startCtrl = new StartMultirunControl();
            startCtrl.DataContext = x;
            startCtrl.btnCancel.Click += (sender_, e_) =>
                {
                    ShadowMaker.ShadowDown();
                    modelControlGrid.IsEnabled = true;
                };
            startCtrl.btnOk.Click += (sender_, e_) =>
                {
                    ShadowMaker.ShadowDown();

                    if (x.NumberOfRuns > 0)
                    {
                        var lc = new LoadingControl();
                        if (!vissim.IsInstanciated) lc.Message = "Starting VISSIM ...";
                        else lc.Message = "Simulation ...";
                        ShadowMaker.ShowThis(lc);

                        experimenter.RunMultiAsync(x, this.Dispatcher
                            , StartAction
                            , (expData) =>
                                {
                                    var ctrl = CreateCreateExperimentControl(expData);
                                    ShadowMaker.ShowThis(ctrl);
                                }
                            , (message) =>
                                {
                                    lc.Message = message;
                                }
                            );
                    }
                    else ShadowMaker.ShowThis(startCtrl);

                    ShadowMaker.ShadowUp();
                };

            ShadowMaker.ShowThis(startCtrl);
        }
Пример #2
0
        void tc_Multi()
        {
            RaiseEvent(new RoutedEventArgs(TreeControl.MultiEvent));

            ShadowMaker.ShadowUp();
            modelControlGrid.IsEnabled = false;

            var x = new StartMultirunBindingSource()
            {
                DisableAnimation = true,
                NumberOfRuns     = 3
            };

            var startCtrl = new StartMultirunControl();

            startCtrl.DataContext      = x;
            startCtrl.btnCancel.Click += (sender_, e_) =>
            {
                ShadowMaker.ShadowDown();
                modelControlGrid.IsEnabled = true;
            };
            startCtrl.btnOk.Click += (sender_, e_) =>
            {
                ShadowMaker.ShadowDown();

                if (x.NumberOfRuns > 0)
                {
                    var lc = new LoadingControl();
                    if (!vissim.IsInstanciated)
                    {
                        lc.Message = "Starting VISSIM ...";
                    }
                    else
                    {
                        lc.Message = "Simulation ...";
                    }
                    ShadowMaker.ShowThis(lc);

                    experimenter.RunMultiAsync(x, this.Dispatcher
                                               , StartAction
                                               , (expData) =>
                    {
                        var ctrl = CreateCreateExperimentControl(expData);
                        ShadowMaker.ShowThis(ctrl);
                    }
                                               , (message) =>
                    {
                        lc.Message = message;
                    }
                                               );
                }
                else
                {
                    ShadowMaker.ShowThis(startCtrl);
                }

                ShadowMaker.ShadowUp();
            };

            ShadowMaker.ShowThis(startCtrl);
        }