wyq 1 year ago
parent
commit
d8548e4c6b

+ 1 - 1
Service/CapMoni/App.config

@@ -2,7 +2,7 @@
 <configuration>
 	<appSettings>
 		<!--采集文件存放目录-->
-		<add key="FileDir" value="C:\"/>
+		<add key="FileDir" value="E:\"/>
 		<!--采集时长(S)-->
 		<add key="Duration" value="60"/>
 		<!--频点(MHz)多个-->

+ 2 - 5
Service/X2D1TaskServer/Service/TaskService.cs

@@ -557,9 +557,6 @@ namespace X2D1TaskServer.Service
                         int fixedStationDto = dto.FixedStationDto != null ? dto.FixedStationDto.FixedStationId : 0;
                         if (refDetects != null && refDetects.Count > 0)//有参考信号
                         {
-                            //过滤参考信号
-                            beFindRef = false;//固定站目标频点直接做无参
-                            fixedStationDto = 0;//固定站目标频点不需要存储固定站编号
                             data1 = data1.Where(c => !refDetects.Any(r => r.Start == c.Smpstart && r.Length == c.Smplen)).ToList();
                             data2 = data2.Where(c => !refDetects.Any(r => r.Start == c.Smpstart && r.Length == c.Smplen)).ToList();
                         }
@@ -605,8 +602,8 @@ namespace X2D1TaskServer.Service
                         XdSnr = data2[i].Snr,
                         SatTxLon = dto.CapLon,
                         SatTxLat = dto.CapLat,
-                        CdbTxLon = dto.CapLon,
-                        CdbTxLat = dto.CapLat,
+                        CdbTxLon = dto.CdbLon,
+                        CdbTxLat = dto.CdbLat,
                         FreqDown = paramInfo.Minfo.FreqHz,
                         FreqUp = paramInfo.Dinfo.FreqHz,
                         BeFindRef = beFindRef,

+ 72 - 1
XdCxRhDW.App/Controllers/PosController.cs

@@ -449,6 +449,27 @@ namespace XdCxRhDW.App.Controllers
                     Serilog.Log.Error($"推算卫星{dto.AdjaCode}的ECEF星历出错.{ephAdja.msg}");
                     return Error<PosResDto>($"推算卫星{dto.AdjaCode}的ECEF星历出错");
                 }
+
+#warning 测试代码
+                var tarEcef = PhysicsHelper.GeoToEcef((110, 17, 0));
+                var ecefXl1 = (ephMain.data.X, ephMain.data.Y, ephMain.data.Z);
+                var ecefXl2 = (ephAdja.data.X, ephAdja.data.Y, ephAdja.data.Z);
+                var ecefCdb = PhysicsHelper.GeoToEcef((dto.CdbTxLon, dto.CdbTxLat, 0));
+                var ecefRec = PhysicsHelper.GeoToEcef((dto.SatTxLon, dto.SatTxLat, 0));
+                var dt1 = PhysicsHelper.Dto(tarEcef, ecefXl1, ecefRec);
+                var dt2 = PhysicsHelper.Dto(tarEcef, ecefXl2, ecefRec);
+                var dt3 = PhysicsHelper.Dto(tarEcef, ecefCdb);
+                var dto1 = dt1 - dt2;
+                var dto2 = dt1 - dt3;
+                dto.SxDto = Math.Round(dto1 * 1e6 + r.Next(-10, 10) + r.NextDouble(), 3);
+                dto.XdDto = Math.Round(dto2 * 1e6 + r.Next(-10, 10) + r.NextDouble(), 3);
+
+                var refEcef = PhysicsHelper.GeoToEcef((dto.RefLon, dto.RefLat, 0));
+                var refdt1 = PhysicsHelper.Dto(refEcef, ecefXl1, ecefRec);
+                var refdt2 = PhysicsHelper.Dto(refEcef, ecefXl2, ecefRec);
+
+                dto.MainYbDto = Math.Round(refdt1 * 1e6, 3);
+                dto.AdjaYbDto = Math.Round(refdt2 * 1e6, 3);
                 using (RHDWPartContext db = RHDWPartContext.GetContext(dto.SigTime, true))
                 {
                     var StationRes = db.StationRes.Add(new StationRes()
@@ -508,6 +529,7 @@ namespace XdCxRhDW.App.Controllers
                         TarFreqDown = dto.FreqDown,
                     });
 
+
                     var res = PosApi.X2D1_Pos(cgRes, StationRes, dto.CalcConfidence);
                     PosRes posRes = new PosRes()
                     {
@@ -523,6 +545,35 @@ namespace XdCxRhDW.App.Controllers
                         Confidence = (int)res[6],
                         PosResType = EnumPosResType.X2D1,
                     };
+                    if (posRes.PosLon == 999 || posRes.PosLat == 999)//有参无结果时做无参
+                    {
+                        if (ConfigurationManager.AppSettings["UseNewPosX2D1NoRef"] != null
+                     && ConfigurationManager.AppSettings["UseNewPosX2D1NoRef"].ToLower() != "false"
+                     && ConfigurationManager.AppSettings["UseNewPosX2D1NoRef"].ToLower() != "0")
+                        {
+                            res = PosApi.X2D1_PosNoRef_ZL(cgRes, StationRes);
+                        }
+                        else
+                        {
+                            res = PosApi.X2D1_PosNoRef(cgRes, StationRes, dto.CalcConfidence);
+                        }
+                        posRes = new PosRes()
+                        {
+                            FreqUpHz = (long)cgRes.TarFreqUp.Value,
+                            SigTime = dto.SigTime,
+                            TaskInfoID = runTask.ID,
+                            CgResID = cgRes.ID,
+                            CheckResID = ckRes.ID,
+                            PosLon = res[0],
+                            PosLat = res[1],
+                            MirrLon = res[3],
+                            MirrLat = res[4],
+                            Confidence = (int)res[6],
+                            PosResType = EnumPosResType.X2D1NoRef,
+                        };
+
+                    }
+
                     if (dto.TheoryDfoCalc && posRes.PosLon != 999)
                         posRes.TargetState = TheoryDtoDfoApi.TheoryDfo(cgRes, StationRes, posRes, SysConfig.Config.YDPZThreshold);
                     posRes = db.PosRes.Add(posRes);
