Esempio n. 1
0
        private void tsmiTemplateUse_Click(object sender, EventArgs e)
        {
            TreeNode currentNode = this.tvSectionEdit.SelectedNode;

            setUpIDByTN(currentNode);

            FormSectAddNewWell formNew = new FormSectAddNewWell(2); //通过2 构造函数 通知模板选择 模板从剖面分析来,不要井号
            var result = formNew.ShowDialog();

            if (result == DialogResult.OK)
            {
                string xtlFileName = formNew.ReturnFileNameXMT;
                bool   bNew        = true;
                if (File.Exists(filePathOper))
                {
                    DialogResult dialogResult = MessageBox.Show("确认应用新模板?", this.sJH + "剖面已存在", MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.No)
                    {
                        bNew = false;
                    }
                }
                if (bNew == true)
                {
                    string xtmPath = Path.Combine(cProjectManager.dirPathTemplate, xtlFileName);
                    cIOtemplate.copyTemplate(xtmPath, filePathOper, this.sJH);
                }
            }
        }
Esempio n. 2
0
        void createNewFile()
        {
            FormSectAddNewWell formNew = new FormSectAddNewWell();
            var result = formNew.ShowDialog();

            if (result == DialogResult.OK)
            {
                this.sJHSelected = formNew.ReturnJH;            //values preserved after close
                string xtlFileName = formNew.ReturnFileNameXMT;
                tbgViewEdit.Text = this.sJHSelected;
                filePathOperSetup();
                bool bNew = true;
                if (File.Exists(filePathOper))
                {
                    DialogResult dialogResult = MessageBox.Show("是否新建并覆盖?", this.sJHSelected + "单井剖面已存在", MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.No)
                    {
                        bNew = false;
                    }
                }
                if (bNew == true)
                {
                    initializeSectionFlow(xtlFileName);
                    updateTV();
                    makeNewSVG();
                }
            }
        }
Esempio n. 3
0
        void insertWell()
        {
            FormSectAddNewWell formNew = new FormSectAddNewWell();
            var result = formNew.ShowDialog();

            if (result == DialogResult.OK)
            {
                string sJHInsert   = formNew.ReturnJH;          //values preserved after close
                string xtlFileName = formNew.ReturnFileNameXMT;
                bool   bNew        = true;
                filePathOper = dirSectionData + "//" + sJHInsert + ".xml";
                if (File.Exists(filePathOper))
                {
                    DialogResult dialogResult = MessageBox.Show("是否新建并覆盖?", "文件已存在", MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.No)
                    {
                        bNew = false;
                    }
                }
                if (bNew == true)
                {
                    ItemWellSection wellSectionInsert = new ItemWellSection(sJHInsert, 0, 0);
                    //默认把显示深度设为全井段
                    wellSectionInsert.fShowedDepthTop  = 0;
                    wellSectionInsert.fShowedDepthBase = wellSectionInsert.fWellBase;
                    Point headView = cCordinationTransform.transRealPointF2ViewPoint(
                        wellSectionInsert.WellPathList[0].dbX, wellSectionInsert.WellPathList[0].dbY, cProjectData.dfMapXrealRefer, cProjectData.dfMapYrealRefer, cProjectData.dfMapScale);
                    wellSectionInsert.fXview = headView.X;
                    wellSectionInsert.fYview = headView.Y;
                    //CSS的加入井
                    cXmlDocSectionGeo.insertWell(this.filePathSectionCss, this.sJH, wellSectionInsert, 0);
                    //copy文件到目录
                    cIOtemplate.copyTemplate(xtlFileName, filePathOper, wellSectionInsert.sJH, wellSectionInsert.fShowedDepthTop, wellSectionInsert.fShowedDepthBase);
                    updateTVandList();
                    makeSVGmap();
                }
            }
        }