コード例 #1
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);
        }
コード例 #2
0
ファイル: PadInfo.cs プロジェクト: ShuDiamonds/PIC-project
        public override ReadCE3.RdStatus RdMb3Member(string str1, string str2, ReadCE3 readCE3)
        {
            switch (str1)
            {
            case "S":
                shape = MbeObjPin.GetPadShapeValue(str2);
                return(ReadCE3.RdStatus.NoError);

            case "W":
                try { Width = Convert.ToInt32(str2); }
                catch (Exception) { Width = MbeObjLine.DEFAULT_LINE_WIDTH; }
                return(ReadCE3.RdStatus.NoError);

            case "H":
                try { Height = Convert.ToInt32(str2); }
                catch (Exception) { Height = MbeObjLine.DEFAULT_LINE_WIDTH; }
                return(ReadCE3.RdStatus.NoError);

            default:
                return(ReadCE3.RdStatus.NoError);
            }
        }