コード例 #1
0
        private void dataMenuItem_Click(object sender, RoutedEventArgs e)
        {
            if (dataWindow == null)
            {
                dataWindow = new DataSelect(this);
            }
            dataWindow.ShowDialog();
            if (dataWindow.IsInitialized)
            {
                if (dataWindow.isChanged)
                {
                    dataWindow.isChanged = false;
                    task                = new DataPlavka(dataWindow.task);
                    Log.Text            = "Загружено " + dataWindow.task.plavka.Rows.Count.ToString() + " записей";
                    labelDataNotes.Text = "Загружено записей: " + dataWindow.task.plavka.Rows.Count.ToString();

                    dataDataGrid.ItemsSource = null;
                    dataDataGrid.ItemsSource = dataWindow.task.plavka.AsDataView();
                    if (dataDataGrid.Columns.Count < 9)
                    {
                        for (int i = 0; i < dataDataGrid.Columns.Count; i++)
                        {
                            dataDataGrid.Columns[i].Width = new DataGridLength(1, DataGridLengthUnitType.Star);
                        }
                    }

                    labelDataX.Content = "Количество исследуемых факторов - " + task.x.Count;
                    labelDataY.Content = "Количество исследуемых свойств - " + task.y.Count;
                    xBoundsData.Clear();
                    for (int i = 0; i < task.x.Count; i++)
                    {
                        xBoundsData.Add(new itemGrid(task.xAll[task.x[i]].description, -1, -1));
                    }
                    xDescrGrid.ItemsSource = xBoundsData;

                    markComboBox.Items.Clear();
                    gostComboBox.Items.Clear();
                    typeComboBox.Items.Clear();
                    typeComboBox.IsEnabled = false;
                    DBWorker  dbConnection = new DBWorker();
                    DataTable dt           = dbConnection.GetPlavka(DbSelect.Marks, null);
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        markComboBox.Items.Add(dt.Rows[i].ItemArray[0]);
                    }
                    dbConnection.CloseConnection();

                    string[] temp = task.mark.Split(' ');
                    SetGOST();

                    funcGrid.Visibility     = System.Windows.Visibility.Collapsed;
                    statGrid.Visibility     = System.Windows.Visibility.Collapsed;
                    groupBoxBefore.Header   = "Начальные границы";
                    groupBoxAfter.Header    = "Дискретная модель";
                    dataExpander.IsExpanded = true;
                }
            }
        }
コード例 #2
0
        private void dataMenuItem_Click(object sender, RoutedEventArgs e)
        {
            if (dataWindow == null) dataWindow = new DataSelect(this);
            dataWindow.ShowDialog();
            if (dataWindow.IsInitialized)
                if (dataWindow.isChanged)
                {
                    dataWindow.isChanged =false;
                    task = new DataPlavka(dataWindow.task);
                    Log.Text = "Загружено " + dataWindow.task.plavka.Rows.Count.ToString() + " записей";
                    labelDataNotes.Text = "Загружено записей: " + dataWindow.task.plavka.Rows.Count.ToString();

                    dataDataGrid.ItemsSource = null;
                    dataDataGrid.ItemsSource = dataWindow.task.plavka.AsDataView();
                    if (dataDataGrid.Columns.Count < 9)
                        for (int i = 0; i < dataDataGrid.Columns.Count; i++)
                            dataDataGrid.Columns[i].Width = new DataGridLength(1, DataGridLengthUnitType.Star);

                    labelDataX.Content = "Количество исследуемых факторов - " + task.x.Count;
                    labelDataY.Content = "Количество исследуемых свойств - " + task.y.Count;
                    xBoundsData.Clear();
                    for(int i=0; i<task.x.Count; i++)
                        xBoundsData.Add(new itemGrid(task.xAll[task.x[i]].description, -1, -1));
                    xDescrGrid.ItemsSource = xBoundsData;

                    markComboBox.Items.Clear();
                    gostComboBox.Items.Clear();
                    typeComboBox.Items.Clear();
                    typeComboBox.IsEnabled = false;
                    DBWorker dbConnection = new DBWorker();
                    DataTable dt = dbConnection.GetPlavka(DbSelect.Marks, null);
                    for (int i = 0; i < dt.Rows.Count; i++)
                        markComboBox.Items.Add(dt.Rows[i].ItemArray[0]);
                    dbConnection.CloseConnection();

                    string[] temp = task.mark.Split(' ');
                    SetGOST();

                    funcGrid.Visibility = System.Windows.Visibility.Collapsed;
                    statGrid.Visibility = System.Windows.Visibility.Collapsed;
                    groupBoxBefore.Header = "Начальные границы";
                    groupBoxAfter.Header = "Дискретная модель";
                    dataExpander.IsExpanded = true;
                }
        }