private static void saveSurfaces(int cipherDetail, int idCalculation)
        {
            List <Surface> surfaces     = Part.getSurfaces();
            int            countSufaces = Part.getCountSurfaces();

            for (int i = 1; i < countSufaces; i++)
            {
                Surface             surface             = surfaces[i];
                ParametersOfSurface parametersOfSurface = surface.getParametersOfSurface();

                string nameSurface = surface.getNameSurface();

                double diameterOfSurface = parametersOfSurface.getDiameterOfPart();

                int typeOfPart             = parametersOfSurface.getTypeOfPart().getIndex();
                int typeOfAllowance        = parametersOfSurface.getTypeOfAllowance().getIndex();
                int typeOfProcessedSurface = parametersOfSurface.getTypeOfProcessedSurface().getIndex();

                double surfaseRoughness = parametersOfSurface.getSurfaceRoughnessRz();

                double holeDepth = parametersOfSurface.getHoleDepth();
                double tolerance = parametersOfSurface.getAllowance();

                dbConnection.SetQuery($@"INSERT INTO {SURFACE} VALUES ({idCalculation}, '{nameSurface}', {doubleToStringForDb(diameterOfSurface)}, {typeOfPart}, {typeOfAllowance}, {typeOfProcessedSurface}, {doubleToStringForDb(surfaseRoughness)}, {doubleToStringForDb(holeDepth)}, {doubleToStringForDb(tolerance)})");

                int idSurface = getIdentCurrent(SURFACE);

                saveToTableOperationsAndResults(idSurface, surface, idCalculation);
            }
        }
Exemplo n.º 2
0
        private static void changeIdOperationsInSurfaces(Operation operationInTechnologicalProcess, int idOnTechnologicalProcessNew)
        {
            int            countSurfaces = Part.getCountSurfaces();
            List <Surface> surfaces      = Part.getSurfaces();

            int idOnTechnologicalProcessOld = operationInTechnologicalProcess.getIdOnTechnologicalProcess();

            operationInTechnologicalProcess.setIdOnTechnologicalProcess(idOnTechnologicalProcessNew);

            for (int i = 1; i < countSurfaces; i++)
            {
                Surface surface = surfaces[i];

                foreach (Operation operation in surface.getOperations())
                {
                    if (operation.getIdOnTechnologicalProcess() == idOnTechnologicalProcessOld)
                    {
                        operation.setIdOnTechnologicalProcess(idOnTechnologicalProcessNew);
                    }
                }
            }
        }
Exemplo n.º 3
0
        private static void distributionIdOnTechnologicalProcess(List <Operation> technologicalProcess)
        {
            int countSurfaces = Part.getCountSurfaces();
            int count         = technologicalProcess.Count;

            if (countSurfaces == 1)
            {
                for (int i = 0; i < count; i++)
                {
                    technologicalProcess[i].setIdOnTechnologicalProcess(i);
                }
            }
            else
            {
                checkIdOperationsInSurfaces();

                for (int i = 0; i < count; i++)
                {
                    changeIdOperationsInSurfaces(technologicalProcess[i], i);
                }
            }
        }
Exemplo n.º 4
0
        private static void checkIdOperationsInSurfaces()
        {
            List <Surface> surfaces      = Part.getSurfaces();
            int            countSurfaces = Part.getCountSurfaces();

            for (int i = 1; i < countSurfaces; i++)
            {
                Surface surface = surfaces[i];

                int countOperation = surface.getCountShortListOperation();

                for (int g = 0; g < countOperation; g++)
                {
                    Operation operation = surface.getOperationOnIndex(g);

                    if (!includedInTechnologicalProcess(operation))
                    {
                        surface.deleteOperation(g);
                        g--;
                        countOperation--;
                    }
                }
            }
        }