Esempio n. 1
0
        private void ShowCreateResearchDialog(ResearchType researchType)
        {
            CreateResearchWindow createResearchWnd = new CreateResearchWindow(researchType)
            {
                Owner = this
            };

            createResearchWnd.ShowDialog();
            if (!(createResearchWnd.DialogResult.HasValue && createResearchWnd.DialogResult.Value))
            {
                return;
            }

            researchDraw = FactoryReserchDraw.CreateResearchDraw(researchType, LabSessionManager.GetResearchModelType());

            Start.Visibility = Visibility.Visible;
            Start.IsEnabled  = true;
            Save.Visibility  = Visibility.Visible;
            Save.IsEnabled   = true;
            AddResearchToTable();
            FillParametersTable();
            researchDraw.SetStatisticsParameters();
            if (researchType == ResearchType.Basic)
            {
                Initial.Visibility  = Visibility.Visible;
                Initial.IsEnabled   = false;
                Final.Visibility    = Visibility.Visible;
                Final.IsEnabled     = false;
                Next.Visibility     = Visibility.Visible;
                Next.IsEnabled      = false;
                Previous.Visibility = Visibility.Visible;
                Previous.IsEnabled  = false;
                Grid.SetColumn(Save, 5);
            }
            else
            {
                Initial.Visibility  = Visibility.Collapsed;
                Final.Visibility    = Visibility.Collapsed;
                Next.Visibility     = Visibility.Collapsed;
                Previous.Visibility = Visibility.Collapsed;
                ChartData           = null;
                Grid.SetColumn(Save, 1);
            }
            Start.Content = "Start";

            mainCanvas.Children.Clear();

            if (LabSessionManager.GetResearchType() == ResearchType.Basic &&
                (LabSessionManager.GetResearchModelType() == ModelType.RegularHierarchic || LabSessionManager.GetResearchModelType() == ModelType.NonRegularHierarchic))
            {
                Flat.Visibility = System.Windows.Visibility.Visible;
                Flat.IsEnabled  = false;
            }
            else
            {
                Flat.Visibility = System.Windows.Visibility.Hidden;
            }
        }
Esempio n. 2
0
        private void InitializeEditResearchDialog()
        {
            ResearchTypeTextBox.Text = LabSessionManager.GetResearchType().ToString();
            ResearchNameTextBox.Text = LabSessionManager.GetResearchName();
            ModelTypeComboBox.Text   = LabSessionManager.GetResearchModelType().ToString();

            Dictionary <GenerationParameter, object> paramValues = LabSessionManager.GetGenerationParameterValues();
            List <ResearchParameter> param = LabSessionManager.GetRequiredResearchParameters(LabSessionManager.GetResearchType());

            for (int i = 0; i < ParametersStackPanelValue.Children.Count; i++)
            {
                GenerationParameter g;
                Enum.TryParse(((TextBox)ParametersStackPanelValue.Children[i]).Name, out g);
                ((TextBox)(ParametersStackPanelValue.Children[i])).Text = paramValues[g].ToString();
            }
        }
Esempio n. 3
0
        private void AddAnalizeOptionsList()
        {
            if (!LabSessionManager.IsResearchCreated())
            {
                return;
            }
            AnalyzeOptionsMenuItem.Items.Clear();
            AnalyzeOption options = LabSessionManager.GetAvailableAnalyzeOptions(LabSessionManager.GetResearchType(), LabSessionManager.GetResearchModelType());

            for (int i = 0; i < Enum.GetNames(typeof(AnalyzeOption)).Length; ++i)
            {
                int k = (int)options & (1 << i);
                if (k != 0)
                {
                    CheckBox option = new CheckBox()
                    {
                        Content = ((AnalyzeOption)k).ToString()
                    };
                    AnalyzeOptionsMenuItem.Items.Add(option);
                }
            }
        }