예제 #1
0
        private void SetHatchParaForm_Load(object sender, EventArgs e)
        {
            int nRet = CSharpInterface.HS_GetHatchPara(ref m_hatchPara);

            if (nRet != 0)
            {
                MessageBox.Show("读取填充参数失败!\n返回值:" + nRet.ToString() + "\n错误信息:"
                                + CSharpInterface.GetError().ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();//关闭此窗口
            }

            m_bFillFirst = m_hatchPara.bFillFirst;
            m_fillData1  = m_hatchPara.newFileData1;
            m_fillData2  = m_hatchPara.newFileData2;

            SetFillData(0, false);
            m_nPrevFillNo = m_nFillNo = 0;
            UpdateDataView();
            UpdateData(false);
        }
예제 #2
0
        void SetFillData(int nNo, bool bSave)
        {
            BaseHatch data = new BaseHatch();

            //
            if (bSave)
            {
                data.bEnable       = m_bEnable;
                data.nFillStyle    = m_nFillStyle;
                data.bEquaDist     = m_bEquaDist;
                data.bKeepAngle    = m_bKeepAngle;
                data.dbSpace       = m_dbSpace;
                data.dbAngle       = m_dbAngle;
                data.dbBeamComp    = m_dbBeamComp;
                data.dbLineReduce  = m_dbLineReduce;
                data.dbStartOffset = m_dbStartOffset;
                data.dbEndOffset   = m_dbEndOffset;
                data.dbMinJump     = m_dbMinJump;

                data.bLoop       = m_bLoop;
                data.nLoopNum    = m_nLoopNum;
                data.dbLoopDist  = m_dbLoopDist;
                data.bRemoveOrg  = m_bRemoveOrg;
                data.bRemoveLine = m_bRemoveFill;

                data.nFillNum = m_nFillNum;
                data.AddDis   = m_dbAddDis;
                data.ProAngle = m_dbAddAngle;

                if (nNo == 0)
                {
                    m_fillData1 = data;
                }
                else
                {
                    m_fillData2 = data;
                }
            }
            else
            {
                if (nNo == 0)
                {
                    data = m_fillData1;
                }
                else
                {
                    data = m_fillData2;
                }

                m_bEnable       = data.bEnable;
                m_nFillStyle    = data.nFillStyle;
                m_bEquaDist     = data.bEquaDist;
                m_bKeepAngle    = data.bKeepAngle;
                m_dbSpace       = data.dbSpace;
                m_dbAngle       = data.dbAngle;
                m_dbBeamComp    = data.dbBeamComp;
                m_dbLineReduce  = data.dbLineReduce;
                m_dbStartOffset = data.dbStartOffset;
                m_dbEndOffset   = data.dbEndOffset;
                m_dbMinJump     = data.dbMinJump;

                m_bLoop       = data.bLoop;
                m_nLoopNum    = data.nLoopNum;
                m_dbLoopDist  = data.dbLoopDist;
                m_bRemoveOrg  = data.bRemoveOrg;
                m_bRemoveFill = data.bRemoveLine;

                m_nFillNum   = data.nFillNum;
                m_dbAddDis   = data.AddDis;
                m_dbAddAngle = data.ProAngle;
                UpdateData(false);
            }
        }