Ejemplo n.º 1
0
 private void AddFeatureLayer(IFeatureLayer iFLayer)
 {
     if (iFLayer != null)
     {
         if (PPipeCfg.IsPipelineLayer(iFLayer.Name, enumPipelineDataType.Line))
         {
             var layerboxItem = new LayerboxItem();
             layerboxItem.m_pPipeLayer = iFLayer;
             _layersCheckedListBox.Items.Add(layerboxItem);
         }
     }
 }
Ejemplo n.º 2
0
 private void AddFeatureLayer(IFeatureLayer iFLayer)
 {
     if (iFLayer != null)
     {
         if (this.pPipeCfg.IsPipelineLayer(iFLayer.Name, enumPipelineDataType.Line))
         {
             LayerboxItem layerboxItem = new LayerboxItem();
             layerboxItem.m_pPipeLayer = iFLayer;
             this.CmbLayers.Items.Add(layerboxItem);
         }
     }
 }
Ejemplo n.º 3
0
        private void CalButton_Click(object sender, EventArgs e)
        {
            _pointRadioChecked = this.PointRadio.Checked;
            _isGeometrySet     = this.GeometrySet.Checked;
            _featureLayers     = new List <IFeatureLayer>();
            foreach (object checkedItem in this.Layerbox.CheckedItems)
            {
                LayerboxItem item = checkedItem as LayerboxItem;
                if (item == null)
                {
                    continue;
                }
                _featureLayers.Add(item.m_pPipeLayer);
            }
            if (_featureLayers.Count <= 0)
            {
                return;
            }

            _waitForm = new WaitForm()
            {
                VisibleBackButton         = true,
                VisibleprogressBarControl = true,
                Description = "状态:准备统计,请稍等...",
                TopMost     = true
            };
            _waitForm.Worker.RunWorkerCompleted += Worker_RunWorkerCompleted;
            _waitForm.Worker.DoWork             += Worker_DoWork;

            _waitForm.Show();
            while (_waitForm.Worker.IsBusy)
            {
                System.Threading.Thread.Sleep(1000);
                _waitForm.Description = "状态:任务正忙,请稍等...";
            }
            CalButton.Enabled = false;
            _waitForm.Worker.RunWorkerAsync();
        }
Ejemplo n.º 4
0
        private void CalButton_Click(object sender, EventArgs e)
        {
            if (_idxQdms < 0 || _idxZdms < 0)
            {
                return;
            }
            _featureLayers = new List <IFeatureLayer>();
            foreach (object checkedItem in checkedListBox1.CheckedItems)
            {
                LayerboxItem item = checkedItem as LayerboxItem;
                if (item == null)
                {
                    continue;
                }
                _featureLayers.Add(item.m_pPipeLayer);
            }
            if (_featureLayers == null || _featureLayers.Count <= 0)
            {
                MessageBox.Show(@"请选定需要统计的管线");
                return;
            }
            int rowCount = this.dataGridView1.RowCount;

            if (rowCount <= 0)
            {
                MessageBox.Show(@"请确定上下限的值,其值不能为空");
                return;
            }
            if (this.dataGridView1[0, 0].Value == null && this.dataGridView1[1, 0].Value == null)
            {
                MessageBox.Show(@"没有确定埋深的范围");
                return;
            }
            values = new Dictionary <double, double>();
            int count2 = this.dataGridView1.Rows.Count;

            for (int j = 0; j < count2; j++)
            {
                this.DXArray.Clear();
                string text  = (string)this.dataGridView1[0, j].Value;
                string text2 = (string)this.dataGridView1[1, j].Value;
                if (text == null || text2 == null)
                {
                    MessageBox.Show(@"请确定上下限的值,其值不能为空");
                    return;
                }
                double num  = 0.0;
                double num2 = 0.0;
                try
                {
                    num  = Convert.ToDouble(text);
                    num2 = Convert.ToDouble(text2);
                    values.Add(num, num2);
                }
                catch (Exception)
                {
                    MessageBox.Show(@"请确定上下限的值是否输入有误");
                    return;
                }
            }

            if (values == null || values.Count <= 0)
            {
                return;
            }

            if (_waitForm == null || _waitForm.IsDisposed)
            {
                _waitForm = new WaitForm()
                {
                    VisibleBackButton         = true,
                    VisibleprogressBarControl = true,
                    Description = "状态:准备统计,请稍等...",
                    TopMost     = true
                };
                _waitForm.Worker.RunWorkerCompleted += Worker_RunWorkerCompleted;
                _waitForm.Worker.DoWork             += Worker_DoWork;
            }
            _waitForm.Show();
            while (_waitForm.Worker.IsBusy)
            {
                System.Threading.Thread.Sleep(1000);
                _waitForm.Description = "状态:任务正忙,请稍等...";
            }
            CalButton.Enabled = false;
            _waitForm.Worker.RunWorkerAsync();
        }
Ejemplo n.º 5
0
        private void Calbut2_Click(object sender, EventArgs e)
        {
            _typeCount         = this.listBox1.Items.Count;
            _pointRadioChecked = this.PointRadio.Checked;
            _isGeometrySet     = this.GeometrySet.Checked;
            _featureLayers     = new List <IFeatureLayer>();
            foreach (object checkedItem in this.Layerbox.CheckedItems)
            {
                LayerboxItem item = checkedItem as LayerboxItem;
                if (item == null)
                {
                    continue;
                }
                _featureLayers.Add(item.m_pPipeLayer);
            }
            if (_featureLayers.Count <= 0)
            {
                return;
            }

            if (!_dataTable.Columns.Contains("层名"))
            {
                _dataTable.Columns.Add("层名", typeof(string));
            }
            for (int i = 0; i < this.listBox1.Items.Count; i++)
            {
                if (!_dataTable.Columns.Contains(this.listBox1.Items[i].ToString()))
                {
                    _dataTable.Columns.Add(this.listBox1.Items[i].ToString(), typeof(string));
                    strFields += this.listBox1.Items[i].ToString();
                    if (i < this.listBox1.Items.Count - 1)
                    {
                        strFields += ",";
                    }
                }
            }
            if (this.listBox1.Items.Count < 1)
            {
                MessageBox.Show(@"请添加分类项!");
            }
            else
            {
                _waitForm = new WaitForm()
                {
                    VisibleBackButton         = true,
                    VisibleprogressBarControl = true,
                    Description = "状态:准备统计,请稍等...",
                    TopMost     = true
                };
                _waitForm.Worker.RunWorkerCompleted += Worker_RunWorkerCompleted2;
                _waitForm.Worker.DoWork             += Worker_DoWork2;

                _waitForm.Show();
                while (_waitForm.Worker.IsBusy)
                {
                    System.Threading.Thread.Sleep(1000);
                    _waitForm.Description = "状态:任务正忙,请稍等...";
                }
                CalButton.Enabled = false;
                _waitForm.Worker.RunWorkerAsync();
            }
        }