Exemple #1
0
        private void checkingDataCorrect_Tick(object sender, EventArgs e)
        {
            if (isDoneConvert)
            {
                indexTimer++;
                if (indexTimer * checkingDataCorrect.Interval >= UPDATE_STATUS_TIMER)
                {
                    indexTimer = 0;
                    converterProgressBar.Value = 0;
                    progressPercentLabel.Text  = "0%";
                    progressStatusLabel.Text   = STANDART_CONVERT_STATUS;
                }
            }

            int numberOfPoints;

            try { numberOfPoints = Int32.Parse(pointsNumberTextBox.Text); }
            catch (Exception ex) { numberOfPoints = -1; }
            converter.setNumberOfPoints(numberOfPoints);

            int rectSizeX;

            try { rectSizeX = Int32.Parse(xRecSize.Text); }
            catch (Exception ex) { rectSizeX = -1; }
            converter.setTargetFieldSizeX(rectSizeX);

            int rectSizeY;

            try { rectSizeY = Int32.Parse(yRecSize.Text); }
            catch (Exception ex) { rectSizeY = -1; }
            converter.setTargetFieldSizeY(rectSizeY);

            int rectSizeZ;

            try { rectSizeZ = Int32.Parse(zRecSize.Text); }
            catch (Exception ex) { rectSizeZ = -1; }
            converter.setTargetFieldSizeZ(rectSizeZ);

            int rectBeginX;

            try { rectBeginX = Int32.Parse(xRecOffset.Text); }
            catch (Exception ex) { rectBeginX = -1; }
            converter.setTargetFieldBeginX(rectBeginX);

            int rectBeginY;

            try { rectBeginY = Int32.Parse(yRecOffset.Text); }
            catch (Exception ex) { rectBeginY = -1; }
            converter.setTargetFieldBeginY(rectBeginY);

            int rectBeginZ;

            try { rectBeginZ = Int32.Parse(zRecOffset.Text); }
            catch (Exception ex) { rectBeginZ = -1; }
            converter.setTargetFieldBeginZ(rectBeginZ);

            int rectStepX;

            try { rectStepX = Int32.Parse(xRecStep.Text); }
            catch (Exception ex) { rectStepX = -1; }
            converter.setTargetFieldOffsetX(rectStepX);

            int rectStepY;

            try { rectStepY = Int32.Parse(yRecStep.Text); }
            catch (Exception ex) { rectStepY = -1; }
            converter.setTargetFieldOffsetY(rectStepY);

            int rectStepZ;

            try { rectStepZ = Int32.Parse(zRecStep.Text); }
            catch (Exception ex) { rectStepZ = -1; }
            converter.setTargetFieldOffsetZ(rectStepZ);

            converter.setTargetName("tempSavingCalculations");

            if (messages != null)
            {
                string messagesBoxText = "";
                foreach (string message in messages)
                {
                    messagesBoxText += message + Environment.NewLine + Environment.NewLine;
                }
                messageBox.Text = messagesBoxText;
            }
        }