示例#1
0
        private void NewTaskToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewTaskForm ntf = new NewTaskForm();

            if (ntf.ShowDialog() == DialogResult.OK)
            {
                TaskEditForm tef = new TaskEditForm();

                tef.InitForm(ntf.N, ntf.M);

                if (tef.ShowDialog() == DialogResult.OK)
                {
                    IsNewTask = true;

                    TaskTypeComboBox.SelectedIndex = tef.TaskType;
                    SimplexTables.Clear();

                    SourceN        = tef.N;
                    SourceM        = tef.M;
                    SourceSign     = tef.Signs;
                    SourceVectorb  = tef.Vectorb;
                    SourceVectorc  = tef.Vectorc;
                    SourceMatrixA  = tef.MatrixA;
                    SourceTaskType = tef.TaskType;

                    PrintSolveLog(TaskInfotextBox);

                    SimplexTable smptbl = new SimplexTable(CanonicalN, CanonicalM);
                    smptbl.GetTable(CanonicalMatrixA, CanonicalVectorb, CanonicalVectorc);
                    smptbl.TaskType = CanonicalTaskType;
                    SimplexTables.Add(smptbl);
                    currentSimplexTable = SimplexTables.Count - 1;
                    UpdateSimplexGrid();
                    OpenTableMode();
                }
            }
        }
示例#2
0
        private void NewSimplexTableToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewTaskForm ntf = new NewTaskForm();

            ntf.Text = NewSimplexTableToolStripMenuItem.Text;
            if (ntf.ShowDialog() == DialogResult.OK)
            {
                IsNewTask = false;

                SimplexTables.Clear();
                SimplexTable smptbl = new SimplexTable(ntf.N, ntf.M);

                CanonicalN = smptbl.N;
                CanonicalM = smptbl.M;

                for (int i = 0; i < CanonicalM; i++)
                {
                    CanonicalSign[i] = 2;
                }

                SourceTaskType    = 0;
                CanonicalTaskType = 0;
                TaskTypeComboBox.SelectedIndex = 0;

                smptbl.FillVectorb(CanonicalVectorb);
                smptbl.FillVectorc(CanonicalVectorc);
                smptbl.FillMatrixA(CanonicalMatrixA);

                SimplexTables.Add(smptbl);
                currentSimplexTable = SimplexTables.Count - 1;
                UpdateSimplexGrid();
                OpenTableMode();

                PrintSolveLog(TaskInfotextBox);
            }
        }