Example #1
0
        /// <summary>
        /// ReadCE3のストリームから、startWordで始まるMbeObjを読み取る
        /// </summary>
        /// <param name="readMb3"></param>
        /// <param name="startWord"></param>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static ReadCE3.RdStatus ReadMbeObj(ReadCE3 readMb3, string startWord, out MbeObj obj)
        {
            ReadCE3.RdStatus result = ReadCE3.RdStatus.NoError;
            obj = null;
            if (startWord == "+MBE_HOLE")
            {
                obj = new MbeObjHole();
            }
            else if (startWord == "+MBE_PTH")
            {
                obj = new MbeObjPTH();
            }
            else if (startWord == "+MBE_PINSMD")
            {
                obj = new MbeObjPinSMD(true);
            }
            else if (startWord == "+MBE_FLASHMARK")
            {
                obj = new MbeObjPinSMD(false);
            }
            else if (startWord == "+MBE_LINE")
            {
                obj = new MbeObjLine();
            }
            else if (startWord == "+MBE_POLYGON")
            {
                obj = new MbeObjPolygon();
            }
            else if (startWord == "+MBE_TEXT")
            {
                obj = new MbeObjText();
            }
            else if (startWord == "+MBE_ARC")
            {
                obj = new MbeObjArc();
            }
            else if (startWord == "+MBE_COMPONENT")
            {
                obj = new MbeObjComponent();
            }
            else
            {
                string strSkipTo = "-" + startWord.Substring(1);
                readMb3.SkipTo(strSkipTo);
            }

            if (obj != null)
            {
                result = obj.RdMb3(readMb3);
                if (result != ReadCE3.RdStatus.NoError)
                {
                    obj = null;
                }
            }
            return(result);
        }
Example #2
0
        /// <summary>
        /// Holeのプロパティ編集ダイアログの起動
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        private bool EditPropertyHole(MbeObjHole obj)
        {
            SetHoleForm dlg = new SetHoleForm();

            dlg.Drill = obj.Diameter;
            DialogResult retv = dlg.ShowDialog();

            if (retv == DialogResult.OK)
            {
                obj.Diameter = dlg.Drill;
                return(true);
            }
            return(false);
        }
Example #3
0
 /// <summary>
 /// コピーコンストラクタ
 /// </summary>
 /// <param name="mbeObjPin"></param>
 public MbeObjHole(MbeObjHole mbeObjHole)
     : base(mbeObjHole)
 {
     dia = mbeObjHole.dia;
 }
Example #4
0
        /// <summary>
        /// 複製を行う
        /// </summary>
        /// <returns></returns>
        public override MbeObj Duplicate()
        {
            MbeObj newObj = new MbeObjHole(this);

            return(newObj);
        }