Exemple #1
0
        /// <summary>
        /// 加载组件
        /// </summary>
        /// <param name="Globe"></param>
        /// <param name="Parent"></param>
        public void LoadPlugin(iTelluro.GlobeEngine.MapControl3D.GlobeView Globe, PnlLeftControl Parent)
        {
            _globeView = Globe;
            _parent    = Parent;
            this.Dock  = DockStyle.Fill;
            //绑定控制台输出
            //textBox4.BindConsole();
            try
            {
                //绑定数据源
                NodeModel[] nodes = Parent.ProjectModel.Nodes.Where(t => t.PNode == Guids.PMHL).ToArray();
                fileChooseControl1.BindSource(Parent, (nodes != null && nodes.Count() > 0) ? nodes[0].NodeName : string.Empty);
                fileChooseControl2.BindSource(Parent, (nodes != null && nodes.Count() > 1) ? nodes[1].NodeName : string.Empty);
                fileChooseControl3.BindSource(Parent, (nodes != null && nodes.Count() > 2) ? nodes[2].NodeName : string.Empty);

                //显示之前的结果
                _xmlPath = Path.Combine(Path.GetDirectoryName(Parent.ProjectModel.ProjectPath), ConfigNames.SlopeConfluence);
                if (File.Exists(_xmlPath))
                {
                    PMHLResult result = XmlHelper.Deserialize <PMHLResult>(_xmlPath);
                    if (result != null)
                    {
                        textBox1.Text = result.L2 == 0 ? "" : result.L2.ToString();
                        textBox2.Text = result.l2 == 0 ? "" : result.l2.ToString();
                        textBox3.Text = result.A2 == 0 ? "" : result.A2.ToString();
                    }
                }
            }
            catch
            {
            }
            Parent.UIParent.Controls.Add(this);
        }
Exemple #2
0
 private void 新建工程ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (AskSave() == true)
     {
         NewProject NJ = new NewProject();
         if (DialogResult.OK == NJ.ShowDialog())
         {
             _FullPath = NJ.ProjectPath;
             if (_pnlLeft == null)
             {
                 _pnlLeft             = new PnlLeftControl(_globeView, this.tabControl1);
                 _pnlLeft.Dock        = DockStyle.Fill;
                 _pnlLeft.OnChanged  += _pnlLeft_OnChanged;
                 _pnlLeft.OnCaculate += _pnlLeft_OnCaculate;
                 Pnl_Main_Left.Controls.Add(_pnlLeft);
             }
             Pnl_Main_Left.Show();
             pnl_Main_Right.Show();
             _pnlLeft.InitialzeProject(_FullPath);
             //设置标题
             this.Text            = string.Format("{0}-泥石流小流域洪峰流量计算", _pnlLeft.ProjectModel.ProjectName);
             btnImportDom.Enabled = true;
             btnImportShp.Enabled = true;
         }
     }
 }
 /// <summary>
 /// 加载组件
 /// </summary>
 /// <param name="Globe"></param>
 /// <param name="Parent"></param>
 public void LoadPlugin(iTelluro.GlobeEngine.MapControl3D.GlobeView Globe, PnlLeftControl Parent)
 {
     _globeView = Globe;
     _parent    = Parent;
     this.Dock  = DockStyle.Fill;
     //绑定控制台输出
     //textBox4.BindConsole();
     Parent.UIParent.Controls.Add(this);
 }
Exemple #4
0
 /// <summary>
 /// 绑定数据源
 /// </summary>
 /// <param name="model"></param>
 public void BindSource(PnlLeftControl model, string selectedName)
 {
     _model               = model;
     _model.OnChanged    += _model_OnChanged;
     cmbAll.DisplayMember = "NodeName";
     cmbAll.ValueMember   = "Path";
     IniliazeCombox(model.ProjectModel);
     //选中节点上存在的条件
     foreach (var item in cmbAll.Items)
     {
         NodeModel temp = item as NodeModel;
         if (temp.NodeName == selectedName)
         {
             cmbAll.SelectedItem = item;
             break;
         }
     }
 }
Exemple #5
0
 private void IniProject()
 {
     //初始化化树节点
     if (_pnlLeft == null)
     {
         _pnlLeft             = new PnlLeftControl(_globeView, this.tabControl1);
         _pnlLeft.Dock        = DockStyle.Fill;
         _pnlLeft.OnChanged  += _pnlLeft_OnChanged;
         _pnlLeft.OnCaculate += _pnlLeft_OnCaculate;
         Pnl_Main_Left.Controls.Add(_pnlLeft);
     }
     Pnl_Main_Left.Show();
     pnl_Main_Right.Show();
     _pnlLeft.InitialzeProject(_FullPath);
     //设置标题
     this.Text            = string.Format("{0}-泥石流小流域洪峰流量计算", _pnlLeft.ProjectModel.ProjectName);
     btnImportDom.Enabled = true;
     btnImportShp.Enabled = true;
 }
Exemple #6
0
        /// <summary>
        /// 加载组件
        /// </summary>
        /// <param name="Globe"></param>
        /// <param name="Parent"></param>
        public void LoadPlugin(iTelluro.GlobeEngine.MapControl3D.GlobeView Globe, PnlLeftControl Parent)
        {
            _globeView = Globe;
            _parent    = Parent;
            this.Dock  = DockStyle.Fill;
            //绑定控制台输出
            //textBox4.BindConsole();
            //初始化基础参数
            DefaultArgModel model = XmlHelper.Deserialize <DefaultArgModel>(Path.Combine(Path.GetDirectoryName(Parent.ProjectModel.ProjectPath),
                                                                                         ConfigNames.DefaultArgModel));

            if (model != null)
            {
                txteps1.Text = model.esp1;
                txteps2.Text = model.esp2;
                txtp1.Text   = model.p1;
                txtQm.Text   = model.Qm;
                txttc.Text   = model.tc;
            }
            Parent.UIParent.Controls.Add(this);
        }