@@ -677,6 +728,8 @@ namespace XdCxRhDW.App.Controllers
             }
         }
 
+        Random r = new Random();
+
         /// <summary>
         /// 两星一地无参定位(无星历)
         /// </summary>
@@ -722,6 +775,9 @@ namespace XdCxRhDW.App.Controllers
                     Serilog.Log.Error($"系统缺少编号{dto.AdjaCode}卫星的星历!");
                     return Error<PosResDto>($"系统缺少编号{dto.AdjaCode}卫星的星历!");
                 }
+
+
+
                 Serilog.Log.Information($"卫星{dto.AdjaCode}使用发布时刻为{xl2.TimeUTC:yyyyMMddHHmmss}的星历进行推算");
                 var XlCalcDto = new XlCalcDto() { tleStr = xl1.TwoLine, SigTime = dto.SigTime };
                 var ephMain = await HttpHelper.PostRequestAsync<SatEphResDto>(SysConfig.GetUrl("Xl/Calc"), XlCalcDto);
@@ -737,6 +793,21 @@ namespace XdCxRhDW.App.Controllers
                     Serilog.Log.Error($"推算卫星{dto.AdjaCode}的ECEF星历出错.{ephAdja.msg}");
                     return Error<PosResDto>($"推算卫星{dto.AdjaCode}的ECEF星历出错");
                 }
