public ParametersOperation(ParametersOperation operation)
 {
     this.typeOfMachining       = operation.getTypeOfMachining();
     this.precisionOfMachining  = operation.getPrecisionOfMachining();
     this.surfaceRoughnessRz    = operation.getSurfaceRoughnessRz();
     this.recommendedIntervalRz = operation.getRecommendedIntervalRz();
     this.idOperation           = operation.getIdOperation();
     this.kvalitet = operation.getKvalitet();
     this.thicknessOfDefectiveCoating = operation.getThicknessOfDefectiveCoating();
     this.coefficientOfRefinement     = operation.getCoefficientOfRefinement();
     this.typeOfInstrument            = operation.getTypeOfInstrument();
 }
Esempio n. 2
0
        public void setOpetation(ParametersOperation operation, int indexOfOperation = -1)
        {
            if (indexOfOperation.Equals(-1))
            {
                indexOfOperation = getNumberOfOperations();
            }

            try
            {
                List <ParametersOperation> parametersOperationToList = this.operations.ToList <ParametersOperation>();
                parametersOperationToList.Insert(indexOfOperation, operation);
                this.operations = parametersOperationToList.ToArray <ParametersOperation>();
            }
            catch { }
        }
Esempio n. 3
0
        private DataStructures.CalculationOfSurface.ParametersOperationsForCalculation getParametersOperationsForCalculation()
        {
            this.formationOfLongListWithParametersOfOperation();

            int countLongListOperation = this.getCountLongListOperation();

            double[] surfaceRoughnessRz          = new double[countLongListOperation + 1];;
            double[] kvalitets                   = new double[countLongListOperation + 1];;
            double[] thicknessOfDefectiveCoating = new double[countLongListOperation + 1];;
            double[] coefficientOfRefinement     = new double[countLongListOperation + 1];;

            int[]    idOperation      = new int[countLongListOperation + 1];;
            string[] typeOfInstrument = new string[countLongListOperation + 1];

            ParametersWorkpiece workpiece = Part.getWorkpiece();

            surfaceRoughnessRz[0]          = workpiece.getSurfaceRoughnessRz();
            kvalitets[0]                   = workpiece.getKvalitet();
            thicknessOfDefectiveCoating[0] = workpiece.getThicknessOfDefectiveCoating();

            idOperation[0] = workpiece.getIdWorkpiece();

            double validOffsetSurface = workpiece.getValidOffsetSurface();

            for (int i = 0; i < countLongListOperation; i++)
            {
                ParametersOperation operation = this.parametersOperation[i];

                surfaceRoughnessRz[i + 1]          = operation.getSurfaceRoughnessRz();
                kvalitets[i + 1]                   = operation.getKvalitet();
                thicknessOfDefectiveCoating[i + 1] = operation.getThicknessOfDefectiveCoating();
                coefficientOfRefinement[i + 1]     = operation.getCoefficientOfRefinement();

                idOperation[i + 1] = operation.getIdOperation();

                typeOfInstrument[i + 1] = operation.getTypeOfInstrument();
            }

            typeOfInstrument = changeTypeOfInstrument(typeOfInstrument);

            DataStructures.CalculationOfSurface.ParametersOperationsForCalculation parameters = new DataStructures.CalculationOfSurface.ParametersOperationsForCalculation(surfaceRoughnessRz, kvalitets, thicknessOfDefectiveCoating, coefficientOfRefinement, idOperation, typeOfInstrument, validOffsetSurface);
            return(parameters);
        }
        private static void saveToTableOfOperations(FormSaveToDataBase form, int index)
        {
            Surface surface = Part.getSurfaceOnIndex(0);

            List <ParametersOperation> parametersOperations = surface.getParametersOperation();

            int numberOfOperation = surface.getCountLongListOperation();

            for (int i = 0; i < numberOfOperation; i++)
            {
                ParametersOperation parametersOperation = parametersOperations[i];

                ClassesToCalculate.ResultsOfCalculation resultsOfCalculation = parametersOperation.getResultsOfCalculation();

                string nameOperation = parametersOperation.getTypeOfMachining() + ',' + parametersOperation.getPrecisionOfMachining();

                //  form.переходыTableAdapter.Insert(Convert.ToInt16(form.dataGridView1[0, index - 1].Value.ToString()) + 1, i + 1, nameOperation, parametersOperation.getTypeOfInstrument(), (float)parametersOperation.getSurfaceRoughnessRz(), (float)parametersOperation.getThicknessOfDefectiveCoating(), (float)resultsOfCalculation.getSpatialDeviation(), (float)resultsOfCalculation.getdeviationOfInstallation(), (float)resultsOfCalculation.getAccuracies(), (float)resultsOfCalculation.getNominalAllowance(), (float)resultsOfCalculation.getSizeOfWorkprieceAfterOperation(), parametersOperation.getIdOperation(), null, (float)parametersOperation.getCoefficientOfRefinement(), (int)parametersOperation.getKvalitet());
            }
        }