GXStatistics.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using SuperMap.Data;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using WeifenLuo.WinFormsUI.Docking;
  6. using WWPipeLine.MapBasic.Conditions;
  7. using WWPipeLine.MapBasic;
  8. namespace WWPipeLine.MapTools.Conditions.Statistics
  9. {
  10. /// <summary>
  11. /// 管线-材质统计
  12. /// </summary>
  13. public partial class GXStatistics : ConditionPanel
  14. {
  15. private DatasetVector _dv;
  16. private DatasetVectorEx _dvEx;
  17. public GXStatistics() : base()
  18. {
  19. this.ConditionPanelName = "按管线属性统计";
  20. InitializeComponent();
  21. }
  22. protected override void OnLoad(EventArgs e)
  23. {
  24. this.rbgGXSX.SelectedIndex = 0;//0全部 1材质 2管径 3地址描述 4埋设日期
  25. this.rbgCDSL.SelectedIndex = 0;//0长度 1数量
  26. }
  27. public override object Do(DockPanel dockPanel = null)
  28. {
  29. _dvEx = new DatasetVectorEx(_dv.Name) { DatasetVector = _dv };
  30. DataTable dt = new DataTable() { TableName = "selectResult" };
  31. //全部管线的长度
  32. if (rbgGXSX.SelectedIndex == 0 && rbgCDSL.SelectedIndex == 0)
  33. {
  34. }
  35. //全部管线的数量
  36. if (rbgGXSX.SelectedIndex == 0 && rbgCDSL.SelectedIndex == 1)
  37. {
  38. }
  39. //材质的长度
  40. if (rbgGXSX.SelectedIndex == 1 && rbgCDSL.SelectedIndex == 0)
  41. {
  42. return _dvEx.GetTableByFieldOnUniqueValSumOrder("材质", "cz", "cd");
  43. }
  44. //材质的数量
  45. if (rbgGXSX.SelectedIndex == 1 && rbgCDSL.SelectedIndex == 1)
  46. {
  47. return _dvEx.GetTableByFieldOnUniqueValCount("材质", "cz");
  48. }
  49. //管径的长度
  50. if (rbgGXSX.SelectedIndex == 2 && rbgCDSL.SelectedIndex == 0)
  51. {
  52. return _dvEx.GetTableByFieldOnUniqueValSumOrder("管径", "gj", "cd");
  53. }
  54. //管径的数量
  55. if (rbgGXSX.SelectedIndex == 2 && rbgCDSL.SelectedIndex == 1)
  56. {
  57. return _dvEx.GetTableByFieldOnUniqueValCount("管径", "gj");
  58. }
  59. //地址描述的长度
  60. if (rbgGXSX.SelectedIndex == 3 && rbgCDSL.SelectedIndex == 0)
  61. {
  62. return _dvEx.GetTableByFieldOnUniqueValSumOrder("地址描述", "dzms", "cd");
  63. }
  64. //地址描述的数量
  65. if (rbgGXSX.SelectedIndex == 3 && rbgCDSL.SelectedIndex == 1)
  66. {
  67. return _dvEx.GetTableByFieldOnUniqueValCount("地址描述", "dzms");
  68. }
  69. return dt;
  70. }
  71. public override bool ConditionValid()
  72. {
  73. _dv = this.DatasourceMapControl.Datasets["JSLK"] as DatasetVector;
  74. if (_dv == null)
  75. {
  76. Sunny.UI.UIMessageTip.ShowError("当前数据源中不包含相应的矢量数据集");
  77. return false;
  78. }
  79. return true;
  80. }
  81. }
  82. }