예제 #1
0
        private void OnOK(object sender, EventArgs e)
        {
            double d;
            int    n;
            bool   err = false;

            //try { d = Convert.ToDouble(textPtnGap.Text); }
            //catch (Exception) { d = 2000; }
            d          = LengthString.ToDouble(textPtnGap.Text, 2000);
            n          = (int)(d * 10000);
            PatternGap = n;
            if (PatternGap != n)
            {
                textPtnGap.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            try { n = Convert.ToInt32(textErrChkLimit.Text); }
            catch (Exception) { n = 100; }
            ErrorChkLimit = n;
            if (ErrorChkLimit != n)
            {
                textErrChkLimit.BackColor = MbeColors.ColorInputErr;
                err = true;
            }
            if (err)
            {
                return;
            }

            DialogResult = DialogResult.OK;
        }
예제 #2
0
        private bool CheckInputValue()
        {
            double val;
            int    nVal;
            bool   err = false;

            val   = LengthString.ToDouble(textBoxX.Text, -1.0);
            nVal  = (int)(val * 10000);
            MoveX = nVal;
            if (MoveX != nVal)
            {
                textBoxX.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            val   = LengthString.ToDouble(textBoxY.Text, -1.0);
            nVal  = (int)(val * 10000);
            MoveY = nVal;
            if (MoveY != nVal)
            {
                textBoxY.BackColor = MbeColors.ColorInputErr;
                err = true;
            }
            return(!err);
        }
예제 #3
0
        private bool SaveGridInfoSetting()
        {
            double dPitch;
            int    n;
            bool   err = false;

            dPitch = LengthString.ToDouble(textPitch.Text, 0.0);
            n      = (int)Math.Round(dPitch * 10000);
            if (n >= GridInfo.MIN_GRID_VALUE && n <= GridInfo.MAX_GRID_VALUE)
            {
                currentGridInfo.Horizontal = n;
            }
            else
            {
                textPitch.BackColor = MbeColors.ColorInputErr;
                err = true;
            }


            dPitch = LengthString.ToDouble(textPitchV.Text, 0.0);
            n      = (int)Math.Round(dPitch * 10000);
            if (n >= GridInfo.MIN_GRID_VALUE && n <= GridInfo.MAX_GRID_VALUE)
            {
                currentGridInfo.Vertical = n;
            }
            else
            {
                textPitchV.BackColor = MbeColors.ColorInputErr;
                err = true;
            }
            currentGridInfo.DisplayEvery = (int)spinDisplayEvery.Value;
            return(!err);
        }
예제 #4
0
        private bool CheckInputValue()
        {
            double val;
            int    nVal;
            bool   err = false;

            val       = LengthString.ToDouble(textWidth.Text, -1.0);
            nVal      = (int)(val * 10000);
            LineWidth = nVal;
            if (LineWidth != nVal)
            {
                textWidth.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            val    = LengthString.ToDouble(textRadius.Text, -1.0);
            nVal   = (int)(val * 10000);
            Radius = nVal;
            if (Radius != nVal)
            {
                textRadius.BackColor = MbeColors.ColorInputErr;
                err = true;
            }


            try { val = Convert.ToDouble(textStartAngle.Text); }
            catch (Exception) { val = -1; }
            nVal       = (int)(val * 10);
            StartAngle = nVal;
            if (StartAngle != nVal)
            {
                textStartAngle.BackColor = MbeColors.ColorInputErr;
                err = true;
            }


            try { val = Convert.ToDouble(textEndAngle.Text); }
            catch (Exception) { val = -1; }
            nVal     = (int)(val * 10);
            EndAngle = nVal;
            if (EndAngle != nVal)
            {
                textEndAngle.BackColor = MbeColors.ColorInputErr;
                err = true;
            }
            if (err)
            {
                return(false);
            }

            return(true);
        }
예제 #5
0
        private void IDOK_Click(object sender, EventArgs e)
        {
            bool   err = false;
            double _d;
            int    _n;

            _d = LengthString.ToDouble(textLeftMargin.Text, -1);
            _n = (int)(_d * 10000);
            PrintLeftMargin = _n;
            if (PrintLeftMargin != _n)
            {
                textLeftMargin.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            _d = LengthString.ToDouble(textBottomMargin.Text, -1);
            _n = (int)(_d * 10000);
            PrintBottomMargin = _n;
            if (PrintBottomMargin != _n)
            {
                textBottomMargin.BackColor = MbeColors.ColorInputErr;
                err = true;
            }
            print2xMode       = check2xPrintMode.Checked;
            printMirror       = checkMirror.Checked;
            centerPunchMode   = checkCenterPunchMode.Checked;
            printToolMarkMode = checkToolMarkMode.Checked;
            printHeader       = checkBoxHeader.Checked;
            headerText        = textBoxHeader.Text;

            //printColorMode = (MbeView.PrintColorModeValue)(checkPrintColor.Checked ? 1 : 0);
            if (radioBW.Checked)
            {
                printColorMode = MbeView.PrintColorModeValue.BlackAndWhite;
            }
            else if (radioColVector.Checked)
            {
                printColorMode = MbeView.PrintColorModeValue.ColorVector;
            }
            else
            {
                printColorMode = MbeView.PrintColorModeValue.ColorBitmap;
            }

            //Properties.Settings.Default.PrintCurrentView = checkCurrentView.Checked;
            printCurrentView = checkCurrentView.Checked;
            if (!err)
            {
                DialogResult = DialogResult.OK;
            }
        }
예제 #6
0
        private bool CheckInputValue()
        {
            double _width;
            double _height;
            bool   err = false;


            _width  = LengthString.ToDouble(textWidth.Text, -1.0);
            _height = LengthString.ToDouble(textHeight.Text, -1.0);

            int _nWidth  = (int)(_width * 10000);
            int _nHeight = (int)(_height * 10000);


            if ((_nWidth < MbeObjPin.MIN_PAD_SIZE) || (_nWidth > MbeObjPin.MAX_PAD_SIZE))
            {
                textWidth.BackColor = MbeColors.ColorInputErr;
                err = true;
            }
            else
            {
                landWidth = _nWidth;
            }


            if ((_nHeight < MbeObjPin.MIN_PAD_SIZE) || (_nHeight > MbeObjPin.MAX_PAD_SIZE))
            {
                textHeight.BackColor = MbeColors.ColorInputErr;
                err = true;
            }
            else
            {
                landHeight = _nHeight;
            }



            if (err)
            {
                return(false);
            }

            shape = (radioObround.Checked ? MbeObjPin.PadShape.Obround : MbeObjPin.PadShape.Rect);
            thermalReliefSetting = (checkInhibitThermalRelief.Checked ? MbeObjPin.PadThermalRelief.Solid : MbeObjPin.PadThermalRelief.ThmlRlfInComp);
            no_metalMask         = checkNoMetalMask.Checked;
            no_resistMask        = checkNoResistMask.Checked;

            return(true);
        }
예제 #7
0
        private bool CheckInputValue()
        {
            double _width;

            _width = LengthString.ToDouble(textWidth.Text, MbeObjLine.DEFAULT_LINE_WIDTH / 10000.0);

            int _nWidth = (int)(_width * 10000);

            if ((_nWidth < MbeObjLine.MIN_LINE_WIDTH) || (_nWidth > MbeObjLine.MAX_LINE_WIDTH))
            {
                textWidth.BackColor = MbeColors.ColorInputErr;
                return(false);
            }

            lineWidth = _nWidth;
            return(true);
        }
예제 #8
0
        private bool CheckInputValue()
        {
            int    n;
            double d;
            bool   err = false;


            d          = LengthString.ToDouble(textTraceWidth.Text, MbeObjPolygon.DEFAULT_TRACE_WIDTH / 10000.0);
            n          = (int)Math.Round(d * 10000);
            TraceWidth = n;
            if (TraceWidth != n)
            {
                textTraceWidth.BackColor = MbeColors.ColorInputErr;
                err = true;
            }


            d          = LengthString.ToDouble(textPtnGAP.Text, MbeObjPolygon.DEFAULT_PATTERN_GAP / 10000.0);
            n          = (int)Math.Round(d * 10000);
            PatternGap = n;
            if (PatternGap != n)
            {
                textPtnGAP.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            if (!bulkMode)
            {
                try { n = Convert.ToInt32(textPriority.Text); }
                catch (Exception) { n = MbeObjPolygon.DEFAULT_PRIORITY; }
                Priority = n;
                if (Priority != n)
                {
                    textPriority.BackColor = MbeColors.ColorInputErr;
                    err = true;
                }
            }

            if (err)
            {
                return(false);
            }

            return(true);
        }
예제 #9
0
        private bool CheckInputValue()
        {
            double _drill;

            _drill = LengthString.ToDouble(textDrill.Text, -1.0);

            int _nDrill = (int)(_drill * 10000);


            //入力値の範囲チェック
            if ((_nDrill < MbeObjHole.MIN_DIA) || (_nDrill > MbeObjHole.MAX_DIA))
            {
                textDrill.BackColor = MbeColors.ColorInputErr;
                return(false);
            }

            drill = _nDrill;
            return(true);
        }
예제 #10
0
        private bool CheckInputValue()
        {
            double _width;
            double _height;
            int    n;
            bool   err = false;



            _width  = LengthString.ToDouble(textBoxLineWidth.Text, -1.0);
            _height = LengthString.ToDouble(textBoxHeight.Text, -1.0);

            n         = (int)Math.Round(_width * 10000);
            LineWidth = n;
            if (LineWidth != n)
            {
                textBoxLineWidth.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            n          = (int)Math.Round(_height * 10000);
            TextHeight = n;
            if (TextHeight != n)
            {
                textBoxHeight.BackColor = MbeColors.ColorInputErr;
                err = true;
            }


            if (err)
            {
                return(false);
            }

            return(true);
        }
예제 #11
0
        private void OnOK(object sender, EventArgs e)
        {
            double _width;
            double _height;
            double _angle;
            int    nVal;
            bool   err = false;

            //try { _width = Convert.ToDouble(textBoxLineWidth.Text); }
            //catch (Exception) { _width = -1; }
            //try { _height = Convert.ToDouble(textBoxHeight.Text); }
            //catch (Exception) { _height = -1; }

            _width    = LengthString.ToDouble(textBoxLineWidth.Text, -1.0);
            nVal      = (int)(_width * 10000);
            LineWidth = nVal;
            if (LineWidth != nVal)
            {
                textBoxLineWidth.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            _height    = LengthString.ToDouble(textBoxHeight.Text, -1.0);
            nVal       = (int)(_height * 10000);
            TextHeight = nVal;
            if (TextHeight != nVal)
            {
                textBoxHeight.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            try {
                if (textBox_angle.Text == "Undefined")
                {
                    Anglex10 = -1;
                }
                else
                {
                    _angle   = Convert.ToDouble(textBox_angle.Text);
                    nVal     = (int)(_angle * 10);
                    Anglex10 = nVal;
                    if (Anglex10 != nVal)
                    {
                        textBox_angle.BackColor = MbeColors.ColorInputErr;
                        err = true;
                    }
                }
            }
            catch {
                textBox_angle.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            if (err)
            {
                return;
            }

            componentName = textBoxName.Text;
            refNumString  = textBoxRefNum.Text;
            packageName   = textBoxPackage.Text;
            remarksText   = textBoxRemarks.Text;
            drawRefOnDoc  = checkBoxDrawOnDoc.Checked;
            DialogResult  = DialogResult.OK;
        }
예제 #12
0
        private void IDOK_Click(object sender, EventArgs e)
        {
            bool   err = false;
            double _d;
            int    _n;

            _d          = LengthString.ToDouble(textLeft.Text, -1);
            _n          = (int)(_d * 10000);
            ExpAreaLeft = _n;
            if (ExpAreaLeft != _n)
            {
                textLeft.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            _d            = LengthString.ToDouble(textBottom.Text, -1);
            _n            = (int)(_d * 10000);
            ExpAreaBottom = _n;
            if (ExpAreaBottom != _n)
            {
                textBottom.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            _d           = LengthString.ToDouble(textWidth.Text, -1);
            _n           = (int)(_d * 10000);
            ExpAreaWidth = _n;
            if (ExpAreaWidth != _n)
            {
                textWidth.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            _d            = LengthString.ToDouble(textHeight.Text, -1);
            _n            = (int)(_d * 10000);
            ExpAreaHeight = _n;
            if (ExpAreaHeight != _n)
            {
                textHeight.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            try {
                _n = Convert.ToInt32(textResolution.Text);
            }
            catch {
                _n = 0;
            }
            Resolution = _n;
            if (Resolution != _n)
            {
                textResolution.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            DestPath = textFileName.Text;
            if (DestPath.Length == 0)
            {
                textFileName.BackColor = MbeColors.ColorInputErr;
                err = true;
            }

            if (err)
            {
                return;
            }

            ColorMode = checkColorMode.Checked;

            Properties.Settings.Default.ExpBmpLeft       = ExpAreaLeft;
            Properties.Settings.Default.ExpBmpBottom     = ExpAreaBottom;
            Properties.Settings.Default.ExpBmpWidth      = ExpAreaWidth;
            Properties.Settings.Default.ExpBmpHeight     = ExpAreaHeight;
            Properties.Settings.Default.ExpBmpResolution = Resolution;
            Properties.Settings.Default.ImageColorMode   = ColorMode;

            DialogResult = DialogResult.OK;
        }