+
+#warning 测试代码
+                var tarEcef = PhysicsHelper.GeoToEcef((110, 17, 0));
+                var ecefXl1 = (ephMain.data.X, ephMain.data.Y, ephMain.data.Z);
+                var ecefXl2 = (ephAdja.data.X, ephAdja.data.Y, ephAdja.data.Z);
+                var ecefCdb = PhysicsHelper.GeoToEcef((dto.CdbTxLon, dto.CdbTxLat, 0));
+                var ecefRec = PhysicsHelper.GeoToEcef((dto.SatTxLon, dto.SatTxLat, 0));
+                var dt1 = PhysicsHelper.Dto(tarEcef, ecefXl1, ecefRec);
+                var dt2 = PhysicsHelper.Dto(tarEcef, ecefXl2, ecefRec);
+                var dt3 = PhysicsHelper.Dto(tarEcef, ecefCdb);
+                var dto1 = dt1 - dt2;
+                var dto2 = dt1 - dt3;
+                dto.SxDto = dto1 * 1e6 + r.Next(-10, 10) + Math.Round(r.NextDouble(), 3);
+                dto.XdDto = dto2 * 1e6 + r.Next(-10, 10) + Math.Round(r.NextDouble(), 3);
+
                 if (dto.BeFindRef)
                 {
                     X2D1PosRefService.Instance.AddPosDto(dto);
@@ -777,7 +848,7 @@ namespace XdCxRhDW.App.Controllers
                         DfoCdb = Math.Round(dto.XdDfo, 10),
                         SnrCdb = Math.Round(dto.XdSnr, 1),
                         StationResID = StationRes.ID,
-                        FixedStationID=dto.FixedStationId,
+                        FixedStationID = dto.FixedStationId,
                         MainCode = dto.MainCode,
                         Adja1Code = dto.AdjaCode,
                         MainXlTime = ephMain.data.TleTime,

+ 577 - 0
XdCxRhDW.App/UserControl/UcCtrlPage.Designer.cs

@@ -0,0 +1,577 @@
+namespace XdCxRhDW.App.UserControl
+{
+    partial class UcCtrlPage
+    {
+        /// <summary> 
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary> 
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.dataLayoutControl1 = new DevExpress.XtraDataLayout.DataLayoutControl();
+            this.linkGo = new DevExpress.XtraEditors.SimpleButton();
+            this.labelControl3 = new DevExpress.XtraEditors.LabelControl();
+            this.txtPageNum = new DevExpress.XtraEditors.TextEdit();
+            this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
+            this.cbbPageSize = new DevExpress.XtraEditors.ComboBoxEdit();
+            this.lblTotalPage = new DevExpress.XtraEditors.LabelControl();
+            this.linkNext = new DevExpress.XtraEditors.SimpleButton();
+            this.linkPrev = new DevExpress.XtraEditors.SimpleButton();
+            this.linkFirst = new DevExpress.XtraEditors.SimpleButton();
+            this.linkLast = new DevExpress.XtraEditors.SimpleButton();
+            this.labelControl21 = new DevExpress.XtraEditors.LabelControl();
+            this.lblTotalCount = new DevExpress.XtraEditors.LabelControl();
+            this.labelControl211 = new DevExpress.XtraEditors.LabelControl();
+            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
+            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.emptySpaceItem4 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.emptySpaceItem5 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.emptySpaceItem8 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.emptySpaceItem9 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.emptySpaceItem3 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.emptySpaceItem6 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.layoutControlItem12 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem13 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.emptySpaceItem7 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.emptySpaceItem11 = new DevExpress.XtraLayout.EmptySpaceItem();
+            ((System.ComponentModel.ISupportInitialize)(this.dataLayoutControl1)).BeginInit();
+            this.dataLayoutControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.txtPageNum.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.cbbPageSize.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem4)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem5)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem8)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem9)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem6)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem7)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem11)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // dataLayoutControl1
+            // 
+            this.dataLayoutControl1.Controls.Add(this.linkGo);
+            this.dataLayoutControl1.Controls.Add(this.labelControl3);
+            this.dataLayoutControl1.Controls.Add(this.txtPageNum);
+            this.dataLayoutControl1.Controls.Add(this.labelControl2);
+            this.dataLayoutControl1.Controls.Add(this.cbbPageSize);
+            this.dataLayoutControl1.Controls.Add(this.lblTotalPage);
+            this.dataLayoutControl1.Controls.Add(this.linkNext);
+            this.dataLayoutControl1.Controls.Add(this.linkPrev);
+            this.dataLayoutControl1.Controls.Add(this.linkFirst);
+            this.dataLayoutControl1.Controls.Add(this.linkLast);
+            this.dataLayoutControl1.Controls.Add(this.labelControl21);
+            this.dataLayoutControl1.Controls.Add(this.lblTotalCount);
+            this.dataLayoutControl1.Controls.Add(this.labelControl211);
+            this.dataLayoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.dataLayoutControl1.Location = new System.Drawing.Point(0, 0);
+            this.dataLayoutControl1.Name = "dataLayoutControl1";
+            this.dataLayoutControl1.Root = this.Root;
+            this.dataLayoutControl1.Size = new System.Drawing.Size(738, 48);
+            this.dataLayoutControl1.TabIndex = 0;
+            this.dataLayoutControl1.Text = "dataLayoutControl1";
+            this.dataLayoutControl1.Paint += new System.Windows.Forms.PaintEventHandler(this.PageControl_Paint);
+            // 
+            // linkGo
+            // 
+            this.linkGo.Location = new System.Drawing.Point(490, 12);
+            this.linkGo.MaximumSize = new System.Drawing.Size(0, 20);
+            this.linkGo.Name = "linkGo";
+            this.linkGo.Size = new System.Drawing.Size(61, 20);
+            this.linkGo.StyleController = this.dataLayoutControl1;
+            this.linkGo.TabIndex = 12;
+            this.linkGo.Text = "跳转";
+            this.linkGo.Click += new System.EventHandler(this.linkGo_LinkClicked);
+            // 
+            // labelControl3
+            // 
+            this.labelControl3.Location = new System.Drawing.Point(439, 12);
+            this.labelControl3.Name = "labelControl3";
+            this.labelControl3.Size = new System.Drawing.Size(12, 14);
+            this.labelControl3.StyleController = this.dataLayoutControl1;
+            this.labelControl3.TabIndex = 11;
+            this.labelControl3.Text = "页";
+            // 
+            // txtPageNum
+            // 
+            this.txtPageNum.Location = new System.Drawing.Point(381, 12);
+            this.txtPageNum.Name = "txtPageNum";
+            this.txtPageNum.Size = new System.Drawing.Size(54, 20);
+            this.txtPageNum.StyleController = this.dataLayoutControl1;
+            this.txtPageNum.TabIndex = 10;
+            this.txtPageNum.EditValueChanged += new System.EventHandler(this.txtPageNum_TextChanged);
+            // 
+            // labelControl2
+            // 
+            this.labelControl2.Location = new System.Drawing.Point(647, 12);
+            this.labelControl2.Name = "labelControl2";
+            this.labelControl2.Size = new System.Drawing.Size(12, 14);
+            this.labelControl2.StyleController = this.dataLayoutControl1;
+            this.labelControl2.TabIndex = 9;
+            this.labelControl2.Text = "条";
+            // 
+            // cbbPageSize
+            // 
+            this.cbbPageSize.Location = new System.Drawing.Point(593, 12);
+            this.cbbPageSize.Name = "cbbPageSize";
+            this.cbbPageSize.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
+            this.cbbPageSize.Size = new System.Drawing.Size(50, 20);
+            this.cbbPageSize.StyleController = this.dataLayoutControl1;
+            this.cbbPageSize.TabIndex = 8;
+            this.cbbPageSize.SelectedIndexChanged += new System.EventHandler(this.cbbPageSize_SelectedIndexChanged);
+            // 
+            // lblTotalPage
+            // 
+            this.lblTotalPage.Location = new System.Drawing.Point(156, 12);
+            this.lblTotalPage.Name = "lblTotalPage";
+            this.lblTotalPage.Size = new System.Drawing.Size(43, 14);
+            this.lblTotalPage.StyleController = this.dataLayoutControl1;
+            this.lblTotalPage.TabIndex = 7;
+            this.lblTotalPage.Text = "第1/3页";
+            // 
+            // linkNext
+            // 
+            this.linkNext.Location = new System.Drawing.Point(232, 12);
+            this.linkNext.MaximumSize = new System.Drawing.Size(0, 22);
+            this.linkNext.Name = "linkNext";
+            this.linkNext.Size = new System.Drawing.Size(44, 22);
+            this.linkNext.StyleController = this.dataLayoutControl1;
+            this.linkNext.TabIndex = 6;
+            this.linkNext.Text = "下一页";
+            this.linkNext.Click += new System.EventHandler(this.linkNext_LinkClicked);
+            // 
+            // linkPrev
+            // 
+            this.linkPrev.Location = new System.Drawing.Point(94, 12);
+            this.linkPrev.MaximumSize = new System.Drawing.Size(0, 22);
+            this.linkPrev.Name = "linkPrev";
+            this.linkPrev.Size = new System.Drawing.Size(45, 22);
+            this.linkPrev.StyleController = this.dataLayoutControl1;
+            this.linkPrev.TabIndex = 5;
+            this.linkPrev.Text = "上一页";
+            this.linkPrev.Click += new System.EventHandler(this.linkPrev_LinkClicked);
+            // 
+            // linkFirst
+            // 
+            this.linkFirst.Location = new System.Drawing.Point(29, 12);
+            this.linkFirst.MaximumSize = new System.Drawing.Size(0, 22);
+            this.linkFirst.Name = "linkFirst";
+            this.linkFirst.Size = new System.Drawing.Size(50, 22);
+            this.linkFirst.StyleController = this.dataLayoutControl1;
+            this.linkFirst.TabIndex = 4;
+            this.linkFirst.Text = "首页";
+            this.linkFirst.Click += new System.EventHandler(this.linkFirst_LinkClicked);
+            // 
+            // linkLast
+            // 
+            this.linkLast.Location = new System.Drawing.Point(290, 12);
+            this.linkLast.MaximumSize = new System.Drawing.Size(0, 22);
+            this.linkLast.Name = "linkLast";
+            this.linkLast.Size = new System.Drawing.Size(44, 22);
+            this.linkLast.StyleController = this.dataLayoutControl1;
+            this.linkLast.TabIndex = 5;
+            this.linkLast.Text = "尾页";
+            this.linkLast.Click += new System.EventHandler(this.linkLast_LinkClicked);
+            // 
+            // labelControl21
+            // 
+            this.labelControl21.Location = new System.Drawing.Point(565, 12);
+            this.labelControl21.Name = "labelControl21";
+            this.labelControl21.Size = new System.Drawing.Size(24, 14);
+            this.labelControl21.StyleController = this.dataLayoutControl1;
+            this.labelControl21.TabIndex = 9;
+            this.labelControl21.Text = "每页";
+            // 
+            // lblTotalCount
+            // 
+            this.lblTotalCount.Location = new System.Drawing.Point(673, 12);
+            this.lblTotalCount.Name = "lblTotalCount";
+            this.lblTotalCount.Size = new System.Drawing.Size(39, 14);
+            this.lblTotalCount.StyleController = this.dataLayoutControl1;
+            this.lblTotalCount.TabIndex = 9;
+            this.lblTotalCount.Text = "共 3 条";
+            // 
+            // labelControl211
+            // 
+            this.labelControl211.Location = new System.Drawing.Point(353, 12);
+            this.labelControl211.Name = "labelControl211";
+            this.labelControl211.Size = new System.Drawing.Size(24, 14);
+            this.labelControl211.StyleController = this.dataLayoutControl1;
+            this.labelControl211.TabIndex = 9;
+            this.labelControl211.Text = "前往";
+            // 
+            // Root
+            // 
+            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
+            this.Root.GroupBordersVisible = false;
+            this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
+            this.layoutControlItem1,
+            this.layoutControlItem3,
+            this.layoutControlItem5,
+            this.layoutControlItem6,
+            this.layoutControlItem7,
+            this.layoutControlItem8,
+            this.layoutControlItem9,
+            this.emptySpaceItem1,
+            this.emptySpaceItem4,
+            this.emptySpaceItem5,
+            this.emptySpaceItem8,
+            this.emptySpaceItem9,
+            this.layoutControlItem2,
+            this.layoutControlItem4,
+            this.emptySpaceItem3,
+            this.emptySpaceItem6,
+            this.layoutControlItem10,
+            this.layoutControlItem11,
+            this.emptySpaceItem2,
+            this.layoutControlItem12,
+            this.layoutControlItem13,
+            this.emptySpaceItem7,
+            this.emptySpaceItem11});
+            this.Root.Name = "Root";
+            this.Root.Size = new System.Drawing.Size(738, 48);
+            this.Root.TextVisible = false;
+            // 
+            // layoutControlItem1
+            // 
+            this.layoutControlItem1.Control = this.linkFirst;
+            this.layoutControlItem1.Location = new System.Drawing.Point(17, 0);
+            this.layoutControlItem1.Name = "layoutControlItem1";
+            this.layoutControlItem1.Size = new System.Drawing.Size(54, 28);
+            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem1.TextVisible = false;
+            // 
+            // layoutControlItem3
+            // 
+            this.layoutControlItem3.Control = this.linkLast;
+            this.layoutControlItem3.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
+            this.layoutControlItem3.CustomizationFormText = "layoutControlItem2";
+            this.layoutControlItem3.Location = new System.Drawing.Point(278, 0);
+            this.layoutControlItem3.Name = "layoutControlItem3";
+            this.layoutControlItem3.Size = new System.Drawing.Size(48, 28);
+            this.layoutControlItem3.Text = "layoutControlItem2";
+            this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem3.TextVisible = false;
+            // 
+            // layoutControlItem5
+            // 
+            this.layoutControlItem5.Control = this.lblTotalPage;
+            this.layoutControlItem5.Location = new System.Drawing.Point(144, 0);
+            this.layoutControlItem5.Name = "layoutControlItem5";
+            this.layoutControlItem5.Size = new System.Drawing.Size(47, 28);
+            this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem5.TextVisible = false;
+            // 
+            // layoutControlItem6
+            // 
+            this.layoutControlItem6.Control = this.cbbPageSize;
+            this.layoutControlItem6.Location = new System.Drawing.Point(581, 0);
+            this.layoutControlItem6.Name = "layoutControlItem6";
+            this.layoutControlItem6.Size = new System.Drawing.Size(54, 28);
+            this.layoutControlItem6.Text = "每页";
+            this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem6.TextVisible = false;
+            // 
+            // layoutControlItem7
+            // 
+            this.layoutControlItem7.Control = this.labelControl2;
+            this.layoutControlItem7.Location = new System.Drawing.Point(635, 0);
+            this.layoutControlItem7.Name = "layoutControlItem7";
+            this.layoutControlItem7.Size = new System.Drawing.Size(16, 28);
+            this.layoutControlItem7.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem7.TextVisible = false;
+            // 
+            // layoutControlItem8
+            // 
+            this.layoutControlItem8.Control = this.labelControl21;
+            this.layoutControlItem8.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
+            this.layoutControlItem8.CustomizationFormText = "layoutControlItem7";
+            this.layoutControlItem8.Location = new System.Drawing.Point(553, 0);
+            this.layoutControlItem8.Name = "layoutControlItem8";
+            this.layoutControlItem8.Size = new System.Drawing.Size(28, 28);
+            this.layoutControlItem8.Text = "layoutControlItem7";
+            this.layoutControlItem8.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem8.TextVisible = false;
+            // 
+            // layoutControlItem9
+            // 
+            this.layoutControlItem9.Control = this.lblTotalCount;
+            this.layoutControlItem9.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
+            this.layoutControlItem9.CustomizationFormText = "layoutControlItem7";
+            this.layoutControlItem9.Location = new System.Drawing.Point(661, 0);
+            this.layoutControlItem9.Name = "layoutControlItem9";
+            this.layoutControlItem9.Size = new System.Drawing.Size(43, 28);
+            this.layoutControlItem9.Text = "layoutControlItem7";
+            this.layoutControlItem9.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem9.TextVisible = false;
+            // 
+            // emptySpaceItem1
+            // 
+            this.emptySpaceItem1.AllowHotTrack = false;
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 0);
+            this.emptySpaceItem1.Name = "emptySpaceItem1";
+            this.emptySpaceItem1.Size = new System.Drawing.Size(17, 28);
+            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // emptySpaceItem4
+            // 
+            this.emptySpaceItem4.AllowHotTrack = false;
+            this.emptySpaceItem4.Location = new System.Drawing.Point(131, 0);
+            this.emptySpaceItem4.Name = "emptySpaceItem4";
+            this.emptySpaceItem4.Size = new System.Drawing.Size(13, 28);
+            this.emptySpaceItem4.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // emptySpaceItem5
+            // 
+            this.emptySpaceItem5.AllowHotTrack = false;
+            this.emptySpaceItem5.Location = new System.Drawing.Point(191, 0);
+            this.emptySpaceItem5.Name = "emptySpaceItem5";
+            this.emptySpaceItem5.Size = new System.Drawing.Size(29, 28);
+            this.emptySpaceItem5.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // emptySpaceItem8
+            // 
+            this.emptySpaceItem8.AllowHotTrack = false;
+            this.emptySpaceItem8.Location = new System.Drawing.Point(651, 0);
+            this.emptySpaceItem8.Name = "emptySpaceItem8";
+            this.emptySpaceItem8.Size = new System.Drawing.Size(10, 28);
+            this.emptySpaceItem8.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // emptySpaceItem9
+            // 
+            this.emptySpaceItem9.AllowHotTrack = false;
+            this.emptySpaceItem9.Location = new System.Drawing.Point(704, 0);
+            this.emptySpaceItem9.Name = "emptySpaceItem9";
+            this.emptySpaceItem9.Size = new System.Drawing.Size(14, 28);
+            this.emptySpaceItem9.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // layoutControlItem2
+            // 
+            this.layoutControlItem2.Control = this.linkPrev;
+            this.layoutControlItem2.Location = new System.Drawing.Point(82, 0);
+            this.layoutControlItem2.Name = "layoutControlItem2";
+            this.layoutControlItem2.Size = new System.Drawing.Size(49, 28);
+            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem2.TextVisible = false;
+            // 
+            // layoutControlItem4
+            // 
+            this.layoutControlItem4.Control = this.linkNext;
+            this.layoutControlItem4.Location = new System.Drawing.Point(220, 0);
+            this.layoutControlItem4.Name = "layoutControlItem4";
+            this.layoutControlItem4.Size = new System.Drawing.Size(48, 28);
+            this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem4.TextVisible = false;
+            // 
+            // emptySpaceItem3
+            // 
+            this.emptySpaceItem3.AllowHotTrack = false;
+            this.emptySpaceItem3.Location = new System.Drawing.Point(71, 0);
+            this.emptySpaceItem3.Name = "emptySpaceItem3";
+            this.emptySpaceItem3.Size = new System.Drawing.Size(11, 28);
+            this.emptySpaceItem3.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // emptySpaceItem6
+            // 
+            this.emptySpaceItem6.AllowHotTrack = false;
+            this.emptySpaceItem6.Location = new System.Drawing.Point(268, 0);
+            this.emptySpaceItem6.Name = "emptySpaceItem6";
+            this.emptySpaceItem6.Size = new System.Drawing.Size(10, 28);
+            this.emptySpaceItem6.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // layoutControlItem10
+            // 
+            this.layoutControlItem10.Control = this.txtPageNum;
+            this.layoutControlItem10.Location = new System.Drawing.Point(369, 0);
+            this.layoutControlItem10.Name = "layoutControlItem10";
+            this.layoutControlItem10.Size = new System.Drawing.Size(58, 28);
+            this.layoutControlItem10.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem10.TextVisible = false;
+            // 
+            // layoutControlItem11
+            // 
+            this.layoutControlItem11.Control = this.labelControl211;
+            this.layoutControlItem11.ControlAlignment = System.Drawing.ContentAlignment.TopLeft;
+            this.layoutControlItem11.CustomizationFormText = "layoutControlItem7";
+            this.layoutControlItem11.Location = new System.Drawing.Point(341, 0);
+            this.layoutControlItem11.Name = "layoutControlItem11";
+            this.layoutControlItem11.Size = new System.Drawing.Size(28, 28);
+            this.layoutControlItem11.Text = "layoutControlItem7";
+            this.layoutControlItem11.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem11.TextVisible = false;
+            // 
+            // emptySpaceItem2
+            // 
+            this.emptySpaceItem2.AllowHotTrack = false;
+            this.emptySpaceItem2.Location = new System.Drawing.Point(326, 0);
+            this.emptySpaceItem2.Name = "emptySpaceItem2";
+            this.emptySpaceItem2.Size = new System.Drawing.Size(15, 28);
+            this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // layoutControlItem12
+            // 
+            this.layoutControlItem12.Control = this.labelControl3;
+            this.layoutControlItem12.Location = new System.Drawing.Point(427, 0);
+            this.layoutControlItem12.Name = "layoutControlItem12";
+            this.layoutControlItem12.Size = new System.Drawing.Size(16, 28);
+            this.layoutControlItem12.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem12.TextVisible = false;
+            // 
+            // layoutControlItem13
+            // 
+            this.layoutControlItem13.Control = this.linkGo;
+            this.layoutControlItem13.Location = new System.Drawing.Point(478, 0);
+            this.layoutControlItem13.MaxSize = new System.Drawing.Size(0, 26);
+            this.layoutControlItem13.MinSize = new System.Drawing.Size(35, 24);
+            this.layoutControlItem13.Name = "layoutControlItem13";
+            this.layoutControlItem13.Size = new System.Drawing.Size(65, 28);
+            this.layoutControlItem13.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.layoutControlItem13.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem13.TextVisible = false;
+            // 
+            // emptySpaceItem7
+            // 
+            this.emptySpaceItem7.AllowHotTrack = false;
+            this.emptySpaceItem7.Location = new System.Drawing.Point(543, 0);
+            this.emptySpaceItem7.Name = "emptySpaceItem7";
+            this.emptySpaceItem7.Size = new System.Drawing.Size(10, 28);
+            this.emptySpaceItem7.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // emptySpaceItem11
+            // 
+            this.emptySpaceItem11.AllowHotTrack = false;
+            this.emptySpaceItem11.Location = new System.Drawing.Point(443, 0);
+            this.emptySpaceItem11.Name = "emptySpaceItem11";
+            this.emptySpaceItem11.Size = new System.Drawing.Size(35, 28);
+            this.emptySpaceItem11.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // UcCtrlPage
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.dataLayoutControl1);
+            this.Name = "UcCtrlPage";
+            this.Size = new System.Drawing.Size(738, 48);
+            ((System.ComponentModel.ISupportInitialize)(this.dataLayoutControl1)).EndInit();
+            this.dataLayoutControl1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.txtPageNum.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.cbbPageSize.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem4)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem5)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem8)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem9)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem6)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem7)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem11)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraDataLayout.DataLayoutControl dataLayoutControl1;
+        private DevExpress.XtraLayout.LayoutControlGroup Root;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
+        private DevExpress.XtraEditors.SimpleButton linkFirst;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
+        private DevExpress.XtraEditors.SimpleButton linkPrev;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
+        private DevExpress.XtraEditors.SimpleButton linkLast;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
+        private DevExpress.XtraEditors.SimpleButton linkNext;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
+        private DevExpress.XtraEditors.LabelControl labelControl2;
+        private DevExpress.XtraEditors.ComboBoxEdit cbbPageSize;
+        private DevExpress.XtraEditors.LabelControl lblTotalPage;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
+        private DevExpress.XtraEditors.LabelControl labelControl21;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
+        private DevExpress.XtraEditors.LabelControl lblTotalCount;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem9;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem3;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem4;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem5;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem6;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem8;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem9;
+        private DevExpress.XtraEditors.TextEdit txtPageNum;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10;
+        private DevExpress.XtraEditors.SimpleButton linkGo;
+        private DevExpress.XtraEditors.LabelControl labelControl3;
+        private DevExpress.XtraEditors.LabelControl labelControl211;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem11;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem12;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem13;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem7;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem11;
+    }
+}

