public static void clickOnTreeWorkpiece(int idWorkpiece, FormOfSelectWorkpiece form) { ParametersWorkpiece parameters = extractionOfParametersOfWorkpiece(idWorkpiece); Part.setWorkpiece(parameters); parameters.insertParametersOfWorkpieceInTextboxes(form); }
public static ParametersWorkpiece extractionOfParametersOfWorkpiece(int idWorkpiece) { ParametersWorkpiece workpiece = Tables.getParametersOfWorkpieces().getParametersWorkprieceOnIndex(idWorkpiece); return(workpiece); /* TreeNode node = e.Node; * * string nameOfWorkpiece = node.Text; * int kvalitet = Convert.ToInt32(node.FirstNode.FirstNode.Text); * double thicknessOfDefectiveCoating = Convert.ToDouble(node.FirstNode.NextNode.NextNode.FirstNode.Text); * int idWorkpiece = Convert.ToInt32(node.FirstNode.NextNode.NextNode.NextNode.FirstNode.Text); * * string stringRz = node.FirstNode.NextNode.FirstNode.Text; * string[] splitStringRz = parseStringRz(stringRz); * double surfaceRoughnessRz = Convert.ToDouble(splitStringRz[0]); * * string stringRecommendedIntervalRz = splitStringRz[1]; * string[] splitStringRecommendedIntervalRz = parseStringRecommendedIntervalRz(stringRecommendedIntervalRz); * Interval recommendedIntervalRz = createIntervalRz(splitStringRecommendedIntervalRz); * * ParametersWorkpiece parameters = new ParametersWorkpiece(nameOfWorkpiece, idWorkpiece, surfaceRoughnessRz, recommendedIntervalRz, kvalitet, thicknessOfDefectiveCoating); * return parameters; */ }
private static void saveWorkpieceToTableOfOperations(FormSaveToDataBase form, int index) { ParametersWorkpiece parametersWorkpiece = Part.getWorkpiece(); // ClassesToCalculate.ResultsOfCalculation resultOfCalculation = Part.getSurfaceOnIndex(0).getResultsOfCalculation(); // form.переходыTableAdapter.Insert(Convert.ToInt16(form.dataGridView1[0, index - 1].Value.ToString()) + 1, 0, parametersWorkpiece.getNameOfWorkpiece(), "", (float)parametersWorkpiece.getSurfaceRoughnessRz(), (float)parametersWorkpiece.getThicknessOfDefectiveCoating(), (float)resultOfCalculation.getSpatialDeviation()[0], (float)resultOfCalculation.getdeviationOfInstallation()[0], (float)resultOfCalculation.getAccuracies()[0], (float)resultOfCalculation.getNominalAllowance()[0], (float)resultOfCalculation.getSizeOfWorkprieceAfterOperation()[0], parametersWorkpiece.getIdWorkpiece(), null, (float)parametersWorkpiece.getValidOffsetSurface(), (int)parametersWorkpiece.getKvalitet()); }
public static void clickOnTreeWorkpiece(TreeNodeMouseClickEventArgs e, FormOfSelectWorkpiece form) { int idWorkpiece = e.Node.Index; ParametersWorkpiece parameters = extractionOfParametersOfWorkpiece(idWorkpiece); Part.setWorkpiece(parameters); parameters.insertParametersOfWorkpieceInTextboxes(form); }
private static int saveWorkpiece(int cipherDetail, int idCalculation, ParametersWorkpiece workpiece) { int idOperation = workpiece.getIdWorkpieceInTable(); string nameOperation = workpiece.getNameOfWorkpiece(); dbConnection.SetQuery($@"INSERT INTO {TECHNOLOGICAL_PROCESS} VALUES ({0}, {idOperation}, '{nameOperation}', {cipherDetail}, {idCalculation})"); return(getIdentCurrent(TECHNOLOGICAL_PROCESS)); }
public static void buttonSelectWorkpriece(MainForm form) { openingOfFormOfSelectWorkpriece(); ParametersWorkpiece workpiece = Part.getWorkpiece(); if (workpiece != null) { string nameOfWorkpiece = workpiece.getNameOfWorkpiece(); insertNameOfWorkpieceInTreeViewAndTextBox(form, nameOfWorkpiece); enabledTextBoxes(form); } }
private static void saveToTableTechnologicalProcessAndSurfaces(FormSaveToDataBase form, int cipherDetail, int idCalculation) { ParametersWorkpiece workpiece = Part.getWorkpiece(); int idWorkpieceInDB = saveWorkpiece(cipherDetail, idCalculation, workpiece); List <Operation> technologicalProcess = Part.getSurfaceOnIndex(0).getOperations(); int countOperation = Part.getSurfaceOnIndex(0).getCountShortListOperation(); for (int i = 0; i < countOperation; i++) { int idOperation = saveOperationInTechnologicalProcess(cipherDetail, idCalculation, technologicalProcess[i], i + 1); } saveSurfaces(cipherDetail, idCalculation); }
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); }
public static void setWorkpiece(ParametersWorkpiece workpirece) { Part.workpriece = workpirece; }
private static void saveWorkpriece() { ParametersWorkpiece workpriece = Tables.getParametersOfWorkpieces().getParametersWorkprieceOnIndex(EventOutputDataFromDataBase.workpriece.getIdWorkpriece()); Part.setWorkpiece(workpriece); }