private static void insertOperationsOnReachBox(FormResult form, int index)
        {
            int  typeOfPart = Part.getSurfaceOnIndex(index).getParametersOfSurface().getTypeOfPart().getIndex();
            char type;

            if (typeOfPart == 0)
            {
                type = '-';
            }
            else
            {
                type = '+';
            }

            ClassesToCalculate.ResultsOfCalculation resultWorkpiece = Part.getWorkpiece().getResultsOfCalculation();


            form.richTextBoxResult.Text = "Исходные данные: " + Part.getWorkpiece().getNameOfWorkpiece() + "\nСоставляющая припуска P= " + resultWorkpiece.getSpatialDeviation().ToString() + "\nРазмер= " + resultWorkpiece.getSizeOfWorkprieceAfterOperation().ToString() + "(" + type + Part.getWorkpiece().getResultsOfCalculation().getAccuracies() + ")";

            for (int i = 0; i < Part.getSurfaceOnIndex(index).getCountLongListOperation(); i++)
            {
                resultWorkpiece = Part.getSurfaceOnIndex(index).getParametersOperation()[i].getResultsOfCalculation();

                form.richTextBoxResult.Text += "\n" + i.ToString() + ") ";
                form.richTextBoxResult.Text += Part.getSurfaceOnIndex(index).getParametersOperation()[i].getNameOperation();
                form.richTextBoxResult.Text += "\nСоставляющая припуска E= " + resultWorkpiece.getdeviationOfInstallation().ToString() + "\nСоставляющая припуска P= " + resultWorkpiece.getSpatialDeviation().ToString() + "\nВеличина номинального припуска Znom= " + resultWorkpiece.getNominalAllowance().ToString() + "\nРазмер= " + resultWorkpiece.getSizeOfWorkprieceAfterOperation().ToString() + "(" + type + resultWorkpiece.getAccuracies() + ")";
            }
        }
Exemplo n.º 2
0
        private void buttonSaveToDisk_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "Текстовый документ (*.txt)|*.txt|Все файлы (*.*)|*.*";
            List <Surface> surfaces = Part.getSurfaces();

            int count = surfaces.Count;

            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                StreamWriter sw = new StreamWriter(sfd.FileName);

                int  typeOfPart = Part.getParametersOfPart().getTypeOfPart().getIndex();
                char type;

                if (typeOfPart == 0)
                {
                    type = '-';
                }
                else
                {
                    type = '+';
                }

                ClassesToCalculate.ResultsOfCalculation resultWorkpiece = Part.getWorkpiece().getResultsOfCalculation();


                sw.WriteLine("Исходные данные: " + Part.getWorkpiece().getNameOfWorkpiece() + "\nСоставляющая припуска P= " + resultWorkpiece.getSpatialDeviation().ToString() + "\nРазмер= " + resultWorkpiece.getSizeOfWorkprieceAfterOperation().ToString() + "(" + type + Part.getWorkpiece().getResultsOfCalculation().getAccuracies() + ")");

                for (int index = 0; index < count; index++)
                {
                    for (int i = 0; i < Part.getSurfaceOnIndex(index).getCountLongListOperation(); i++)
                    {
                        resultWorkpiece = Part.getSurfaceOnIndex(index).getParametersOperation()[i].getResultsOfCalculation();

                        sw.WriteLine("\n" + i.ToString() + ") ");
                        sw.WriteLine(Part.getSurfaceOnIndex(index).getParametersOperation()[i].getNameOperation());
                        sw.WriteLine("\nСоставляющая припуска E= " + resultWorkpiece.getdeviationOfInstallation().ToString() + "\nСоставляющая припуска P= " + resultWorkpiece.getSpatialDeviation().ToString() + "\nВеличина номинального припуска Znom= " + resultWorkpiece.getNominalAllowance().ToString() + "\nРазмер= " + resultWorkpiece.getSizeOfWorkprieceAfterOperation().ToString() + "(" + type + resultWorkpiece.getAccuracies() + ")");
                    }
                }

                sw.Close();
            }
        }