+ 249 - 0
XdCxRhDW.App/UserControl/UcCtrlPage.cs

@@ -0,0 +1,249 @@
+using DevExpress.XtraEditors;
+using DevExpress.XtraPrinting;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace XdCxRhDW.App.UserControl
+{
+    public partial class UcCtrlPage : DevExpress.XtraEditors.XtraUserControl
+    {
+        public event EventHandler OnPageChanged;
+        public UcCtrlPage()
+        {
+            InitializeComponent();
+
+        }
+
+        //每页显示记录数
+        private int pageSize = 10;
+        //当前页
+        private int pageIndex = 1;
+        //总页数
+        private int pageCount = 0;
+        //总记录数
+        private int totalCount = 0;
+
+        public int PageSize { get => pageSize; set => pageSize = value; }
+        public int PageIndex { get => pageIndex; set => pageIndex = value; }
+        public int PageCount
+        {
+            get
+            {
+                if (pageSize != 0)
+                {
+                    pageCount = GetPageCount();
+                }
+                return pageCount;
+            }
+            set { pageCount = value; }
+        }
+        public int TotalCount { get => totalCount; set => totalCount = value; }
+
+
+        /// <summary>
+        /// 计算总页数
+        /// </summary>
+        /// <returns></returns>
+        private int GetPageCount()
+        {
+            if (PageSize == 0)
+            {
+                return 0;
+            }
+            int pageCount = TotalCount / PageSize;
+            if (TotalCount % PageSize == 0)
+            {
+                pageCount = TotalCount / PageSize;
+            }
+            else
+            {
+                pageCount = TotalCount / PageSize + 1;
+            }
+            return pageCount;
+        }
+
+        /// <summary>
+        /// 首页
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void linkFirst_LinkClicked(object sender, EventArgs e)
+        {
+            PageIndex = 1;
+            DrawControl(true);
+        }
+
+        /// <summary>
+        /// 上一页
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void linkPrev_LinkClicked(object sender, EventArgs e)
+        {
+            PageIndex = Math.Max(1, PageIndex - 1);
+            DrawControl(true);
+        }
+
+
+        /// <summary>
+        /// 下一页
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void linkNext_LinkClicked(object sender, EventArgs e)
+        {
+            PageIndex = Math.Min(PageCount, PageIndex + 1);
+            DrawControl(true);
+        }
+
+        /// <summary>
+        /// 末页
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void linkLast_LinkClicked(object sender, EventArgs e)
+        {
+
+            PageIndex = PageCount;
+            DrawControl(true);
+        }
+
+        public void DrawControl(int count)
+        {
+            TotalCount = count;
+            DrawControl(false);
+        }
+
+        /// <summary>
+        /// 页面控件呈现
+        /// </summary>
+        private void DrawControl(bool callEvent)
+        {
+            lblTotalPage.Text = new StringBuilder("第 ").Append(PageIndex.ToString()).Append(" / ").Append(PageCount.ToString()).Append(" 页").ToString();
+            lblTotalCount.Text = new StringBuilder("共 ").Append(TotalCount.ToString()).Append(" 条").ToString();
+            cbbPageSize.Text = PageSize.ToString();
+
+            if (callEvent && OnPageChanged != null)
+            {
+                OnPageChanged(this, null);//当前分页数字改变时,触发委托事件
+            }
+            SetFormCtrEnabled();
+            if (PageCount <= 1)//有且仅有一页
+            {
+                linkFirst.Enabled = false;
+                linkPrev.Enabled = false;
+                linkNext.Enabled = false;
+                linkLast.Enabled = false;
+                linkGo.Enabled = false;
+            }
+            else if (PageIndex == 1)//第一页
+            {
+                linkFirst.Enabled = false;
+                linkPrev.Enabled = false;
+            }
+            else if (PageIndex == PageCount)//最后一页
+            {
+                linkNext.Enabled = false;
+                linkLast.Enabled = false;
+            }
+        }
+
+        private void SetFormCtrEnabled()
+        {
+            linkFirst.Enabled = true;
+            linkPrev.Enabled = true;
+            linkNext.Enabled = true;
+            linkLast.Enabled = true;
+            linkGo.Enabled = true;
+        }
+
+        /// <summary>
+        /// enter键功能
+        /// </summary>
+        private void txtPageNum_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            linkGo_LinkClicked(null, null);
+        }
+
+        /// <summary>
+        /// 跳转页数限制
+        /// </summary>
+        private void txtPageNum_TextChanged(object sender, EventArgs e)
+        {
+            int num = 0;
+            if (int.TryParse(txtPageNum.Text.Trim(), out num) && num > 0)
+            {
+                if (num > PageCount)
+                {
+                    txtPageNum.Text = PageCount.ToString();
+                }
+            }
+        }
+
+        /// <summary>
+        /// 跳转指定页
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void linkGo_LinkClicked(object sender, EventArgs e)
+        {
+            int num = 0;
+            if (int.TryParse(txtPageNum.Text.Trim(), out num) && num > 0)
+            {
+                PageIndex = num;
+                DrawControl(true);
+            }
+        }
+
+
+
+        private void PageControl_Paint(object sender, PaintEventArgs e)
+        {
+            drawBorder(e);
+        }
+
+        private void drawBorder(PaintEventArgs e)
+        {
+            Color _lineColor = Color.FromArgb(0, 123, 255);
+            ControlPaint.DrawBorder(e.Graphics, this.ClientRectangle,
+            _lineColor, 1, ButtonBorderStyle.Solid, //左边
+          _lineColor, 1, ButtonBorderStyle.Solid, //上边
+          _lineColor, 1, ButtonBorderStyle.Solid, //右边
+          _lineColor, 1, ButtonBorderStyle.Solid);//底边
+
+        }
+
+        /// <summary>
+        /// 每页显示记录数更改事件
+        /// </summary>
+        bool isTextChanged = false;
+        private void cbbPageSize_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            int num = 0;
+            if (!int.TryParse(cbbPageSize.Text.Trim(), out num) || num <= 0)
+            {
+                num = 10;
+                cbbPageSize.Text = "10";
+            }
+            else
+            {
+                isTextChanged = true;
+            }
+            pageSize = num;
+            if (isTextChanged)
+            {
+                isTextChanged = false;
+                linkFirst_LinkClicked(null, null);
+            }
+        }
+
+    }
+}
+

+ 120 - 0
XdCxRhDW.App/UserControl/UcCtrlPage.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 34 - 22
XdCxRhDW.App/X2D1PosRef/X2D1PosHandle.cs

@@ -14,6 +14,20 @@ using XdCxRhDW.Repostory;
 
 namespace XdCxRhDW.App
 {
+
+    public class X2D1PosItem
+    {
+        public X2D1PosItem(X2D1NoXlNoParlPosDto x2D1)
+        {
+            this.Dto = x2D1;
+            this.CreateTime = DateTime.Now;
+
+        }
+        public X2D1NoXlNoParlPosDto Dto { get; set; }
+
+        public DateTime CreateTime { get; set; }
+
+    }
     /// <summary>
     /// 两星一地定位取参考
     /// </summary>
@@ -23,10 +37,11 @@ namespace XdCxRhDW.App
         public int TaskId;
         //多少分钟时间内的参考信号数据
         private double takeRefTimeSeconds;
+
         private bool isRuning = true;
 
-        BlockingCollection<X2D1NoXlNoParlPosDto> posItems = new BlockingCollection<X2D1NoXlNoParlPosDto>();
-        public X2D1PosHandle(int taskId,double takeRefTime)
+        BlockingCollection<X2D1PosItem> posItems = new BlockingCollection<X2D1PosItem>();
+        public X2D1PosHandle(int taskId, double takeRefTime)
         {
             takeRefTimeSeconds = takeRefTime * 60;//秒
             TaskId = taskId;
@@ -42,12 +57,13 @@ namespace XdCxRhDW.App
                 {
                     try
                     {
-                        var dto = posItems.Take();
+                        var posItem = posItems.Take();
+                        var dto = posItem.Dto;
                         FixedStation fixedStation;
                         int fixedStationId = dto.FixedStationId.HasValue ? dto.FixedStationId.Value : 0;
                         using (RHDWContext db = new RHDWContext())
                         {
-                            fixedStation = await db.FixedStation.FirstOrDefaultAsync(f => f.ID == dto.FixedStationId.Value);
+                            fixedStation = await db.FixedStation.FirstOrDefaultAsync(f => f.ID == fixedStationId);
                         }
                         if (fixedStation == null)//没有固定站
                         {
@@ -75,14 +91,18 @@ namespace XdCxRhDW.App
 
                             if (point1 == null || point2 == null)//若参考频点未出结果,查找目标信号出
                             {
-                                bool isTarAny = await db.CgRes.AnyAsync(m => m.TaskID == dto.TaskID && m.TarFreqUp.HasValue&&m.TarFreqUp.Value== fixedStation.FreqUpHz &&  m.SigTime >= dto.SigTime);
-                                if (!isTarAny)//目标未出结果
+                                bool isTarAny = await db.CgRes.AnyAsync(m => m.TaskID == dto.TaskID && !m.FixedStationID.HasValue && m.TarFreqUp.HasValue && m.TarFreqUp.Value == fixedStation.FreqUpHz && m.SigTime >= dto.SigTime);
+                                if (!isTarAny && (DateTime.Now - posItem.CreateTime).TotalMinutes < 2)//目标未出结果
                                 {
-                                    Append(dto);
+                                    posItems.Add(posItem);
+                                    continue;
+                                }
+                                else if (!isTarAny && (DateTime.Now - posItem.CreateTime).TotalMinutes >= 2)//目标两分钟之内未出结果走无参
+                                {
+                                    SendX2D1NoXlNoParAsync(dto);
                                     continue;
                                 }
                             }
-                            bool isSucces = false;
                             if (point1 != null && point2 != null)
                             {
                                 //通过双星时差及超短波时差怎么计算参考信息的时差
@@ -113,29 +133,20 @@ namespace XdCxRhDW.App
                                     SxSnr = dto.SxSnr,
                                     CalcConfidence = true,
                                     TheoryDfoCalc = true,
+                                    TaskID = dto.TaskID,
                                 };
                                 var result = await HttpHelper.PostRequestAsync<PosResDto>(SysConfig.GetUrl("Pos/PosX2D1NoXlAsync"), X2D1NoXlPosDto);
                                 if (result.code != 200)
                                 {
-                                    isSucces = false;
-                                    Serilog.Log.Error($"{dto.SigTime:yyyy-MM-dd HH:mm:ss}两星一地有参定位失败{result.msg}");
+                                    Serilog.Log.Error($"{dto.SigTime:yyyy-MM-dd HH:mm:ss}两星一地定位失败{result.msg}");
                                 }
                                 else
                                 {
-                                    isSucces = true;
-                                    Serilog.Log.Error($"{dto.SigTime:yyyy-MM-dd HH:mm:ss}两星一地有参定位完成{result.msg}");
-                                }
-                                if (isSucces && result.data.PosLon == 999)
-                                {
-                                    isSucces = false;
+                                    Serilog.Log.Error($"{dto.SigTime:yyyy-MM-dd HH:mm:ss}两星一地定位完成{result.msg}");
                                 }
-
-                            }
-                            if (!isSucces)
-                            {
-                                SendX2D1NoXlNoParAsync(dto);
                             }
 
+
                         }
                     }
                     catch (Exception ex)
@@ -168,7 +179,8 @@ namespace XdCxRhDW.App
         }
         public void Append(X2D1NoXlNoParlPosDto dto)
         {
-            bool ret = posItems.TryAdd(dto);
+            X2D1PosItem posItem = new X2D1PosItem(dto);
+            bool ret = posItems.TryAdd(posItem);
             if (!ret)
             {
                 Serilog.Log.Error($"【任务{dto.TaskID}】添加取参考Dto");

+ 9 - 0
XdCxRhDW.App/XdCxRhDW.App.csproj

@@ -334,6 +334,12 @@
     <Compile Include="Model\ModelCgXgf.cs" />
     <Compile Include="Model\RePosRes.cs" />
     <Compile Include="CpuMonitor.cs" />
+    <Compile Include="UserControl\UcCtrlPage.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="UserControl\UcCtrlPage.Designer.cs">
+      <DependentUpon>UcCtrlPage.cs</DependentUpon>
+    </Compile>
     <Compile Include="X2D1PosRef\LinearInterpolation.cs" />
     <Compile Include="X2D1PosRef\X2D1PosRefService.cs" />
     <Compile Include="PopupControl\ShowCgCtrl.cs">
@@ -640,6 +646,9 @@
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
+    <EmbeddedResource Include="UserControl\UcCtrlPage.resx">
+      <DependentUpon>UcCtrlPage.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="UserControl\UCEphXYZ.resx">
       <DependentUpon>UCEphXYZ.cs</DependentUpon>
     </EmbeddedResource>